@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,1707 @@
1
+ /* eslint-disable */
2
+ import Ext from "../../../../tr-grid-util/es6/Ext.js";
3
+ import Plugin from "./Plugin.js";
4
+ import Core from "../Core.js";
5
+ import ILayoutGrid from "../ILayoutGrid.js";
6
+ import ElementWrapper from "../components/ElementWrapper.js";
7
+ import DataTable from "../../data/DataTable.js";
8
+ /* eslint-enable */
9
+
10
+ /** Fired when user click and before the sorting operation.
11
+ * @event SortableTitlePlugin#preClicked
12
+ * @property {number} colIndex
13
+ * @property {Element} target Element being clicked
14
+ * @example
15
+ * function onPreClicked(e) {
16
+ * e.cancel = true; // Cancel sorting operation
17
+ * }
18
+ */
19
+
20
+ /** Fired when user click and after the sorting operation
21
+ * @event SortableTitlePlugin#clicked
22
+ * @property {number} colIndex
23
+ * @property {string} sortOrder "a" for "ascending, "d" for descending, and "n" for none
24
+ * @property {string} dataColumnName Field that is used for sorting
25
+ */
26
+
27
+ /** Fired just before sorting data. This allows additional modification before the actual sorting
28
+ * @event SortableTitlePlugin#preDataSorting
29
+ * @property {boolean=} isUserAction This has true value, if event initiate from clicking title/header section
30
+ */
31
+
32
+ /** Fired once column is sorted and before {@link SortableTitlePlugin#clicked}
33
+ * @event SortableTitlePlugin#columnSorted
34
+ * @property {number} colIndex
35
+ * @property {string} sortOrder "a" for "ascending, "d" for descending, and "n" for none
36
+ * @property {string} sortedField Field that is used for sorting
37
+ * @property {Array.<number>} colIndices An array of colIndex
38
+ * @property {Array.<string>} sortOrders An array of sortOrder
39
+ * @property {Array.<string>} sortedFields An array of sortedField
40
+ */
41
+
42
+ /** @constructor
43
+ * @extends {Plugin}
44
+ * @param {SortableTitlePlugin.Options=} options
45
+ */
46
+ var SortableTitlePlugin = function (options) { // TODO: Extract SortableTitlePlugin to grid extension.
47
+ var _t = this;
48
+ _t._onSectionAdded = _t._onSectionAdded.bind(_t);
49
+ _t._onMouseDown = _t._onMouseDown.bind(_t);
50
+
51
+ _t._onUIUpdated = _t._onUIUpdated.bind(_t);
52
+
53
+ _t._onColumnAdded = _t._onColumnAdded.bind(_t);
54
+ _t._onColumnRemoved = _t._onColumnRemoved.bind(_t);
55
+ _t._onItemSortingClicked = _t._onItemSortingClicked.bind(_t);
56
+ _t.refresh = _t.refresh.bind(_t);
57
+
58
+ _t._hosts = [];
59
+ _t._sortLogic = {};
60
+
61
+ _t._addEvents(
62
+ "preClicked"
63
+ , "clicked"
64
+ , "preDataSorting"
65
+ , "columnSorted"
66
+ );
67
+
68
+ _t._sortStates = [];
69
+ _t._sortingSequence = ["a", "d"];
70
+
71
+ if(options) {
72
+ _t.config({ "sorting": options });
73
+ }
74
+ };
75
+ Ext.inherits(SortableTitlePlugin, Plugin);
76
+
77
+ /**
78
+ * @typedef {"a" | "ascending" | "d" | "descending" | "n" | null} SortableTitlePlugin~SortOrder
79
+ */
80
+
81
+ /** The sorting object which will be used for initialSort config.
82
+ * @typedef {Object} SortableTitlePlugin~InitialSort
83
+ * @property {number} colIndex Index of the column
84
+ * @property {SortableTitlePlugin~SortOrder=} sortOrder=null Set to "d" for descending order and "a" for ascending order
85
+ * @property {SortableTitlePlugin~SortOrder=} order Alias of sortOrder
86
+ */
87
+ SortableTitlePlugin.InitialSort;
88
+
89
+ /** The sorting properties for column option.
90
+ * @typedef {Object} SortableTitlePlugin~ColumnOptions
91
+ * @property {boolean=} sortable=false If enable, the column can be sorted by user click
92
+ * @property {string=} sortBy Field to be used for sorting. If defined, user can click at the header section to sort the column
93
+ * @property {DataTable.SortLogic=} sortLogic=null Custom compare function for sorting
94
+ * @property {DataTable.SortLogic=} sortingLogic Alias to `sortLogic`
95
+ * @property {DataTable.SortLogic=} sorter Alias to `sortLogic`
96
+ * @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence Collection of sorting direction for the particular field.
97
+ */
98
+ SortableTitlePlugin.ColumnOptions;
99
+
100
+ /** The configuration object for sorting options. This can be defined by `sorting` property in CompositeGrid configuration object.
101
+ * @typedef {Object} SortableTitlePlugin~Options
102
+ * @property {(SortableTitlePlugin~InitialSort|Array.<SortableTitlePlugin.InitialSort>)=} initialSort=null Set this config to initiate sorting after grid is created.
103
+ * @property {(boolean|number)=} multicolumn=false Allow multiple columns to be sorted at the same time. If number is defined, it is treated as maximum number of column to be sorted.
104
+ * @property {(boolean|number)=} multiColumn=false Alias to `multicolumn`
105
+ * @property {boolean=} threeStatesSorting=false If enabled, sorting will cycle through ascending, descending and original order states. This option is deprecated in favor of sortingSequence option
106
+ * @property {Object.<string, DataTable.SortLogic>=} sortLogic=null Custom logic for sorting based on the specified field. The key is field name and the value pair is a function.
107
+ * @property {boolean=} disableDoubleClickToSort=false If enabled, double click on column title to sort
108
+ * @property {boolean=} sortableColumns=false If enabled, all columns will be sortable by field automatically
109
+ * @property {boolean=} sortableIndicator=false If enabled, sort indicator (diamond) icon will always show regardless of sorting states. In Halo theme, this option will be enabled by default.
110
+ * @property {boolean=} indicatorOnly=false If enabled, data will not be sorted, but the UI is rendered normally. This is useful for server side sorting.
111
+ * @property {string=} mode Set to "manual" to disable data sorting. Deprecated in favor of `indicatorOnly`
112
+ * @property {boolean=} disabled=false If enabled, header section cannot be clicked and no sort UI is rendered. Sorting can still be triggered only through `sortColumn` method.
113
+ * @property {Function=} columnSorted A shortcut to define the columnSorted event handler
114
+ * @property {Function=} preClicked A shortcut to define the preClicked event handler
115
+ * @property {Function=} clicked A shortcut to define the clicked event handler
116
+ * @property {Function=} preDataSorting A shortcut to define the preDataSorting event handler
117
+ * @property {Array.<SortableTitlePlugin~SortOrder>=} sortingSequence=["a", "d"] Sequence in which sort order will be changed. The default value is ["a", "d"]. This option override threeStatesSorting
118
+ */
119
+ SortableTitlePlugin.Options;
120
+
121
+ /** Order of item indicates sort priorities used in DataView. <br>
122
+ * Each state contains column name{string}, sort order {string}, and rendering cell {ElementWrapper}
123
+ * @private
124
+ * @type {!Array.<Object>}
125
+ */
126
+ SortableTitlePlugin.prototype._sortStates;
127
+ /** Maximum possible number of sorting columns at any time. how a column is sorted.
128
+ * @private
129
+ * @type {number}
130
+ */
131
+ SortableTitlePlugin.prototype._maxCount = 1;
132
+
133
+ /** @private
134
+ * @type {boolean}
135
+ */
136
+ SortableTitlePlugin.prototype._dataSorting = true;
137
+ /** @private
138
+ * @type {boolean}
139
+ */
140
+ SortableTitlePlugin.prototype._isDisableDoubleClickToSort = true;
141
+
142
+ /** @private
143
+ * @type {number}
144
+ */
145
+ SortableTitlePlugin.prototype._clickTimer = 0;
146
+ /** @private
147
+ * @type {number}
148
+ */
149
+ SortableTitlePlugin.prototype._delayInterval = 0;
150
+ /** @private
151
+ * @type {number}
152
+ */
153
+ SortableTitlePlugin.prototype._lastMouseDown = 0;
154
+ /** @private
155
+ * @type {SortableTitlePlugin.InitialSort}
156
+ */
157
+ SortableTitlePlugin.prototype._initialSort = null;
158
+ /** @private
159
+ * @type {string}
160
+ */
161
+ SortableTitlePlugin.prototype._mode = "";
162
+ /** @private
163
+ * @type {boolean}
164
+ */
165
+ SortableTitlePlugin.prototype._sortableColumns = true;
166
+ /** @private
167
+ * @type {boolean}
168
+ */
169
+ SortableTitlePlugin.prototype._sortableIndicator = false;
170
+ /** @private
171
+ * @type {boolean}
172
+ */
173
+ SortableTitlePlugin.prototype._solarTheme = false;
174
+ /** Logic map based on field name
175
+ * @private
176
+ * @type {Object.<string, Function>}
177
+ */
178
+ SortableTitlePlugin.prototype._sortLogic;
179
+ /** To allow users/clients to store and provide all sorting logics by themselve
180
+ * @private
181
+ * @type {boolean}
182
+ */
183
+ SortableTitlePlugin.prototype._userManagedLogic = false;
184
+ /** @private
185
+ * @type {boolean}
186
+ */
187
+ SortableTitlePlugin.prototype._disabled = false;
188
+ /** Since DataView in real-time grid has only one ROW_DEF column, we need to re-map sorting field to sort correctly.
189
+ * @private
190
+ * @type {boolean}
191
+ */
192
+ SortableTitlePlugin.prototype._rowDefMode = false;
193
+
194
+ /** @private
195
+ * @type {!Object.<string, string>}
196
+ */
197
+ SortableTitlePlugin._icons = {};
198
+
199
+ /** @private
200
+ * @type {!Array.<string>}
201
+ */
202
+ SortableTitlePlugin.prototype._sortingSequence;
203
+ /** @private
204
+ * @type {Object.<string, Array>}
205
+ */
206
+ SortableTitlePlugin.prototype._sortingSequenceMap = null;
207
+
208
+
209
+ /** @type {string}
210
+ * @private
211
+ * @const
212
+ */
213
+ var CODE_UP = "\u25B2";
214
+ /** @type {string}
215
+ * @private
216
+ * @const
217
+ */
218
+ var CODE_DOWN = "\u25BC";
219
+ /** @type {string}
220
+ * @private
221
+ * @const
222
+ */
223
+ var CODE_DIAMOND = "\u25CA";
224
+
225
+ /** @override */
226
+ SortableTitlePlugin.prototype.getName = function () {
227
+ return "SortableTitlePlugin"; // Read Only
228
+ };
229
+
230
+ /**
231
+ * @override
232
+ * @description Suppress google compiler for argument options because Internal Plugin doesn't support.
233
+ * @suppress {checkTypes}
234
+ */
235
+ SortableTitlePlugin.prototype.initialize = function (host, options) {
236
+ if (this._hosts.indexOf(host) >= 0) { return; }
237
+ this._hosts.push(host);
238
+
239
+ if (this._hosts.length === 1) {
240
+ host.listen("columnAdded", this._onColumnAdded);
241
+ host.listen("columnRemoved", this._onColumnRemoved);
242
+ }
243
+ host.listen("sectionAdded", this._onSectionAdded);
244
+ host.listen("postSectionRender", this._onUIUpdated);
245
+ host.listen("dataSourceChanged", this.refresh);
246
+
247
+ this.config(options);
248
+ };
249
+
250
+ /** @override */
251
+ SortableTitlePlugin.prototype.unload = function (host) {
252
+ var at = this._hosts.indexOf(host);
253
+ if (at < 0) { return; }
254
+
255
+ this._hosts.splice(at, 1);
256
+ host.unlisten("sectionAdded", this._onSectionAdded);
257
+ host.unlisten("postSectionRender", this._onUIUpdated);
258
+ host.unlisten("dataSourceChanged", this.refresh);
259
+
260
+ host.unlisten("columnAdded", this._onColumnAdded);
261
+ host.unlisten("columnRemoved", this._onColumnRemoved);
262
+
263
+ if (this._hosts.length <= 0) {
264
+ if (this._clickTimer) {
265
+ clearTimeout(this._clickTimer);
266
+ this._clickTimer = 0;
267
+ }
268
+ }
269
+ };
270
+
271
+ /** @public
272
+ */
273
+ SortableTitlePlugin.prototype.afterInit = function () {
274
+ var t = this;
275
+
276
+ // Data source not available during initialization
277
+ t.setSortLogics(t._sortLogic);
278
+
279
+ // Sort columns if initialSort are specified initially
280
+ if (t._initialSort != null) {
281
+ var initialSort = t._initialSort;
282
+ if (!Array.isArray(initialSort)) {
283
+ initialSort = [initialSort];
284
+ }
285
+ if (t._maxCount === 1) {
286
+ initialSort = initialSort.slice(0, 1); // Ensure only 1 item is sorted in non-multiColumn mode
287
+ }
288
+ t.sortColumns(initialSort);
289
+ }
290
+ };
291
+
292
+ /** @public
293
+ * @param {Object=} options Core model object
294
+ */
295
+ SortableTitlePlugin.prototype.config = function (options) {
296
+ if (!options) { return; }
297
+
298
+ var t = this;
299
+
300
+ var icons = options["icons"];
301
+ if (icons != null) {
302
+ if (icons["sorting"]) {
303
+ SortableTitlePlugin._icons = icons["sorting"];
304
+ }
305
+ }
306
+ var themeName = options["themeName"];
307
+ if (!themeName || themeName.indexOf("solar") >= 0) {
308
+ t._solarTheme = true;
309
+ } else {
310
+ t._solarTheme = false;
311
+ }
312
+ t._initialSort = t._initialSortByColumnField(options);
313
+
314
+ var extOptions = options["sorting"];
315
+ if (!extOptions) {
316
+ return;
317
+ }
318
+
319
+ if(extOptions["ROW_DEF"]) {
320
+ this._rowDefMode = true;
321
+ }
322
+ if(extOptions["userManagedLogic"]) {
323
+ t._userManagedLogic = true;
324
+ }
325
+
326
+ var val = extOptions["multiColumn"] || extOptions["multicolumn"];
327
+ if (val != null) {
328
+ if (val === true) val = -1;
329
+ if (val === false) val = 1;
330
+ t.setSortableColumnCount((typeof val == "number" && val > 0) ? val : -1);
331
+ }
332
+
333
+ val = extOptions["sortableIndicator"];
334
+ if (val != null) {
335
+ t._sortableIndicator = val; // This can override default halo theme
336
+ }
337
+
338
+ val = extOptions["disabled"];
339
+ if (val != null) {
340
+ t._disabled = val ? true : false;
341
+ }
342
+
343
+ val = extOptions["threeStatesSorting"];
344
+ if (val != null) {
345
+ t.disableTwoStateSorting(val);
346
+ }
347
+
348
+ val = extOptions["sortingSequence"];
349
+ if (val != null) {
350
+ if(Array.isArray(val)) {
351
+ t._sortingSequence = val;
352
+ }
353
+ }
354
+
355
+ val = extOptions["mode"];
356
+ if (val != null) {
357
+ t._mode = val;
358
+ if (val === "manual") {
359
+ t.disableDataSorting();
360
+ }
361
+ }
362
+
363
+ val = extOptions["indicatorOnly"];
364
+ if (val != null) {
365
+ t.disableDataSorting(val);
366
+ }
367
+
368
+ val = extOptions["disableDoubleClickToSort"];
369
+ if (val != null) {
370
+ t.disableDoubleClickToSort(val);
371
+ }
372
+
373
+ val = extOptions["columnSorted"];
374
+ if (typeof val === "function") {
375
+ t.listen("columnSorted", val);
376
+ }
377
+ val = extOptions["preClicked"];
378
+ if (typeof val === "function") {
379
+ t.listen("preClicked", val);
380
+ }
381
+ val = extOptions["clicked"];
382
+ if (typeof val === "function") {
383
+ t.listen("clicked", val);
384
+ }
385
+ val = extOptions["preDataSorting"];
386
+ if (typeof val === "function") {
387
+ t.listen("preDataSorting", val);
388
+ }
389
+
390
+ val = extOptions["sortableColumns"];
391
+ if (val != null) {
392
+ t._sortableColumns = val;
393
+ }
394
+
395
+ // Override _initialSortByColumnField
396
+ val = extOptions["initialSort"];
397
+ if (typeof val === "object") {
398
+ t._initialSort = val;
399
+ }
400
+
401
+ val = extOptions["sortLogic"];
402
+ if (typeof val === "object") {
403
+ for (var field in val) {
404
+ if (typeof val[field] === "function") {
405
+ t._sortLogic[field] = val[field];
406
+ }
407
+ }
408
+ }
409
+ };
410
+
411
+ /** @public
412
+ * @param {Object=} gridOptions
413
+ * @return {!Object}
414
+ */
415
+ SortableTitlePlugin.prototype.getConfigObject = function (gridOptions) {
416
+ var obj = gridOptions || {};
417
+
418
+ var columns = obj["columns"];
419
+ if (!columns) {
420
+ columns = obj["columns"] = [];
421
+ }
422
+
423
+ var host = this._hosts[0];
424
+
425
+ if (!host) return obj;
426
+
427
+ var len = host.getColumnCount();
428
+ var col, opt, field;
429
+ for(var i = 0; i < len; ++i) {
430
+ col = columns[i];
431
+ if (!col) {
432
+ col = columns[i] = {};
433
+ }
434
+
435
+ opt = this._getSortOptions(i);
436
+
437
+ if (!opt) { continue; }
438
+
439
+ if(this._sortableColumns) {
440
+ if (opt["disabled"]) {
441
+ col["sortable"] = false;
442
+ }
443
+ } else if(!opt["disabled"]) {
444
+ col["sortable"] = true;
445
+ }
446
+ field = opt["field"];
447
+ if (field) {
448
+ col["sortBy"] = field;
449
+ if (this._sortingSequenceMap && this._sortingSequenceMap[field]) {
450
+ col["sortingSequence"] = this._sortingSequenceMap[field];
451
+ }
452
+ }
453
+
454
+ }
455
+
456
+ var extOptions = obj["sorting"];
457
+ if(!extOptions) {
458
+ extOptions = obj["sorting"] = {};
459
+ }
460
+
461
+ extOptions["initialSort"] = this.getSortedColumns();
462
+ extOptions["sortableIndicator"] = this._sortableIndicator;
463
+ if(this._maxCount !== 1) {
464
+ extOptions["multiColumn"] = this._maxCount === -1 ? true : this._maxCount;
465
+ }
466
+ extOptions["disableDoubleClickToSort"] = this._isDisableDoubleClickToSort;
467
+ extOptions["sortableColumns"] = this._sortableColumns;
468
+ extOptions["indicatorOnly"] = !this._dataSorting;
469
+ // extOptions["mode"] = this._mode;
470
+ if(this._disabled) {
471
+ extOptions["disabled"] = true;
472
+ }
473
+
474
+ var sortingSeq = this._sortingSequence;
475
+ var notDefaultSeq = true;
476
+ if (sortingSeq.length === 2) {
477
+ if (sortingSeq[0] === "a" && sortingSeq[1] === "d") { // Sorting Sequence is not the default one
478
+ notDefaultSeq = false;
479
+ }
480
+ }
481
+ if(notDefaultSeq) {
482
+ extOptions["sortingSequence"] = sortingSeq.slice();
483
+ }
484
+
485
+ return obj;
486
+ };
487
+
488
+ /** @public
489
+ * @description Function for ColumnMenuExtension to collect config of column menu
490
+ * @param {number} colIndex Column index
491
+ * @param {Object} config Column Menu configuration
492
+ * @return {!Object}
493
+ */
494
+ SortableTitlePlugin.prototype.getColumnMenu = function (colIndex, config) {
495
+ if (!config) {
496
+ config = {};
497
+ }
498
+
499
+ var menus = config["menus"];
500
+ if (!menus) {
501
+ menus = config["menus"] = [];
502
+ }
503
+
504
+ var menu = menus[0];
505
+ if (!menu) {
506
+ menu = menus[0] = {
507
+ "menuItems": []
508
+ };
509
+ }
510
+
511
+ var order = this.getSortOrder(colIndex);
512
+
513
+ // Menu items for this extension
514
+ var extMenuItem = {
515
+ "indexScore": 100,
516
+ "label": "Sort Column",
517
+ "icon": "sort-a-to-z",
518
+ "group": "FREQUENTLY_USED",
519
+ "subMenu": {
520
+ "menuItems": [{
521
+ "indexScore": 3,
522
+ "label": "Ascending",
523
+ "radioMode": true,
524
+ "value": {
525
+ "colIndex": colIndex,
526
+ "order": "a"
527
+ },
528
+ "selected": order === "a",
529
+ "click": this._onItemSortingClicked
530
+ }, {
531
+ "indexScore": 2,
532
+ "label": "Descending",
533
+ "radioMode": true,
534
+ "value": {
535
+ "colIndex": colIndex,
536
+ "order": "d"
537
+ },
538
+ "selected": order === "d",
539
+ "click": this._onItemSortingClicked
540
+ }, {
541
+ "indexScore": 1,
542
+ "label": "Un-Sort",
543
+ "radioMode": true,
544
+ "value": {
545
+ "colIndex": colIndex,
546
+ "order": "n"
547
+ },
548
+ "selected": order === "n",
549
+ "click": this._onItemSortingClicked
550
+ }]
551
+ }
552
+ };
553
+
554
+ // Push menu items to config
555
+ menu["menuItems"].push(extMenuItem);
556
+
557
+ return config;
558
+ };
559
+
560
+ /** @private
561
+ * @param {Object} e
562
+ */
563
+ SortableTitlePlugin.prototype._onItemSortingClicked = function (e) {
564
+ var host = this._hosts[0];
565
+ var columnMenuExt = host["getPlugin"]("ColumnMenuPlugin");
566
+ columnMenuExt["hide"]();
567
+
568
+ var value = e["currentTarget"]["value"];
569
+ var colIndex = value["colIndex"];
570
+ var order = value["sortOrder"];
571
+ this.sortColumn(colIndex, order);
572
+ };
573
+
574
+ /** @public
575
+ * @return {Object.<string, string>} "a" for ascending, "d" for descending, and "n" for no sorting
576
+ */
577
+ SortableTitlePlugin.prototype.getIcons = function () {
578
+ return SortableTitlePlugin._icons;
579
+ };
580
+
581
+ /** @public
582
+ * @param {Object.<string, Function>} sortLogic
583
+ */
584
+ SortableTitlePlugin.prototype.setSortLogics = function (sortLogic) { // TODO: This should be deprecated
585
+ if (sortLogic != null) {
586
+ var host = this._hosts[0];
587
+ if (host) {
588
+ var ds = host.getDataSource();
589
+ for (var field in sortLogic) {
590
+ this._setSortLogic(ds, field, sortLogic[field]);
591
+ }
592
+ }
593
+ }
594
+ };
595
+
596
+ /** @public
597
+ * @param {string} field
598
+ * @param {Function} func
599
+ */
600
+ SortableTitlePlugin.prototype.setSortLogic = function (field, func) { // TODO: This should be deprecated
601
+ if (typeof field === "string") {
602
+ var host = this._hosts[0];
603
+ if (host) {
604
+ var ds = host.getDataSource();
605
+ this._setSortLogic(ds, field, func);
606
+ }
607
+ }
608
+ };
609
+
610
+ /** @private
611
+ * @param {Object} ds
612
+ * @param {string} field
613
+ * @param {Function} func
614
+ */
615
+ SortableTitlePlugin.prototype._setSortLogic = function (ds, field, func) { // TODO: This is deprecated
616
+ if (ds && typeof field === "string") {
617
+ if (field === "*") {
618
+ ds.setSortingLogic(func);
619
+ } else {
620
+ ds.setColumnSortingLogic(field, func);
621
+ }
622
+ }
623
+ };
624
+
625
+ /** @public
626
+ * @param {number=} colIndex If colIndex is undefined or null the first sorted column is used instead
627
+ * @return {string} "a" for ascending, "d" for descending, and "n" for no sorting
628
+ */
629
+ SortableTitlePlugin.prototype.getSortOrder = function (colIndex) {
630
+ var priority = (colIndex != null) ? this.getSortPriority(colIndex) : 0;
631
+ var state = this._sortStates[priority];
632
+ var sortOrder = state ? state["sortOrder"] : "";
633
+ return sortOrder || "n";
634
+ };
635
+ /** Return the first (highest priority) sorted column's index
636
+ * @public
637
+ * @param {number=} priority
638
+ * @return {number} Return negative value if there is no sorted column
639
+ */
640
+ SortableTitlePlugin.prototype.getSortedColumnIndex = function (priority) {
641
+ var state = this._sortStates[priority || 0];
642
+ if (state) {
643
+ var host = this._hosts[0];
644
+ var colCount = host ? host.getColumnCount() : 0;
645
+ for (var c = 0; c < colCount; ++c) {
646
+ var sortOptions = this._getSortOptions(c);
647
+ if (sortOptions === state) {
648
+ return c;
649
+ }
650
+ }
651
+ }
652
+ return -1;
653
+ };
654
+ /** @public
655
+ * @param {number} colIndex
656
+ * @return {number} Start with 0 (first column to be sorted) and end in the highest number. Negative means the specified column is not sorted
657
+ */
658
+ SortableTitlePlugin.prototype.getSortPriority = function (colIndex) {
659
+ var sortOptions = this._getSortOptions(colIndex);
660
+ if (sortOptions && sortOptions["sortOrder"]) {
661
+ var len = this._sortStates.length;
662
+ for (var i = 0; i < len; ++i) {
663
+ if (this._sortStates[i] === sortOptions) {
664
+ return i;
665
+ }
666
+ }
667
+ }
668
+ return -1;
669
+ };
670
+ /** @public
671
+ * @param {number} colIndex
672
+ * @return {boolean}
673
+ */
674
+ SortableTitlePlugin.prototype.isColumnSorted = function (colIndex) {
675
+ return this.getSortPriority(colIndex) >= 0;
676
+ };
677
+ /** @public
678
+ * @return {Array.<Object> | null} Array of object with "colIndex" and "sortOrder"
679
+ */
680
+ SortableTitlePlugin.prototype.getSortedColumns = function () {
681
+ var len = this._sortStates.length;
682
+ if (len <= 0) { return null; }
683
+
684
+ var arr = new Array(len);
685
+ for (var i = 0; i < len; ++i) {
686
+ var colIndex = this.getSortedColumnIndex(i);
687
+ arr[i] = {
688
+ "colIndex": colIndex,
689
+ "sortOrder": this._sortStates[i]["sortOrder"] || "n"
690
+ };
691
+ }
692
+ return arr;
693
+ };
694
+
695
+ /** @public
696
+ * @param {number} colIndex
697
+ * @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
698
+ * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
699
+ * @fires SortableTitlePlugin#preDataSorting
700
+ * @fires SortableTitlePlugin#columnSorted
701
+ */
702
+ SortableTitlePlugin.prototype.sortColumn = function (colIndex, sortOrder, opt_arg) {
703
+ if (colIndex >= 0) { // ColIndex can be greater than the host column count, to allow default sorting
704
+
705
+ var state = this._preSortColumn(colIndex, sortOrder);
706
+ if (state) {
707
+ this._sortColumn([state], opt_arg);
708
+ }
709
+ }
710
+ };
711
+
712
+ /** Sort multiple columns at once
713
+ * @public
714
+ * @param {Array.<SortableTitlePlugin.InitialSort>} sortOptions Input an array to specify the multiple column sort order
715
+ * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
716
+ * @fires SortableTitlePlugin#preDataSorting
717
+ * @fires SortableTitlePlugin#columnSorted
718
+ */
719
+ SortableTitlePlugin.prototype.sortColumns = function (sortOptions, opt_arg) {
720
+ if (Array.isArray(sortOptions)) {
721
+ var states = [];
722
+ for (var i = 0; i < sortOptions.length; i++) {
723
+ var opt = sortOptions[i];
724
+ var state = this._preSortColumn(opt["colIndex"], opt["sortOrder"] || opt["order"]);
725
+ if (state) {
726
+ states[i] = state;
727
+ }
728
+ }
729
+ this._sortColumn(states, opt_arg);
730
+ }
731
+ };
732
+ /** @description Clear all sorting states
733
+ * @public
734
+ * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
735
+ */
736
+ SortableTitlePlugin.prototype.clearSortState = function (opt_arg) {
737
+ this._popSortState(0, opt_arg);
738
+ this.updateSortSymbols();
739
+ };
740
+ /** @description Perform sorting with the same parameter.
741
+ * @public
742
+ * @fires SortableTitlePlugin#preDataSorting
743
+ */
744
+ SortableTitlePlugin.prototype.refresh = function () {
745
+ if (this._sortStates.length) {
746
+ this._sortDataView();
747
+ this.updateSortSymbols();
748
+ }
749
+ };
750
+
751
+ /** @description Perform sorting with the same parameter. Alias to {@link SortableTitlePlugin#refresh}
752
+ * @public
753
+ * @override
754
+ * @function
755
+ */
756
+ SortableTitlePlugin.prototype.restoreUserActions = SortableTitlePlugin.prototype.refresh;
757
+
758
+ /** @public
759
+ * @param {number} count
760
+ */
761
+ SortableTitlePlugin.prototype.setSortableColumnCount = function (count) {
762
+ this._maxCount = count ? count : 1;
763
+ this._popSortState(this._maxCount);
764
+ };
765
+
766
+ /** Deprecated. Use getSortedColumns instead of this
767
+ * @public
768
+ * @return {Array.<Object>} Array of sorted column states ordered by priority
769
+ * @see {@link SortableTitlePlugin#getSortedColumns}
770
+ */
771
+ SortableTitlePlugin.prototype.getSortingStates = function () {
772
+ return this._sortStates; // WARNING: Exposing internal variable
773
+ };
774
+
775
+ /** @public
776
+ */
777
+ SortableTitlePlugin.prototype.updateSortSymbols = function () {
778
+ if(!this._disabled) {
779
+ for (var i = this._hosts.length; --i >= 0;) {
780
+ this._updateSortableIndicator(i);
781
+ }
782
+ }
783
+ };
784
+
785
+ /** Get Array of fields used for sorting
786
+ * @public
787
+ * @return {!Array.<string>}
788
+ */
789
+ SortableTitlePlugin.prototype.getDataColumnMap = function () {
790
+ var host = this._hosts[0];
791
+ var dataMap = [];
792
+ if (host) {
793
+ var colCount = host.getColumnCount();
794
+ for (var i = 0; i < colCount; ++i) {
795
+ dataMap[i] = this.getColumnSortingField(i);
796
+ }
797
+ }
798
+ return dataMap;
799
+ };
800
+ SortableTitlePlugin.prototype.getDataColumnNames = SortableTitlePlugin.prototype.getDataColumnMap;
801
+
802
+ /** Set sorting field for multiple columns at once
803
+ * @public
804
+ * @param {Array.<string|null>} dataMap
805
+ */
806
+ SortableTitlePlugin.prototype.setDataColumnMap = function (dataMap) { // TODO: This should be deprecated
807
+ // This should work just like "sortBy"
808
+ if (Array.isArray(dataMap)) {
809
+ for (var i = dataMap.length; --i >= 0;) {
810
+ this.setColumnSortingField(i, dataMap[i]);
811
+ }
812
+ }
813
+ };
814
+ SortableTitlePlugin.prototype.setDataColumnNames = SortableTitlePlugin.prototype.setDataColumnMap;
815
+
816
+ /** @public
817
+ * @param {number} colIndex
818
+ * @return {string} field A field used for sorting
819
+ */
820
+ SortableTitlePlugin.prototype.getColumnSortingField = function (colIndex) {
821
+ var options = this._getSortOptions(colIndex);
822
+ // options["field"] is already consolidated from field, sortBy, and sortable properties.
823
+ var field = (options) ? options["field"] : null;
824
+
825
+ if (field == null && !this._rowDefMode) { // Old CompositeGrid may stored sorting field in DataColumnName
826
+ var host = this._hosts[0];
827
+ if (host) {
828
+ field = host.getDataColumnName(colIndex);
829
+ }
830
+ }
831
+
832
+ return field || "";
833
+ };
834
+ /** @public
835
+ * @param {number} colIndex
836
+ * @param {string|null} field A field used for sorting
837
+ * @param {Function=} sortLogic
838
+ */
839
+ SortableTitlePlugin.prototype.setColumnSortingField = function (colIndex, field, sortLogic) {
840
+ if (typeof colIndex == "number" && field != null) {
841
+ var options = this._newSortOptions(colIndex);
842
+ if (!field) {
843
+ field = "";
844
+ }
845
+ if (options["field"] !== field) {
846
+ options["field"] = field;
847
+ }
848
+ if(sortLogic != null && !this._userManagedLogic) {
849
+ if (options["sortLogic"] !== sortLogic) {
850
+ options["sortLogic"] = sortLogic || null;
851
+ }
852
+ }
853
+ }
854
+ };
855
+ /** @public
856
+ * @return {!Array.<string>} fields of each sorting states
857
+ */
858
+ SortableTitlePlugin.prototype.getColumnSortingFields = function () {
859
+ var ary = [];
860
+ var host = this._hosts[0];
861
+ var colCount = host ? host.getColumnCount() : 0;
862
+ for (var c = 0; c < colCount; ++c) {
863
+ var sortOptions = this._getSortOptions(c);
864
+ if (sortOptions && sortOptions["sortOrder"]) {
865
+ var priority = this._sortStates.indexOf(sortOptions);
866
+ if (priority >= 0) {
867
+ ary[priority] = this.getColumnSortingField(c);
868
+ }
869
+ }
870
+ }
871
+ return ary;
872
+ };
873
+
874
+ /** This is deprecated in favor of setSortingSequence method. Move existing sort order to the front of sorting sequence. New sort order will be added, if the specified sort order does not exist in current sorting sequence.
875
+ * @public
876
+ * @param {string|number|Array.<string|number>} colIdentifier string is data column name, while number is display column index. If null value is given, first sort order is set to grid level configuration
877
+ * @param {string=} sortOrder="a" "ascending", "descending", "none"
878
+ * @see {@link SortableTitlePlugin#setSortingSequence}
879
+ */
880
+
881
+ SortableTitlePlugin.prototype.setFirstSortOrder = function (colIdentifier, sortOrder) {
882
+ if (sortOrder) {
883
+ sortOrder = SortableTitlePlugin._toSortOrder(sortOrder);
884
+ } else {
885
+ sortOrder = "a";
886
+ }
887
+ if (sortOrder !== "a" && sortOrder !== "d") {
888
+ sortOrder = "a"; // There is no "none" as the first sorting order
889
+ }
890
+
891
+ var fields = null;
892
+ if (Array.isArray(colIdentifier)) {
893
+ fields = colIdentifier;
894
+ } else {
895
+ fields = [/** @type{string|number} */(colIdentifier)];
896
+ }
897
+
898
+ var len = fields.length;
899
+ for (var i = 0; i < len; ++i) {
900
+ var field = fields[i];
901
+ var sortingSeq = this.getSortingSequence(field).slice();
902
+ var index = sortingSeq.indexOf(sortOrder);
903
+ if (index >= 0) {
904
+ sortingSeq.splice(index, 1);
905
+ }
906
+ sortingSeq.unshift(sortOrder);
907
+ this.setSortingSequence(sortingSeq, field);
908
+
909
+ }
910
+ };
911
+
912
+ /** This is deprecated in favor of setSortingSequence method. If two-state sorting is disabled, "n" (original order) will be added to current sorting sequence. If two-state sorting is enabled, "n" will be removed from current sorting sequence.
913
+ * @public
914
+ * @param {boolean=} disabled
915
+ * @see {@link SortableTitlePlugin#setSortingSequence}
916
+ */
917
+ SortableTitlePlugin.prototype.disableTwoStateSorting = function (disabled) {
918
+ var at = this._sortingSequence.indexOf("n");
919
+ if(disabled === false) { // two-state sorting
920
+ if(at >= 0) {
921
+ this._sortingSequence.splice(at, 1);
922
+ }
923
+ } else { // three-state sorting
924
+ if(at < 0) {
925
+ this._sortingSequence.push("n");
926
+ }
927
+ }
928
+
929
+ };
930
+ /** @public
931
+ * @param {boolean=} disabled
932
+ */
933
+ SortableTitlePlugin.prototype.disableSortSymbols = function (disabled) {
934
+ // this._sortSymbols = disabled === false;
935
+ // TODO: Clear existing UIs at run-time
936
+ };
937
+ /** @public
938
+ * @param {boolean=} disabled
939
+ */
940
+ SortableTitlePlugin.prototype.disableDataSorting = function (disabled) {
941
+ this._dataSorting = disabled === false;
942
+ };
943
+ /** @public
944
+ * @description To allow double click action to sort. Default value is false.
945
+ * @param {boolean=} disabled
946
+ */
947
+ SortableTitlePlugin.prototype.disableDoubleClickToSort = function (disabled) {
948
+ this._isDisableDoubleClickToSort = !!disabled;
949
+ };
950
+ /** This api is deprecated. Use {@link SortableTitlePlugin.prototype.disableColumnSorting} instead
951
+ * @public
952
+ * @param {ElementWrapper} cell
953
+ * @param {boolean=} disabled
954
+ */
955
+ SortableTitlePlugin.prototype.disableCellClick = function (cell, disabled) {
956
+ if (cell) {
957
+ cell.enableClass("no-sort", disabled !== false);
958
+ }
959
+ };
960
+ /** @public
961
+ * @param {number|Array.<number>} columns
962
+ * @param {boolean=} disabled
963
+ */
964
+ SortableTitlePlugin.prototype.disableColumnSorting = function (columns, disabled) {
965
+ disabled = disabled !== false;
966
+ if (typeof columns === "number") {
967
+ this._disableColumnSorting(columns, disabled);
968
+ } else if (Array.isArray(columns)) {
969
+ var len = columns.length;
970
+ for (var i = 0; i < len; ++i) {
971
+ this._disableColumnSorting(columns[i] || 0, disabled);
972
+ }
973
+ }
974
+ };
975
+ /** @private
976
+ * @param {number} colIndex
977
+ * @param {boolean} disabled
978
+ */
979
+ SortableTitlePlugin.prototype._disableColumnSorting = function (colIndex, disabled) {
980
+ var sortOptions = this._newSortOptions(colIndex);
981
+ if (sortOptions["disabled"] !== disabled) {
982
+ sortOptions["disabled"] = disabled;
983
+ // TODO: Remove existing sort
984
+ }
985
+ };
986
+
987
+ /** @public
988
+ * @param {number=} opt_ms Delay before actual sorting in milliseconds. Setting undefined value will be 500ms. Setting 0 to instantly perform sorting
989
+ */
990
+ SortableTitlePlugin.prototype.setClickDelayInterval = function (opt_ms) {
991
+ this._delayInterval = (opt_ms != null) ? opt_ms : 500;
992
+ };
993
+
994
+ /** @private
995
+ * @description Pre-process columns options to support both composite and rt-grid backward compatible
996
+ * @param {number} colIndex
997
+ * @param {Object} options
998
+ * @returns {Object}
999
+ */
1000
+ SortableTitlePlugin.prototype._prepareColumnOptions = function (colIndex, options) {
1001
+ var t = this;
1002
+ var column = options || {};
1003
+ var colOption = {
1004
+ "colIndex": colIndex,
1005
+ "field": column["field"],
1006
+ "sortable": !!t._sortableColumns
1007
+ };
1008
+
1009
+ if (column["sortBy"] != null) { // composite grid option
1010
+ colOption["sortable"] = !!column["sortBy"];
1011
+ colOption["sortBy"] = column["sortBy"];
1012
+ }
1013
+ if (column["sortable"] != null) { // rt grid option
1014
+ colOption["sortable"] = !!column["sortable"];
1015
+ }
1016
+
1017
+ colOption["sortLogic"] = column["sortLogic"] || column["sortingLogic"] || column["sorter"]; // Originally, rt grid support option for sortLogic by column
1018
+ colOption["sort"] = column["defaultSort"] || column["sort"]; // composite and rt grid option for default sort order
1019
+ return colOption;
1020
+ };
1021
+
1022
+ /** @private
1023
+ * @description Get initial sort from column option `defaultSort` or `sort`
1024
+ * @param {Object} options Core model object
1025
+ * @returns {Object}
1026
+ */
1027
+ SortableTitlePlugin.prototype._initialSortByColumnField = function (options) {
1028
+ var t = this;
1029
+ var columns = options["columns"] || [];
1030
+ var initialSort = null;
1031
+ for (var i = 0; i < columns.length; i++) {
1032
+ var col = t._prepareColumnOptions(i, columns[i]);
1033
+ var val = col["sort"];
1034
+ if (val) {
1035
+ initialSort = {
1036
+ "colIndex": col["colIndex"],
1037
+ "sortOrder": val
1038
+ };
1039
+ }
1040
+ }
1041
+ return initialSort;
1042
+ };
1043
+
1044
+ /** @private
1045
+ * @param {Object} e
1046
+ */
1047
+ SortableTitlePlugin.prototype._onSectionAdded = function (e) {
1048
+ if (e["sectionType"] !== "title") { return; }
1049
+
1050
+ var section = /** @type{ILayoutGrid} */(e["section"]);
1051
+ if (section.getIndex() !== 0) return; // only topmost header can click
1052
+ section.listen("mousedown", this._onMouseDown);
1053
+ section.listen("click", this._onClickTitle.bind(this, e["sender"]), 0); // Sorting has higher priority
1054
+ };
1055
+
1056
+ /** @private
1057
+ * @param {Object} e
1058
+ */
1059
+ SortableTitlePlugin.prototype._onUIUpdated = function (e) {
1060
+ if (e["sectionType"] === "title") {
1061
+ this.updateSortSymbols();
1062
+ }
1063
+ };
1064
+
1065
+ /** @private
1066
+ * @param {Object} hitObj
1067
+ * @return {boolean}
1068
+ * @fires SortableTitlePlugin#preClicked
1069
+ */
1070
+ SortableTitlePlugin.prototype._canClickToSort = function (hitObj) {
1071
+ if(this._disabled) {
1072
+ return false;
1073
+ }
1074
+
1075
+ var grid = hitObj["grid"];
1076
+ if (!grid || !grid.getElement()) { // The given grid has been disposed
1077
+ return false;
1078
+ }
1079
+
1080
+ var cep = this._getPlugin("CellEditingPlugin");
1081
+ if (cep && cep["isEditing"]()) { // Current cell is being edited, so skip the sort
1082
+ return false;
1083
+ }
1084
+
1085
+ this._dispatch("preClicked", hitObj);
1086
+ if (hitObj["cancel"]) { // User want to cancel the operation
1087
+ return false;
1088
+ }
1089
+
1090
+ var colIndex = hitObj["colIndex"];
1091
+ var section = hitObj["section"];
1092
+ var rowIndex = hitObj["rowIndex"];
1093
+
1094
+ if (!this._isCellSortable(section, colIndex, rowIndex)) {
1095
+ return false;
1096
+ }
1097
+
1098
+ return true;
1099
+ };
1100
+
1101
+ /** @private
1102
+ * @param {Object} hitObj
1103
+ * @fires SortableTitlePlugin#preDataSorting
1104
+ * @fires SortableTitlePlugin#columnSorted
1105
+ * @fires SortableTitlePlugin#clicked
1106
+ */
1107
+ SortableTitlePlugin.prototype._proceedSorting = function (hitObj) {
1108
+ this._clickTimer = 0;
1109
+
1110
+ if (this._canClickToSort(hitObj)) {
1111
+ var colIndex = hitObj["colIndex"];
1112
+ // _proceedSorting() method is always produced by user clicking at the header // Thus, this operation is guaranteed to be a user action
1113
+ var state = this._preSortColumn(colIndex);
1114
+ if (state) {
1115
+ this._sortColumn([state], { "isUserAction": true });
1116
+ }
1117
+
1118
+ if (this._hasListener("clicked")) {
1119
+ var ce = {};
1120
+ ce["colIndex"] = colIndex;
1121
+ ce["sortOrder"] = this.getSortOrder(colIndex);
1122
+ ce["dataColumnName"] = this.getColumnSortingField(colIndex);
1123
+ this._dispatch("clicked", ce);
1124
+ }
1125
+ }
1126
+ };
1127
+
1128
+ /** @private
1129
+ * @param {MouseEvent} e
1130
+ */
1131
+ SortableTitlePlugin.prototype._onMouseDown = function (e) {
1132
+ if (!e.button) { // left mouse only
1133
+ this._lastMouseDown = e.timeStamp;
1134
+ }
1135
+ };
1136
+ /** @private
1137
+ * @param {Core} grid
1138
+ * @param {MouseEvent} e
1139
+ */
1140
+ SortableTitlePlugin.prototype._onClickTitle = function (grid, e) {
1141
+ if(this._disabled) {
1142
+ return;
1143
+ }
1144
+ if (e.detail === 2 && this._isDisableDoubleClickToSort) { // dblclick
1145
+ if (this._clickTimer) {
1146
+ clearTimeout(this._clickTimer);
1147
+ this._clickTimer = 0;
1148
+ }
1149
+ return; // This is registered as double click in modern browser so we ignored the click
1150
+ } else if (e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) { // If any modifier key is pressed, ignored the click
1151
+ return;
1152
+ }
1153
+
1154
+ // Avoid click by dragging
1155
+ if (!(e.timeStamp - this._lastMouseDown < 500)) {
1156
+ return;
1157
+ }
1158
+
1159
+ var hitObj = grid.getRelativePosition(e);
1160
+ if (!hitObj["hit"]) { // Click across multiple elements (dragging)
1161
+ return;
1162
+ }
1163
+
1164
+ var csp = this._getPlugin("ColumnSelectionPlugin");
1165
+ if (csp && csp["isEnabled"]()) {
1166
+ var colIndex = hitObj["colIndex"];
1167
+ if (!csp["isSelectedColumn"](colIndex)) { // Sort only if the column is selected
1168
+ return;
1169
+ }
1170
+ }
1171
+ hitObj["target"] = e["target"];
1172
+
1173
+ if (this._delayInterval > 0) {
1174
+ if (!this._clickTimer) {
1175
+ this._clickTimer = setTimeout(
1176
+ this._proceedSorting.bind(this, hitObj),
1177
+ this._delayInterval
1178
+ );
1179
+ }
1180
+ } else {
1181
+ this._proceedSorting(hitObj);
1182
+ }
1183
+ };
1184
+
1185
+ /** @private
1186
+ * @param {number} toIndex INCLUSIVE
1187
+ * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
1188
+ * @return {boolean}
1189
+ * @fires SortableTitlePlugin#preDataSorting
1190
+ */
1191
+ SortableTitlePlugin.prototype._popSortState = function (toIndex, opt_arg) {
1192
+ if (toIndex < 0 || this._sortStates.length <= toIndex) { return false; }
1193
+
1194
+ var dirty = false;
1195
+ for (var i = this._sortStates.length; --i >= toIndex;) {
1196
+ this._clearSortSymbols(this._sortStates[i]);
1197
+ dirty = true;
1198
+ }
1199
+ this._sortStates.length = toIndex;
1200
+ this._sortDataView(opt_arg);
1201
+ return dirty;
1202
+ };
1203
+
1204
+ /** @private
1205
+ * @param {string=} order "ascending", "descending", "none"
1206
+ * @return {string}
1207
+ */
1208
+ SortableTitlePlugin._toSortOrder = function(order) {
1209
+ if (order && typeof order === "string") {
1210
+ order = order.charAt(0).toLowerCase();
1211
+ if (order === "d" || order === "a") {
1212
+ return order;
1213
+ }
1214
+ }
1215
+ return "n";
1216
+ };
1217
+
1218
+ /** Returns current sorting sequence for either a grid (all columns), or a single column.
1219
+ * @public
1220
+ * @param {(number|string)=} colRef Column index or column field. If no value is given or no field is found, grid level sorting sequence is returned
1221
+ * @return {!Array.<string>}
1222
+ */
1223
+ SortableTitlePlugin.prototype.getSortingSequence = function (colRef) {
1224
+ if (this._sortingSequenceMap && (colRef || colRef === 0)) {
1225
+ if(typeof colRef !== "string") {
1226
+ colRef = this.getColumnSortingField(/** @type{number} */(colRef));
1227
+ }
1228
+ if(this._sortingSequenceMap[colRef]) {
1229
+ return /** @type{!Array.<string>} */(this._sortingSequenceMap[colRef]);
1230
+ }
1231
+ }
1232
+ return this._sortingSequence;
1233
+ };
1234
+ /** Specify sorting sequence for either a grid (all columns), or a single column.
1235
+ * @public
1236
+ * @param {Array.<string>} sequence Collection of sorting direction. If null value or empty Array is given, sorting sequence will be reverted to default.
1237
+ * @param {(number|string)=} colRef Column index or column field. If no value is given, sorting sequence will be set to grid level configuration.
1238
+ * @example
1239
+ * stPlugin.setSortingSequence(["d", "a", "n"]); // Set three-state sorting and start with "d"
1240
+ * stPlugin.setSortingSequence(["a"]); // Force to sort with ascending order only and cannot change to other order
1241
+ * stPlugin.setSortingSequence(["d", "a"], "field"); // The specified column will have different sorting sequence
1242
+ */
1243
+ SortableTitlePlugin.prototype.setSortingSequence = function (sequence, colRef) {
1244
+ if (Array.isArray(sequence)) {
1245
+ if(!sequence.length) {
1246
+ sequence = null; // Empty array is treated as null value
1247
+ }
1248
+ } else if(sequence) { // true, 1, "string", and other datatypes are not allowed
1249
+ return;
1250
+ }
1251
+
1252
+ var field;
1253
+ if (colRef != null) {
1254
+ if (typeof colRef === "string") {
1255
+ field = colRef;
1256
+ } else if (typeof colRef === "number") {
1257
+ field = this.getColumnSortingField(colRef);
1258
+ }
1259
+ }
1260
+
1261
+ if (sequence) {
1262
+ // Ensure that user sequence has only valid sort order
1263
+ var sortingSequence = sequence.map(SortableTitlePlugin._toSortOrder);
1264
+ if (field) {
1265
+ if (!this._sortingSequenceMap) {
1266
+ this._sortingSequenceMap = {};
1267
+ }
1268
+
1269
+ this._sortingSequenceMap[field] = sortingSequence;
1270
+ } else {
1271
+ this._sortingSequence = sortingSequence;
1272
+ }
1273
+ } else { // No sequence is specified, revert existing sequence to default
1274
+ if(field) {
1275
+ if (this._sortingSequenceMap) {
1276
+ delete this._sortingSequenceMap[field];
1277
+ }
1278
+ } else { // Reset current sorting sequence to default
1279
+ this._sortingSequence = this._sortingSequence.length > 2 ? ["a", "d", "n"] : ["a", "d"];
1280
+ }
1281
+ }
1282
+ };
1283
+ /** @public
1284
+ */
1285
+ SortableTitlePlugin.prototype.clearAllColumnSortingSequences = function () {
1286
+ this._sortingSequenceMap = null;
1287
+ };
1288
+
1289
+
1290
+ /** @private
1291
+ * @param {number} colIndex
1292
+ * @param {string=} sortOrder "a" for ascending, "d" for descending, and "n" for no sorting
1293
+ * @returns {Object} state Returns null, if nothing is changed
1294
+ */
1295
+ SortableTitlePlugin.prototype._preSortColumn = function (colIndex, sortOrder) {
1296
+ if (!this._maxCount) { return null; }
1297
+
1298
+ var priority = this.getSortPriority(colIndex);
1299
+ var curState = (priority >= 0) ? this._sortStates[priority] : null;
1300
+
1301
+ var curOrder = curState ? curState["sortOrder"] : "n";
1302
+
1303
+ // Getting next sort order
1304
+ var nextOrder = "n";
1305
+ var sortingField = this.getColumnSortingField(colIndex);
1306
+ if (sortOrder == null) { // Auto order switch
1307
+ var sortingSequence = this.getSortingSequence(sortingField);
1308
+
1309
+ var sequenceIndex = sortingSequence.indexOf(curOrder);
1310
+ if (sequenceIndex < 0) {
1311
+ sequenceIndex = 0;
1312
+ } else {
1313
+ sequenceIndex = (sequenceIndex + 1) % sortingSequence.length;
1314
+ }
1315
+ nextOrder = sortingSequence[sequenceIndex];
1316
+ } else {
1317
+ nextOrder = SortableTitlePlugin._toSortOrder(sortOrder);
1318
+ }
1319
+
1320
+ if (curState) { // Remove existing state to rearrange priority later
1321
+ if (curOrder === nextOrder) {
1322
+ this.updateSortSymbols(); // Update Display
1323
+ return null; // Nothing has changed
1324
+ }
1325
+
1326
+ this._sortStates.splice(priority, 1); // Remove sort states
1327
+ this._clearSortSymbols(curState); // Clear any previous symbols
1328
+ // TODO: Other states in curState should be cleared as it is actually a sortOptions object
1329
+ }
1330
+
1331
+ if (nextOrder === "a" || nextOrder === "d") { // Reorder sort states
1332
+ if (!curState) {
1333
+ // TODO: Sort state object should not be sortOptions
1334
+ curState = this._newSortOptions(colIndex); // This may come with sortLogic
1335
+ }
1336
+
1337
+ this._sortStates.push(curState); // Latest sorting have lowest priority (multiColumn sorting)
1338
+ }
1339
+
1340
+ if (curState) { // Update current state
1341
+ if(curOrder !== "n") {
1342
+ curState["prevOrder"] = curOrder; // For backward compatibility
1343
+ } else {
1344
+ delete curState["prevOrder"];
1345
+ }
1346
+ curState["order"] = nextOrder; // For backward compatibility
1347
+ curState["sortOrder"] = nextOrder;
1348
+ }
1349
+
1350
+ var clearedSortColIndexes = [];
1351
+ if (this._maxCount > 0) {
1352
+ while (this._sortStates.length > this._maxCount) { // Shift excess
1353
+ var index = this._clearSortSymbols(this._sortStates.shift());
1354
+ if (index !== null) {
1355
+ clearedSortColIndexes.push(index);
1356
+ }
1357
+ }
1358
+ }
1359
+
1360
+ return { // TODO: Refactor this code as it is only used by "columnSorted" event (unnecessarily complex).
1361
+ "colIndex": colIndex,
1362
+ "sortedField": sortingField,
1363
+ "sortOrder": nextOrder || "n",
1364
+ "prevOrder": curOrder,
1365
+ "clearedSortColIndexes": clearedSortColIndexes
1366
+ };
1367
+ };
1368
+
1369
+ /** @private
1370
+ * @param {Array.<Object>} states States from _preSortColumn for dispatching columnSorted event.
1371
+ * @param {Object=} opt_arg Event argument to be sent with preDataSorting event
1372
+ * @fires SortableTitlePlugin#preDataSorting
1373
+ * @fires SortableTitlePlugin#columnSorted
1374
+ */
1375
+ SortableTitlePlugin.prototype._sortColumn = function (states, opt_arg) {
1376
+ this._sortDataView(opt_arg); // Update Data
1377
+ this.updateSortSymbols(); // Update Display
1378
+
1379
+ var res = states[0] || {};
1380
+ var len = states.length;
1381
+ if (len > 1) {
1382
+ res["colIndices"] = new Array(len);
1383
+ res["sortedFields"] = new Array(len);
1384
+ res["sortOrders"] = new Array(len);
1385
+ res["prevOrders"] = new Array(len);
1386
+ for (var i = 0; i < len; i++) {
1387
+ var obj = states[i];
1388
+ res["colIndices"][i] = obj["colIndex"];
1389
+ res["sortedFields"][i] = obj["sortedField"];
1390
+ res["sortOrders"][i] = obj["sortOrder"];
1391
+ res["prevOrders"][i] = obj["prevOrder"];
1392
+ }
1393
+ }
1394
+ this._dispatch("columnSorted", res);
1395
+ };
1396
+
1397
+ /** @override
1398
+ * @ignore
1399
+ */
1400
+ SortableTitlePlugin.prototype._onColumnAdded = function (e) {
1401
+ var t = this;
1402
+ var colIndex = e["colIndex"];
1403
+ var context = e["context"];
1404
+ var col = t._prepareColumnOptions(colIndex, context);
1405
+ var field = col["sortBy"] || col["field"];
1406
+ var logic = col["sortLogic"] || t._sortLogic[field];
1407
+
1408
+ var sortingSequence = context ? context["sortingSequence"] : null;
1409
+ if (sortingSequence != null && field) { // Make sure that column config does not affect grid level config
1410
+ t.setSortingSequence(sortingSequence, field);
1411
+ }
1412
+
1413
+ if (col["sortable"]) {
1414
+ t.setColumnSortingField(colIndex, field, typeof logic === "function" ? logic : null);
1415
+ } else {
1416
+ t.disableColumnSorting(colIndex, true);
1417
+ }
1418
+ };
1419
+
1420
+ /** @override
1421
+ * @ignore
1422
+ * @fires SortableTitlePlugin#preDataSorting
1423
+ * @fires SortableTitlePlugin#columnSorted
1424
+ */
1425
+ SortableTitlePlugin.prototype._onColumnRemoved = function (e) {
1426
+ if (!e["atTheMiddle"]) { return; }
1427
+
1428
+ var sortCount = this._sortStates.length;
1429
+ if (!sortCount) {
1430
+ return;
1431
+ }
1432
+ var colData = e["columnData"];
1433
+ var sortOptions = colData ? colData["sortableTitle"] : null;
1434
+ var sortOrder = sortOptions ? sortOptions["sortOrder"] : "";
1435
+
1436
+ // TODO: columnRemoved event could be fired repeatedly and triggers multiple sorts
1437
+ if (sortOrder) {
1438
+ var priority = this._sortStates.indexOf(sortOptions);
1439
+ if (priority >= 0) {
1440
+ this._sortStates.splice(priority, 1);
1441
+ }
1442
+ this._clearSortSymbols(sortOptions);
1443
+ this._sortDataView();
1444
+ }
1445
+ };
1446
+
1447
+ /** @private
1448
+ * @param {Object=} sortState
1449
+ * @return {string}
1450
+ */
1451
+ SortableTitlePlugin._toRowDefField = function(sortState) {
1452
+ return "ROW_DEF";
1453
+ };
1454
+ /** @private
1455
+ * @param {Object=} opt_action Action that raised the sort. This is optional
1456
+ * @fires SortableTitlePlugin#preDataSorting
1457
+ */
1458
+ SortableTitlePlugin.prototype._sortDataView = function (opt_action) {
1459
+ opt_action = opt_action || {};
1460
+ this._dispatch("preDataSorting", opt_action);
1461
+
1462
+ if (!this._dataSorting) { return; }
1463
+
1464
+ var sortCount = this._sortStates.length;
1465
+ var orders = null;
1466
+ var sortLogics = null;
1467
+ var c_ref = null;
1468
+ if (sortCount) {
1469
+ orders = new Array(sortCount);
1470
+ sortLogics = new Array(sortCount);
1471
+ for (var i = 0; i < sortCount; ++i) {
1472
+ orders[i] = this._sortStates[i]["sortOrder"];
1473
+ sortLogics[i] = this._sortStates[i]["sortLogic"];
1474
+ }
1475
+ if(this._rowDefMode) { // DataView in real-time grid has only ROW_DEF column
1476
+ c_ref = this._sortStates.map(SortableTitlePlugin._toRowDefField);
1477
+ } else {
1478
+ c_ref = this.getColumnSortingFields();
1479
+ }
1480
+ }
1481
+
1482
+ // Perform sorting even if there is no sort state
1483
+ for (var j = this._hosts.length; --j >= 0;) {
1484
+ var host = this._hosts[j];
1485
+ // TODO: In wrap mode all hosts does not need to be sorted
1486
+ var dataSource = host.getDataSource();
1487
+ if (dataSource) {
1488
+ var noOptimization = opt_action["isUserAction"] == true;
1489
+ dataSource.sort(c_ref, orders, sortLogics, noOptimization); // If length === 0 data is not sorted
1490
+ }
1491
+ }
1492
+ };
1493
+ /**`section` and `cell` variable in this scope can either be instance of LayoutGrid or SectionWriter (from tr-grid-printer).
1494
+ * Need to force calling public methods (section["isColumnActive"] and section["getCell"]) so it works while being minified.
1495
+ * @private
1496
+ * @param {Object} state
1497
+ * @return {number|null} The column index of cleared sort
1498
+ */
1499
+ SortableTitlePlugin.prototype._clearSortSymbols = function (state) {
1500
+ var cells = state["targetCells"];
1501
+ if (!cells) {
1502
+ return null;
1503
+ }
1504
+ var colIndex = null;
1505
+ for (var j = cells.length; --j >= 0;) { // One single cell per host
1506
+ var cell = cells[j];
1507
+ cell["removeClass"]("sorting");
1508
+ cell["removeClass"]("sortable");
1509
+ cell["removeFloatingIcon"]("sort-symbol");
1510
+ cell["removeFloatingIcon"]("priority-symbol");
1511
+ var section;
1512
+ if(colIndex == null && (section = cell["getSection"]())) {
1513
+ colIndex = section["getColumnIndex"](cell["getParent"]());
1514
+ }
1515
+ }
1516
+ cells.length = 0;
1517
+ return colIndex;
1518
+ };
1519
+ /**`section` and `cell` variable in this scope can either be instance of LayoutGrid or SectionWriter (from tr-grid-printer).
1520
+ * Need to force calling public methods (section["getColumnCount"] and section["getCell"]) so it works while being minified.
1521
+ * @private
1522
+ * @param {number} hostIndex
1523
+ */
1524
+ SortableTitlePlugin.prototype._updateSortableIndicator = function (hostIndex) {
1525
+ var t = this;
1526
+ var host = t._hosts[hostIndex];
1527
+ if (!host) { return; }
1528
+
1529
+ var section = host.getSection("title");
1530
+ if (section == null) { return; }
1531
+ var sectionCount = section["getColumnCount"]();
1532
+ for (var col = sectionCount; --col >= 0;) {
1533
+
1534
+ var rowCount = section["getRowCount"]();
1535
+ for (var r = 0; r < rowCount; r++) {
1536
+
1537
+ var cell = section["getCell"](col, r, true);
1538
+ if (!cell) { continue; }
1539
+
1540
+ // Clear all sorting icons
1541
+ cell["removeClass"]("sorting");
1542
+ cell["removeClass"]("sortable");
1543
+ cell["removeClass"]("asc");
1544
+ cell["removeClass"]("desc");
1545
+ cell["removeClass"]("edge-indicator");
1546
+ cell["removeFloatingIcon"]("sort-symbol");
1547
+ cell["removeFloatingIcon"]("priority-symbol");
1548
+ cell["removeFloatingIcon"]("sortable-indicator");
1549
+
1550
+ if (r !== rowCount - 1) { continue; } // Sort icon should only appear in last row of section otherwise skip
1551
+ if (!t._isCellSortable(section, col, r)) { continue; }
1552
+
1553
+ cell["addClass"]("sortable");
1554
+
1555
+ var priority = t._getColumnSortingStatePriority(col);
1556
+ var state = t._sortStates[priority];
1557
+
1558
+ var isSorting = state && state["sortOrder"] !== "n";
1559
+ var symbol, icon;
1560
+ if (isSorting) {
1561
+ if (!state["targetCells"]) {
1562
+ state["targetCells"] = [];
1563
+ }
1564
+
1565
+ state["targetCells"][hostIndex] = cell; // NOTE: This can be improved.
1566
+
1567
+ if (state["sortOrder"] === "a") {
1568
+ cell["addClass"]("asc");
1569
+ } else {
1570
+ cell["addClass"]("desc");
1571
+ }
1572
+ cell["addClass"]("sorting");
1573
+
1574
+ if(t._solarTheme) { // Insert icon when use solar theme
1575
+ var textContent;
1576
+
1577
+ if (state["sortOrder"] === "a") {
1578
+ textContent = CODE_UP;
1579
+ icon = SortableTitlePlugin._icons["ascending"];
1580
+ } else {
1581
+ textContent = CODE_DOWN;
1582
+ icon = SortableTitlePlugin._icons["descending"];
1583
+ }
1584
+
1585
+ symbol = t._createIconElem(icon, textContent);
1586
+ symbol.className = "sort-symbol";
1587
+ cell["insertFloatingIcon"](symbol, 0);
1588
+
1589
+ if (t._sortStates.length > 1) {
1590
+ symbol = document.createElement("span");
1591
+ symbol.className = "priority-symbol";
1592
+ symbol.textContent = priority + 1;
1593
+ cell["insertFloatingIcon"](symbol, 1);
1594
+ }
1595
+ } else {
1596
+ cell["addClass"]("edge-indicator");
1597
+ }
1598
+ } else if (t._sortableIndicator) { // Can sort but currently not sorting
1599
+ icon = SortableTitlePlugin._icons["sortable"];
1600
+ symbol = t._createIconElem(icon, CODE_DIAMOND);
1601
+ symbol.className = "sortable-indicator";
1602
+ cell["insertFloatingIcon"](symbol, 0);
1603
+ }
1604
+ }
1605
+ }
1606
+ };
1607
+
1608
+ /** @private
1609
+ * @param {string} icon - valid elf icon name
1610
+ * @param {string} fallback - a fallback in case icon in not defined
1611
+ * @return {Element}
1612
+ */
1613
+ SortableTitlePlugin.prototype._createIconElem = function (icon, fallback) {
1614
+ var elem;
1615
+ if (!icon || typeof icon !== "string") {
1616
+ elem = document.createElement("span");
1617
+ elem.textContent = fallback;
1618
+ } else {
1619
+ elem = document.createElement("ef-icon");
1620
+ elem.setAttribute("icon", icon);
1621
+ }
1622
+ return elem;
1623
+ };
1624
+
1625
+ /** @private
1626
+ * @param {number} colIndex
1627
+ * @return {number} -1 means not found
1628
+ */
1629
+ SortableTitlePlugin.prototype._getColumnSortingStatePriority = function (colIndex) {
1630
+ var t = this;
1631
+ for (var i = t._sortStates.length; --i >= 0;) {
1632
+ var col = t.getSortedColumnIndex(i);
1633
+ if (col === colIndex) return i;
1634
+ }
1635
+ return -1;
1636
+ };
1637
+
1638
+ /** @private
1639
+ * @param {number} colIndex
1640
+ * @return {Object}
1641
+ */
1642
+ SortableTitlePlugin.prototype._getSortOptions = function (colIndex) {
1643
+ var host = this._hosts[0];
1644
+ if (host) {
1645
+ var colData = host.getColumnData(colIndex);
1646
+ if (colData) {
1647
+ return colData["sortableTitle"];
1648
+ }
1649
+ }
1650
+ return null;
1651
+ };
1652
+ /** @private
1653
+ * @param {number} colIndex
1654
+ * @return {!Object}
1655
+ */
1656
+ SortableTitlePlugin.prototype._newSortOptions = function (colIndex) {
1657
+ var host = this._hosts[0];
1658
+ var sortOptions = null;
1659
+ if (host && colIndex >= 0) {
1660
+ var colData = host.getColumnData(colIndex);
1661
+ if (!colData) {
1662
+ colData = host.setColumnData(colIndex, {});
1663
+ }
1664
+ sortOptions = colData["sortableTitle"];
1665
+ if (!sortOptions) {
1666
+ sortOptions = colData["sortableTitle"] = {};
1667
+ }
1668
+ }
1669
+ return sortOptions || {};
1670
+ };
1671
+ /** @private
1672
+ * @param {ILayoutGrid} section
1673
+ * @param {number} colIndex
1674
+ * @param {number} rowIndex
1675
+ * @return {boolean}
1676
+ */
1677
+ SortableTitlePlugin.prototype._isCellSortable = function (section, colIndex, rowIndex) {
1678
+ var options = this._getSortOptions(colIndex);
1679
+ if (options) {
1680
+ if (options["disabled"]) {
1681
+ return false;
1682
+ }
1683
+
1684
+ var field = options["field"];
1685
+ if (field != null) {
1686
+ if (!field) {
1687
+ return false;
1688
+ }
1689
+ }
1690
+ }
1691
+
1692
+ var targetCell = section["getCell"](colIndex, rowIndex, true);
1693
+ if (targetCell.hasClass("no-sort")) {
1694
+ return false; // The cell is not allowed for sorting
1695
+ }
1696
+ var bottomCell = section["getCell"](colIndex, section["getRowCount"]() - 1, true);
1697
+ if (targetCell !== bottomCell) {
1698
+ return false;
1699
+ }
1700
+
1701
+ return true; // By default all cells are sortable
1702
+ };
1703
+
1704
+ SortableTitlePlugin._proto = SortableTitlePlugin.prototype;
1705
+
1706
+ export default SortableTitlePlugin;
1707
+ export { SortableTitlePlugin };