@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
@@ -166,40 +166,6 @@ Util.moveArrayItem = function (ary, from, to) {
166
166
  }
167
167
  return ary;
168
168
  };
169
- /** Insert an item in the given array at the specified position. If the position exceeds the array length, the array will be expanded
170
- * @public
171
- * @ignore
172
- * @param {Array|*} ary
173
- * @param {number} at INCLUSIVE
174
- * @param {*} item
175
- */
176
- Util.insertArrayItem = function (ary, at, item) {
177
- if (!ary) { return; }
178
-
179
- if (at < 0) {
180
- return; // Negative index cannot be added
181
- }
182
- if (at < ary.length) {
183
- ary.splice(at, 0, item); // any subsequence item is shifted to the right
184
- } else {
185
- ary[at] = item;
186
- }
187
- };
188
- /** Remove the specified item from the given array
189
- * @public
190
- * @ignore
191
- * @param {Array|*} ary
192
- * @param {number} at INCLUSIVE
193
- * @return {*} removed item. If not existed, null is returned
194
- */
195
- Util.removeArrayItem = function (ary, at) {
196
- if (!ary) { return null; }
197
-
198
- if (at >= 0 && at < ary.length) {
199
- return ary.splice(at, 1)[0];
200
- }
201
- return null;
202
- };
203
169
  /** @public
204
170
  * @function
205
171
  * @param {Array} ary
@@ -267,35 +233,6 @@ Util.cycleArray = function (ary, numItems) {
267
233
  return ary || null;
268
234
  };
269
235
 
270
- /** Correct the index when associated item is moved by the specified indices
271
- * @public
272
- * @ignore
273
- * @param {number|null} num
274
- * @param {number|null} from INCLUSIVE removed index
275
- * @param {number|null=} opt_to INCLUSIVE added index
276
- * @return {number} Negative if the index is removed
277
- */
278
- Util.moveIndex = function (num, from, opt_to) {
279
- if (!Util.isNumber(num)) { return -1; }
280
- if (num === from) {
281
- if (Util.isNumber(opt_to)) {
282
- return /** @type{number} */(opt_to);
283
- }
284
- return -1;
285
- }
286
- if (from !== null) {
287
- if (num > from) {
288
- --num;
289
- }
290
- }
291
- if (opt_to !== null) {
292
- if (num >= opt_to) {
293
- ++num;
294
- }
295
- }
296
- return /** @type{number} */(num);
297
- };
298
-
299
236
  /** STL implementation of lowerBound() of the C++ vector class with no recursion
300
237
  * @public
301
238
  * @ignore
@@ -368,28 +305,6 @@ Util.stringFormat = function (format) {
368
305
  Util._defaultLessComparator = function (left, right) {
369
306
  return left < right;
370
307
  };
371
- /** @public
372
- * @function
373
- * @ignore
374
- * @param {number} left
375
- * @param {number} right
376
- * @return {number}
377
- * @example [4, 1, 2].sort(Util._numericSorter) === [1, 2, 4];
378
- */
379
- Util._numericSorter = function (left, right) {
380
- return left - right;
381
- };
382
-
383
- /** @public
384
- * @function
385
- * @ignore
386
- * @param {Event} e
387
- */
388
- Util._preventDefault = function (e) {
389
- e.preventDefault();
390
- e.stopPropagation();
391
- };
392
-
393
308
  /**
394
309
  * @public
395
310
  * @function
@@ -427,24 +342,34 @@ Util.calculatePercent = function (lowVal, lastVal, highVal) {
427
342
  return percent * 100;
428
343
  };
429
344
 
430
- /** @description Return closest ancestor element or the element itself with specified class string. Otherwise return null
345
+ /** @description The method returns closest ancestor element or the element itself with specified class string. Otherwise, it returns null
431
346
  * @public
432
347
  * @function
433
- * @ignore
434
348
  * @param {Element|Node|undefined} elem
435
349
  * @param {string} classStr The class string can only be one single class without spaces
436
350
  * @return {Element}
437
351
  */
438
352
  Util.closestElement = function (elem, classStr) {
439
353
  var n = elem;
440
- while (n && n.classList) {
441
- if (n.classList.contains(classStr)) {
442
- return /** @type{Element} */(n);
354
+ while (n) {
355
+ if(n.classList) { // DocumentFragment does not have classList property
356
+ if (n.classList.contains(classStr)) {
357
+ return /** @type{Element} */(n);
358
+ }
443
359
  }
444
- n = n.parentNode;
360
+ n = n.parentNode || n.host; // ShadowRoot has host, but not parentNode
445
361
  }
446
362
  return null;
447
363
  };
364
+ /** @public
365
+ * @function
366
+ * @ignore
367
+ * @param {Event} e
368
+ */
369
+ Util._preventDefault = function (e) {
370
+ e.preventDefault();
371
+ e.stopPropagation();
372
+ };
448
373
 
449
374
  /** @public
450
375
  * @type {boolean}
@@ -4202,8 +4127,9 @@ ILayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPosit
4202
4127
  * @ignore
4203
4128
  * @param {!Array.<number>} positions Left and right bound positions in pixel
4204
4129
  * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
4130
+ * @param {number=} topPx Top position of bound
4205
4131
  */
4206
- ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {};
4132
+ ILayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {};
4207
4133
 
4208
4134
  /* harmony default export */ const grid_ILayoutGrid = (ILayoutGrid);
4209
4135
 
@@ -5082,7 +5008,7 @@ StretchedCells.prototype.getRowIndex = function (cellRef) {
5082
5008
  * @return {Cell}
5083
5009
  */
5084
5010
  StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
5085
- // Increase the active count regardless of redundancy. This acts as a dirty flag. It does not needed to be accurate
5011
+ // Increase the active count regardless of redundancy. This acts as a dirty flag. It does not need to be accurate
5086
5012
  ++this._activeCount;
5087
5013
  if(!colIndex || colIndex < 0) {
5088
5014
  colIndex = 0;
@@ -5097,7 +5023,17 @@ StretchedCells.prototype.stretchCell = function (rowIndex, colIndex) {
5097
5023
  }
5098
5024
  var cellElem = cell["getElement"]();
5099
5025
  cellElem["stretched"] = true;
5100
- cellElem._colIndex = colIndex;
5026
+ if(cellElem._colIndex !== colIndex) {
5027
+ cellElem._colIndex = colIndex;
5028
+ if(colIndex > 0) {
5029
+ cellElem.classList.add("right-stretching");
5030
+ } else {
5031
+ cellElem.classList.remove("right-stretching");
5032
+ }
5033
+ }
5034
+ if(cellElem._rowIndex !== rowIndex) {
5035
+ cellElem._rowIndex = rowIndex;
5036
+ }
5101
5037
 
5102
5038
  var width = this._stretchSize || this._trackX.getTrackSize();
5103
5039
  _updateXAxis(cell, this._trackX, colIndex, width);
@@ -7530,6 +7466,19 @@ Scrollbar.prototype.freezeScrolling = function (frozen) {
7530
7466
  this._isFrozen = frozen !== false;
7531
7467
  return prev;
7532
7468
  };
7469
+ /** @public
7470
+ */
7471
+ Scrollbar.prototype.restoreTrackPosition = function () {
7472
+ // Scroll event will be fired asynchronously, if there is any change
7473
+ var track = this._element;
7474
+ if(this._vertical) {
7475
+ track.scrollTop = this._tScrollVal;
7476
+ if(track.scrollTop){
7477
+ this._tScrollVal = track.scrollTop; //Check to ensure that cache equal to element's scroll
7478
+ }
7479
+ }
7480
+ //TODO: handle restore scrollLeft for hscroll
7481
+ };
7533
7482
 
7534
7483
  Scrollbar._proto = Scrollbar.prototype;
7535
7484
 
@@ -8310,10 +8259,8 @@ LayoutGrid.prototype._updateColumnLayout = function () {
8310
8259
  /** @public
8311
8260
  * @ignore
8312
8261
  * @param {boolean} enabled
8313
- * @param {number=} fromR
8314
- * @param {number=} toR
8315
8262
  */
8316
- LayoutGrid.prototype._startBindingSession = function (enabled, fromR, toR) {
8263
+ LayoutGrid.prototype._startBindingSession = function (enabled) {
8317
8264
  // Prevent error when calling _startBindingSession in LayoutGrid
8318
8265
  };
8319
8266
  /** @public
@@ -9530,8 +9477,14 @@ LayoutGrid.prototype.moveColumn = function (from, to) {
9530
9477
 
9531
9478
  util.moveArrayItem(this._columns, from, to);
9532
9479
 
9533
- var nextSibling = this._columns[to + 1] || null;
9534
- movedColumn.insertBefore(nextSibling);
9480
+ if(movedColumn.getElement().offsetParent) {
9481
+ var siblingIndex = to + 1;
9482
+ var nextSibling = this._columns[siblingIndex] || null;
9483
+ while (nextSibling && !nextSibling.getElement().offsetParent) {
9484
+ nextSibling = this._columns[++siblingIndex];
9485
+ }
9486
+ movedColumn.insertBefore(nextSibling);
9487
+ }
9535
9488
 
9536
9489
  this._updateColumnIndices();
9537
9490
  this._updateCellSpans(cellSpans, true); // Restore all styling
@@ -9750,6 +9703,10 @@ LayoutGrid.prototype.updateStretchedCells = function () {
9750
9703
  * @return {number}
9751
9704
  */
9752
9705
  LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
9706
+ if(this._frozenLayout) {
9707
+ return this._stretchedCells.getStretchSize();
9708
+ }
9709
+
9753
9710
  var ctx = this._ctx;
9754
9711
  var stretchSize = forceRecal ? 0 : this._stretchedCells.getStretchSize();
9755
9712
  if(!stretchSize && ctx) {
@@ -9757,9 +9714,6 @@ LayoutGrid.prototype._calculateViewSize = function (forceRecal) {
9757
9714
  var contentWidth = this.getContentWidth();
9758
9715
  stretchSize = ctx["getWidth"]();
9759
9716
  if(stretchSize) { // Grid may not be in the document
9760
- if(!ctx.hasClass("no-borders")) {
9761
- stretchSize -= 1;
9762
- }
9763
9717
  if(contentWidth < stretchSize) { // If view width is larger than actual content
9764
9718
  stretchSize = contentWidth;
9765
9719
  }
@@ -10107,8 +10061,9 @@ LayoutGrid.prototype.calculateColumnBounds = function (lftIdx, rgtIdx, outPositi
10107
10061
  * @ignore
10108
10062
  * @param {!Array.<number>} positions Left and right bound positions in pixel
10109
10063
  * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
10064
+ * @param {number=} topPx Top position of bound
10110
10065
  */
10111
- LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
10066
+ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
10112
10067
  var columnBound = this._columnBound;
10113
10068
  if(!columnBound) {
10114
10069
  return;
@@ -10125,7 +10080,9 @@ LayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
10125
10080
  columnBound.style.left = lftPx + "px";
10126
10081
  columnBound.style.width = (rgtPx - lftPx) + "px";
10127
10082
 
10128
- columnBound.style.height = this._trackY.getTrackSize() + "px";
10083
+ topPx = topPx || 0;
10084
+ columnBound.style.top = topPx + "px";
10085
+ columnBound.style.height = (this._trackY.getTrackSize() - topPx) + "px";
10129
10086
  columnBound.classList.toggle("no-left-bound", noBorders[0]);
10130
10087
  columnBound.classList.toggle("no-right-bound", noBorders[1]);
10131
10088
  if(this._boundLayer) {
@@ -12786,7 +12743,15 @@ DataTable.prototype.setRowData = function(rid, values, eventArg) { // Data chang
12786
12743
  this._prevData[rid] = this._rows[rid]; // Move reference from the removed row to history
12787
12744
  delete this._rows[rid];
12788
12745
  if(this._segments) {
12789
- segmentChanged = this._segments.containsSegment(rid); // TODO: Handle this case where the segment separator row is removed
12746
+ var segment = this._segments.getSegment(rid);
12747
+ if(segment) {
12748
+ if(this._segments.removeSegment(rid)) {
12749
+ segmentChanged = true;
12750
+ if(!this._segments.getSegmentCount()) {
12751
+ this._segments = null;
12752
+ }
12753
+ }
12754
+ }
12790
12755
  }
12791
12756
  for(var i = this._rids.length; --i >= 0;) {
12792
12757
  if(this._rids[i] === rid) {
@@ -13989,18 +13954,33 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
13989
13954
  return null;
13990
13955
  }
13991
13956
 
13957
+ var sortLogic;
13992
13958
  // Populate data for each definition
13993
13959
  for(var c = 0; c < defCount; ++c) {
13994
13960
  var sortingDef = sortingDefs[c];
13995
- var columnId = sortingDef[0];
13996
13961
  var rows = sortingDef[1];
13997
- if(rows) {
13998
- rows.length = rowCount;
13999
- } else {
14000
- rows = sortingDef[1] = new Array(rowCount);
14001
- }
14002
- for(var r = 0; r < rowCount; ++r) {
14003
- rows[r] = dataRows[r][columnId];
13962
+ sortLogic = sortingDef[2];
13963
+ var rowSorting = sortLogic["rowSorting"];
13964
+ var r;
13965
+ if(rowSorting) {
13966
+ if(rows) {
13967
+ rows.length = rowCount;
13968
+ for(r = 0; r < rowCount; ++r) {
13969
+ rows[r] = dataRows[r];
13970
+ }
13971
+ } else {
13972
+ rows = sortingDef[1] = dataRows;
13973
+ }
13974
+ } else {
13975
+ if(rows) {
13976
+ rows.length = rowCount;
13977
+ } else {
13978
+ rows = sortingDef[1] = new Array(rowCount);
13979
+ }
13980
+ var columnId = sortingDef[0];
13981
+ for(r = 0; r < rowCount; ++r) {
13982
+ rows[r] = dataRows[r][columnId];
13983
+ }
14004
13984
  }
14005
13985
  }
14006
13986
 
@@ -14026,7 +14006,7 @@ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentVal
14026
14006
  }
14027
14007
 
14028
14008
  var sortOrder = 0;
14029
- var sortLogic, sortContext;
14009
+ var sortContext;
14030
14010
  if(defCount > 1) {
14031
14011
  sortLogic = DataTable._multiColumnCompareLogic;
14032
14012
  sortContext = sortingDefs;
@@ -16957,45 +16937,65 @@ DataView.prototype.isSorting = function() {
16957
16937
 
16958
16938
  /** Hide rows in the data view
16959
16939
  * @param {string|number} rId Row id to hide. If the rId is a number, it will be treated as a row index
16960
- * @param {boolean=} opt_show show if false
16940
+ * @param {boolean=} hidden=true If the value is false, the specified row will be shown.
16961
16941
  * @public
16962
16942
  */
16963
- DataView.prototype.hideRow = function(rId, opt_show) {
16964
- this.showRows([rId], opt_show === false);
16943
+ DataView.prototype.hideRow = function(rId, hidden) {
16944
+ this.hideRows([rId], hidden);
16965
16945
  };
16966
16946
  /** Hide rows in the data view
16967
16947
  * @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
16968
- * @param {boolean=} opt_show show if false
16948
+ * @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
16969
16949
  * @public
16970
16950
  */
16971
- DataView.prototype.hideRows = function(rowRefs, opt_show) {
16972
- this.showRows(rowRefs, opt_show === false);
16973
- };
16974
- /**
16975
- * Show/hide rows in the data view
16976
- * @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
16977
- * @param {boolean=} opt_show hide instead show if false
16978
- * @public
16979
- */
16980
- DataView.prototype.showRows = function(rowRefs, opt_show) {
16981
- var hidden = opt_show === false;
16951
+ DataView.prototype.hideRows = function(rowRefs, hidden) {
16952
+ hidden = hidden !== false;
16953
+ var dirty = false;
16954
+ var rids = this._toRowIds(rowRefs);
16955
+ var hiddenRids = this._hiddenRids;
16956
+
16982
16957
  if(hidden){
16983
- if(!this._hiddenRids) {
16984
- this._hiddenRids = {};
16958
+ if(!hiddenRids) {
16959
+ hiddenRids = this._hiddenRids = {};
16985
16960
  }
16986
- } else if(!this._hiddenRids) {
16961
+ } else if(!hiddenRids) {
16987
16962
  return; // All rows are visible
16988
16963
  }
16989
16964
 
16990
- var rids = this._toRowIds(rowRefs);
16991
16965
  for(var i = rids.length; --i >= 0;) {
16992
16966
  var rid = rids[i];
16993
16967
  if(rid) { // undefined, null, and an empty string value are not a valid row id
16994
- this._hiddenRids[rid] = hidden;
16968
+ if(!!hiddenRids[rid] !== hidden) {
16969
+ hiddenRids[rid] = hidden;
16970
+ dirty = true;
16971
+ }
16995
16972
  }
16996
16973
  }
16997
16974
 
16998
- this._refreshAndNotify(); // Very slow
16975
+ if(dirty) {
16976
+ if(!hidden) {
16977
+ var hasHiddenRow = false;
16978
+ for(var key in hiddenRids) {
16979
+ if(hiddenRids[key]) {
16980
+ hasHiddenRow = true;
16981
+ break;
16982
+ }
16983
+ }
16984
+ if(!hasHiddenRow) {
16985
+ hiddenRids = this._hiddenRids = null;
16986
+ }
16987
+ }
16988
+ this._refreshAndNotify(); // Very slow
16989
+ }
16990
+ };
16991
+ /**
16992
+ * Show/hide rows in the data view
16993
+ * @param {Array.<string|number>} rowRefs Array of row ids or indices to hide
16994
+ * @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
16995
+ * @public
16996
+ */
16997
+ DataView.prototype.showRows = function(rowRefs, shown) {
16998
+ this.hideRows(rowRefs, shown === false);
16999
16999
  };
17000
17000
  /** Unhide all rows
17001
17001
  * @public
@@ -17011,7 +17011,7 @@ DataView.prototype.unhideAllRows = function(){
17011
17011
  * @return {boolean}
17012
17012
  */
17013
17013
  DataView.prototype.hasHiddenRow = function(){
17014
- return !!this._hiddenRids;
17014
+ return this._hiddenRids ? true : false;
17015
17015
  };
17016
17016
 
17017
17017
  /** @public
@@ -22150,12 +22150,22 @@ VirtualizedLayoutGrid.prototype.updateLayout = function () {
22150
22150
  /** {@link ILayoutGrid#stretchCell}
22151
22151
  * @inheritDoc */
22152
22152
  VirtualizedLayoutGrid.prototype.stretchCell = function (cellRef, rowIndex, opt_stretching, onlyToTheRight) {
22153
- return this._grid.stretchCell(
22153
+ var stretchedCell = this._grid.stretchCell(
22154
22154
  cellRef,
22155
22155
  (rowIndex != null) ? rowIndex - this._firstIndex : null,
22156
22156
  opt_stretching,
22157
22157
  onlyToTheRight
22158
22158
  );
22159
+
22160
+ if (stretchedCell){
22161
+ var cellElem = stretchedCell.getElement();
22162
+ if(rowIndex === 0) {
22163
+ cellElem.classList.add("top");
22164
+ } else {
22165
+ cellElem.classList.remove("top");
22166
+ }
22167
+ }
22168
+ return stretchedCell;
22159
22169
  };
22160
22170
 
22161
22171
  /** {@link ILayoutGrid#unstretchCell}
@@ -22374,9 +22384,10 @@ VirtualizedLayoutGrid.prototype._updateCellBounds = function () {
22374
22384
  * @ignore
22375
22385
  * @param {!Array.<number>} positions Left and right bound positions in pixel
22376
22386
  * @param {!Array.<boolean>} noBorders Boolean values indicating existence of left and right CSS borders
22387
+ * @param {number=} topPx Top position of bound
22377
22388
  */
22378
- VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders) {
22379
- this._grid.updateColumnBounds(positions, noBorders);
22389
+ VirtualizedLayoutGrid.prototype.updateColumnBounds = function (positions, noBorders, topPx) {
22390
+ this._grid.updateColumnBounds(positions, noBorders, topPx);
22380
22391
  this._updateRowBounds();
22381
22392
  };
22382
22393
  /** @private
@@ -22566,10 +22577,9 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
22566
22577
 
22567
22578
 
22568
22579
  ;// CONCATENATED MODULE: ./src/js/grid/Core.js
22569
- /* eslint-disable */
22570
-
22571
22580
 
22572
22581
 
22582
+ // eslint-disable-line
22573
22583
 
22574
22584
 
22575
22585
 
@@ -22581,7 +22591,6 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
22581
22591
 
22582
22592
 
22583
22593
 
22584
- /* eslint-enable */
22585
22594
 
22586
22595
  //#region Events
22587
22596
  /** @event Core#sectionAdded */
@@ -22619,6 +22628,15 @@ VirtualizedLayoutGrid._proto = VirtualizedLayoutGrid.prototype;
22619
22628
  */
22620
22629
  //#endregion Events
22621
22630
 
22631
+ /** @private
22632
+ * @param {number} a
22633
+ * @param {number} b
22634
+ * @return {number}
22635
+ */
22636
+ var ascNumberSorter = function (a, b) {
22637
+ return a - b;
22638
+ };
22639
+
22622
22640
  /** @constructor
22623
22641
  * @param {Element=} opt_initializer this can be either element id (string) or DOM element.
22624
22642
  * @extends {ElementWrapper}
@@ -22756,7 +22774,8 @@ var Core_Core = function (opt_initializer) {
22756
22774
  "rowAdded",
22757
22775
  "rowRemoved",
22758
22776
  "columnPositionChanged",
22759
- "rowPositionChanged"
22777
+ "rowPositionChanged",
22778
+ "beforeColumnBoundUpdate"
22760
22779
  );
22761
22780
 
22762
22781
  // For debugging in advanced optimization mode
@@ -22776,13 +22795,13 @@ var Core_Core = function (opt_initializer) {
22776
22795
  Core_Core._runningGridId++;
22777
22796
 
22778
22797
  // init hiddenInput for retrieve copy and cut event
22779
- var hiddenInput = document.createElement('input');
22780
- hiddenInput.style.position = 'absolute';
22781
- hiddenInput.style.width = '0';
22782
- hiddenInput.style.height = '0';
22783
- hiddenInput.style.padding = '0';
22784
- hiddenInput.style.border = '0';
22785
- hiddenInput.value = '0';
22798
+ var hiddenInput = document.createElement("input");
22799
+ hiddenInput.style.position = "absolute";
22800
+ hiddenInput.style.width = "0";
22801
+ hiddenInput.style.height = "0";
22802
+ hiddenInput.style.padding = "0";
22803
+ hiddenInput.style.border = "0";
22804
+ hiddenInput.value = "0";
22786
22805
  _t._hiddenInput = hiddenInput;
22787
22806
  elem.insertBefore(hiddenInput, elem.firstChild);
22788
22807
 
@@ -23088,7 +23107,7 @@ Core_Core.prototype._rowHeightTimerId = 0;
23088
23107
  * @return {string}
23089
23108
  */
23090
23109
  Core_Core.getVersion = function () {
23091
- return "5.0.58";
23110
+ return "5.1.17";
23092
23111
  };
23093
23112
  /** {@link ElementWrapper#dispose}
23094
23113
  * @override
@@ -23252,6 +23271,9 @@ Core_Core.prototype.getConfigObject = function (gridOptions) {
23252
23271
  if(this.hasClass("no-horizontal-grid-line")) {
23253
23272
  obj["horizontalLines"] = false;
23254
23273
  }
23274
+ if(this.hasClass("no-content-vertical-line")) {
23275
+ obj["contentVerticalLines"] = false;
23276
+ }
23255
23277
  if(this._bottomPaddingSect) {
23256
23278
  obj["contentBottomPadding"] = this._bottomPadding;
23257
23279
  }
@@ -24085,13 +24107,118 @@ Core_Core.prototype.isColumnMoveAllowed = function (fromColIndex, toColIndex) {
24085
24107
  return true;
24086
24108
  };
24087
24109
 
24110
+ /** This method is used for checking movability of column.
24111
+ * @public
24112
+ * @param {number} colIndex Index of the column.
24113
+ * @return {boolean} Return true if the column moving is movable, and false otherwise
24114
+ */
24115
+ Core_Core.prototype.isColumnMovable = function (colIndex) {
24116
+ var stationaryIndex = this.getStationaryColumnIndex();
24117
+
24118
+ if (stationaryIndex > -1) {
24119
+ if (colIndex <= stationaryIndex) {
24120
+ return false;
24121
+ }
24122
+ }
24123
+
24124
+ return true;
24125
+ };
24126
+
24088
24127
  /** @public
24089
- * @param {number} fromCol INCLUSIVE
24128
+ * @param {number|Array.<number>} fromCol INCLUSIVE index/indices of the column to be moved
24090
24129
  * @param {number} destCol INCLUSIVE
24091
24130
  * @return {boolean} Return true if there is any change, and false otherwise
24092
24131
  * @fires Core#columnMoved
24093
24132
  */
24094
24133
  Core_Core.prototype.moveColumn = function (fromCol, destCol) {
24134
+ if(typeof fromCol === "number") {
24135
+ return this._moveColumn(fromCol, destCol);
24136
+ }
24137
+ if(!Array.isArray(fromCol)) {
24138
+ return false;
24139
+ }
24140
+
24141
+ // Validate user inputs
24142
+ var i;
24143
+ var len = fromCol.length;
24144
+ var colIndices = [];
24145
+ var colIndex = 0;
24146
+ var colCount = this.getColumnCount();
24147
+ var dict = {};
24148
+ for(i = 0; i < len; ++i) {
24149
+ colIndex = fromCol[i];
24150
+ if(colIndex >= 0 && colIndex < colCount) { // Filter out invalid index
24151
+ if(dict[colIndex] == null) { // Remove duplication
24152
+ dict[colIndex] = 1;
24153
+ colIndices.push(colIndex);
24154
+ }
24155
+ }
24156
+ }
24157
+ if (destCol < 0) {
24158
+ destCol = 0;
24159
+ } else if (destCol >= colCount) {
24160
+ destCol = colCount - 1;
24161
+ }
24162
+
24163
+ // Skip unneccessary cases
24164
+ len = colIndices.length;
24165
+ if(!len) {
24166
+ return false;
24167
+ }
24168
+ if(len === 1) {
24169
+ return this._moveColumn(colIndices[0], destCol);
24170
+ }
24171
+ if(!this.isColumnMoveAllowed(colIndices, destCol)) {
24172
+ return false;
24173
+ }
24174
+
24175
+ colIndices.sort(ascNumberSorter);
24176
+ if(dict[destCol]) { // Destination falls in the same place as source columns
24177
+ // Check if source columns are in continuous sequence
24178
+ var continuousSequence = true;
24179
+ colIndex = colIndices[0];
24180
+ for(i = 1; i < len; ++i) {
24181
+ if(++colIndex !== colIndices[i]) {
24182
+ continuousSequence = false;
24183
+ break;
24184
+ }
24185
+ }
24186
+ if(continuousSequence) {
24187
+ return false; // No moving operation is required
24188
+ }
24189
+ }
24190
+ var prevState = this.freezeLayout(true);
24191
+
24192
+ // Start moving multiple items
24193
+ var rhsCount = 0;
24194
+ var srcIndex, destIndex;
24195
+ // Perform move operation on the right hand side
24196
+ for(i = 0; i < len; ++i) {
24197
+ srcIndex = colIndices[i];
24198
+ if(srcIndex >= destCol) {
24199
+ destIndex = destCol + rhsCount;
24200
+ this._moveColumn(srcIndex, destIndex);
24201
+ ++rhsCount;
24202
+ }
24203
+ }
24204
+ // Perform move operation on the left hand side
24205
+ var lhsCount = len - rhsCount;
24206
+ destIndex = rhsCount ? destCol - 1 : destCol;
24207
+ for(i = 0; i < lhsCount; ++i) {
24208
+ srcIndex = colIndices[i] - i;
24209
+ this._moveColumn(srcIndex, destIndex);
24210
+ }
24211
+
24212
+ this.freezeLayout(prevState);
24213
+ return true;
24214
+ };
24215
+ /** @private
24216
+ * @param {number} fromCol INCLUSIVE
24217
+ * @param {number} destCol INCLUSIVE
24218
+ * @return {boolean} Return true if there is any change, and false otherwise
24219
+ * @fires Core#columnMoved
24220
+ */
24221
+ Core_Core.prototype._moveColumn = function (fromCol, destCol) {
24095
24222
  var colCount = this.getColumnCount();
24096
24223
  if (fromCol < 0) { fromCol = 0; }
24097
24224
  else if (fromCol >= colCount) { fromCol = colCount - 1; }
@@ -24176,6 +24303,7 @@ Core_Core.prototype.moveColumn = function (fromCol, destCol) {
24176
24303
  this._colVirtualizer.update();
24177
24304
  }
24178
24305
  }
24306
+ this._updateColumnBounds();
24179
24307
  return true;
24180
24308
  };
24181
24309
 
@@ -25382,6 +25510,7 @@ Core_Core.prototype.isLayoutFrozen = function () {
25382
25510
 
25383
25511
  /** Deprecated
25384
25512
  * @public
25513
+ * @ignore
25385
25514
  * @function
25386
25515
  * @param {boolean=} opt_shown
25387
25516
  * @see {@link Core#toggleBorders}
@@ -25389,6 +25518,7 @@ Core_Core.prototype.isLayoutFrozen = function () {
25389
25518
  Core_Core.prototype.showBorders = util._deprecatedFunction;
25390
25519
  /** Deprecated
25391
25520
  * @public
25521
+ * @ignore
25392
25522
  * @function
25393
25523
  * @param {boolean=} opt_hidden
25394
25524
  * @see {@link Core#toggleBorders}
@@ -25422,6 +25552,14 @@ Core_Core.prototype.toggleVerticalLines = function(forcedVal) {
25422
25552
  Core_Core.prototype.toggleHorizontalLines = function(forcedVal) {
25423
25553
  this.toggleClass("no-horizontal-grid-line", forcedVal != null ? !forcedVal : null);
25424
25554
  };
25555
+ /** Toggle vertical gridlines. This applies to ONLY content sections.
25556
+ * @public
25557
+ * @param {boolean=} forcedVal If value is true, show horizontal lines, otherwise hide them
25558
+ */
25559
+ Core_Core.prototype.toggleContentVerticalLines = function(forcedVal) {
25560
+ this.toggleClass("no-content-vertical-line", forcedVal != null ? !forcedVal : null);
25561
+ };
25562
+
25425
25563
 
25426
25564
  /** @public
25427
25565
  * @return {Array.<string>}
@@ -25916,6 +26054,11 @@ Core_Core.prototype.getScrollHeight = function () {
25916
26054
  }
25917
26055
  return this._vscrollbar.getContentHeight();
25918
26056
  };
26057
+ /** @public
26058
+ */
26059
+ Core_Core.prototype.restoreScrollbars = function () {
26060
+ this._vscrollbar.restoreTrackPosition();
26061
+ };
25919
26062
 
25920
26063
  /** @public
25921
26064
  * @ignore
@@ -26232,18 +26375,18 @@ Core_Core.prototype.isBinding = function() {
26232
26375
  };
26233
26376
 
26234
26377
  /**
26235
- * Hide row(s) in the Grid by specifying the rId
26378
+ * Hide the specified rows by row id
26236
26379
  * @param {number | string} rowId rowId of the row to hide
26237
- * @param {boolean=} hidden if false, show instead of hide
26380
+ * @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
26238
26381
  * @public
26239
26382
  */
26240
26383
  Core_Core.prototype.hideRow = function (rowId, hidden) {
26241
26384
  this._dataSource.hideRow(rowId, hidden);
26242
26385
  };
26243
26386
  /**
26244
- * Hide row(s) in the Grid by specifying the rIds
26387
+ * Hide the specified rows by rowIds
26245
26388
  * @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to hide
26246
- * @param {boolean=} hidden if false, show instead of hide
26389
+ * @param {boolean=} hidden=true If the value is false, the specified rows will be shown.
26247
26390
  * @public
26248
26391
  */
26249
26392
  Core_Core.prototype.hideRows = function (rowIds, hidden) {
@@ -26255,9 +26398,9 @@ Core_Core.prototype.hideRows = function (rowIds, hidden) {
26255
26398
  };
26256
26399
 
26257
26400
  /**
26258
- * Show row(s) in the Grid by specifying the rIds
26401
+ * Show the specified rows by rowIds. To show all rows, use unhideAllRows method for better performance.
26259
26402
  * @param {number | string | Array.<number | string>} rowIds rowId(s) of the rows to show
26260
- * @param {boolean=} shown if false, hide instead of show
26403
+ * @param {boolean=} shown=true If the value is false, the specified rows will be hidden.
26261
26404
  * @public
26262
26405
  */
26263
26406
  Core_Core.prototype.showRows = function (rowIds, shown) {
@@ -26278,7 +26421,7 @@ Core_Core.prototype.unhideAllRows = function () {
26278
26421
 
26279
26422
  /**
26280
26423
  * @public
26281
- * @returns {boolean}
26424
+ * @return {boolean}
26282
26425
  */
26283
26426
  Core_Core.prototype.hasHiddenRow = function () {
26284
26427
  return this._dataSource.hasHiddenRow();
@@ -26357,10 +26500,22 @@ Core_Core.prototype._updateColumnBounds = function () {
26357
26500
  return;
26358
26501
  }
26359
26502
 
26503
+ var colCount = this.getColumnCount();
26504
+ var colIndices = [];
26505
+ var i;
26506
+ for(i = 0; i < colCount; i++) {
26507
+ if(this.isSelectedColumn(i)) {
26508
+ colIndices.push(i);
26509
+ }
26510
+ }
26511
+ var arg = {
26512
+ selectedColumns: colIndices
26513
+ };
26514
+ this._dispatch("beforeColumnBoundUpdate", arg);
26515
+
26360
26516
  var len = this.getColumnCount();
26361
26517
  var lftIdx = -1;
26362
26518
  var rgtIdx = -1;
26363
- var i;
26364
26519
  for(i = 0; i < len; ++i) {
26365
26520
  if(this.isSelectedColumn(i)) {
26366
26521
  rgtIdx = i;
@@ -26371,12 +26526,17 @@ Core_Core.prototype._updateColumnBounds = function () {
26371
26526
  }
26372
26527
  var sectCount = this._settings.length;
26373
26528
  if(sectCount) {
26374
- var section = this._settings[0].getSection();
26529
+ var sectionSetting = this._settings[0];
26530
+ var section = sectionSetting.getSection();
26375
26531
  var positions = [0, 0];
26376
26532
  var noBorders = [false, false];
26377
26533
  section.calculateColumnBounds(lftIdx, rgtIdx, positions, noBorders);
26378
-
26379
- for (i = sectCount; --i >= 0; ) {
26534
+ var topPx = 0;
26535
+ if(sectionSetting.getType() === "title" && arg.topBoundRowIndex != null) {
26536
+ topPx = this._layoutY.getLaneStart(arg.topBoundRowIndex);
26537
+ }
26538
+ section.updateColumnBounds(positions, noBorders, topPx);
26539
+ for(i = 1; i < sectCount; i++) {
26380
26540
  section = this._settings[i].getSection();
26381
26541
  section.updateColumnBounds(positions, noBorders);
26382
26542
  }
@@ -27546,6 +27706,10 @@ Core_Core.prototype._updateScrollbarHeight = function (paneChanged, contentChang
27546
27706
  * @param {boolean} contentChanged
27547
27707
  */
27548
27708
  Core_Core.prototype._updateScrollbarWidth = function (paneChanged, contentChanged) {
27709
+ if (this._frozenLayout) {
27710
+ return;
27711
+ }
27712
+
27549
27713
  if (paneChanged && this._hScrollbarEnabled) {
27550
27714
  // Scroll Frame
27551
27715
  var gridElem = this.getElement();
@@ -27744,12 +27908,13 @@ Core_Core.prototype._updateSectionIndices = function (from) {
27744
27908
 
27745
27909
  /** @private */
27746
27910
  Core_Core.prototype._updateLayout = function () {
27747
- if(this._disposed) { return; }
27911
+ var element = this.getElement();
27912
+ if(this._disposed || !element.offsetParent) { return; }
27748
27913
 
27749
27914
  this._syncLayoutToColumns(); // Update only if need
27750
27915
 
27751
27916
  this._updateScrollbarHeight(true, true);
27752
- this._updateScrollbarWidth(true, true);
27917
+ this._updateScrollbarWidth(true, true); // WARNING this may be redundant with _syncLayoutToColumns
27753
27918
 
27754
27919
  var sectionCount = this.getSectionCount();
27755
27920
  for (var s = 0; s < sectionCount; ++s) {
@@ -27881,7 +28046,7 @@ SortableTitlePlugin.ColumnOptions;
27881
28046
  * @property {(boolean|number)=} multiColumn=false Alias to `multicolumn`
27882
28047
  * @property {boolean=} threeStatesSorting=false If enabled, sorting will cycle through ascending, descending and original order states. This option is deprecated in favor of sortingSequence option
27883
28048
  * @property {Object.<string, DataTable.SortLogic>=} sortLogic=null Custom logic for sorting based on the specified field. The key is field name and the value pair is a function.
27884
- * @property {boolean=} disableDoubleClickToSort=false If enabled, double click on column title to sort
28049
+ * @property {boolean=} disableDoubleClickToSort=true If disabled, double click will trigger sorting operation
27885
28050
  * @property {boolean=} sortableColumns=false If enabled, all columns will be sortable by field automatically
27886
28051
  * @property {boolean=} sortableIndicator=false If enabled, sort indicator (diamond) icon will always show regardless of sorting states. In Halo theme, this option will be enabled by default.
27887
28052
  * @property {boolean=} indicatorOnly=false If enabled, data will not be sorted, but the UI is rendered normally. This is useful for server side sorting.
@@ -27891,7 +28056,8 @@ SortableTitlePlugin.ColumnOptions;
27891
28056
  * @property {Function=} preClicked A shortcut to define the preClicked event handler
27892
28057
  * @property {Function=} clicked A shortcut to define the clicked event handler
27893
28058
  * @property {Function=} preDataSorting A shortcut to define the preDataSorting event handler
27894
- * @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option override threeStatesSorting
28059
+ * @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option overrides threeStatesSorting
28060
+ * @property {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
27895
28061
  */
27896
28062
  SortableTitlePlugin.Options;
27897
28063
 
@@ -27920,7 +28086,7 @@ SortableTitlePlugin.prototype._dataSorting = true;
27920
28086
  /** @private
27921
28087
  * @type {boolean}
27922
28088
  */
27923
- SortableTitlePlugin.prototype._isDisableDoubleClickToSort = true;
28089
+ SortableTitlePlugin.prototype._dblClickAllowed = false;
27924
28090
 
27925
28091
  /** @private
27926
28092
  * @type {number}
@@ -28063,19 +28229,20 @@ SortableTitlePlugin.prototype.unload = function (host) {
28063
28229
  SortableTitlePlugin.prototype.afterInit = function () {
28064
28230
  var t = this;
28065
28231
 
28066
- // Data source not available during initialization
28232
+ // Set logic to the data source, since the data source not available during the initialization
28067
28233
  t.setSortLogics(t._sortLogic);
28068
28234
 
28069
- // Sort columns if initialSort are specified initially
28070
- if (t._initialSort != null) {
28071
- var initialSort = t._initialSort;
28072
- if (!Array.isArray(initialSort)) {
28073
- initialSort = [initialSort];
28074
- }
28075
- if (t._maxCount === 1) {
28076
- initialSort = initialSort.slice(0, 1); // Ensure only 1 item is sorted in non-multiColumn mode
28235
+ var userInput = t._initialSort;
28236
+ if (userInput != null) {
28237
+ if(Array.isArray(userInput)) {
28238
+ if(t._maxCount === 1) { // TODO: max count could be part of sortColumns method
28239
+ t.sortColumns(userInput.slice(0, 1));
28240
+ } else {
28241
+ t.sortColumns(userInput);
28242
+ }
28243
+ } else {
28244
+ t.sortColumns([userInput]);
28077
28245
  }
28078
- t.sortColumns(initialSort);
28079
28246
  }
28080
28247
  };
28081
28248
 
@@ -28253,7 +28420,9 @@ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
28253
28420
  if(this._maxCount !== 1) {
28254
28421
  extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
28255
28422
  }
28256
- extOptions["disableDoubleClickToSort"] = this._isDisableDoubleClickToSort;
28423
+ if(this._dblClickAllowed) {
28424
+ extOptions["disableDoubleClickToSort"] = !this._dblClickAllowed;
28425
+ }
28257
28426
  extOptions["sortableColumns"] = this._sortableColumns;
28258
28427
  extOptions["indicatorOnly"] = !this._dataSorting;
28259
28428
  // extOptions["mode"] = this._mode;
@@ -28626,9 +28795,10 @@ SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
28626
28795
  * @public
28627
28796
  * @param {number} colIndex
28628
28797
  * @param {string|null} field A field used for sorting
28629
- * @param {Function=} sortLogic
28798
+ * @param {Function=} sortLogic=null
28799
+ * @param {boolean=} rowSorting=false A flag indicating that the given sortLogic takes entire row data instead of a field value for comparison
28630
28800
  */
28631
- SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic) {
28801
+ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic, rowSorting) {
28632
28802
  if (typeof colIndex == "number" && field != null) {
28633
28803
  var options = this._newSortOptions(colIndex);
28634
28804
  if (!field) {
@@ -28640,6 +28810,9 @@ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field,
28640
28810
  if(sortLogic != null && !this._userManagedLogic) {
28641
28811
  if (options["sortLogic"] !== sortLogic) {
28642
28812
  options["sortLogic"] = sortLogic || null;
28813
+ if(rowSorting && sortLogic) {
28814
+ sortLogic["rowSorting"] = true; // Tell data view/table about the argument
28815
+ }
28643
28816
  }
28644
28817
  }
28645
28818
  }
@@ -28739,10 +28912,10 @@ SortableTitlePlugin.prototype.disableDataSorting = function (disabled) {
28739
28912
  };
28740
28913
  /** @public
28741
28914
  * @description To allow double click action to sort. Default value is false.
28742
- * @param {boolean=} disabled
28915
+ * @param {boolean=} disabled=false
28743
28916
  */
28744
28917
  SortableTitlePlugin.prototype.disableDoubleClickToSort = function (disabled) {
28745
- this._isDisableDoubleClickToSort = !!disabled;
28918
+ this._dblClickAllowed = !disabled;
28746
28919
  };
28747
28920
  /** This api is deprecated. Use {@link SortableTitlePlugin.prototype.disableColumnSorting} instead
28748
28921
  * @public
@@ -28788,54 +28961,26 @@ SortableTitlePlugin.prototype.setClickDelayInterval = function (opt_ms) {
28788
28961
  this._delayInterval = (opt_ms != null) ? opt_ms : 500;
28789
28962
  };
28790
28963
 
28791
- /** @private
28792
- * @description Pre-process columns options to support both composite and rt-grid backward compatible
28793
- * @param {number} colIndex
28794
- * @param {Object} options
28795
- * @returns {Object}
28796
- */
28797
- SortableTitlePlugin.prototype._prepareColumnOptions = function (colIndex, options) {
28798
- var t = this;
28799
- var column = options || {};
28800
- var colOption = {
28801
- "colIndex": colIndex,
28802
- "field": column["field"],
28803
- "sortable": !!t._sortableColumns
28804
- };
28805
-
28806
- if (column["sortBy"] != null) { // composite grid option
28807
- colOption["sortable"] = !!column["sortBy"];
28808
- colOption["sortBy"] = column["sortBy"];
28809
- }
28810
- if (column["sortable"] != null) { // rt grid option
28811
- colOption["sortable"] = !!column["sortable"];
28812
- }
28813
-
28814
- colOption["sortLogic"] = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
28815
- colOption["sort"] = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
28816
- return colOption;
28817
- };
28818
-
28819
28964
  /** @private
28820
28965
  * @description Get initial sort from column option `defaultSort` or `sort`
28821
28966
  * @param {Object} options Core model object
28822
28967
  * @returns {Object}
28823
28968
  */
28824
28969
  SortableTitlePlugin.prototype._initialSortByColumnField = function (options) {
28825
- var t = this;
28826
- var columns = options["columns"] || [];
28827
- var initialSort = null;
28828
- for (var i = 0; i < columns.length; i++) {
28829
- var col = t._prepareColumnOptions(i, columns[i]);
28830
- var val = col["sort"];
28831
- if (val) {
28832
- initialSort = {
28833
- "colIndex": col["colIndex"],
28834
- "sortOrder": val
28970
+ var columns = options["columns"];
28971
+ var colCount = columns ? columns.length : 0;
28972
+ for (var i = 0; i < colCount; i++) {
28973
+ var column = columns[i];
28974
+ var sortOrder = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
28975
+ if (sortOrder) {
28976
+ // TODO: Support multi-column sorting
28977
+ return {
28978
+ "colIndex": i,
28979
+ "sortOrder": sortOrder
28835
28980
  };
28836
28981
  }
28837
28982
  }
28838
- return initialSort;
28983
+ return null;
28839
28984
  };
28840
28985
 
28841
28986
  /** @private
@@ -28946,7 +29091,7 @@ SortableTitlePlugin.prototype._onClickTitle = function (grid, e) {
28946
29091
  if(this._disabled) {
28947
29092
  return;
28948
29093
  }
28949
- if (e.detail === 2 && this._isDisableDoubleClickToSort) { // dblclick
29094
+ if (e.detail === 2 && !this._dblClickAllowed) { // dblclick
28950
29095
  if (this._clickTimer) {
28951
29096
  clearTimeout(this._clickTimer);
28952
29097
  this._clickTimer = 0;
@@ -29224,18 +29369,35 @@ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
29224
29369
  SortableTitlePlugin.prototype._onColumnAdded = function (e) {
29225
29370
  var t = this;
29226
29371
  var colIndex = e["colIndex"];
29227
- var context = e["context"];
29228
- var col = t._prepareColumnOptions(colIndex, context);
29229
- var field = col["sortBy"] || col["field"];
29230
- var logic = col["sortLogic"] || t._sortLogic[field];
29372
+ var column = e["context"] || {};
29373
+
29374
+ var sortable = !!t._sortableColumns;
29375
+ var field = column["field"];
29376
+ var sortBy = column["sortBy"];
29377
+
29378
+ if (sortBy != null) { // composite grid option
29379
+ sortable = !!sortBy;
29380
+ field = sortBy;
29381
+ }
29382
+ if (column["sortable"] != null) { // rt grid option
29383
+ sortable = !!column["sortable"];
29384
+ }
29385
+
29386
+ var sortLogic = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
29387
+ if(!sortLogic) {
29388
+ sortLogic = t._sortLogic[field];
29389
+ }
29390
+ if(typeof sortLogic !== "function") {
29391
+ sortLogic = null;
29392
+ }
29231
29393
 
29232
- var sortingSequence = context ? context["sortingSequence"] : null;
29394
+ var sortingSequence = column["sortingSequence"];
29233
29395
  if (sortingSequence != null && field) { // Make sure that column config does not affect grid level config
29234
29396
  t.setSortingSequence(sortingSequence, field);
29235
29397
  }
29236
29398
 
29237
- if (col["sortable"]) {
29238
- t.setColumnSortingField(colIndex, field, typeof logic === "function" ? logic : null);
29399
+ if (sortable) { // TODO: Check if empty field should be sortable
29400
+ t.setColumnSortingField(colIndex, field, sortLogic, column["rowSorting"]);
29239
29401
  } else {
29240
29402
  t.disableColumnSorting(colIndex, true);
29241
29403
  }