@refinitiv-ui/efx-grid 6.0.0-next.0

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 (837) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +61 -0
  3. package/lib/column-format-dialog/index.d.ts +1 -0
  4. package/lib/column-format-dialog/index.js +1 -0
  5. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +64 -0
  6. package/lib/column-format-dialog/lib/column-format-dialog.js +2713 -0
  7. package/lib/column-format-dialog/lib/locale/translation-de.d.ts +7 -0
  8. package/lib/column-format-dialog/lib/locale/translation-de.js +94 -0
  9. package/lib/column-format-dialog/lib/locale/translation-en.d.ts +7 -0
  10. package/lib/column-format-dialog/lib/locale/translation-en.js +94 -0
  11. package/lib/column-format-dialog/lib/locale/translation-ja.d.ts +7 -0
  12. package/lib/column-format-dialog/lib/locale/translation-ja.js +94 -0
  13. package/lib/column-format-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  14. package/lib/column-format-dialog/lib/locale/translation-zh-hant.js +94 -0
  15. package/lib/column-format-dialog/lib/locale/translation-zh.d.ts +7 -0
  16. package/lib/column-format-dialog/lib/locale/translation-zh.js +94 -0
  17. package/lib/column-format-dialog/lib/locale/translation.d.ts +11 -0
  18. package/lib/column-format-dialog/lib/locale/translation.js +18 -0
  19. package/lib/column-format-dialog/lib/preview-table.d.ts +151 -0
  20. package/lib/column-format-dialog/lib/preview-table.js +995 -0
  21. package/lib/column-format-dialog/themes/base.less +429 -0
  22. package/lib/column-format-dialog/themes/elemental/column-format-dialog.less +1 -0
  23. package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +4 -0
  24. package/lib/column-format-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  25. package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
  26. package/lib/column-format-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
  27. package/lib/column-format-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
  28. package/lib/column-format-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  29. package/lib/column-format-dialog/themes/elemental/dark.js +16 -0
  30. package/lib/column-format-dialog/themes/elemental/defaults.less +1 -0
  31. package/lib/column-format-dialog/themes/elemental/index.less +5 -0
  32. package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +4 -0
  33. package/lib/column-format-dialog/themes/elemental/light/css/native-elements.css +0 -0
  34. package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +2 -0
  35. package/lib/column-format-dialog/themes/elemental/light/imports/all-elements.js +1 -0
  36. package/lib/column-format-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
  37. package/lib/column-format-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  38. package/lib/column-format-dialog/themes/elemental/light.js +16 -0
  39. package/lib/column-format-dialog/themes/halo/column-format-dialog.less +6 -0
  40. package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +4 -0
  41. package/lib/column-format-dialog/themes/halo/dark/css/native-elements.css +0 -0
  42. package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +2 -0
  43. package/lib/column-format-dialog/themes/halo/dark/imports/all-elements.js +1 -0
  44. package/lib/column-format-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
  45. package/lib/column-format-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  46. package/lib/column-format-dialog/themes/halo/dark.js +16 -0
  47. package/lib/column-format-dialog/themes/halo/defaults.less +1 -0
  48. package/lib/column-format-dialog/themes/halo/index.less +5 -0
  49. package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +4 -0
  50. package/lib/column-format-dialog/themes/halo/light/css/native-elements.css +0 -0
  51. package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +2 -0
  52. package/lib/column-format-dialog/themes/halo/light/imports/all-elements.js +1 -0
  53. package/lib/column-format-dialog/themes/halo/light/imports/custom-elements.js +1 -0
  54. package/lib/column-format-dialog/themes/halo/light/imports/native-elements.js +0 -0
  55. package/lib/column-format-dialog/themes/halo/light.js +16 -0
  56. package/lib/column-format-dialog/themes/luna/column-format-dialog.less +1 -0
  57. package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +4 -0
  58. package/lib/column-format-dialog/themes/luna/default/css/native-elements.css +0 -0
  59. package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +2 -0
  60. package/lib/column-format-dialog/themes/luna/default/imports/all-elements.js +1 -0
  61. package/lib/column-format-dialog/themes/luna/default/imports/custom-elements.js +1 -0
  62. package/lib/column-format-dialog/themes/luna/default/imports/native-elements.js +0 -0
  63. package/lib/column-format-dialog/themes/luna/defaults.less +1 -0
  64. package/lib/column-format-dialog/themes/luna/index.less +5 -0
  65. package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +4 -0
  66. package/lib/column-format-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  67. package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
  68. package/lib/column-format-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
  69. package/lib/column-format-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
  70. package/lib/column-format-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  71. package/lib/column-format-dialog/themes/solar/charcoal.js +16 -0
  72. package/lib/column-format-dialog/themes/solar/column-format-dialog.less +6 -0
  73. package/lib/column-format-dialog/themes/solar/defaults.less +1 -0
  74. package/lib/column-format-dialog/themes/solar/index.less +5 -0
  75. package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +4 -0
  76. package/lib/column-format-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  77. package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
  78. package/lib/column-format-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
  79. package/lib/column-format-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
  80. package/lib/column-format-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  81. package/lib/column-format-dialog/themes/solar/pearl.js +16 -0
  82. package/lib/column-selection-dialog/index.d.ts +1 -0
  83. package/lib/column-selection-dialog/index.js +1 -0
  84. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +41 -0
  85. package/lib/column-selection-dialog/lib/column-selection-dialog.js +1410 -0
  86. package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
  87. package/lib/column-selection-dialog/lib/locale/translation-de.js +19 -0
  88. package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
  89. package/lib/column-selection-dialog/lib/locale/translation-en.js +19 -0
  90. package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
  91. package/lib/column-selection-dialog/lib/locale/translation-ja.js +19 -0
  92. package/lib/column-selection-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  93. package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +19 -0
  94. package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
  95. package/lib/column-selection-dialog/lib/locale/translation-zh.js +19 -0
  96. package/lib/column-selection-dialog/lib/locale/translation.d.ts +11 -0
  97. package/lib/column-selection-dialog/lib/locale/translation.js +18 -0
  98. package/lib/column-selection-dialog/themes/base.less +189 -0
  99. package/lib/column-selection-dialog/themes/elemental/column-selection-dialog.less +1 -0
  100. package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +4 -0
  101. package/lib/column-selection-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  102. package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
  103. package/lib/column-selection-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
  104. package/lib/column-selection-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
  105. package/lib/column-selection-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  106. package/lib/column-selection-dialog/themes/elemental/dark.js +6 -0
  107. package/lib/column-selection-dialog/themes/elemental/defaults.less +1 -0
  108. package/lib/column-selection-dialog/themes/elemental/index.less +5 -0
  109. package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +4 -0
  110. package/lib/column-selection-dialog/themes/elemental/light/css/native-elements.css +0 -0
  111. package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +2 -0
  112. package/lib/column-selection-dialog/themes/elemental/light/imports/all-elements.js +1 -0
  113. package/lib/column-selection-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
  114. package/lib/column-selection-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  115. package/lib/column-selection-dialog/themes/elemental/light.js +6 -0
  116. package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +22 -0
  117. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +4 -0
  118. package/lib/column-selection-dialog/themes/halo/dark/css/native-elements.css +0 -0
  119. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +2 -0
  120. package/lib/column-selection-dialog/themes/halo/dark/imports/all-elements.js +1 -0
  121. package/lib/column-selection-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
  122. package/lib/column-selection-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  123. package/lib/column-selection-dialog/themes/halo/dark.js +6 -0
  124. package/lib/column-selection-dialog/themes/halo/defaults.less +1 -0
  125. package/lib/column-selection-dialog/themes/halo/index.less +6 -0
  126. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +4 -0
  127. package/lib/column-selection-dialog/themes/halo/light/css/native-elements.css +0 -0
  128. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +2 -0
  129. package/lib/column-selection-dialog/themes/halo/light/imports/all-elements.js +1 -0
  130. package/lib/column-selection-dialog/themes/halo/light/imports/custom-elements.js +1 -0
  131. package/lib/column-selection-dialog/themes/halo/light/imports/native-elements.js +0 -0
  132. package/lib/column-selection-dialog/themes/halo/light.js +6 -0
  133. package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +4 -0
  134. package/lib/column-selection-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  135. package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
  136. package/lib/column-selection-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
  137. package/lib/column-selection-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
  138. package/lib/column-selection-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  139. package/lib/column-selection-dialog/themes/solar/charcoal.js +6 -0
  140. package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +1 -0
  141. package/lib/column-selection-dialog/themes/solar/defaults.less +1 -0
  142. package/lib/column-selection-dialog/themes/solar/index.less +6 -0
  143. package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +4 -0
  144. package/lib/column-selection-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  145. package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
  146. package/lib/column-selection-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
  147. package/lib/column-selection-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
  148. package/lib/column-selection-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  149. package/lib/column-selection-dialog/themes/solar/pearl.js +6 -0
  150. package/lib/core/dist/core.css +1 -0
  151. package/lib/core/dist/core.js +28075 -0
  152. package/lib/core/dist/core.min.js +1 -0
  153. package/lib/core/es6/data/ColumnStats.d.ts +42 -0
  154. package/lib/core/es6/data/ColumnStats.js +428 -0
  155. package/lib/core/es6/data/DataCache.d.ts +81 -0
  156. package/lib/core/es6/data/DataCache.js +1317 -0
  157. package/lib/core/es6/data/DataTable.d.ts +125 -0
  158. package/lib/core/es6/data/DataTable.js +1655 -0
  159. package/lib/core/es6/data/DataView.d.ts +280 -0
  160. package/lib/core/es6/data/DataView.js +3654 -0
  161. package/lib/core/es6/data/Segment.d.ts +38 -0
  162. package/lib/core/es6/data/Segment.js +193 -0
  163. package/lib/core/es6/data/SegmentCollection.d.ts +58 -0
  164. package/lib/core/es6/data/SegmentCollection.js +431 -0
  165. package/lib/core/es6/grid/Core.d.ts +387 -0
  166. package/lib/core/es6/grid/Core.js +4939 -0
  167. package/lib/core/es6/grid/ILayoutGrid.d.ts +204 -0
  168. package/lib/core/es6/grid/ILayoutGrid.js +658 -0
  169. package/lib/core/es6/grid/LayoutGrid.d.ts +23 -0
  170. package/lib/core/es6/grid/LayoutGrid.js +2602 -0
  171. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +18 -0
  172. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +907 -0
  173. package/lib/core/es6/grid/components/Cell.d.ts +50 -0
  174. package/lib/core/es6/grid/components/Cell.js +740 -0
  175. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +19 -0
  176. package/lib/core/es6/grid/components/CellFloatingPanel.js +123 -0
  177. package/lib/core/es6/grid/components/CellSpan.d.ts +18 -0
  178. package/lib/core/es6/grid/components/CellSpan.js +99 -0
  179. package/lib/core/es6/grid/components/CellSpans.d.ts +38 -0
  180. package/lib/core/es6/grid/components/CellSpans.js +341 -0
  181. package/lib/core/es6/grid/components/Column.d.ts +22 -0
  182. package/lib/core/es6/grid/components/Column.js +612 -0
  183. package/lib/core/es6/grid/components/ElementWrapper.d.ts +125 -0
  184. package/lib/core/es6/grid/components/ElementWrapper.js +714 -0
  185. package/lib/core/es6/grid/components/HScrollbar.d.ts +24 -0
  186. package/lib/core/es6/grid/components/HScrollbar.js +222 -0
  187. package/lib/core/es6/grid/components/Scrollbar.d.ts +61 -0
  188. package/lib/core/es6/grid/components/Scrollbar.js +1374 -0
  189. package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
  190. package/lib/core/es6/grid/components/StretchedCells.js +328 -0
  191. package/lib/core/es6/grid/components/VScrollbar.d.ts +18 -0
  192. package/lib/core/es6/grid/components/VScrollbar.js +139 -0
  193. package/lib/core/es6/grid/components/VirtualItems.d.ts +12 -0
  194. package/lib/core/es6/grid/components/VirtualItems.js +51 -0
  195. package/lib/core/es6/grid/event/EventDispatcher.d.ts +16 -0
  196. package/lib/core/es6/grid/event/EventDispatcher.js +138 -0
  197. package/lib/core/es6/grid/event/EventListeners.d.ts +34 -0
  198. package/lib/core/es6/grid/event/EventListeners.js +163 -0
  199. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
  200. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +615 -0
  201. package/lib/core/es6/grid/plugins/Plugin.d.ts +28 -0
  202. package/lib/core/es6/grid/plugins/Plugin.js +272 -0
  203. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +127 -0
  204. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1707 -0
  205. package/lib/core/es6/grid/util/Conflator.d.ts +32 -0
  206. package/lib/core/es6/grid/util/Conflator.js +191 -0
  207. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +18 -0
  208. package/lib/core/es6/grid/util/ElementFrameWork.js +227 -0
  209. package/lib/core/es6/grid/util/HttpRequest.d.ts +53 -0
  210. package/lib/core/es6/grid/util/HttpRequest.js +371 -0
  211. package/lib/core/es6/grid/util/PercentBar.d.ts +43 -0
  212. package/lib/core/es6/grid/util/PercentBar.js +390 -0
  213. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +41 -0
  214. package/lib/core/es6/grid/util/PercentBarRenderer.js +316 -0
  215. package/lib/core/es6/grid/util/RangeBar.d.ts +25 -0
  216. package/lib/core/es6/grid/util/RangeBar.js +255 -0
  217. package/lib/core/es6/grid/util/Reverter.d.ts +14 -0
  218. package/lib/core/es6/grid/util/Reverter.js +79 -0
  219. package/lib/core/es6/grid/util/SectionSettings.d.ts +79 -0
  220. package/lib/core/es6/grid/util/SectionSettings.js +674 -0
  221. package/lib/core/es6/grid/util/SelectionList.d.ts +50 -0
  222. package/lib/core/es6/grid/util/SelectionList.js +422 -0
  223. package/lib/core/es6/grid/util/TrackLayout.d.ts +84 -0
  224. package/lib/core/es6/grid/util/TrackLayout.js +850 -0
  225. package/lib/core/es6/grid/util/Virtualizer.d.ts +40 -0
  226. package/lib/core/es6/grid/util/Virtualizer.js +340 -0
  227. package/lib/core/es6/grid/util/util.d.ts +18 -0
  228. package/lib/core/es6/grid/util/util.js +450 -0
  229. package/lib/core/es6/index.d.ts +84 -0
  230. package/lib/core/es6/index.js +132 -0
  231. package/lib/core/es6/tr-grid-theme.d.ts +5 -0
  232. package/lib/core/es6/tr-grid-theme.js +5 -0
  233. package/lib/filter-dialog/index.d.ts +1 -0
  234. package/lib/filter-dialog/index.js +1 -0
  235. package/lib/filter-dialog/lib/checkbox-list.d.ts +27 -0
  236. package/lib/filter-dialog/lib/checkbox-list.js +336 -0
  237. package/lib/filter-dialog/lib/filter-dialog.d.ts +53 -0
  238. package/lib/filter-dialog/lib/filter-dialog.js +860 -0
  239. package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
  240. package/lib/filter-dialog/lib/locale/translation-de.js +37 -0
  241. package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
  242. package/lib/filter-dialog/lib/locale/translation-en.js +37 -0
  243. package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
  244. package/lib/filter-dialog/lib/locale/translation-ja.js +37 -0
  245. package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  246. package/lib/filter-dialog/lib/locale/translation-zh-hant.js +37 -0
  247. package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
  248. package/lib/filter-dialog/lib/locale/translation-zh.js +37 -0
  249. package/lib/filter-dialog/lib/locale/translation.d.ts +11 -0
  250. package/lib/filter-dialog/lib/locale/translation.js +18 -0
  251. package/lib/filter-dialog/themes/base-checkbox.less +37 -0
  252. package/lib/filter-dialog/themes/base.less +102 -0
  253. package/lib/filter-dialog/themes/elemental/checkbox-list.less +3 -0
  254. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +4 -0
  255. package/lib/filter-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  256. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +4 -0
  257. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +5 -0
  258. package/lib/filter-dialog/themes/elemental/dark/imports/all-elements.js +2 -0
  259. package/lib/filter-dialog/themes/elemental/dark/imports/custom-elements.js +2 -0
  260. package/lib/filter-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  261. package/lib/filter-dialog/themes/elemental/dark.js +11 -0
  262. package/lib/filter-dialog/themes/elemental/defaults.less +3 -0
  263. package/lib/filter-dialog/themes/elemental/filter-dialog.less +1 -0
  264. package/lib/filter-dialog/themes/elemental/index.less +6 -0
  265. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +4 -0
  266. package/lib/filter-dialog/themes/elemental/light/css/native-elements.css +0 -0
  267. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +4 -0
  268. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +5 -0
  269. package/lib/filter-dialog/themes/elemental/light/imports/all-elements.js +2 -0
  270. package/lib/filter-dialog/themes/elemental/light/imports/custom-elements.js +2 -0
  271. package/lib/filter-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  272. package/lib/filter-dialog/themes/elemental/light.js +11 -0
  273. package/lib/filter-dialog/themes/halo/checkbox-list.less +3 -0
  274. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +4 -0
  275. package/lib/filter-dialog/themes/halo/dark/css/native-elements.css +0 -0
  276. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +4 -0
  277. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +5 -0
  278. package/lib/filter-dialog/themes/halo/dark/imports/all-elements.js +2 -0
  279. package/lib/filter-dialog/themes/halo/dark/imports/custom-elements.js +2 -0
  280. package/lib/filter-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  281. package/lib/filter-dialog/themes/halo/dark.js +11 -0
  282. package/lib/filter-dialog/themes/halo/defaults.less +3 -0
  283. package/lib/filter-dialog/themes/halo/filter-dialog.less +9 -0
  284. package/lib/filter-dialog/themes/halo/index.less +6 -0
  285. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +4 -0
  286. package/lib/filter-dialog/themes/halo/light/css/native-elements.css +0 -0
  287. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +4 -0
  288. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +5 -0
  289. package/lib/filter-dialog/themes/halo/light/imports/all-elements.js +2 -0
  290. package/lib/filter-dialog/themes/halo/light/imports/custom-elements.js +2 -0
  291. package/lib/filter-dialog/themes/halo/light/imports/native-elements.js +0 -0
  292. package/lib/filter-dialog/themes/halo/light.js +11 -0
  293. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +4 -0
  294. package/lib/filter-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  295. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +4 -0
  296. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +5 -0
  297. package/lib/filter-dialog/themes/solar/charcoal/imports/all-elements.js +2 -0
  298. package/lib/filter-dialog/themes/solar/charcoal/imports/custom-elements.js +2 -0
  299. package/lib/filter-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  300. package/lib/filter-dialog/themes/solar/charcoal.js +11 -0
  301. package/lib/filter-dialog/themes/solar/checkbox-list.less +3 -0
  302. package/lib/filter-dialog/themes/solar/defaults.less +3 -0
  303. package/lib/filter-dialog/themes/solar/filter-dialog.less +5 -0
  304. package/lib/filter-dialog/themes/solar/index.less +6 -0
  305. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +4 -0
  306. package/lib/filter-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  307. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +4 -0
  308. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +5 -0
  309. package/lib/filter-dialog/themes/solar/pearl/imports/all-elements.js +2 -0
  310. package/lib/filter-dialog/themes/solar/pearl/imports/custom-elements.js +2 -0
  311. package/lib/filter-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  312. package/lib/filter-dialog/themes/solar/pearl.js +11 -0
  313. package/lib/formatters/es6/CoralButtonFormatter.d.ts +22 -0
  314. package/lib/formatters/es6/CoralButtonFormatter.js +40 -0
  315. package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
  316. package/lib/formatters/es6/CoralCheckboxFormatter.js +45 -0
  317. package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
  318. package/lib/formatters/es6/CoralComboBoxFormatter.js +102 -0
  319. package/lib/formatters/es6/CoralIconFormatter.d.ts +23 -0
  320. package/lib/formatters/es6/CoralIconFormatter.js +45 -0
  321. package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
  322. package/lib/formatters/es6/CoralInputFormatter.js +40 -0
  323. package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +22 -0
  324. package/lib/formatters/es6/CoralRadioButtonFormatter.js +80 -0
  325. package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
  326. package/lib/formatters/es6/CoralSelectFormatter.js +66 -0
  327. package/lib/formatters/es6/CoralToggleFormatter.d.ts +12 -0
  328. package/lib/formatters/es6/CoralToggleFormatter.js +47 -0
  329. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
  330. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +119 -0
  331. package/lib/formatters/es6/EFButtonFormatter.d.ts +22 -0
  332. package/lib/formatters/es6/EFButtonFormatter.js +40 -0
  333. package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
  334. package/lib/formatters/es6/EFCheckboxFormatter.js +45 -0
  335. package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
  336. package/lib/formatters/es6/EFComboBoxFormatter.js +68 -0
  337. package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
  338. package/lib/formatters/es6/EFDateTimePickerFormatter.js +55 -0
  339. package/lib/formatters/es6/EFIconFormatter.d.ts +23 -0
  340. package/lib/formatters/es6/EFIconFormatter.js +45 -0
  341. package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
  342. package/lib/formatters/es6/EFNumberFieldFormatter.js +40 -0
  343. package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +22 -0
  344. package/lib/formatters/es6/EFRadioButtonFormatter.js +80 -0
  345. package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
  346. package/lib/formatters/es6/EFSelectFormatter.js +66 -0
  347. package/lib/formatters/es6/EFTextFieldFormatter.d.ts +12 -0
  348. package/lib/formatters/es6/EFTextFieldFormatter.js +40 -0
  349. package/lib/formatters/es6/EFToggleFormatter.d.ts +12 -0
  350. package/lib/formatters/es6/EFToggleFormatter.js +47 -0
  351. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
  352. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +55 -0
  353. package/lib/formatters/es6/FormatterBuilder.d.ts +22 -0
  354. package/lib/formatters/es6/FormatterBuilder.js +334 -0
  355. package/lib/formatters/es6/NumericInputFormatter.d.ts +13 -0
  356. package/lib/formatters/es6/NumericInputFormatter.js +64 -0
  357. package/lib/formatters/es6/PercentBarFormatter.d.ts +25 -0
  358. package/lib/formatters/es6/PercentBarFormatter.js +62 -0
  359. package/lib/formatters/es6/SimpleImageFormatter.d.ts +21 -0
  360. package/lib/formatters/es6/SimpleImageFormatter.js +64 -0
  361. package/lib/formatters/es6/SimpleInputFormatter.d.ts +12 -0
  362. package/lib/formatters/es6/SimpleInputFormatter.js +40 -0
  363. package/lib/formatters/es6/SimpleLinkFormatter.d.ts +21 -0
  364. package/lib/formatters/es6/SimpleLinkFormatter.js +48 -0
  365. package/lib/formatters/es6/SimpleTickerFormatter.d.ts +25 -0
  366. package/lib/formatters/es6/SimpleTickerFormatter.js +65 -0
  367. package/lib/formatters/es6/SimpleToggleFormatter.d.ts +22 -0
  368. package/lib/formatters/es6/SimpleToggleFormatter.js +132 -0
  369. package/lib/formatters/es6/TextFormatter.d.ts +12 -0
  370. package/lib/formatters/es6/TextFormatter.js +30 -0
  371. package/lib/formatters/es6/index.d.ts +43 -0
  372. package/lib/formatters/es6/index.js +67 -0
  373. package/lib/grid/index.d.ts +1 -0
  374. package/lib/grid/index.js +2 -0
  375. package/lib/grid/lib/efx-grid.d.ts +32 -0
  376. package/lib/grid/lib/efx-grid.js +469 -0
  377. package/lib/grid/themes/base.less +134 -0
  378. package/lib/grid/themes/halo/dark/css/native-elements.css +0 -0
  379. package/lib/grid/themes/halo/dark/efx-grid.js +4 -0
  380. package/lib/grid/themes/halo/dark/es5/all-elements.js +2 -0
  381. package/lib/grid/themes/halo/dark/imports/all-elements.js +1 -0
  382. package/lib/grid/themes/halo/dark/imports/custom-elements.js +1 -0
  383. package/lib/grid/themes/halo/dark/imports/native-elements.js +0 -0
  384. package/lib/grid/themes/halo/dark.js +3 -0
  385. package/lib/grid/themes/halo/efx-grid.less +92 -0
  386. package/lib/grid/themes/halo/index.less +3 -0
  387. package/lib/grid/themes/halo/light/css/native-elements.css +0 -0
  388. package/lib/grid/themes/halo/light/efx-grid.js +4 -0
  389. package/lib/grid/themes/halo/light/es5/all-elements.js +2 -0
  390. package/lib/grid/themes/halo/light/imports/all-elements.js +1 -0
  391. package/lib/grid/themes/halo/light/imports/custom-elements.js +1 -0
  392. package/lib/grid/themes/halo/light/imports/native-elements.js +0 -0
  393. package/lib/grid/themes/halo/light.js +3 -0
  394. package/lib/grid/themes/solar/charcoal/css/native-elements.css +0 -0
  395. package/lib/grid/themes/solar/charcoal/efx-grid.js +4 -0
  396. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +2 -0
  397. package/lib/grid/themes/solar/charcoal/imports/all-elements.js +1 -0
  398. package/lib/grid/themes/solar/charcoal/imports/custom-elements.js +1 -0
  399. package/lib/grid/themes/solar/charcoal/imports/native-elements.js +0 -0
  400. package/lib/grid/themes/solar/charcoal.js +3 -0
  401. package/lib/grid/themes/solar/efx-grid.less +27 -0
  402. package/lib/grid/themes/solar/index.less +3 -0
  403. package/lib/grid/themes/solar/pearl/css/native-elements.css +0 -0
  404. package/lib/grid/themes/solar/pearl/efx-grid.js +4 -0
  405. package/lib/grid/themes/solar/pearl/es5/all-elements.js +2 -0
  406. package/lib/grid/themes/solar/pearl/imports/all-elements.js +1 -0
  407. package/lib/grid/themes/solar/pearl/imports/custom-elements.js +1 -0
  408. package/lib/grid/themes/solar/pearl/imports/native-elements.js +0 -0
  409. package/lib/grid/themes/solar/pearl.js +3 -0
  410. package/lib/index.d.ts +102 -0
  411. package/lib/index.js +102 -0
  412. package/lib/row-segmenting/es6/RowSegmenting.d.ts +83 -0
  413. package/lib/row-segmenting/es6/RowSegmenting.js +592 -0
  414. package/lib/row-segmenting/es6/index.d.ts +1 -0
  415. package/lib/row-segmenting/es6/index.js +1 -0
  416. package/lib/rt-grid/dist/rt-grid.js +44672 -0
  417. package/lib/rt-grid/dist/rt-grid.min.js +1 -0
  418. package/lib/rt-grid/es6/ColumnDefinition.d.ts +141 -0
  419. package/lib/rt-grid/es6/ColumnDefinition.js +1074 -0
  420. package/lib/rt-grid/es6/DataConnector.d.ts +37 -0
  421. package/lib/rt-grid/es6/DataConnector.js +266 -0
  422. package/lib/rt-grid/es6/FieldDefinition.d.ts +20 -0
  423. package/lib/rt-grid/es6/FieldDefinition.js +418 -0
  424. package/lib/rt-grid/es6/Grid.d.ts +261 -0
  425. package/lib/rt-grid/es6/Grid.js +2893 -0
  426. package/lib/rt-grid/es6/PredefinedFormula.d.ts +16 -0
  427. package/lib/rt-grid/es6/PredefinedFormula.js +33 -0
  428. package/lib/rt-grid/es6/ReferenceCounter.d.ts +38 -0
  429. package/lib/rt-grid/es6/ReferenceCounter.js +230 -0
  430. package/lib/rt-grid/es6/RowDefinition.d.ts +120 -0
  431. package/lib/rt-grid/es6/RowDefinition.js +873 -0
  432. package/lib/rt-grid/es6/SnapshotFiller.d.ts +21 -0
  433. package/lib/rt-grid/es6/SnapshotFiller.js +252 -0
  434. package/lib/rt-grid/es6/StyleLoader.d.ts +17 -0
  435. package/lib/rt-grid/es6/StyleLoader.js +47 -0
  436. package/lib/rt-grid/es6/index.d.ts +8 -0
  437. package/lib/rt-grid/es6/index.js +43 -0
  438. package/lib/statistics-row/es6/StatisticsRow.d.ts +67 -0
  439. package/lib/statistics-row/es6/StatisticsRow.js +786 -0
  440. package/lib/statistics-row/es6/index.d.ts +1 -0
  441. package/lib/statistics-row/es6/index.js +1 -0
  442. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.d.ts +45 -0
  443. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +431 -0
  444. package/lib/tr-grid-auto-tooltip/es6/index.d.ts +1 -0
  445. package/lib/tr-grid-auto-tooltip/es6/index.js +1 -0
  446. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +67 -0
  447. package/lib/tr-grid-cell-selection/es6/CellSelection.js +1777 -0
  448. package/lib/tr-grid-cell-selection/es6/index.d.ts +1 -0
  449. package/lib/tr-grid-cell-selection/es6/index.js +1 -0
  450. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +69 -0
  451. package/lib/tr-grid-checkbox/es6/Checkbox.js +1476 -0
  452. package/lib/tr-grid-checkbox/es6/index.d.ts +1 -0
  453. package/lib/tr-grid-checkbox/es6/index.js +1 -0
  454. package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +56 -0
  455. package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +1000 -0
  456. package/lib/tr-grid-column-fitter/es6/index.d.ts +1 -0
  457. package/lib/tr-grid-column-fitter/es6/index.js +1 -0
  458. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +89 -0
  459. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +615 -0
  460. package/lib/tr-grid-column-formatting/es6/index.d.ts +1 -0
  461. package/lib/tr-grid-column-formatting/es6/index.js +1 -0
  462. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +60 -0
  463. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +913 -0
  464. package/lib/tr-grid-column-grouping/es6/index.d.ts +1 -0
  465. package/lib/tr-grid-column-grouping/es6/index.js +1 -0
  466. package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +68 -0
  467. package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1013 -0
  468. package/lib/tr-grid-column-resizing/es6/index.d.ts +1 -0
  469. package/lib/tr-grid-column-resizing/es6/index.js +1 -0
  470. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +70 -0
  471. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +928 -0
  472. package/lib/tr-grid-column-selection/es6/index.d.ts +1 -0
  473. package/lib/tr-grid-column-selection/es6/index.js +1 -0
  474. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +76 -0
  475. package/lib/tr-grid-column-stack/es6/ColumnStack.js +1227 -0
  476. package/lib/tr-grid-column-stack/es6/index.d.ts +1 -0
  477. package/lib/tr-grid-column-stack/es6/index.js +1 -0
  478. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +70 -0
  479. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +947 -0
  480. package/lib/tr-grid-conditional-coloring/es6/index.d.ts +1 -0
  481. package/lib/tr-grid-conditional-coloring/es6/index.js +1 -0
  482. package/lib/tr-grid-content-wrap/es6/ContentWrap.d.ts +43 -0
  483. package/lib/tr-grid-content-wrap/es6/ContentWrap.js +478 -0
  484. package/lib/tr-grid-content-wrap/es6/index.d.ts +1 -0
  485. package/lib/tr-grid-content-wrap/es6/index.js +1 -0
  486. package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +83 -0
  487. package/lib/tr-grid-contextmenu/es6/ContextMenu.js +471 -0
  488. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
  489. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +133 -0
  490. package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +39 -0
  491. package/lib/tr-grid-contextmenu/es6/MenuItem.js +245 -0
  492. package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +29 -0
  493. package/lib/tr-grid-contextmenu/es6/PopupMenu.js +292 -0
  494. package/lib/tr-grid-contextmenu/es6/index.d.ts +1 -0
  495. package/lib/tr-grid-contextmenu/es6/index.js +1 -0
  496. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +57 -0
  497. package/lib/tr-grid-filter-input/es6/FilterInput.js +928 -0
  498. package/lib/tr-grid-filter-input/es6/index.d.ts +1 -0
  499. package/lib/tr-grid-filter-input/es6/index.js +1 -0
  500. package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +44 -0
  501. package/lib/tr-grid-heat-map/es6/HeatMap.js +394 -0
  502. package/lib/tr-grid-heat-map/es6/index.d.ts +1 -0
  503. package/lib/tr-grid-heat-map/es6/index.js +1 -0
  504. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +129 -0
  505. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +1977 -0
  506. package/lib/tr-grid-in-cell-editing/es6/index.d.ts +1 -0
  507. package/lib/tr-grid-in-cell-editing/es6/index.js +1 -0
  508. package/lib/tr-grid-pagination/es6/Pagination.d.ts +57 -0
  509. package/lib/tr-grid-pagination/es6/Pagination.js +427 -0
  510. package/lib/tr-grid-pagination/es6/index.d.ts +1 -0
  511. package/lib/tr-grid-pagination/es6/index.js +1 -0
  512. package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +60 -0
  513. package/lib/tr-grid-percent-bar/es6/PercentBar.js +801 -0
  514. package/lib/tr-grid-percent-bar/es6/index.d.ts +1 -0
  515. package/lib/tr-grid-percent-bar/es6/index.js +1 -0
  516. package/lib/tr-grid-printer/es6/CellWriter.d.ts +49 -0
  517. package/lib/tr-grid-printer/es6/CellWriter.js +226 -0
  518. package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +12 -0
  519. package/lib/tr-grid-printer/es6/ColumnWriter.js +21 -0
  520. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +32 -0
  521. package/lib/tr-grid-printer/es6/GridPrinter.js +761 -0
  522. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +38 -0
  523. package/lib/tr-grid-printer/es6/PrintTrait.js +481 -0
  524. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +54 -0
  525. package/lib/tr-grid-printer/es6/SectionWriter.js +205 -0
  526. package/lib/tr-grid-printer/es6/index.d.ts +1 -0
  527. package/lib/tr-grid-printer/es6/index.js +1 -0
  528. package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +39 -0
  529. package/lib/tr-grid-range-bar/es6/RangeBar.js +353 -0
  530. package/lib/tr-grid-range-bar/es6/index.d.ts +1 -0
  531. package/lib/tr-grid-range-bar/es6/index.js +1 -0
  532. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +53 -0
  533. package/lib/tr-grid-row-dragging/es6/RowDragging.js +794 -0
  534. package/lib/tr-grid-row-dragging/es6/index.d.ts +1 -0
  535. package/lib/tr-grid-row-dragging/es6/index.js +1 -0
  536. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +118 -0
  537. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +1884 -0
  538. package/lib/tr-grid-row-filtering/es6/index.d.ts +1 -0
  539. package/lib/tr-grid-row-filtering/es6/index.js +1 -0
  540. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +109 -0
  541. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1541 -0
  542. package/lib/tr-grid-row-grouping/es6/index.d.ts +1 -0
  543. package/lib/tr-grid-row-grouping/es6/index.js +1 -0
  544. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +74 -0
  545. package/lib/tr-grid-row-selection/es6/RowSelection.js +1202 -0
  546. package/lib/tr-grid-row-selection/es6/index.d.ts +1 -0
  547. package/lib/tr-grid-row-selection/es6/index.js +1 -0
  548. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +60 -0
  549. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +611 -0
  550. package/lib/tr-grid-rowcoloring/es6/index.d.ts +1 -0
  551. package/lib/tr-grid-rowcoloring/es6/index.js +1 -0
  552. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +77 -0
  553. package/lib/tr-grid-textformatting/es6/TextFormatting.js +574 -0
  554. package/lib/tr-grid-textformatting/es6/index.d.ts +1 -0
  555. package/lib/tr-grid-textformatting/es6/index.js +1 -0
  556. package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +29 -0
  557. package/lib/tr-grid-titlewrap/es6/TitleWrap.js +431 -0
  558. package/lib/tr-grid-titlewrap/es6/index.d.ts +1 -0
  559. package/lib/tr-grid-titlewrap/es6/index.js +1 -0
  560. package/lib/tr-grid-util/es6/CellPainter.d.ts +136 -0
  561. package/lib/tr-grid-util/es6/CellPainter.js +1128 -0
  562. package/lib/tr-grid-util/es6/Conflator.d.ts +34 -0
  563. package/lib/tr-grid-util/es6/Conflator.js +193 -0
  564. package/lib/tr-grid-util/es6/CoralItems.d.ts +10 -0
  565. package/lib/tr-grid-util/es6/CoralItems.js +42 -0
  566. package/lib/tr-grid-util/es6/DateTime.d.ts +57 -0
  567. package/lib/tr-grid-util/es6/DateTime.js +508 -0
  568. package/lib/tr-grid-util/es6/Deferred.d.ts +14 -0
  569. package/lib/tr-grid-util/es6/Deferred.js +98 -0
  570. package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
  571. package/lib/tr-grid-util/es6/Delay.js +85 -0
  572. package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
  573. package/lib/tr-grid-util/es6/Dom.js +346 -0
  574. package/lib/tr-grid-util/es6/ElementObserver.d.ts +10 -0
  575. package/lib/tr-grid-util/es6/ElementObserver.js +101 -0
  576. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
  577. package/lib/tr-grid-util/es6/ElementWrapper.js +83 -0
  578. package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
  579. package/lib/tr-grid-util/es6/ElfDate.js +163 -0
  580. package/lib/tr-grid-util/es6/ElfUtil.d.ts +33 -0
  581. package/lib/tr-grid-util/es6/ElfUtil.js +458 -0
  582. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +26 -0
  583. package/lib/tr-grid-util/es6/EventDispatcher.js +161 -0
  584. package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +27 -0
  585. package/lib/tr-grid-util/es6/ExpanderIcon.js +169 -0
  586. package/lib/tr-grid-util/es6/Ext.d.ts +10 -0
  587. package/lib/tr-grid-util/es6/Ext.js +52 -0
  588. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +55 -0
  589. package/lib/tr-grid-util/es6/FieldFormatter.js +432 -0
  590. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +48 -0
  591. package/lib/tr-grid-util/es6/FilterBuilder.js +521 -0
  592. package/lib/tr-grid-util/es6/FilterOperators.d.ts +41 -0
  593. package/lib/tr-grid-util/es6/FilterOperators.js +181 -0
  594. package/lib/tr-grid-util/es6/GridPlugin.d.ts +72 -0
  595. package/lib/tr-grid-util/es6/GridPlugin.js +747 -0
  596. package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
  597. package/lib/tr-grid-util/es6/Icon.js +61 -0
  598. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
  599. package/lib/tr-grid-util/es6/MouseDownTrait.js +237 -0
  600. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +32 -0
  601. package/lib/tr-grid-util/es6/MultiTableManager.js +506 -0
  602. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +83 -0
  603. package/lib/tr-grid-util/es6/NumberFormatter.js +471 -0
  604. package/lib/tr-grid-util/es6/PercentBar.d.ts +71 -0
  605. package/lib/tr-grid-util/es6/PercentBar.js +600 -0
  606. package/lib/tr-grid-util/es6/Perf.d.ts +32 -0
  607. package/lib/tr-grid-util/es6/Perf.js +162 -0
  608. package/lib/tr-grid-util/es6/Popup.d.ts +84 -0
  609. package/lib/tr-grid-util/es6/Popup.js +818 -0
  610. package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
  611. package/lib/tr-grid-util/es6/RangeBar.js +259 -0
  612. package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
  613. package/lib/tr-grid-util/es6/RequestQueue.js +239 -0
  614. package/lib/tr-grid-util/es6/RowPainter.d.ts +23 -0
  615. package/lib/tr-grid-util/es6/RowPainter.js +188 -0
  616. package/lib/tr-grid-util/es6/SubTable.d.ts +74 -0
  617. package/lib/tr-grid-util/es6/SubTable.js +558 -0
  618. package/lib/tr-grid-util/es6/Table.d.ts +125 -0
  619. package/lib/tr-grid-util/es6/Table.js +790 -0
  620. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +18 -0
  621. package/lib/tr-grid-util/es6/TextHighlighter.js +273 -0
  622. package/lib/tr-grid-util/es6/TickCodes.d.ts +8 -0
  623. package/lib/tr-grid-util/es6/TickCodes.js +33 -0
  624. package/lib/tr-grid-util/es6/Timer.d.ts +16 -0
  625. package/lib/tr-grid-util/es6/Timer.js +49 -0
  626. package/lib/tr-grid-util/es6/TouchProxy.d.ts +46 -0
  627. package/lib/tr-grid-util/es6/TouchProxy.js +212 -0
  628. package/lib/tr-grid-util/es6/Util.d.ts +65 -0
  629. package/lib/tr-grid-util/es6/Util.js +528 -0
  630. package/lib/tr-grid-util/es6/formula/ADCService.d.ts +11 -0
  631. package/lib/tr-grid-util/es6/formula/ADCService.js +72 -0
  632. package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +17 -0
  633. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +317 -0
  634. package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +12 -0
  635. package/lib/tr-grid-util/es6/formula/AdFinService.js +61 -0
  636. package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +19 -0
  637. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +310 -0
  638. package/lib/tr-grid-util/es6/formula/Engine.d.ts +56 -0
  639. package/lib/tr-grid-util/es6/formula/Engine.js +592 -0
  640. package/lib/tr-grid-util/es6/formula/Formula.d.ts +68 -0
  641. package/lib/tr-grid-util/es6/formula/Formula.js +882 -0
  642. package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +16 -0
  643. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +165 -0
  644. package/lib/tr-grid-util/es6/formula/Realtime.d.ts +18 -0
  645. package/lib/tr-grid-util/es6/formula/Realtime.js +279 -0
  646. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +18 -0
  647. package/lib/tr-grid-util/es6/formula/RealtimeService.js +203 -0
  648. package/lib/tr-grid-util/es6/formula/TSIService.d.ts +11 -0
  649. package/lib/tr-grid-util/es6/formula/TSIService.js +51 -0
  650. package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +18 -0
  651. package/lib/tr-grid-util/es6/formula/TSISubscription.js +1015 -0
  652. package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +30 -0
  653. package/lib/tr-grid-util/es6/formula/VariableToken.js +314 -0
  654. package/lib/tr-grid-util/es6/formula/functions/AdFin.d.ts +9 -0
  655. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +1778 -0
  656. package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +8 -0
  657. package/lib/tr-grid-util/es6/formula/functions/Excel.js +21 -0
  658. package/lib/tr-grid-util/es6/formula/functions/Info.d.ts +8 -0
  659. package/lib/tr-grid-util/es6/formula/functions/Info.js +192 -0
  660. package/lib/tr-grid-util/es6/formula/functions/Internal.d.ts +8 -0
  661. package/lib/tr-grid-util/es6/formula/functions/Internal.js +90 -0
  662. package/lib/tr-grid-util/es6/formula/functions/Logic.d.ts +12 -0
  663. package/lib/tr-grid-util/es6/formula/functions/Logic.js +176 -0
  664. package/lib/tr-grid-util/es6/formula/functions/Math.d.ts +18 -0
  665. package/lib/tr-grid-util/es6/formula/functions/Math.js +1624 -0
  666. package/lib/tr-grid-util/es6/formula/functions/Statistics.d.ts +18 -0
  667. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +234 -0
  668. package/lib/tr-grid-util/es6/formula/functions/Text.d.ts +10 -0
  669. package/lib/tr-grid-util/es6/formula/functions/Text.js +676 -0
  670. package/lib/tr-grid-util/es6/index.d.ts +63 -0
  671. package/lib/tr-grid-util/es6/index.js +99 -0
  672. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
  673. package/lib/tr-grid-util/es6/jet/CollectionDict.js +141 -0
  674. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +114 -0
  675. package/lib/tr-grid-util/es6/jet/DataGenerator.js +827 -0
  676. package/lib/tr-grid-util/es6/jet/DataSet.d.ts +8 -0
  677. package/lib/tr-grid-util/es6/jet/DataSet.js +392 -0
  678. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +21 -0
  679. package/lib/tr-grid-util/es6/jet/MockArchive.js +56 -0
  680. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +25 -0
  681. package/lib/tr-grid-util/es6/jet/MockJET.js +63 -0
  682. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +37 -0
  683. package/lib/tr-grid-util/es6/jet/MockQuotes.js +199 -0
  684. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +72 -0
  685. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +564 -0
  686. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +8 -0
  687. package/lib/tr-grid-util/es6/jet/MockRTK.js +43 -0
  688. package/lib/tr-grid-util/es6/jet/index.d.ts +9 -0
  689. package/lib/tr-grid-util/es6/jet/index.js +18 -0
  690. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +11 -0
  691. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +131 -0
  692. package/lib/tr-grid-util/es6/locale/translation-de.d.ts +7 -0
  693. package/lib/tr-grid-util/es6/locale/translation-de.js +51 -0
  694. package/lib/tr-grid-util/es6/locale/translation-en.d.ts +7 -0
  695. package/lib/tr-grid-util/es6/locale/translation-en.js +51 -0
  696. package/lib/tr-grid-util/es6/locale/translation-ja.d.ts +7 -0
  697. package/lib/tr-grid-util/es6/locale/translation-ja.js +51 -0
  698. package/lib/tr-grid-util/es6/locale/translation-zh-hant.d.ts +7 -0
  699. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +51 -0
  700. package/lib/tr-grid-util/es6/locale/translation-zh.d.ts +7 -0
  701. package/lib/tr-grid-util/es6/locale/translation-zh.js +51 -0
  702. package/lib/tr-grid-util/es6/locale/translation.d.ts +11 -0
  703. package/lib/tr-grid-util/es6/locale/translation.js +18 -0
  704. package/lib/types/es6/AutoTooltip.d.ts +45 -0
  705. package/lib/types/es6/CellSelection.d.ts +67 -0
  706. package/lib/types/es6/Checkbox.d.ts +69 -0
  707. package/lib/types/es6/ColumnFitter.d.ts +56 -0
  708. package/lib/types/es6/ColumnFormatting.d.ts +90 -0
  709. package/lib/types/es6/ColumnGrouping.d.ts +60 -0
  710. package/lib/types/es6/ColumnResizing.d.ts +68 -0
  711. package/lib/types/es6/ColumnSelection.d.ts +70 -0
  712. package/lib/types/es6/ColumnStack.d.ts +76 -0
  713. package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
  714. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +38 -0
  715. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
  716. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +287 -0
  717. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +22 -0
  718. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +44 -0
  719. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +30 -0
  720. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +42 -0
  721. package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +24 -0
  722. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +46 -0
  723. package/lib/types/es6/CompositeGrid/index.d.ts +9 -0
  724. package/lib/types/es6/ConditionalColoring.d.ts +70 -0
  725. package/lib/types/es6/ContentWrap.d.ts +43 -0
  726. package/lib/types/es6/ContextMenu.d.ts +83 -0
  727. package/lib/types/es6/CoralButtonFormatter.d.ts +22 -0
  728. package/lib/types/es6/CoralCheckboxFormatter.d.ts +12 -0
  729. package/lib/types/es6/CoralComboBoxFormatter.d.ts +23 -0
  730. package/lib/types/es6/CoralIconFormatter.d.ts +23 -0
  731. package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
  732. package/lib/types/es6/CoralRadioButtonFormatter.d.ts +22 -0
  733. package/lib/types/es6/CoralSelectFormatter.d.ts +23 -0
  734. package/lib/types/es6/CoralToggleFormatter.d.ts +12 -0
  735. package/lib/types/es6/Core/data/ColumnStats.d.ts +42 -0
  736. package/lib/types/es6/Core/data/DataCache.d.ts +81 -0
  737. package/lib/types/es6/Core/data/DataTable.d.ts +125 -0
  738. package/lib/types/es6/Core/data/DataView.d.ts +280 -0
  739. package/lib/types/es6/Core/data/Segment.d.ts +38 -0
  740. package/lib/types/es6/Core/data/SegmentCollection.d.ts +58 -0
  741. package/lib/types/es6/Core/grid/Core.d.ts +387 -0
  742. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +204 -0
  743. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +23 -0
  744. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +18 -0
  745. package/lib/types/es6/Core/grid/components/Cell.d.ts +50 -0
  746. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +19 -0
  747. package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
  748. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +38 -0
  749. package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
  750. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +125 -0
  751. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +24 -0
  752. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +61 -0
  753. package/lib/types/es6/Core/grid/components/StretchedCells.d.ts +17 -0
  754. package/lib/types/es6/Core/grid/components/VScrollbar.d.ts +18 -0
  755. package/lib/types/es6/Core/grid/components/VirtualItems.d.ts +12 -0
  756. package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +16 -0
  757. package/lib/types/es6/Core/grid/event/EventListeners.d.ts +34 -0
  758. package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
  759. package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +28 -0
  760. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +127 -0
  761. package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
  762. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +18 -0
  763. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +53 -0
  764. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +43 -0
  765. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +41 -0
  766. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +25 -0
  767. package/lib/types/es6/Core/grid/util/Reverter.d.ts +14 -0
  768. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +79 -0
  769. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +50 -0
  770. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +84 -0
  771. package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
  772. package/lib/types/es6/Core/grid/util/util.d.ts +18 -0
  773. package/lib/types/es6/Core/index.d.ts +84 -0
  774. package/lib/types/es6/Core/tr-grid-theme.d.ts +5 -0
  775. package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
  776. package/lib/types/es6/EFButtonFormatter.d.ts +22 -0
  777. package/lib/types/es6/EFCheckboxFormatter.d.ts +12 -0
  778. package/lib/types/es6/EFComboBoxFormatter.d.ts +23 -0
  779. package/lib/types/es6/EFDateTimePickerFormatter.d.ts +13 -0
  780. package/lib/types/es6/EFIconFormatter.d.ts +23 -0
  781. package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
  782. package/lib/types/es6/EFRadioButtonFormatter.d.ts +22 -0
  783. package/lib/types/es6/EFSelectFormatter.d.ts +23 -0
  784. package/lib/types/es6/EFTextFieldFormatter.d.ts +12 -0
  785. package/lib/types/es6/EFToggleFormatter.d.ts +12 -0
  786. package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
  787. package/lib/types/es6/ExtensionColumnOptions.d.ts +41 -0
  788. package/lib/types/es6/ExtensionOptions.d.ts +52 -0
  789. package/lib/types/es6/Extensions.d.ts +61 -0
  790. package/lib/types/es6/FilterInput.d.ts +57 -0
  791. package/lib/types/es6/FormatterBuilder.d.ts +22 -0
  792. package/lib/types/es6/GridFormatter.d.ts +63 -0
  793. package/lib/types/es6/HeatMap.d.ts +44 -0
  794. package/lib/types/es6/InCellEditing.d.ts +129 -0
  795. package/lib/types/es6/MenuEventAPI.d.ts +22 -0
  796. package/lib/types/es6/MenuItem.d.ts +39 -0
  797. package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
  798. package/lib/types/es6/Pagination.d.ts +57 -0
  799. package/lib/types/es6/PercentBar.d.ts +60 -0
  800. package/lib/types/es6/PercentBarFormatter.d.ts +25 -0
  801. package/lib/types/es6/PopupMenu.d.ts +29 -0
  802. package/lib/types/es6/RangeBar.d.ts +39 -0
  803. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +143 -0
  804. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +37 -0
  805. package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +20 -0
  806. package/lib/types/es6/RealtimeGrid/Grid.d.ts +263 -0
  807. package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
  808. package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +38 -0
  809. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +120 -0
  810. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +21 -0
  811. package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +17 -0
  812. package/lib/types/es6/RealtimeGrid/index.d.ts +8 -0
  813. package/lib/types/es6/RowColoring.d.ts +60 -0
  814. package/lib/types/es6/RowDragging.d.ts +53 -0
  815. package/lib/types/es6/RowFiltering.d.ts +118 -0
  816. package/lib/types/es6/RowGrouping.d.ts +109 -0
  817. package/lib/types/es6/RowSegmenting.d.ts +83 -0
  818. package/lib/types/es6/RowSelection.d.ts +74 -0
  819. package/lib/types/es6/SimpleImageFormatter.d.ts +21 -0
  820. package/lib/types/es6/SimpleInputFormatter.d.ts +12 -0
  821. package/lib/types/es6/SimpleLinkFormatter.d.ts +21 -0
  822. package/lib/types/es6/SimpleTickerFormatter.d.ts +25 -0
  823. package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
  824. package/lib/types/es6/StatisticsRow.d.ts +67 -0
  825. package/lib/types/es6/TextFormatter.d.ts +12 -0
  826. package/lib/types/es6/TextFormatting.d.ts +77 -0
  827. package/lib/types/es6/TitleWrap.d.ts +29 -0
  828. package/lib/types/es6/Zoom.d.ts +51 -0
  829. package/lib/types/es6/index.d.ts +76 -0
  830. package/lib/types/index.d.ts +1 -0
  831. package/lib/versions.json +36 -0
  832. package/lib/window-exporter.js +13 -0
  833. package/lib/zoom/es6/Zoom.d.ts +51 -0
  834. package/lib/zoom/es6/Zoom.js +419 -0
  835. package/lib/zoom/es6/index.d.ts +1 -0
  836. package/lib/zoom/es6/index.js +1 -0
  837. package/package.json +42 -0
@@ -0,0 +1,1655 @@
1
+ import Ext from "../../../tr-grid-util/es6/Ext.js";
2
+ import DataCache from "./DataCache.js";
3
+ import Util from "../grid/util/util.js";
4
+ import SegmentCollection from "./SegmentCollection.js";
5
+
6
+ /** Trigger when data within the table has been changed
7
+ * @event DataTable#dataChanged
8
+ * @property {boolean} globalChange Indicates a big change. User should expect all data has been change
9
+ * @property {string} type Type of changes. Possible values are "inserted", "removed", "updated", and undefined
10
+ * @property {string} rid Row Id
11
+ * @property {Object.<string, *>} rowData Column values of the changed row in JSON object format
12
+ */
13
+
14
+ /** Trigger before DataTable#dataChanged. Perform any data update during the event will NOT cause more dataChanged events
15
+ * @event DataTable#dataComposed
16
+ */
17
+
18
+ /** @constructor
19
+ * @extends {DataCache}
20
+ */
21
+ var DataTable = function() {
22
+ DataTable.base(this, 'constructor');
23
+
24
+ this._removeRows = this._removeRows.bind(this);
25
+ this._bySegmentSeparator = this._bySegmentSeparator.bind(this);
26
+
27
+ this._prevData = {};
28
+ this._rids = [];
29
+
30
+ this._compMap = {};
31
+ };
32
+ Ext.inherits(DataTable, DataCache);
33
+
34
+ /** @private
35
+ * @type {Object.<string, Object.<string, *>>}
36
+ */
37
+ DataTable.prototype._prevData = null; // Mainly used for blinking
38
+ /** @private
39
+ * @type {!Array.<string>}
40
+ */
41
+ DataTable.prototype._rids;
42
+ /** @private
43
+ * @type {boolean}
44
+ */
45
+ DataTable.prototype._frozen = false;
46
+ /** @private
47
+ * @type {number}
48
+ */
49
+ DataTable.prototype._runningId = 0;
50
+
51
+ /** Comparer map that will be shared across all child DataViews
52
+ * @private
53
+ * @type {Object.<string, DataTable.SortLogic>}
54
+ */
55
+ DataTable.prototype._compMap = null;
56
+
57
+ /** @private
58
+ * @type {SegmentCollection}
59
+ */
60
+ DataTable.prototype._segments = null;
61
+ /** @private
62
+ * @type {boolean}
63
+ */
64
+ DataTable.prototype._autoSegmentFilling = false;
65
+ /** @private
66
+ * @type {Object}
67
+ */
68
+ DataTable.prototype._removedRows = null;
69
+ /** @private
70
+ * @type {Function}
71
+ */
72
+ DataTable.prototype._userSegmentComparer = null;
73
+
74
+
75
+ /** @typedef {Function} DataTable~SortLogic
76
+ * @description SortLogic function is used for comparison between two values during sorting. <br>
77
+ * The function should return:<br>
78
+ * negative value to put val1 before val2, <br>
79
+ * positive value to put val2 before val1. <br>
80
+ * zero or falsy value to keep val1 and val2 unchanged.
81
+ * @property {*} val1 Value from a row
82
+ * @property {*} val2 Value from another row
83
+ * @property {number=} order 1 indicates ascending order, and -1 indicates descending order
84
+ * @property {*=} contextObject Any given user context
85
+ * @example
86
+ * var customComparer = function(a, b, order) {
87
+ * if(a + 10 < b) { return -order; }
88
+ * if(b + 10 < a) { return order; }
89
+ * return 0; // a and b are less than 10 difference apart
90
+ * };
91
+ */
92
+ DataTable.SortLogic;
93
+
94
+
95
+ /** @override
96
+ */
97
+ DataTable.prototype.dispose = function() {
98
+ this.unlistenAll();
99
+ this.clearAllData(true);
100
+
101
+ this._compMap = null; // Release user function that may be bound
102
+ this._segments = null;
103
+ };
104
+
105
+ /** {@link DataCache#getColumnData}
106
+ * @override
107
+ */
108
+ DataTable.prototype.getColumnData = function(cid) {
109
+ var rows = new Array(this._rids.length);
110
+ for(var i = this._rids.length; --i >= 0;) {
111
+ rows[i] = this._rows[this._rids[i]][cid];
112
+ }
113
+ return rows;
114
+ };
115
+ /** @public
116
+ * @param {number} rowIndex
117
+ * @return {string}
118
+ */
119
+ DataTable.prototype.getRowId = function(rowIndex) {
120
+ return this._rids[rowIndex] || "";
121
+ };
122
+ /** {@link DataCache#getAllRowIds}
123
+ * @override
124
+ * @param {boolean=} opt_shallowCopy Default value is false. Set to true for speed
125
+ */
126
+ DataTable.prototype.getAllRowIds = function(opt_shallowCopy) {
127
+ if(opt_shallowCopy) {
128
+ return this._rids;
129
+ }
130
+ return this._rids.slice(0); // Fastest way to clone an array
131
+ };
132
+ /** @public
133
+ * @param {string} rid
134
+ * @return {number}
135
+ */
136
+ DataTable.prototype.getRowIndex = function(rid) {
137
+ return this._rids.indexOf(rid);
138
+ };
139
+ /** @public
140
+ * @return {number}
141
+ */
142
+ DataTable.prototype.getRowCount = function() {
143
+ return this._rids.length;
144
+ };
145
+ /** @public
146
+ * @param {number} rowIndex
147
+ * @param {string} cid
148
+ * @return {Object.<string, *>}
149
+ */
150
+ DataTable.prototype.getDataAt = function(rowIndex, cid) {
151
+ return this.getData(this._rids[rowIndex], cid);
152
+ };
153
+ /** @public
154
+ * @param {number} rowIndex
155
+ * @return {Object.<string, *>}
156
+ */
157
+ DataTable.prototype.getRowDataAt = function(rowIndex) {
158
+ return this.getRowData(this._rids[rowIndex]);
159
+ };
160
+ /** Get previously set data. This is good for blinking changed data
161
+ * @public
162
+ * @param {string} rid
163
+ * @param {string} cid
164
+ * @return {Object.<string, *>}
165
+ */
166
+ DataTable.prototype.getPreviousData = function(rid, cid) {
167
+ var row = this._prevData[rid] || null;
168
+ if(row) {
169
+ return row[cid];
170
+ }
171
+ return null;
172
+ };
173
+
174
+ /** Set data to individual cell
175
+ * @override
176
+ * @param {string} rid Row Id
177
+ * @param {string} cid Column Id
178
+ * @param {*} value
179
+ * @return {boolean} Return true if there is any change, and false otherwise
180
+ * @fires DataTable#dataChanged
181
+ */
182
+ DataTable.prototype.setData = function(rid, cid, value) { // Data changed event may be dispatched
183
+ if(!this._needFiring()) {
184
+ return this._setData(rid, cid, value);
185
+ }
186
+ var values = {};
187
+ values[cid] = value;
188
+ return this.setRowData(rid, values);
189
+ };
190
+ /** Set data in row manner
191
+ * @override
192
+ * @param {string} rid Row Id
193
+ * @param {Object.<string, *>=} values Object where the key is column Id and value is the data to be set
194
+ * @param {Object=} eventArg Additional arguments to be attached to the event fired
195
+ * @return {boolean} Return true if there is any change, and false otherwise
196
+ * @fires DataTable#dataChanged
197
+ * @example
198
+ * var dt = new DataTable();
199
+ * dt.setRowData("row 1", {"column 1": "a", "column 2": 1, "column 3": null});
200
+ * dt.log(); // See console for the results
201
+ */
202
+ DataTable.prototype.setRowData = function(rid, values, eventArg) { // Data changed event may be dispatched
203
+ if(!rid) {
204
+ return false;
205
+ }
206
+
207
+ var row = this.getRowData(rid);
208
+ var dirty = false;
209
+ var type = "updated";
210
+ var segmentChanged = false;
211
+
212
+ if(values) {
213
+ if(!row) {
214
+ type = "inserted";
215
+ row = values;
216
+ this._rows[rid] = row; // WARNING: Dangerous use of external reference. User may modify data without using DataTable's API
217
+ this._prevData[rid] = {};
218
+ if(eventArg) {
219
+ var nextRid = /** @type{string} */(eventArg["nextRid"]); // Used for insertion only
220
+ var rowIndex = (nextRid != null) ? this.getRowIndex(nextRid) : -1;
221
+ if(rowIndex < 0) {
222
+ rowIndex = /** @type{number} */(eventArg["fallback"]);
223
+ }
224
+ if(rowIndex == null || rowIndex < 0 || rowIndex >= this._rids.length) {
225
+ this._rids.push(rid);
226
+ } else {
227
+ this._rids.splice(rowIndex, 0, rid);
228
+ segmentChanged = !this._isLastSegment(rowIndex);
229
+ }
230
+ } else {
231
+ this._rids.push(rid);
232
+ }
233
+ } else {
234
+ var prevData = this._prevData[rid];
235
+ for (var cid in values) {
236
+ prevData[cid] = row[cid];
237
+ row[cid] = values[cid];
238
+ }
239
+ }
240
+ dirty = true;
241
+ } else {
242
+ if(row) {
243
+ type = "removed";
244
+ // WARNING: Even if row is removed we still keep previous data
245
+ // delete this._prevData[rid];
246
+ this._prevData[rid] = this._rows[rid]; // Move reference from the removed row to history
247
+ delete this._rows[rid];
248
+ if(this._segments) {
249
+ segmentChanged = this._segments.containsSegment(rid); // TODO: Handle this case where the segment separator row is removed
250
+ }
251
+ for(var i = this._rids.length; --i >= 0;) {
252
+ if(this._rids[i] === rid) {
253
+ this._rids.splice(i, 1);
254
+ break;
255
+ }
256
+ }
257
+ dirty = true;
258
+ }
259
+ }
260
+
261
+ if(dirty && this._needFiring()) {
262
+ if(this._autoFillSegments()) {
263
+ this.dispatchGlobalChange();
264
+ } else {
265
+ var e = eventArg || {};
266
+ e["rid"] = rid;
267
+ e["changes"] = values; // WARNING: External user data is passed along
268
+ e["rowData"] = row;
269
+ e["type"] = type;
270
+ if(segmentChanged) {
271
+ e["segmentChanged"] = true;
272
+ }
273
+ this._dispatchDataChange(e);
274
+ }
275
+
276
+ }
277
+ return dirty;
278
+ };
279
+ /** Set data in a column manner. This is faster than repeatedly calling {@link DataTable#setData}
280
+ * @public
281
+ * @param {string} cid
282
+ * @param {Array.<*>} valueList
283
+ * @param {Array.<string>=} opt_ridList Specify row id to be set corresponding to the data item
284
+ * @example
285
+ * var dt = new DataTable();
286
+ * dt.setColumnData("column 1", ["1st row data", "2nd row data", "3rd row data"]);
287
+ * dt.log(); // See console for the results
288
+ */
289
+ DataTable.prototype.setColumnData = function(cid, valueList, opt_ridList) { // Data changed event may be dispatched
290
+ var rLen = (valueList) ? valueList.length : 0;
291
+ if(rLen < 0) { return; }
292
+
293
+ var prevFrozen = this._frozen;
294
+ this.freeze();
295
+ var rids = this._generateRids(rLen, opt_ridList);
296
+
297
+ for(var r = 0; r < rLen; ++r) {
298
+ this._setData(rids[r], cid, valueList[r]);
299
+ }
300
+
301
+ this.freeze(prevFrozen);
302
+ };
303
+ /** Add, update, and remove data in batch by using JSON object. This is faster than repeatedly calling {@link DataTable#setRowData}. <br>
304
+ Any existing row, that is not matched by the same row id provided in the argument, remains the same. <br>
305
+ Any existing row with the same row id from the provided argument will be updated. <br>
306
+ Row id with null value will cause a removal of the row with the same id.
307
+ * @public
308
+ * @param {Object.<string, Object.<string, *>>} obj Object is 2 level nested object where 1st level key is row Id and 2nd level key is column Id
309
+ * @see {@link DataTable#addRows}
310
+ * @see {@link DataTable#setDataFrom2DArray}
311
+ * @example
312
+ * var data = {
313
+ * "rowId 1": {"column 1": "a", "column 2": 1, "column 3": 2},
314
+ * "rowId 2": {"column 1": "b", "column 2": 3, "column 3": 4},
315
+ * "rowId 4": {"column 1": "d", "group_criteria": 1} // Rows don't need to be in uniform structure
316
+ * };
317
+ * var dt = new DataTable();
318
+ * dt.setDataFromObjectMap(data);
319
+ * dt.log(); // See console for the results
320
+ * dt.setDataFromObjectMap({"rowId 1": null}); // Remove the row with "rowId 1"
321
+ * dt.setDataFromObjectMap({"rowId 2": {"column 1": "newValue"} }); // Update existing row
322
+ */
323
+ DataTable.prototype.setDataFromObjectMap = function(obj) {
324
+ if(!obj) {
325
+ return;
326
+ }
327
+ if(Array.isArray(obj)) {
328
+ this.addRows(/** @type{Array.<Object>} */(obj));
329
+ return;
330
+ }
331
+
332
+ var prevFrozen = this._frozen;
333
+ this.freeze();
334
+
335
+ for(var rid in obj) {
336
+ this.setRowData(rid, obj[rid]);
337
+ }
338
+
339
+ this.freeze(prevFrozen);
340
+ };
341
+ /** Set data in batch from 2 dimensional array. This is faster than repeatedly calling {@link DataTable#setRowData}
342
+ * @public
343
+ * @param {Array.<Array.<*>>} ary Row based array
344
+ * @param {Array.<string>=} opt_cidList
345
+ * @param {Array.<string>=} opt_ridList
346
+ * @see {@link DataTable#addRows}
347
+ * @see {@link DataTable#setDataFromObjectMap}
348
+ * @example
349
+ * var data = [
350
+ * ["a", 1, 2],
351
+ * ["b", 3, 4],
352
+ * ["c", 5, 6]
353
+ * ];
354
+ * var dt = new DataTable();
355
+ * dt.setDataFrom2DArray(data, ["column 1", "column 2", "column 3"]);
356
+ * dt.log(); // See console for the results
357
+ */
358
+ DataTable.prototype.setDataFrom2DArray = function(ary, opt_cidList, opt_ridList) {
359
+ var rLen = (ary) ? ary.length : 0;
360
+ if(rLen < 0) { return; }
361
+
362
+ var prevFrozen = this._frozen;
363
+ this.freeze();
364
+
365
+ var c = 0;
366
+ var rids = this._generateRids(rLen, opt_ridList);
367
+
368
+ for(var r = 0; r < rLen; ++r) {
369
+ var row = ary[r];
370
+ var rid = rids[r];
371
+ if(opt_cidList) {
372
+ for(c = row.length; --c >= 0;) {
373
+ this._setData(rid, opt_cidList[c], row[c]);
374
+ }
375
+ } else {
376
+ for(c = row.length; --c >= 0;) {
377
+ this._setData(rid, "" + c, row[c]); // Auto-generate column id
378
+ }
379
+ }
380
+ }
381
+
382
+ this.freeze(prevFrozen);
383
+ };
384
+
385
+ /** Set data to individual cell by specified row index instead of row Id
386
+ * @public
387
+ * @param {number} rowIndex Invalid row index will not produce any effect
388
+ * @param {string} cid
389
+ * @param {*} value
390
+ * @return {boolean} Return true if there is any change, and false otherwise
391
+ * @fires DataTable#dataChanged
392
+ */
393
+ DataTable.prototype.setDataAt = function(rowIndex, cid, value) { // Data changed event may be dispatched
394
+ var rid = this.getRowId(rowIndex);
395
+ return (rid) ? this.setData(rid, cid, value) : false;
396
+ };
397
+ /** @public
398
+ * @param {number} rowIndex Invalid row index will not produce any effect
399
+ * @param {Object.<string, *>=} values Object where the key is column Id and value is the data to be set
400
+ * @param {Object=} opt_eventArg
401
+ * @return {boolean} Return true if there is any change, and false otherwise
402
+ * @fires DataTable#dataChanged
403
+ */
404
+ DataTable.prototype.setRowDataAt = function(rowIndex, values, opt_eventArg) { // Data changed event may be dispatched
405
+ var rid = this.getRowId(rowIndex);
406
+ return (rid) ? this.setRowData(rid, values, opt_eventArg) : false;
407
+ };
408
+ /** Add new row of data to the end of the Data Table
409
+ * @public
410
+ * @param {Object.<string, *>=} values field-value pair object
411
+ * @param {string|null=} rid If the given row Id already exists, data is updated and no new row is added. Leave blank or null to let DataTable generate unique row Id
412
+ * @return {string} Return Row id that has been inserted or changed
413
+ * @fires DataTable#dataChanged
414
+ * @example
415
+ * var dt = new DataTable();
416
+ * dt.addRow({"column 1": "a", "column 2": 1, "column 3": null});
417
+ * dt.addRow({"column 1": "b", "column 2": 5, "column 3": {"someKey": 10}});
418
+ * dt.log(); // See console for the results
419
+ */
420
+ DataTable.prototype.addRow = function(values, rid) {
421
+ if(!values) { values = {}; }
422
+ rid = this._generateUniqueRid(values, rid);
423
+
424
+ this.setRowData(rid, values);
425
+ return rid;
426
+ };
427
+ /** Add multiple rows all at once. This is used to improve the performance. dataChagned with globalChange flag will be fired, if multiple rows are added.
428
+ * @public
429
+ * @param {Array.<Object>} rows Array of field-value pair object.
430
+ * @param {Array.<string>=} rids If the given row Id already exists, data is updated and no new row is added. Leave blank or null to let DataTable generate unique row Id
431
+ * @fires DataTable#dataChanged
432
+ * @see {@link DataTable#setDataFrom2DArray}
433
+ * @see {@link DataTable#setDataFromObjectMap}
434
+ * @example
435
+ * var dt = new DataTable();
436
+ * dt.addRows([
437
+ * {"field1": "a", "field2": 1, "field3": null},
438
+ * {"field1": "b", "field2": 5, "field3": {"someKey": 10}},
439
+ * {"field1": "c", "field2": 7, "field3": [1, 2, 3]},
440
+ * {"field1": "c", "field4": "some value"} // Rows don't need to be in uniform structure
441
+ * ]); // 4 rows are added
442
+ * dt.log(); // See console for the results
443
+ */
444
+ DataTable.prototype.addRows = function(rows, rids) {
445
+ if(!Array.isArray(rows)) {
446
+ return;
447
+ }
448
+ var len = rows.length;
449
+ if(!len) {
450
+ return;
451
+ } else if(len === 1) {
452
+ this.addRow(rows[0], rids ? rids[0] : null);
453
+ return;
454
+ }
455
+ if(!rids) {
456
+ rids = [];
457
+ }
458
+ var prevFrozen = this._frozen;
459
+ this.freeze();
460
+ for(var i = 0; i < len; ++i) {
461
+ this.addRow(rows[i], rids[i]);
462
+ }
463
+ this.freeze(prevFrozen);
464
+ };
465
+
466
+ /** Insert a new row as the first row
467
+ * @public
468
+ * @param {Object.<string, *>=} opt_values
469
+ * @param {string|null=} opt_rid If the given row Id already exists, data is updated and no new row is added. Leave blank or null to let DataTable generate unique row Id
470
+ * @return {string} Return Row id that has been inserted or changed
471
+ * @fires DataTable#dataChanged
472
+ * @see {@link DataTable#insertRow}
473
+ */
474
+ DataTable.prototype.unshiftRow = function(opt_values, opt_rid) {
475
+ return this.insertRow(0, opt_values, opt_rid);
476
+ };
477
+ /** @public
478
+ * @param {string|number|null=} rowRef
479
+ * @param {Object.<string, *>=} values Key/value pair object map
480
+ * @param {string|null=} rid If the given row Id already exists, data is updated and no new row is added. Leave blank or null to let DataTable generate unique row Id
481
+ * @return {string} Return Row id that has been inserted or changed
482
+ * @fires DataTable#dataChanged
483
+ * @see {@link DataTable#unshiftRow}
484
+ * @see {@link DataTable#removeRow}
485
+ */
486
+ DataTable.prototype.insertRow = function(rowRef, values, rid) {
487
+ var arg = {};
488
+ if(typeof rowRef === "number") {
489
+ arg["nextRid"] = this._rids[rowRef];
490
+ arg["fallback"] = rowRef; // Fallback index in case of no nextRid found
491
+ } else {
492
+ arg["nextRid"] = /** @type{string} */(rowRef);
493
+ }
494
+
495
+ if(!values) { values = {}; }
496
+ rid = this._generateUniqueRid(values, rid);
497
+
498
+ this.setRowData(rid, values, arg);
499
+ return rid;
500
+ };
501
+ /** @public
502
+ * @param {string|number} rowRef
503
+ * @param {Object=} opt_values
504
+ * @param {string=} opt_rid
505
+ * @return {string}
506
+ * @fires DataTable#dataChanged
507
+ */
508
+ DataTable.prototype.insertAfter = function(rowRef, opt_values, opt_rid) {
509
+ var rowIndex = (typeof rowRef === "string") ? this.getRowIndex(rowRef) : /** @type{number}*/ (rowRef);
510
+
511
+ if(!(rowIndex >= 0) || rowIndex >= this._rids.length - 1) {
512
+ return this.addRow(opt_values, opt_rid);
513
+ }
514
+ return this.insertRow(rowIndex + 1, opt_values, opt_rid);
515
+ };
516
+
517
+ /** @public
518
+ * @param {number|string} rowRef Reference to the row to be removed
519
+ * @see {@link DataTable#removeRows}
520
+ */
521
+ DataTable.prototype.removeRow = function(rowRef) { // Data changed event may be dispatched
522
+ if(typeof rowRef === "number") {
523
+ this.setRowData(this.getRowId(rowRef), null);
524
+ } else {
525
+ this.setRowData(/** @type{string} */(rowRef), null);
526
+ }
527
+ };
528
+ /** @public
529
+ * @param {Array.<number|string>} refs Reference to the rows to be removed
530
+ * @see {@link DataTable#removeAllRows}
531
+ */
532
+ DataTable.prototype.removeRows = function(refs) {
533
+ if(refs.length === 1) {
534
+ var rid = refs[0];
535
+ if (typeof rid === "number") {
536
+ this.removeRow(rid);
537
+ } else {
538
+ this.setRowData(rid, null);
539
+ }
540
+ return;
541
+ }
542
+
543
+ var i;
544
+ var dirty = false;
545
+ this._removedRows = {};
546
+ for (i = refs.length; --i >= 0;) {
547
+ rid = refs[i];
548
+ if (typeof rid === "number") {
549
+ rid = this.getRowId(rid);
550
+ }
551
+
552
+ var row = this.getRowData(rid);
553
+ if(row) {
554
+ this._prevData[rid] = this._rows[rid];
555
+ this._removedRows[rid] = 1;
556
+ delete this._rows[rid];
557
+ dirty = true;
558
+ }
559
+ }
560
+ if(dirty) {
561
+ this._rids = this._rids.filter(this._removeRows);
562
+ this._removedRows = null;
563
+ this.dispatchGlobalChange();
564
+ } else {
565
+ this._removedRows = null;
566
+ }
567
+ };
568
+ /** @private
569
+ * @param {string} rid
570
+ * @return {boolean}
571
+ */
572
+ DataTable.prototype._removeRows = function(rid) {
573
+ return !this._removedRows[rid];
574
+ };
575
+ /** Remove all existing rows
576
+ * @override
577
+ */
578
+ DataTable.prototype.clearAllData = function(suppressEvent) {
579
+ DataTable.base(this, "clearAllData", true);
580
+ this._prevData = {};
581
+
582
+ if(this._rids.length) {
583
+ this._rids.length = 0;
584
+
585
+ this.dispatchGlobalChange(suppressEvent);
586
+ }
587
+ };
588
+ /** Alias to {@link DataTable#clearAllData}
589
+ * @public
590
+ * @function
591
+ * @param {boolean=} suppressEvent
592
+ * @fires DataTable#dataChanged
593
+ */
594
+ DataTable.prototype.removeAllRows = DataTable.prototype.clearAllData;
595
+ /** @private
596
+ * @function
597
+ * @param {number} a
598
+ * @param {number} b
599
+ * @return {number}
600
+ */
601
+ DataTable._ascendingOrder = function(a, b) { return a - b; };
602
+ /** @public
603
+ * @param {Array.<number>|number} fromIndex
604
+ * @param {number} toIndex
605
+ * @param {boolean=} suppressEvent
606
+ * @return {Array.<string>|string} Return row id(s). Return null if nothing has changed
607
+ */
608
+ DataTable.prototype.moveRow = function(fromIndex, toIndex, suppressEvent) {
609
+ var output = null;
610
+ var rid = "";
611
+ if(!(toIndex >= 0 && toIndex < this._rids.length)) {
612
+ toIndex = this._rids.length;
613
+ }
614
+
615
+ if (Array.isArray(fromIndex)) {
616
+ var fromIndices = fromIndex;
617
+ fromIndices.sort(DataTable._ascendingOrder);
618
+ var movedRids = [];
619
+ for (var i = fromIndices.length; --i >= 0;) {
620
+ var idx = fromIndices[i];
621
+ rid = this._rids[idx];
622
+ if(rid) {
623
+ movedRids.unshift(rid);
624
+ this._rids.splice(idx, 1); // WARNING: splice method is slow
625
+ if (idx < toIndex) {
626
+ --toIndex;
627
+ }
628
+ }
629
+ }
630
+ if(movedRids.length) {
631
+ this._rids.splice.apply(this._rids, [toIndex, 0].concat(movedRids));
632
+ output = movedRids;
633
+ }
634
+ } else {
635
+ if (fromIndex < 0) {
636
+ fromIndex = 0;
637
+ }
638
+
639
+ if(fromIndex !== toIndex && (fromIndex + 1) !== toIndex) {
640
+ rid = this._rids.splice(fromIndex, 1)[0];
641
+ if (rid) {
642
+ if (fromIndex < toIndex) {
643
+ --toIndex;
644
+ }
645
+ this._rids.splice(toIndex, 0, rid);
646
+ output = rid;
647
+ }
648
+ }
649
+ }
650
+
651
+ if(output) {
652
+ if(this._segments) {
653
+ this._sort(null); // Reorder segment members
654
+ }
655
+ this._dispatchPositionChange(suppressEvent);
656
+ }
657
+ return output;
658
+ };
659
+ /** @public
660
+ * @ignore
661
+ * @param {Array.<string>} fromRids
662
+ * @param {string} toRid If rid is empty string, insert the rid to the last index
663
+ * @param {boolean=} suppressEvent
664
+ * @return {Array.<string>|string} rid
665
+ */
666
+ DataTable.prototype._moveRow = function(fromRids, toRid, suppressEvent) {
667
+ var len = fromRids.length;
668
+ if(!len) {
669
+ return null;
670
+ }
671
+
672
+ var fromIndices = new Array(len);
673
+ for(var i = 0; i < len; ++i) {
674
+ fromIndices[i] = this.getRowIndex(fromRids[i]);
675
+ }
676
+
677
+ var toIndex = (toRid) ? this.getRowIndex(toRid) : this._rids.length;
678
+ if(len > 1) {
679
+ return this.moveRow(fromIndices, toIndex, suppressEvent);
680
+ }
681
+ return this.moveRow(fromIndices[0], toIndex, suppressEvent);
682
+ };
683
+
684
+ /** Move rows in chunk by specifying chunk size in the third parameter.
685
+ * @public
686
+ * @param {number|string} startIndex
687
+ * @param {number|string} toIndex
688
+ * @param {number=} opt_count
689
+ * @param {boolean=} suppressEvent
690
+ * @return {Array.<string>} rids Return null if nothing has changed
691
+ * @see {@link DataTable#moveRow}
692
+ */
693
+ DataTable.prototype.moveRows = function(startIndex, toIndex, opt_count, suppressEvent) {
694
+ if(typeof startIndex === "string") {
695
+ startIndex = this.getRowIndex(startIndex);
696
+ }
697
+ if(typeof toIndex === "string") {
698
+ toIndex = this.getRowIndex(toIndex);
699
+ }
700
+ if(startIndex < 0) { startIndex = 0; }
701
+ if(toIndex < 0) { toIndex = this._rids.length; }
702
+ if(!opt_count) { opt_count = 1; }
703
+
704
+ var endIndex = startIndex + opt_count - 1;
705
+ var targetIndex = toIndex;
706
+ if (toIndex >= startIndex) {
707
+ if (toIndex <= endIndex) {
708
+ targetIndex = startIndex;
709
+ } else {
710
+ targetIndex = toIndex - opt_count;
711
+ }
712
+ }
713
+
714
+ if ((opt_count > 0) && (endIndex <= this._rids.length)) {
715
+ if (targetIndex > this._rids.length) {
716
+ targetIndex = this._rids.length;
717
+ }
718
+
719
+ var rows = this._rids.splice(startIndex, opt_count);
720
+ var args = [targetIndex, 0].concat(rows);
721
+ Array.prototype.splice.apply(this._rids, args);
722
+
723
+ if(this._segments) {
724
+ this._sort(null); // Reorder segment members
725
+ }
726
+ this._dispatchPositionChange(suppressEvent);
727
+ return rows;
728
+ }
729
+
730
+ return null;
731
+ };
732
+
733
+ /** This method is deprecated in favor of more sophisticate {@link DataTable#moveRow}
734
+ * @public
735
+ * @param {number} fromIndex
736
+ * @param {number} toIndex
737
+ */
738
+ DataTable.prototype.swapRow = function(fromIndex, toIndex) { // No event is fired. No effect on other views
739
+ var len = this._rids.length;
740
+ if(fromIndex < 0 || fromIndex >= len) { return; }
741
+ if(toIndex < 0 || toIndex >= len) { return; }
742
+
743
+ var rid = this._rids[fromIndex];
744
+ this._rids[fromIndex] = this._rids[toIndex];
745
+ this._rids[toIndex] = rid;
746
+ };
747
+
748
+ /** @public
749
+ * @function
750
+ * @param {string} rid
751
+ */
752
+ DataTable.prototype.clearRowData = DataTable.prototype.removeRow;
753
+ /** {@link DataCache#clearColumnData}
754
+ * @override
755
+ */
756
+ DataTable.prototype.clearColumnData = function(colId, suppressEvent) {
757
+ var cids = (typeof colId === "string") ? [/** @type {string} */(colId)] : /** @type {Array.<string>} */(colId);
758
+ for(var i = cids.length; --i >= 0;) {
759
+ var cid = cids[i];
760
+ if(cid) {
761
+ for(var rid in this._rows) {
762
+ delete this._rows[rid][cid];
763
+ delete this._prevData[rid][cid];
764
+ }
765
+ }
766
+ }
767
+
768
+ this.dispatchGlobalChange(suppressEvent);
769
+ };
770
+
771
+ /** Get parent data source. Note that DataTable cannot be child of other data source. So the returned value will always be null.
772
+ * @public
773
+ * @return {null}
774
+ */
775
+ DataTable.prototype.getDataSource = function() {
776
+ return null; // No other source
777
+ };
778
+ /** @public
779
+ * @param {*} source
780
+ */
781
+ DataTable.prototype.setDataSource = function(source) {};
782
+
783
+ /**
784
+ * @public
785
+ * @ignore
786
+ * @return {Object.<string, DataTable.SortLogic>}
787
+ */
788
+ DataTable.prototype.getSortingLogics = function() {
789
+ return this._compMap;
790
+ };
791
+ /** @public
792
+ * @param {string|Array.<string>} cid Column id
793
+ * @param {string|number|Array.<string|number>=} sortOrders "a"|"d"|"n"
794
+ * @param {DataTable.SortLogic=} customComparer
795
+ * @param {*=} contextObj Context object that will be provided as the forth parameter of the given comparer method
796
+ * @return {boolean} Return true if there is any change, otherwise false
797
+ * @fires DataTable#dataChanged
798
+ */
799
+ DataTable.prototype.sortOnce = function(cid, sortOrders, customComparer, contextObj) {
800
+ var sortingDefs = DataTable._buildSortContext(
801
+ [],
802
+ cid,
803
+ sortOrders,
804
+ customComparer || this._compMap,
805
+ contextObj // User context
806
+ );
807
+
808
+ if(this._sort(sortingDefs)) {
809
+ this._dispatchPositionChange();
810
+ return true;
811
+ }
812
+ return false;
813
+ };
814
+ /** @public
815
+ * @param {DataTable.SortLogic} func
816
+ * @example
817
+ * customLogic = function(a, b, sortOrder) {
818
+ * return (a - b) * sortOrder; // for numeric comparison
819
+ * };
820
+ * var dt = new DataTable();
821
+ * dt.setSortingLogic(customLogic);
822
+ * dt.sortOnce("Column id", "ascending");
823
+ */
824
+ DataTable.prototype.setSortingLogic = function(func) {
825
+ this._compMap["_default"] = func;
826
+ };
827
+ /** Specified sorting logic for the column with the given column id. This will override logic set by {@link DataTable#setSortingLogic}, when the column is sorted
828
+ * @public
829
+ * @param {string} cid
830
+ * @param {DataTable.SortLogic} func Use null to remove current sorting logic
831
+ */
832
+ DataTable.prototype.setColumnSortingLogic = function(cid, func) {
833
+ this._compMap[cid] = func;
834
+ };
835
+
836
+ /** Freeze data table so that no event is fired for data processing until executing {@link DataTable#unfreeze} method
837
+ * @public
838
+ * @param {boolean=} bool
839
+ * @return {boolean} Previous freeze state before the execution
840
+ * @fires DataTable#dataChanged
841
+ * @example
842
+ * var prevState = dt.freeze();
843
+ * for(var i = 0; i < 100; ++i) {
844
+ * dt.insertRow({}); // no event is fired
845
+ * }
846
+ * dt.freeze(prevState); // Restore previous freeze states
847
+ */
848
+ DataTable.prototype.freeze = function(bool) {
849
+ bool = bool !== false;
850
+ var prevState = this._frozen;
851
+ if(prevState !== bool) {
852
+ this._frozen = bool;
853
+ this._autoFillSegments();
854
+ this.dispatchGlobalChange();
855
+ }
856
+ return prevState;
857
+ };
858
+ /** @public
859
+ * @param {boolean=} bool
860
+ * @return {boolean} Previous freeze state before the execution
861
+ */
862
+ DataTable.prototype.unfreeze = function(bool) {
863
+ return this.freeze(bool === false);
864
+ };
865
+ /** @public
866
+ * @return {boolean} Current freeze state
867
+ */
868
+ DataTable.prototype.isFrozen = function() {
869
+ return this._frozen;
870
+ };
871
+
872
+
873
+ /**
874
+ * @public
875
+ * @param {string} rid
876
+ * @param {boolean=} enabled
877
+ * @return {boolean} Return true if there is any change
878
+ */
879
+ DataTable.prototype.setSegmentSeparator = function(rid, enabled) {
880
+ var change = false;
881
+ if(typeof rid === "string") {
882
+ if(enabled !== false) {
883
+ if(!this._segments) {
884
+ this._segments = new SegmentCollection();
885
+ }
886
+ if(this._segments.addSegment(rid)) {
887
+ change = true;
888
+ }
889
+ } else if(this._segments) {
890
+ if(this._segments.removeSegment(rid)) {
891
+ change = true;
892
+ if(!this._segments.getSegmentCount()) {
893
+ this._segments = null;
894
+ }
895
+ }
896
+ }
897
+ }
898
+ if(change && this._needFiring()) {
899
+ if(this._autoFillSegments()) {
900
+ this.dispatchGlobalChange();
901
+ } else {
902
+ var rowData = this._rows[rid] || null;
903
+ if(rowData) {
904
+ this._dispatchDataChange({
905
+ "rid": rid,
906
+ "changes": {},
907
+ "rowData": rowData,
908
+ "type": "updated",
909
+ "segmentChanged": true
910
+ });
911
+ }
912
+ }
913
+ }
914
+
915
+ return change;
916
+ };
917
+ /** @public
918
+ * @return {boolean} Return true if there is any change
919
+ */
920
+ DataTable.prototype.unsetAllSegmentSeparators = function() {
921
+ if(this._segments) {
922
+ this._segments = null;
923
+ this.dispatchGlobalChange();
924
+ return true;
925
+ }
926
+ return false;
927
+ };
928
+ /**
929
+ * @public
930
+ * @return {boolean}
931
+ */
932
+ DataTable.prototype.hasSegmentation = function() {
933
+ return this._segments ? true : false;
934
+ };
935
+ /**
936
+ * @public
937
+ * @param {string} rid
938
+ * @return {boolean}
939
+ */
940
+ DataTable.prototype.isSegmentSeparator = function(rid) {
941
+ if(this._segments) {
942
+ return this._segments.containsSegment(rid);
943
+ }
944
+ return false;
945
+ };
946
+ /**
947
+ * @public
948
+ * @param {string} rid
949
+ * @return {string} parent row id of this segmentation. If the parent row id for this segmentation cannot be found, return ""
950
+ */
951
+ DataTable.prototype.getSegmentParentRowId = function(rid) {
952
+ if(this._segments) {
953
+ return this._segments.getParentRowId(rid);
954
+ }
955
+ return "";
956
+ };
957
+ /**
958
+ * @public
959
+ * @param {Array.<string>=} rids If no row id is given, row ids of this data table is used instead
960
+ * @return {Array.<number>} Return null if there is no segmentation
961
+ */
962
+ DataTable.prototype.getSegmentValues = function(rids) {
963
+ if(this._segments) {
964
+ return this._segments.getSegmentValues(rids || this._rids);
965
+ }
966
+ return null;
967
+ };
968
+ /**
969
+ * @private
970
+ * @param {number} at Row index
971
+ * @return {boolean} Return true if the given row is in the last segment
972
+ */
973
+ DataTable.prototype._isLastSegment = function(at) {
974
+ var segmentSeparators = this._segments;
975
+ if(segmentSeparators) {
976
+ var rids = this._rids;
977
+ var rowCount = rids.length;
978
+ for(var r = at + 1; r < rowCount; ++r) {
979
+ if(segmentSeparators.containsSegment(rids[r])) {
980
+ return false;
981
+ }
982
+ }
983
+ }
984
+ return true;
985
+ };
986
+ /**
987
+ * @public
988
+ * @ignore
989
+ * @return {SegmentCollection} Return null if there is no segmentation
990
+ */
991
+ DataTable.prototype._getSegmentSeparators = function() {
992
+ return this._segments;
993
+ };
994
+ /** @public
995
+ * @param {boolean=} enabled
996
+ * @ignore
997
+ */
998
+ DataTable.prototype.enableAutoSegmentFilling = function(enabled) {
999
+ this._autoSegmentFilling = enabled != false;
1000
+ this._autoFillSegments();
1001
+ };
1002
+ /** @private
1003
+ * @return {boolean} Return true if the fill segments have changed, otherwise return false
1004
+ */
1005
+ DataTable.prototype._autoFillSegments = function() {
1006
+ if(this._autoSegmentFilling) {
1007
+ return this.fillSegments();
1008
+ }
1009
+ return false;
1010
+ };
1011
+ /** Remove existing segment children and fill the segments with all contnet rows before the next segment separator
1012
+ * @public
1013
+ * @param {string} segmentId Row id
1014
+ */
1015
+ DataTable.prototype.fillSegment = function(segmentId) {
1016
+ if(this._segments) {
1017
+ this._segments.fillSegment(segmentId, this._rids);
1018
+ }
1019
+ };
1020
+ /** Remove all existing segment children in each segment and fill the segments with all contnet rows before the next segment separator
1021
+ * @public
1022
+ * @return {boolean} Return true if the fill segments have changed, otherwise return false
1023
+ */
1024
+ DataTable.prototype.fillSegments = function() {
1025
+ if(this._segments) {
1026
+ return this._segments.fillSegments(this._rids);
1027
+ }
1028
+ return false;
1029
+ };
1030
+ /** @public
1031
+ * @param {string} segmentId Row id
1032
+ * @param {string} rid Row id
1033
+ * @return {boolean} Return true if there is any change
1034
+ */
1035
+ DataTable.prototype.addSegmentChild = function(segmentId, rid) {
1036
+ if(this._segments) {
1037
+ var dirty = this._segments.addSegmentChild(segmentId, rid);
1038
+ if(dirty) {
1039
+ if(this._sort(null)) {
1040
+ this._dispatchPositionChange();
1041
+ }
1042
+ return true;
1043
+ }
1044
+ }
1045
+ return false;
1046
+ };
1047
+ /** @public
1048
+ * @param {string} segmentId Row id
1049
+ * @param {Array.<string>} rids Row id
1050
+ * @return {boolean} Return true if there is any change
1051
+ */
1052
+ DataTable.prototype.addSegmentChildren = function(segmentId, rids) {
1053
+ if(this._segments) {
1054
+ var dirty = this._segments.addSegmentChildren(segmentId, rids);
1055
+ if(dirty) {
1056
+ if(this._sort(null)) {
1057
+ this._dispatchPositionChange();
1058
+ }
1059
+ return true;
1060
+ }
1061
+ }
1062
+ return false;
1063
+ };
1064
+ /** @public
1065
+ * @param {string} segmentId Row id
1066
+ * @param {string} rid Row id
1067
+ * @return {boolean} Return true if there is any change
1068
+ */
1069
+ DataTable.prototype.removeSegmentChild = function(segmentId, rid) {
1070
+ if(this._segments) {
1071
+ return this._segments.removeSegmentChild(segmentId, rid);
1072
+ }
1073
+ return false;
1074
+ };
1075
+ /** @public
1076
+ * @param {string} segmentId Row id
1077
+ * @param {Array.<string>} rids Row id
1078
+ * @return {boolean} Return true if there is any change
1079
+ */
1080
+ DataTable.prototype.removeSegmentChildren = function(segmentId, rids) {
1081
+ if(this._segments) {
1082
+ return this._segments.removeSegmentChildren(segmentId, rids);
1083
+ }
1084
+ return false;
1085
+ };
1086
+ /** @public
1087
+ * @return {boolean} Return true if there is any change
1088
+ */
1089
+ DataTable.prototype.removeAllSegmentChildren = function() {
1090
+ if(this._segments) {
1091
+ return this._segments.removeAllSegmentChildren();
1092
+ }
1093
+ return false;
1094
+ };
1095
+ /** Get row ids of all segment separator
1096
+ * @public
1097
+ * @return {Array.<string>} Return null if there is no segment separator
1098
+ */
1099
+ DataTable.prototype.getSegmentIds = function() {
1100
+ if(this._segments) {
1101
+ return this._segments.getSegmentIds();
1102
+ }
1103
+ return null;
1104
+ };
1105
+ /** Get row ids of all children from the specified segment
1106
+ * @public
1107
+ * @param {string} segmentId
1108
+ * @return {Array.<string>} Returns array of row ids. Returns null if there is no child or no segment separator found
1109
+ */
1110
+ DataTable.prototype.getSegmentChildIds = function(segmentId) {
1111
+ if(this._segments) {
1112
+ var segment = this._segments.getSegment(segmentId);
1113
+ if(segment) {
1114
+ var chdr = segment.getChildIds();
1115
+ return chdr.length ? chdr : null;
1116
+ }
1117
+ }
1118
+ return null;
1119
+ };
1120
+ /** Sort all of existing segments by given compare function
1121
+ * @public
1122
+ * @param {Function} compare
1123
+ */
1124
+ DataTable.prototype.sortSegments = function (compare) {
1125
+ if(!this._segments || typeof compare !== "function") {
1126
+ return;
1127
+ }
1128
+ var rids = this._rids;
1129
+ var segments = this._segments;
1130
+ var segmentCount = segments.getSegmentCount();
1131
+ var segmentList = [];
1132
+ var origOrder = [];
1133
+ var itemCount = 0;
1134
+ var rowCount = rids.length;
1135
+ var rid = "";
1136
+ var segment = null;
1137
+ var i;
1138
+ for(i = 0; i < rowCount; ++i) {
1139
+ rid = rids[i];
1140
+ segment = segments.getSegment(rid);
1141
+ if(segment) {
1142
+ origOrder.push(i);
1143
+ segmentList.push(segment);
1144
+ if(++itemCount >= segmentCount) {
1145
+ break;
1146
+ }
1147
+ }
1148
+ }
1149
+
1150
+ this._userSegmentComparer = compare;
1151
+ segmentList.sort(this._bySegmentSeparator);
1152
+ this._userSegmentComparer = null;
1153
+
1154
+ var dirty = false;
1155
+ for(i = 0; i < itemCount; ++i) {
1156
+ var idx = origOrder[i];
1157
+ rid = rids[idx];
1158
+ segment = segmentList[i];
1159
+ var newRid = segment.getId();
1160
+ if(rid !== newRid) {
1161
+ rids[idx] = newRid;
1162
+ dirty = true;
1163
+ }
1164
+ }
1165
+
1166
+ if(dirty) {
1167
+ this._sort(null);
1168
+ this._dispatchPositionChange();
1169
+ }
1170
+ };
1171
+ /** Sort all of existing segments by given compare function
1172
+ * @private
1173
+ * @param {tr.Segment} segmentA
1174
+ * @param {tr.Segment} segmentB
1175
+ * @return {number}
1176
+ */
1177
+ DataTable.prototype._bySegmentSeparator = function (segmentA, segmentB) {
1178
+ return /** @type{number} */(this._userSegmentComparer(
1179
+ this.getRowData(segmentA.getId()),
1180
+ this.getRowData(segmentB.getId())
1181
+ ));
1182
+ };
1183
+
1184
+
1185
+ /**
1186
+ * @public
1187
+ * @ignore
1188
+ * @param {Array.<Array>} sortingDefs
1189
+ * @return {boolean} Return true if there is any change, otherwise false
1190
+ */
1191
+ DataTable.prototype._sort = function(sortingDefs) {
1192
+ var rids = this._rids;
1193
+ var dataRows = this.getMultipleRowData(rids);
1194
+ var segmentValues = this.getSegmentValues(rids);
1195
+ var change = DataTable._performMultiLevelSorting(dataRows, sortingDefs, segmentValues);
1196
+
1197
+ if(change) {
1198
+ this._rids = DataTable._reorderItems(rids, change);
1199
+ return true;
1200
+ }
1201
+ return false;
1202
+ };
1203
+
1204
+ /** Simulate data changed event by firing global change event argument to all listeners<br>
1205
+ * Normally this will force data view to do sorting, filtering, and grouping again
1206
+ * @public
1207
+ * @param {boolean=} suppressEvent
1208
+ * @fires DataTable#dataComposed
1209
+ * @fires DataTable#dataChanged
1210
+ */
1211
+ DataTable.prototype.dispatchGlobalChange = function(suppressEvent) {
1212
+ if(!suppressEvent && this._needFiring()) {
1213
+ this._dispatchDataChange(DataTable._globalChangeArg);
1214
+ }
1215
+ };
1216
+ /** Position change will not cause dataComposed to be fired
1217
+ * @private
1218
+ * @param {boolean=} suppressEvent
1219
+ * @fires DataTable#dataChanged
1220
+ */
1221
+ DataTable.prototype._dispatchPositionChange = function(suppressEvent) {
1222
+ if(!suppressEvent && this._needFiring()) {
1223
+ this._dispatch("dataChanged", DataTable._positionChangeArg);
1224
+ }
1225
+ };
1226
+
1227
+ /** {@link DataCache#dump} Construct a JSON object that is compatible with console.table()
1228
+ * @override
1229
+ * @param {Object=} opt_options {@link DataCache#dump}
1230
+ * @return {!Array.<Object>} Return a JSON object that is compatible with console.table()
1231
+ * @see {@link DataCache#dump}
1232
+ */
1233
+ DataTable.prototype.dump = function(opt_options) {
1234
+ return DataCache.constructTable(this.getMultipleRowData(this._rids), opt_options, this._rids);
1235
+ };
1236
+
1237
+
1238
+ /** @private
1239
+ * @param {string} rid
1240
+ * @param {string} cid
1241
+ * @param {*} value
1242
+ * @return {boolean} Return true if there is any change, and false otherwise
1243
+ */
1244
+ DataTable.prototype._setData = function(rid, cid, value) {
1245
+ var row = this.getRowData(rid);
1246
+
1247
+ if(!row) {
1248
+ row = {};
1249
+ this._rows[rid] = row;
1250
+ this._prevData[rid] = {};
1251
+ this._rids.push(rid);
1252
+ }
1253
+ this._prevData[rid][cid] = row[cid];
1254
+ row[cid] = value;
1255
+ return true;
1256
+ };
1257
+ /** @private
1258
+ * @param {number} len
1259
+ * @param {Array.<string>=} opt_ridList
1260
+ * @returns {Array.<string>}
1261
+ */
1262
+ DataTable.prototype._generateRids = function(len, opt_ridList) {
1263
+ var r = 0, rids;
1264
+ if(opt_ridList) {
1265
+ rids = opt_ridList;
1266
+ } else {
1267
+ rids = [];
1268
+ var rowCount = this._rids.length;
1269
+ while(r < rowCount && r < len) {
1270
+ rids.push(this._rids[r++]);
1271
+ }
1272
+ }
1273
+ r = rids.length;
1274
+ while(r < len) {
1275
+ rids.push("" + r++); // Auto-generate row id
1276
+ }
1277
+ return rids;
1278
+ };
1279
+ /** @private
1280
+ * @param {Object} values
1281
+ * @param {string|null=} rid
1282
+ * @return {string}
1283
+ */
1284
+ DataTable.prototype._generateUniqueRid = function(values, rid) {
1285
+ if(!rid) {
1286
+ if(values["ROW_ID"]) {
1287
+ return values["ROW_ID"];
1288
+ }
1289
+ rid = "_" + this._runningId++;
1290
+ while(this._rows[rid]) {
1291
+ rid = "_" + this._runningId++;
1292
+ }
1293
+ }
1294
+ return rid;
1295
+ };
1296
+
1297
+ /** @private
1298
+ * @return {boolean}
1299
+ */
1300
+ DataTable.prototype._needFiring = function() {
1301
+ return !this._frozen && !this._composing;
1302
+ };
1303
+
1304
+ /** Deprecated
1305
+ * @deprecated
1306
+ * @public
1307
+ * @function
1308
+ */
1309
+ DataTable.getSortingDefinitions = Util._deprecatedFunction;
1310
+ /** @public
1311
+ * @const
1312
+ * @ignore
1313
+ * @type {!Object}
1314
+ */
1315
+ DataTable._globalChangeArg = {"globalChange": true};
1316
+ /** @public
1317
+ * @const
1318
+ * @ignore
1319
+ * @type {!Object}
1320
+ */
1321
+ DataTable._positionChangeArg = {"globalChange": true, "positionChangeOnly": true};
1322
+
1323
+
1324
+ /**
1325
+ * @function
1326
+ * @public
1327
+ * @ignore
1328
+ * @param {Array.<Array>} out_defs Output object. Array is used to optimize property accessing time.
1329
+ * @param {string|Array.<string>} cids
1330
+ * @param {string|number|Array.<string|number>=} sortOrders
1331
+ * @param {Function|Array.<Function>|Object.<string, DataTable.SortLogic>=} logics
1332
+ * @param {*=} contextObj Context object that will be provided as the forth parameter of the given comparer method
1333
+ * @return {!Array.<Array>}
1334
+ */
1335
+ DataTable._buildSortContext = function(out_defs, cids, sortOrders, logics, contextObj) {
1336
+ var aryColumnIds, aryOrders;
1337
+ if(Array.isArray(cids)) {
1338
+ aryColumnIds = /** @type{Array.<string>} */(cids);
1339
+ aryOrders = /** @type{Array.<string|number>} */(sortOrders);
1340
+ } else {
1341
+ aryColumnIds = [/** @type{string} */(cids)];
1342
+ aryOrders = (cids) ? [/** @type{string|number} */(sortOrders)] : [0];
1343
+ }
1344
+
1345
+ var logic = null;
1346
+ var logicMap = null;
1347
+ if(typeof logics == "function") {
1348
+ logic = logics;
1349
+ } else {
1350
+ logicMap = /** @type{Array.<Function>|Object.<string, DataTable.SortLogic>} */(logics);
1351
+ }
1352
+ var len = aryColumnIds.length;
1353
+ out_defs.length = len;
1354
+ for(var c = len; --c >= 0;) {
1355
+ if (Array.isArray(logicMap)) {
1356
+ logic = logicMap[c];
1357
+ }
1358
+ var sortingDef = out_defs[c];
1359
+ if(!sortingDef) {
1360
+ sortingDef = out_defs[c] = new Array(5);
1361
+ }
1362
+ var columnId = aryColumnIds[c];
1363
+ sortingDef[0] = columnId; // text field
1364
+ sortingDef[1] = null; // Reserved for row data
1365
+ sortingDef[2] = logic || logicMap[columnId] || logicMap["_default"]; // sort logic
1366
+ if(!sortingDef[2]) {
1367
+ sortingDef[2] = DataTable._defaultComparer;
1368
+ }
1369
+ sortingDef[3] = DataTable._getSortOrder(aryOrders[c]); // sort order
1370
+ sortingDef[4] = contextObj;
1371
+ }
1372
+ return out_defs;
1373
+ };
1374
+ /** Performance is extremely vital in this method
1375
+ * @public
1376
+ * @ignore
1377
+ * @function
1378
+ * @param {number} a
1379
+ * @param {number} b
1380
+ * @param {number} order Not used by in this method
1381
+ * @param {Array.<Array>} sortingDefs
1382
+ * @return {number}
1383
+ */
1384
+ DataTable._multiColumnCompareLogic = function(a, b, order, sortingDefs) {
1385
+ var count = sortingDefs.length;
1386
+ var result = 0;
1387
+ for(var c = 0; c < count; ++c) {
1388
+ var sortingDef = sortingDefs[c];
1389
+ result = DataTable._singleColumnCompareLogic(a, b, sortingDef[3], sortingDef);
1390
+ if(result) {
1391
+ return result;
1392
+ }
1393
+ }
1394
+ return result;
1395
+ };
1396
+ /** Performance is extremely vital in this method
1397
+ * @public
1398
+ * @ignore
1399
+ * @function
1400
+ * @param {number} a
1401
+ * @param {number} b
1402
+ * @param {number} order
1403
+ * @param {Array} sortingDef
1404
+ * @return {number}
1405
+ */
1406
+ DataTable._singleColumnCompareLogic = function(a, b, order, sortingDef) {
1407
+ var values = /** @type{Array} */(sortingDef[1]);
1408
+ return /** @type{number} */(sortingDef[2](
1409
+ values[a], // Value1
1410
+ values[b], // Value2
1411
+ order, // Sort order (3)
1412
+ sortingDef[4] // Context object
1413
+ ));
1414
+ };
1415
+ /** @public
1416
+ * @function
1417
+ * @ignore
1418
+ * @param {!Array.<Object>} dataRows
1419
+ * @param {Array.<Array>} sortingDefs
1420
+ * @param {Array.<number>=} segmentValues
1421
+ * @return {Array.<number>} Returns new item positions if there is any change, otherwise returns null
1422
+ */
1423
+ DataTable._performMultiLevelSorting = function(dataRows, sortingDefs, segmentValues) {
1424
+ var rowCount = dataRows ? dataRows.length : 0;
1425
+ var defCount = sortingDefs ? sortingDefs.length : 0;
1426
+ if(!rowCount) {
1427
+ return null;
1428
+ }
1429
+
1430
+ // Populate data for each definition
1431
+ for(var c = 0; c < defCount; ++c) {
1432
+ var sortingDef = sortingDefs[c];
1433
+ var columnId = sortingDef[0];
1434
+ var rows = sortingDef[1];
1435
+ if(rows) {
1436
+ rows.length = rowCount;
1437
+ } else {
1438
+ rows = sortingDef[1] = new Array(rowCount);
1439
+ }
1440
+ for(var r = 0; r < rowCount; ++r) {
1441
+ rows[r] = dataRows[r][columnId];
1442
+ }
1443
+ }
1444
+
1445
+ if(segmentValues) {
1446
+ var segmentDef = [ // TODO: Make this static variable
1447
+ "ROW_SEGMENT", // Dummy column id
1448
+ segmentValues, // Segment values
1449
+ DataTable._segmentComparer,
1450
+ 1, // Ascending order
1451
+ null // Context object
1452
+ ];
1453
+ if(sortingDefs) {
1454
+ sortingDefs = sortingDefs.slice();
1455
+ sortingDefs.unshift(segmentDef);
1456
+ } else {
1457
+ sortingDefs = [segmentDef];
1458
+ }
1459
+ ++defCount;
1460
+ }
1461
+
1462
+ if(!defCount) {
1463
+ return null;
1464
+ }
1465
+
1466
+ var sortOrder = 0;
1467
+ var sortLogic, sortContext;
1468
+ if(defCount > 1) {
1469
+ sortLogic = DataTable._multiColumnCompareLogic;
1470
+ sortContext = sortingDefs;
1471
+ sortOrder = 1; // sortOrder is not used by _multiColumnCompareLogic
1472
+ } else { // Single level sorting
1473
+ sortLogic = DataTable._singleColumnCompareLogic;
1474
+ sortContext = sortingDefs[0];
1475
+ sortOrder = /** @type{number} */(sortContext[3]);
1476
+ }
1477
+
1478
+ return DataTable._mergeSort(rowCount, sortOrder, sortLogic, sortContext);
1479
+ };
1480
+ /**
1481
+ * @function
1482
+ * @public
1483
+ * @ignore
1484
+ * @param {number} len Length of array item
1485
+ * @param {number} order
1486
+ * @param {DataTable.SortLogic} comparer
1487
+ * @param {*=} contextObj Context object that will be provided as the forth parameter of the given comparer method
1488
+ * @return {Array.<number>} Returns new item positions if there is any change, otherwise returns null
1489
+ */
1490
+ DataTable._mergeSort = function(len, order, comparer, contextObj) {
1491
+ var change = false;
1492
+
1493
+ var grpSize = 1;
1494
+ var iter, lhsFrom, rhsFrom, lhsTo, rhsTo;
1495
+ var subj = DataTable._createIndexArray(len);
1496
+ var obj = subj.slice();
1497
+
1498
+ while(grpSize <= len) {
1499
+ iter = rhsTo = 0; // start from 0
1500
+ while(iter < len) {
1501
+ lhsFrom = rhsTo;
1502
+ lhsTo = lhsFrom + grpSize;
1503
+ rhsFrom = lhsTo;
1504
+ rhsTo = rhsFrom + grpSize;
1505
+ if(rhsTo > len) rhsTo = len;
1506
+
1507
+ if(rhsFrom < rhsTo) {
1508
+ while(true) { // Merge two groups together
1509
+ if(comparer(subj[lhsFrom], subj[rhsFrom], order, contextObj) <= 0) {
1510
+ obj[iter++] = subj[lhsFrom];
1511
+ if(++lhsFrom >= lhsTo) {
1512
+ while(rhsFrom < rhsTo) {
1513
+ obj[iter++] = subj[rhsFrom];
1514
+ ++rhsFrom;
1515
+ }
1516
+ break;
1517
+ }
1518
+ } else {
1519
+ change = true;
1520
+ obj[iter++] = subj[rhsFrom];
1521
+ if(++rhsFrom >= rhsTo) {
1522
+ while(lhsFrom < lhsTo) {
1523
+ obj[iter++] = subj[lhsFrom];
1524
+ ++lhsFrom;
1525
+ }
1526
+ break;
1527
+ }
1528
+ }
1529
+ }
1530
+ } else {
1531
+ while(iter < len) {
1532
+ obj[iter] = subj[iter];
1533
+ ++iter;
1534
+ }
1535
+ }
1536
+ }
1537
+
1538
+ var tmp = subj;
1539
+ subj = obj;
1540
+ obj = tmp;
1541
+ grpSize <<= 1;
1542
+ }
1543
+ return change ? subj : null;
1544
+ };
1545
+ /** reorderItems(["a", "b", "c", "d"], [1, 3, 0, 2]) === ["b", "d", "a", "c"]; (Move the first item to where its corresponding index is) <br>
1546
+ * Not in-place reordering. Orders array will become the results
1547
+ * @function
1548
+ * @public
1549
+ * @ignore
1550
+ * @param {!Array} ary
1551
+ * @param {Array} orders
1552
+ * @return {!Array}
1553
+ */
1554
+ DataTable._reorderItems = function (ary, orders) {
1555
+ if(orders) {
1556
+ for(var i = ary.length; --i >= 0;) {
1557
+ orders[i] = ary[orders[i]];
1558
+ }
1559
+ return orders;
1560
+ }
1561
+ return ary;
1562
+ };
1563
+ /** Create array of incremental series starting from 0 (e.g. [0, 1, 2, 3, ...])
1564
+ * @private
1565
+ * @function
1566
+ * @ignore
1567
+ * @param {number} len Length of the generated array
1568
+ * @return {!Array.<number>}
1569
+ */
1570
+ DataTable._createIndexArray = function(len) {
1571
+ var ary = DataTable._idxAryMap[len];
1572
+ if(!ary) {
1573
+ if(DataTable._idxAryCount > 50) { // Clear cache to avoid caching huge memory
1574
+ DataTable._idxAryMap = {};
1575
+ DataTable._idxAryCount = 0;
1576
+ }
1577
+ ary = DataTable._idxAryMap[len] = new Array(len);
1578
+ DataTable._idxAryCount++;
1579
+
1580
+ for(var i = 0; i < len; ++i) {
1581
+ ary[i] = i;
1582
+ }
1583
+ }
1584
+ return ary.slice(); // Fastest way to clone an array is to perform slice() method
1585
+ };
1586
+ /** @private
1587
+ * @type {Object.<number, Array.<number>>}
1588
+ */
1589
+ DataTable._idxAryMap = {};
1590
+ /** @private
1591
+ * @type {number}
1592
+ */
1593
+ DataTable._idxAryCount = 0;
1594
+
1595
+ /** @private
1596
+ * @function
1597
+ * @param {number} a
1598
+ * @param {number} b
1599
+ * @return {number}
1600
+ */
1601
+ DataTable._segmentComparer = function(a, b) {
1602
+ if(a === b) {
1603
+ return 0;
1604
+ }
1605
+ return (a < b) ? -1 : 1;
1606
+ };
1607
+ /** @private
1608
+ * @function
1609
+ * @param {*} a
1610
+ * @param {*} b
1611
+ * @param {number} order
1612
+ * @return {number}
1613
+ */
1614
+ DataTable._defaultComparer = function(a, b, order) { // User data may contain invalid value such as undefined or null
1615
+ if(a == null || a !== a) {
1616
+ if(b == null || b !== b) {
1617
+ return 0;
1618
+ }
1619
+ return 1;
1620
+ }
1621
+ if(b == null || b !== b) {
1622
+ return -1;
1623
+ }
1624
+
1625
+ if(a < b) {
1626
+ return -order;
1627
+ }
1628
+ if(b < a) {
1629
+ return order;
1630
+ }
1631
+ return 0;
1632
+ };
1633
+ /** @private
1634
+ * @function
1635
+ * @param {string|number=} sortOrder
1636
+ * @returns {number}
1637
+ */
1638
+ DataTable._getSortOrder = function(sortOrder) {
1639
+ if(typeof sortOrder === "number") {
1640
+ return sortOrder;
1641
+ } else if(sortOrder && typeof sortOrder === "string") {
1642
+ sortOrder = sortOrder.charAt(0).toLowerCase();
1643
+ if(sortOrder === "a") {
1644
+ return 1;
1645
+ } else if(sortOrder === "d") {
1646
+ return -1;
1647
+ }
1648
+ }
1649
+ return 0;
1650
+ };
1651
+
1652
+ DataTable._proto = DataTable.prototype;
1653
+
1654
+ export default DataTable;
1655
+ export { DataTable };