@refinitiv-ui/efx-grid 0.0.0-dev.12023565035.1

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 (864) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +61 -0
  3. package/lib/column-dragging/es6/ColumnDragging.d.ts +51 -0
  4. package/lib/column-dragging/es6/ColumnDragging.js +968 -0
  5. package/lib/column-dragging/es6/index.d.ts +1 -0
  6. package/lib/column-dragging/es6/index.js +1 -0
  7. package/lib/column-format-dialog/index.d.ts +2 -0
  8. package/lib/column-format-dialog/index.js +2 -0
  9. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +77 -0
  10. package/lib/column-format-dialog/lib/column-format-dialog.js +2688 -0
  11. package/lib/column-format-dialog/lib/locale/translation-de.d.ts +7 -0
  12. package/lib/column-format-dialog/lib/locale/translation-de.js +94 -0
  13. package/lib/column-format-dialog/lib/locale/translation-en.d.ts +7 -0
  14. package/lib/column-format-dialog/lib/locale/translation-en.js +94 -0
  15. package/lib/column-format-dialog/lib/locale/translation-ja.d.ts +7 -0
  16. package/lib/column-format-dialog/lib/locale/translation-ja.js +94 -0
  17. package/lib/column-format-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  18. package/lib/column-format-dialog/lib/locale/translation-zh-hant.js +94 -0
  19. package/lib/column-format-dialog/lib/locale/translation-zh.d.ts +7 -0
  20. package/lib/column-format-dialog/lib/locale/translation-zh.js +94 -0
  21. package/lib/column-format-dialog/lib/locale/translation.d.ts +11 -0
  22. package/lib/column-format-dialog/lib/locale/translation.js +18 -0
  23. package/lib/column-format-dialog/lib/preview-table.d.ts +151 -0
  24. package/lib/column-format-dialog/lib/preview-table.js +982 -0
  25. package/lib/column-format-dialog/themes/base.less +429 -0
  26. package/lib/column-format-dialog/themes/elemental/column-format-dialog.less +1 -0
  27. package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +4 -0
  28. package/lib/column-format-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  29. package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
  30. package/lib/column-format-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
  31. package/lib/column-format-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
  32. package/lib/column-format-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  33. package/lib/column-format-dialog/themes/elemental/dark.js +16 -0
  34. package/lib/column-format-dialog/themes/elemental/defaults.less +1 -0
  35. package/lib/column-format-dialog/themes/elemental/index.less +5 -0
  36. package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +4 -0
  37. package/lib/column-format-dialog/themes/elemental/light/css/native-elements.css +0 -0
  38. package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +2 -0
  39. package/lib/column-format-dialog/themes/elemental/light/imports/all-elements.js +1 -0
  40. package/lib/column-format-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
  41. package/lib/column-format-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  42. package/lib/column-format-dialog/themes/elemental/light.js +16 -0
  43. package/lib/column-format-dialog/themes/halo/column-format-dialog.less +6 -0
  44. package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +4 -0
  45. package/lib/column-format-dialog/themes/halo/dark/css/native-elements.css +0 -0
  46. package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +2 -0
  47. package/lib/column-format-dialog/themes/halo/dark/imports/all-elements.js +1 -0
  48. package/lib/column-format-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
  49. package/lib/column-format-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  50. package/lib/column-format-dialog/themes/halo/dark.js +16 -0
  51. package/lib/column-format-dialog/themes/halo/defaults.less +1 -0
  52. package/lib/column-format-dialog/themes/halo/index.less +5 -0
  53. package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +4 -0
  54. package/lib/column-format-dialog/themes/halo/light/css/native-elements.css +0 -0
  55. package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +2 -0
  56. package/lib/column-format-dialog/themes/halo/light/imports/all-elements.js +1 -0
  57. package/lib/column-format-dialog/themes/halo/light/imports/custom-elements.js +1 -0
  58. package/lib/column-format-dialog/themes/halo/light/imports/native-elements.js +0 -0
  59. package/lib/column-format-dialog/themes/halo/light.js +16 -0
  60. package/lib/column-format-dialog/themes/luna/column-format-dialog.less +1 -0
  61. package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +4 -0
  62. package/lib/column-format-dialog/themes/luna/default/css/native-elements.css +0 -0
  63. package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +2 -0
  64. package/lib/column-format-dialog/themes/luna/default/imports/all-elements.js +1 -0
  65. package/lib/column-format-dialog/themes/luna/default/imports/custom-elements.js +1 -0
  66. package/lib/column-format-dialog/themes/luna/default/imports/native-elements.js +0 -0
  67. package/lib/column-format-dialog/themes/luna/defaults.less +1 -0
  68. package/lib/column-format-dialog/themes/luna/index.less +5 -0
  69. package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +4 -0
  70. package/lib/column-format-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  71. package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
  72. package/lib/column-format-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
  73. package/lib/column-format-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
  74. package/lib/column-format-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  75. package/lib/column-format-dialog/themes/solar/charcoal.js +16 -0
  76. package/lib/column-format-dialog/themes/solar/column-format-dialog.less +6 -0
  77. package/lib/column-format-dialog/themes/solar/defaults.less +1 -0
  78. package/lib/column-format-dialog/themes/solar/index.less +5 -0
  79. package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +4 -0
  80. package/lib/column-format-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  81. package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
  82. package/lib/column-format-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
  83. package/lib/column-format-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
  84. package/lib/column-format-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  85. package/lib/column-format-dialog/themes/solar/pearl.js +16 -0
  86. package/lib/column-selection-dialog/index.d.ts +2 -0
  87. package/lib/column-selection-dialog/index.js +2 -0
  88. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +66 -0
  89. package/lib/column-selection-dialog/lib/column-selection-dialog.js +2034 -0
  90. package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
  91. package/lib/column-selection-dialog/lib/locale/translation-de.js +20 -0
  92. package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
  93. package/lib/column-selection-dialog/lib/locale/translation-en.js +20 -0
  94. package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
  95. package/lib/column-selection-dialog/lib/locale/translation-ja.js +20 -0
  96. package/lib/column-selection-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  97. package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +20 -0
  98. package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
  99. package/lib/column-selection-dialog/lib/locale/translation-zh.js +20 -0
  100. package/lib/column-selection-dialog/lib/locale/translation.d.ts +11 -0
  101. package/lib/column-selection-dialog/lib/locale/translation.js +18 -0
  102. package/lib/column-selection-dialog/themes/base.less +258 -0
  103. package/lib/column-selection-dialog/themes/elemental/column-selection-dialog.less +1 -0
  104. package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +4 -0
  105. package/lib/column-selection-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  106. package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
  107. package/lib/column-selection-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
  108. package/lib/column-selection-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
  109. package/lib/column-selection-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  110. package/lib/column-selection-dialog/themes/elemental/dark.js +8 -0
  111. package/lib/column-selection-dialog/themes/elemental/defaults.less +1 -0
  112. package/lib/column-selection-dialog/themes/elemental/index.less +5 -0
  113. package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +4 -0
  114. package/lib/column-selection-dialog/themes/elemental/light/css/native-elements.css +0 -0
  115. package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +2 -0
  116. package/lib/column-selection-dialog/themes/elemental/light/imports/all-elements.js +1 -0
  117. package/lib/column-selection-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
  118. package/lib/column-selection-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  119. package/lib/column-selection-dialog/themes/elemental/light.js +8 -0
  120. package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +25 -0
  121. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +4 -0
  122. package/lib/column-selection-dialog/themes/halo/dark/css/native-elements.css +0 -0
  123. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +2 -0
  124. package/lib/column-selection-dialog/themes/halo/dark/imports/all-elements.js +1 -0
  125. package/lib/column-selection-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
  126. package/lib/column-selection-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  127. package/lib/column-selection-dialog/themes/halo/dark.js +8 -0
  128. package/lib/column-selection-dialog/themes/halo/defaults.less +1 -0
  129. package/lib/column-selection-dialog/themes/halo/index.less +6 -0
  130. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +4 -0
  131. package/lib/column-selection-dialog/themes/halo/light/css/native-elements.css +0 -0
  132. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +2 -0
  133. package/lib/column-selection-dialog/themes/halo/light/imports/all-elements.js +1 -0
  134. package/lib/column-selection-dialog/themes/halo/light/imports/custom-elements.js +1 -0
  135. package/lib/column-selection-dialog/themes/halo/light/imports/native-elements.js +0 -0
  136. package/lib/column-selection-dialog/themes/halo/light.js +8 -0
  137. package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +4 -0
  138. package/lib/column-selection-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  139. package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
  140. package/lib/column-selection-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
  141. package/lib/column-selection-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
  142. package/lib/column-selection-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  143. package/lib/column-selection-dialog/themes/solar/charcoal.js +8 -0
  144. package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +5 -0
  145. package/lib/column-selection-dialog/themes/solar/defaults.less +1 -0
  146. package/lib/column-selection-dialog/themes/solar/index.less +6 -0
  147. package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +4 -0
  148. package/lib/column-selection-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  149. package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
  150. package/lib/column-selection-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
  151. package/lib/column-selection-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
  152. package/lib/column-selection-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  153. package/lib/column-selection-dialog/themes/solar/pearl.js +8 -0
  154. package/lib/core/dist/core.css +1 -0
  155. package/lib/core/dist/core.js +33910 -0
  156. package/lib/core/dist/core.min.js +1 -0
  157. package/lib/core/es6/data/ColumnStats.d.ts +42 -0
  158. package/lib/core/es6/data/ColumnStats.js +428 -0
  159. package/lib/core/es6/data/DataCache.d.ts +43 -0
  160. package/lib/core/es6/data/DataCache.js +597 -0
  161. package/lib/core/es6/data/DataTable.d.ts +156 -0
  162. package/lib/core/es6/data/DataTable.js +2206 -0
  163. package/lib/core/es6/data/DataView.d.ts +332 -0
  164. package/lib/core/es6/data/DataView.js +4144 -0
  165. package/lib/core/es6/data/Segment.d.ts +91 -0
  166. package/lib/core/es6/data/Segment.js +1001 -0
  167. package/lib/core/es6/data/SegmentCollection.d.ts +84 -0
  168. package/lib/core/es6/data/SegmentCollection.js +713 -0
  169. package/lib/core/es6/data/WrappedView.d.ts +290 -0
  170. package/lib/core/es6/data/WrappedView.js +1320 -0
  171. package/lib/core/es6/grid/Core.d.ts +455 -0
  172. package/lib/core/es6/grid/Core.js +6196 -0
  173. package/lib/core/es6/grid/ILayoutGrid.d.ts +212 -0
  174. package/lib/core/es6/grid/ILayoutGrid.js +706 -0
  175. package/lib/core/es6/grid/LayoutGrid.d.ts +37 -0
  176. package/lib/core/es6/grid/LayoutGrid.js +2975 -0
  177. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +28 -0
  178. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +1241 -0
  179. package/lib/core/es6/grid/components/Cell.d.ts +52 -0
  180. package/lib/core/es6/grid/components/Cell.js +826 -0
  181. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +21 -0
  182. package/lib/core/es6/grid/components/CellFloatingPanel.js +130 -0
  183. package/lib/core/es6/grid/components/CellSpan.d.ts +18 -0
  184. package/lib/core/es6/grid/components/CellSpan.js +99 -0
  185. package/lib/core/es6/grid/components/CellSpans.d.ts +40 -0
  186. package/lib/core/es6/grid/components/CellSpans.js +368 -0
  187. package/lib/core/es6/grid/components/Column.d.ts +22 -0
  188. package/lib/core/es6/grid/components/Column.js +618 -0
  189. package/lib/core/es6/grid/components/ElementWrapper.d.ts +127 -0
  190. package/lib/core/es6/grid/components/ElementWrapper.js +718 -0
  191. package/lib/core/es6/grid/components/HScrollbar.d.ts +28 -0
  192. package/lib/core/es6/grid/components/HScrollbar.js +241 -0
  193. package/lib/core/es6/grid/components/Scrollbar.d.ts +63 -0
  194. package/lib/core/es6/grid/components/Scrollbar.js +1413 -0
  195. package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
  196. package/lib/core/es6/grid/components/StretchedCells.js +342 -0
  197. package/lib/core/es6/grid/components/VScrollbar.d.ts +18 -0
  198. package/lib/core/es6/grid/components/VScrollbar.js +139 -0
  199. package/lib/core/es6/grid/components/VirtualItems.d.ts +12 -0
  200. package/lib/core/es6/grid/components/VirtualItems.js +51 -0
  201. package/lib/core/es6/grid/event/EventDispatcher.d.ts +16 -0
  202. package/lib/core/es6/grid/event/EventDispatcher.js +138 -0
  203. package/lib/core/es6/grid/event/EventListeners.d.ts +34 -0
  204. package/lib/core/es6/grid/event/EventListeners.js +166 -0
  205. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +155 -0
  206. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1977 -0
  207. package/lib/core/es6/grid/util/CellBoundPainter.d.ts +16 -0
  208. package/lib/core/es6/grid/util/CellBoundPainter.js +171 -0
  209. package/lib/core/es6/grid/util/Conflator.d.ts +32 -0
  210. package/lib/core/es6/grid/util/Conflator.js +191 -0
  211. package/lib/core/es6/grid/util/Reverter.d.ts +14 -0
  212. package/lib/core/es6/grid/util/Reverter.js +79 -0
  213. package/lib/core/es6/grid/util/SectionSettings.d.ts +79 -0
  214. package/lib/core/es6/grid/util/SectionSettings.js +679 -0
  215. package/lib/core/es6/grid/util/SelectionList.d.ts +54 -0
  216. package/lib/core/es6/grid/util/SelectionList.js +491 -0
  217. package/lib/core/es6/grid/util/TrackLayout.d.ts +92 -0
  218. package/lib/core/es6/grid/util/TrackLayout.js +902 -0
  219. package/lib/core/es6/grid/util/Virtualizer.d.ts +40 -0
  220. package/lib/core/es6/grid/util/Virtualizer.js +340 -0
  221. package/lib/core/es6/grid/util/util.d.ts +20 -0
  222. package/lib/core/es6/grid/util/util.js +391 -0
  223. package/lib/core/es6/index.d.ts +79 -0
  224. package/lib/core/es6/index.js +125 -0
  225. package/lib/core/es6/tr-grid-theme.d.ts +5 -0
  226. package/lib/core/es6/tr-grid-theme.js +5 -0
  227. package/lib/filter-dialog/index.d.ts +2 -0
  228. package/lib/filter-dialog/index.js +2 -0
  229. package/lib/filter-dialog/lib/checkbox-list.d.ts +52 -0
  230. package/lib/filter-dialog/lib/checkbox-list.js +444 -0
  231. package/lib/filter-dialog/lib/filter-dialog.d.ts +75 -0
  232. package/lib/filter-dialog/lib/filter-dialog.js +1160 -0
  233. package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
  234. package/lib/filter-dialog/lib/locale/translation-de.js +40 -0
  235. package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
  236. package/lib/filter-dialog/lib/locale/translation-en.js +40 -0
  237. package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
  238. package/lib/filter-dialog/lib/locale/translation-ja.js +40 -0
  239. package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  240. package/lib/filter-dialog/lib/locale/translation-zh-hant.js +40 -0
  241. package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
  242. package/lib/filter-dialog/lib/locale/translation-zh.js +40 -0
  243. package/lib/filter-dialog/lib/locale/translation.d.ts +11 -0
  244. package/lib/filter-dialog/lib/locale/translation.js +18 -0
  245. package/lib/filter-dialog/themes/base-checkbox.less +42 -0
  246. package/lib/filter-dialog/themes/base.less +191 -0
  247. package/lib/filter-dialog/themes/elemental/checkbox-list.less +3 -0
  248. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +4 -0
  249. package/lib/filter-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  250. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +4 -0
  251. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +5 -0
  252. package/lib/filter-dialog/themes/elemental/dark/imports/all-elements.js +2 -0
  253. package/lib/filter-dialog/themes/elemental/dark/imports/custom-elements.js +2 -0
  254. package/lib/filter-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  255. package/lib/filter-dialog/themes/elemental/dark.js +11 -0
  256. package/lib/filter-dialog/themes/elemental/defaults.less +3 -0
  257. package/lib/filter-dialog/themes/elemental/filter-dialog.less +1 -0
  258. package/lib/filter-dialog/themes/elemental/index.less +6 -0
  259. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +4 -0
  260. package/lib/filter-dialog/themes/elemental/light/css/native-elements.css +0 -0
  261. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +4 -0
  262. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +5 -0
  263. package/lib/filter-dialog/themes/elemental/light/imports/all-elements.js +2 -0
  264. package/lib/filter-dialog/themes/elemental/light/imports/custom-elements.js +2 -0
  265. package/lib/filter-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  266. package/lib/filter-dialog/themes/elemental/light.js +11 -0
  267. package/lib/filter-dialog/themes/halo/checkbox-list.less +3 -0
  268. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +4 -0
  269. package/lib/filter-dialog/themes/halo/dark/css/native-elements.css +0 -0
  270. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +4 -0
  271. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +5 -0
  272. package/lib/filter-dialog/themes/halo/dark/imports/all-elements.js +2 -0
  273. package/lib/filter-dialog/themes/halo/dark/imports/custom-elements.js +2 -0
  274. package/lib/filter-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  275. package/lib/filter-dialog/themes/halo/dark.js +11 -0
  276. package/lib/filter-dialog/themes/halo/defaults.less +3 -0
  277. package/lib/filter-dialog/themes/halo/filter-dialog.less +15 -0
  278. package/lib/filter-dialog/themes/halo/index.less +6 -0
  279. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +4 -0
  280. package/lib/filter-dialog/themes/halo/light/css/native-elements.css +0 -0
  281. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +4 -0
  282. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +5 -0
  283. package/lib/filter-dialog/themes/halo/light/imports/all-elements.js +2 -0
  284. package/lib/filter-dialog/themes/halo/light/imports/custom-elements.js +2 -0
  285. package/lib/filter-dialog/themes/halo/light/imports/native-elements.js +0 -0
  286. package/lib/filter-dialog/themes/halo/light.js +11 -0
  287. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +4 -0
  288. package/lib/filter-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  289. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +4 -0
  290. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +5 -0
  291. package/lib/filter-dialog/themes/solar/charcoal/imports/all-elements.js +2 -0
  292. package/lib/filter-dialog/themes/solar/charcoal/imports/custom-elements.js +2 -0
  293. package/lib/filter-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  294. package/lib/filter-dialog/themes/solar/charcoal.js +11 -0
  295. package/lib/filter-dialog/themes/solar/checkbox-list.less +3 -0
  296. package/lib/filter-dialog/themes/solar/defaults.less +3 -0
  297. package/lib/filter-dialog/themes/solar/filter-dialog.less +5 -0
  298. package/lib/filter-dialog/themes/solar/index.less +6 -0
  299. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +4 -0
  300. package/lib/filter-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  301. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +4 -0
  302. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +5 -0
  303. package/lib/filter-dialog/themes/solar/pearl/imports/all-elements.js +2 -0
  304. package/lib/filter-dialog/themes/solar/pearl/imports/custom-elements.js +2 -0
  305. package/lib/filter-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  306. package/lib/filter-dialog/themes/solar/pearl.js +11 -0
  307. package/lib/formatters/es6/CoralButtonFormatter.d.ts +20 -0
  308. package/lib/formatters/es6/CoralButtonFormatter.js +45 -0
  309. package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
  310. package/lib/formatters/es6/CoralCheckboxFormatter.js +50 -0
  311. package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
  312. package/lib/formatters/es6/CoralComboBoxFormatter.js +103 -0
  313. package/lib/formatters/es6/CoralIconFormatter.d.ts +21 -0
  314. package/lib/formatters/es6/CoralIconFormatter.js +50 -0
  315. package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
  316. package/lib/formatters/es6/CoralInputFormatter.js +45 -0
  317. package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +20 -0
  318. package/lib/formatters/es6/CoralRadioButtonFormatter.js +85 -0
  319. package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
  320. package/lib/formatters/es6/CoralSelectFormatter.js +71 -0
  321. package/lib/formatters/es6/CoralToggleFormatter.d.ts +12 -0
  322. package/lib/formatters/es6/CoralToggleFormatter.js +47 -0
  323. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
  324. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +119 -0
  325. package/lib/formatters/es6/EFButtonFormatter.d.ts +20 -0
  326. package/lib/formatters/es6/EFButtonFormatter.js +45 -0
  327. package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
  328. package/lib/formatters/es6/EFCheckboxFormatter.js +50 -0
  329. package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
  330. package/lib/formatters/es6/EFComboBoxFormatter.js +78 -0
  331. package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
  332. package/lib/formatters/es6/EFDateTimePickerFormatter.js +60 -0
  333. package/lib/formatters/es6/EFIconFormatter.d.ts +21 -0
  334. package/lib/formatters/es6/EFIconFormatter.js +50 -0
  335. package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
  336. package/lib/formatters/es6/EFNumberFieldFormatter.js +45 -0
  337. package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +20 -0
  338. package/lib/formatters/es6/EFRadioButtonFormatter.js +132 -0
  339. package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
  340. package/lib/formatters/es6/EFSelectFormatter.js +76 -0
  341. package/lib/formatters/es6/EFTextFieldFormatter.d.ts +12 -0
  342. package/lib/formatters/es6/EFTextFieldFormatter.js +40 -0
  343. package/lib/formatters/es6/EFToggleFormatter.d.ts +12 -0
  344. package/lib/formatters/es6/EFToggleFormatter.js +47 -0
  345. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
  346. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +55 -0
  347. package/lib/formatters/es6/FormatterBuilder.d.ts +26 -0
  348. package/lib/formatters/es6/FormatterBuilder.js +493 -0
  349. package/lib/formatters/es6/NumericInputFormatter.d.ts +13 -0
  350. package/lib/formatters/es6/NumericInputFormatter.js +64 -0
  351. package/lib/formatters/es6/PercentBarFormatter.d.ts +25 -0
  352. package/lib/formatters/es6/PercentBarFormatter.js +62 -0
  353. package/lib/formatters/es6/SimpleImageFormatter.d.ts +21 -0
  354. package/lib/formatters/es6/SimpleImageFormatter.js +64 -0
  355. package/lib/formatters/es6/SimpleInputFormatter.d.ts +12 -0
  356. package/lib/formatters/es6/SimpleInputFormatter.js +40 -0
  357. package/lib/formatters/es6/SimpleLinkFormatter.d.ts +21 -0
  358. package/lib/formatters/es6/SimpleLinkFormatter.js +48 -0
  359. package/lib/formatters/es6/SimpleTickerFormatter.d.ts +23 -0
  360. package/lib/formatters/es6/SimpleTickerFormatter.js +66 -0
  361. package/lib/formatters/es6/SimpleToggleFormatter.d.ts +22 -0
  362. package/lib/formatters/es6/SimpleToggleFormatter.js +132 -0
  363. package/lib/formatters/es6/TextFormatter.d.ts +12 -0
  364. package/lib/formatters/es6/TextFormatter.js +35 -0
  365. package/lib/formatters/es6/index.d.ts +64 -0
  366. package/lib/formatters/es6/index.js +88 -0
  367. package/lib/grid/index.d.ts +2 -0
  368. package/lib/grid/index.js +3 -0
  369. package/lib/grid/lib/efx-grid.d.ts +53 -0
  370. package/lib/grid/lib/efx-grid.js +444 -0
  371. package/lib/grid/themes/base.less +137 -0
  372. package/lib/grid/themes/ds/dark/css/native-elements.css +0 -0
  373. package/lib/grid/themes/ds/dark/efx-grid.js +4 -0
  374. package/lib/grid/themes/ds/dark/es5/all-elements.js +2 -0
  375. package/lib/grid/themes/ds/dark/imports/all-elements.js +1 -0
  376. package/lib/grid/themes/ds/dark/imports/custom-elements.js +1 -0
  377. package/lib/grid/themes/ds/dark/imports/native-elements.js +0 -0
  378. package/lib/grid/themes/ds/dark.js +3 -0
  379. package/lib/grid/themes/ds/efx-grid.less +207 -0
  380. package/lib/grid/themes/ds/index.less +3 -0
  381. package/lib/grid/themes/ds/light/css/native-elements.css +0 -0
  382. package/lib/grid/themes/ds/light/efx-grid.js +4 -0
  383. package/lib/grid/themes/ds/light/es5/all-elements.js +2 -0
  384. package/lib/grid/themes/ds/light/imports/all-elements.js +1 -0
  385. package/lib/grid/themes/ds/light/imports/custom-elements.js +1 -0
  386. package/lib/grid/themes/ds/light/imports/native-elements.js +0 -0
  387. package/lib/grid/themes/ds/light.js +3 -0
  388. package/lib/grid/themes/halo/dark/css/native-elements.css +0 -0
  389. package/lib/grid/themes/halo/dark/efx-grid.js +4 -0
  390. package/lib/grid/themes/halo/dark/es5/all-elements.js +2 -0
  391. package/lib/grid/themes/halo/dark/imports/all-elements.js +1 -0
  392. package/lib/grid/themes/halo/dark/imports/custom-elements.js +1 -0
  393. package/lib/grid/themes/halo/dark/imports/native-elements.js +0 -0
  394. package/lib/grid/themes/halo/dark.js +3 -0
  395. package/lib/grid/themes/halo/efx-grid.less +127 -0
  396. package/lib/grid/themes/halo/index.less +3 -0
  397. package/lib/grid/themes/halo/light/css/native-elements.css +0 -0
  398. package/lib/grid/themes/halo/light/efx-grid.js +4 -0
  399. package/lib/grid/themes/halo/light/es5/all-elements.js +2 -0
  400. package/lib/grid/themes/halo/light/imports/all-elements.js +1 -0
  401. package/lib/grid/themes/halo/light/imports/custom-elements.js +1 -0
  402. package/lib/grid/themes/halo/light/imports/native-elements.js +0 -0
  403. package/lib/grid/themes/halo/light.js +3 -0
  404. package/lib/grid/themes/solar/charcoal/css/native-elements.css +0 -0
  405. package/lib/grid/themes/solar/charcoal/efx-grid.js +4 -0
  406. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +2 -0
  407. package/lib/grid/themes/solar/charcoal/imports/all-elements.js +1 -0
  408. package/lib/grid/themes/solar/charcoal/imports/custom-elements.js +1 -0
  409. package/lib/grid/themes/solar/charcoal/imports/native-elements.js +0 -0
  410. package/lib/grid/themes/solar/charcoal.js +3 -0
  411. package/lib/grid/themes/solar/efx-grid.less +27 -0
  412. package/lib/grid/themes/solar/index.less +3 -0
  413. package/lib/grid/themes/solar/pearl/css/native-elements.css +0 -0
  414. package/lib/grid/themes/solar/pearl/efx-grid.js +4 -0
  415. package/lib/grid/themes/solar/pearl/es5/all-elements.js +2 -0
  416. package/lib/grid/themes/solar/pearl/imports/all-elements.js +1 -0
  417. package/lib/grid/themes/solar/pearl/imports/custom-elements.js +1 -0
  418. package/lib/grid/themes/solar/pearl/imports/native-elements.js +0 -0
  419. package/lib/grid/themes/solar/pearl.js +3 -0
  420. package/lib/index.d.ts +100 -0
  421. package/lib/index.js +100 -0
  422. package/lib/row-segmenting/es6/RowSegmenting.d.ts +115 -0
  423. package/lib/row-segmenting/es6/RowSegmenting.js +1182 -0
  424. package/lib/row-segmenting/es6/index.d.ts +1 -0
  425. package/lib/row-segmenting/es6/index.js +1 -0
  426. package/lib/rt-grid/dist/rt-grid.js +54547 -0
  427. package/lib/rt-grid/dist/rt-grid.min.js +1 -0
  428. package/lib/rt-grid/es6/ColumnDefinition.d.ts +174 -0
  429. package/lib/rt-grid/es6/ColumnDefinition.js +1203 -0
  430. package/lib/rt-grid/es6/DataConnector.d.ts +43 -0
  431. package/lib/rt-grid/es6/DataConnector.js +290 -0
  432. package/lib/rt-grid/es6/FieldDefinition.d.ts +40 -0
  433. package/lib/rt-grid/es6/FieldDefinition.js +560 -0
  434. package/lib/rt-grid/es6/Grid.d.ts +376 -0
  435. package/lib/rt-grid/es6/Grid.js +4653 -0
  436. package/lib/rt-grid/es6/PredefinedFormula.d.ts +16 -0
  437. package/lib/rt-grid/es6/PredefinedFormula.js +33 -0
  438. package/lib/rt-grid/es6/ReferenceCounter.d.ts +40 -0
  439. package/lib/rt-grid/es6/ReferenceCounter.js +251 -0
  440. package/lib/rt-grid/es6/RowDefSorter.d.ts +19 -0
  441. package/lib/rt-grid/es6/RowDefSorter.js +231 -0
  442. package/lib/rt-grid/es6/RowDefinition.d.ts +156 -0
  443. package/lib/rt-grid/es6/RowDefinition.js +1478 -0
  444. package/lib/rt-grid/es6/SnapshotFiller.d.ts +36 -0
  445. package/lib/rt-grid/es6/SnapshotFiller.js +537 -0
  446. package/lib/rt-grid/es6/StyleLoader.d.ts +17 -0
  447. package/lib/rt-grid/es6/StyleLoader.js +47 -0
  448. package/lib/rt-grid/es6/index.d.ts +8 -0
  449. package/lib/rt-grid/es6/index.js +43 -0
  450. package/lib/statistics-row/es6/StatisticsRow.d.ts +68 -0
  451. package/lib/statistics-row/es6/StatisticsRow.js +807 -0
  452. package/lib/statistics-row/es6/index.d.ts +1 -0
  453. package/lib/statistics-row/es6/index.js +1 -0
  454. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.d.ts +46 -0
  455. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +617 -0
  456. package/lib/tr-grid-auto-tooltip/es6/index.d.ts +1 -0
  457. package/lib/tr-grid-auto-tooltip/es6/index.js +1 -0
  458. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +70 -0
  459. package/lib/tr-grid-cell-selection/es6/CellSelection.js +1695 -0
  460. package/lib/tr-grid-cell-selection/es6/index.d.ts +1 -0
  461. package/lib/tr-grid-cell-selection/es6/index.js +1 -0
  462. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +82 -0
  463. package/lib/tr-grid-checkbox/es6/Checkbox.js +1704 -0
  464. package/lib/tr-grid-checkbox/es6/index.d.ts +1 -0
  465. package/lib/tr-grid-checkbox/es6/index.js +1 -0
  466. package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +56 -0
  467. package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +817 -0
  468. package/lib/tr-grid-column-fitter/es6/index.d.ts +1 -0
  469. package/lib/tr-grid-column-fitter/es6/index.js +1 -0
  470. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +91 -0
  471. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +617 -0
  472. package/lib/tr-grid-column-formatting/es6/index.d.ts +1 -0
  473. package/lib/tr-grid-column-formatting/es6/index.js +1 -0
  474. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +110 -0
  475. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +2028 -0
  476. package/lib/tr-grid-column-grouping/es6/index.d.ts +1 -0
  477. package/lib/tr-grid-column-grouping/es6/index.js +1 -0
  478. package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +68 -0
  479. package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1010 -0
  480. package/lib/tr-grid-column-resizing/es6/index.d.ts +1 -0
  481. package/lib/tr-grid-column-resizing/es6/index.js +1 -0
  482. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +77 -0
  483. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +1405 -0
  484. package/lib/tr-grid-column-selection/es6/index.d.ts +1 -0
  485. package/lib/tr-grid-column-selection/es6/index.js +1 -0
  486. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +160 -0
  487. package/lib/tr-grid-column-stack/es6/ColumnStack.js +2155 -0
  488. package/lib/tr-grid-column-stack/es6/index.d.ts +1 -0
  489. package/lib/tr-grid-column-stack/es6/index.js +1 -0
  490. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +100 -0
  491. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +1513 -0
  492. package/lib/tr-grid-conditional-coloring/es6/index.d.ts +1 -0
  493. package/lib/tr-grid-conditional-coloring/es6/index.js +1 -0
  494. package/lib/tr-grid-content-wrap/es6/ContentWrap.d.ts +43 -0
  495. package/lib/tr-grid-content-wrap/es6/ContentWrap.js +519 -0
  496. package/lib/tr-grid-content-wrap/es6/index.d.ts +1 -0
  497. package/lib/tr-grid-content-wrap/es6/index.js +1 -0
  498. package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +83 -0
  499. package/lib/tr-grid-contextmenu/es6/ContextMenu.js +453 -0
  500. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
  501. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +138 -0
  502. package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +41 -0
  503. package/lib/tr-grid-contextmenu/es6/MenuItem.js +285 -0
  504. package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +33 -0
  505. package/lib/tr-grid-contextmenu/es6/PopupMenu.js +303 -0
  506. package/lib/tr-grid-contextmenu/es6/index.d.ts +1 -0
  507. package/lib/tr-grid-contextmenu/es6/index.js +1 -0
  508. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +64 -0
  509. package/lib/tr-grid-filter-input/es6/FilterInput.js +1027 -0
  510. package/lib/tr-grid-filter-input/es6/index.d.ts +1 -0
  511. package/lib/tr-grid-filter-input/es6/index.js +1 -0
  512. package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +45 -0
  513. package/lib/tr-grid-heat-map/es6/HeatMap.js +401 -0
  514. package/lib/tr-grid-heat-map/es6/index.d.ts +1 -0
  515. package/lib/tr-grid-heat-map/es6/index.js +1 -0
  516. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +148 -0
  517. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +2671 -0
  518. package/lib/tr-grid-in-cell-editing/es6/index.d.ts +1 -0
  519. package/lib/tr-grid-in-cell-editing/es6/index.js +1 -0
  520. package/lib/tr-grid-pagination/es6/Pagination.d.ts +58 -0
  521. package/lib/tr-grid-pagination/es6/Pagination.js +433 -0
  522. package/lib/tr-grid-pagination/es6/index.d.ts +1 -0
  523. package/lib/tr-grid-pagination/es6/index.js +1 -0
  524. package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +60 -0
  525. package/lib/tr-grid-percent-bar/es6/PercentBar.js +804 -0
  526. package/lib/tr-grid-percent-bar/es6/index.d.ts +1 -0
  527. package/lib/tr-grid-percent-bar/es6/index.js +1 -0
  528. package/lib/tr-grid-printer/es6/CellWriter.d.ts +50 -0
  529. package/lib/tr-grid-printer/es6/CellWriter.js +234 -0
  530. package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +13 -0
  531. package/lib/tr-grid-printer/es6/ColumnWriter.js +23 -0
  532. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +33 -0
  533. package/lib/tr-grid-printer/es6/GridPrinter.js +794 -0
  534. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +39 -0
  535. package/lib/tr-grid-printer/es6/PrintTrait.js +494 -0
  536. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +57 -0
  537. package/lib/tr-grid-printer/es6/SectionWriter.js +238 -0
  538. package/lib/tr-grid-printer/es6/index.d.ts +1 -0
  539. package/lib/tr-grid-printer/es6/index.js +1 -0
  540. package/lib/tr-grid-range-bar/es6/LEDGuage.d.ts +39 -0
  541. package/lib/tr-grid-range-bar/es6/LEDGuage.js +261 -0
  542. package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +56 -0
  543. package/lib/tr-grid-range-bar/es6/RangeBar.js +514 -0
  544. package/lib/tr-grid-range-bar/es6/index.d.ts +1 -0
  545. package/lib/tr-grid-range-bar/es6/index.js +1 -0
  546. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +81 -0
  547. package/lib/tr-grid-row-dragging/es6/RowDragging.js +1479 -0
  548. package/lib/tr-grid-row-dragging/es6/index.d.ts +1 -0
  549. package/lib/tr-grid-row-dragging/es6/index.js +1 -0
  550. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +159 -0
  551. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +2568 -0
  552. package/lib/tr-grid-row-filtering/es6/index.d.ts +1 -0
  553. package/lib/tr-grid-row-filtering/es6/index.js +1 -0
  554. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +123 -0
  555. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1728 -0
  556. package/lib/tr-grid-row-grouping/es6/index.d.ts +1 -0
  557. package/lib/tr-grid-row-grouping/es6/index.js +1 -0
  558. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +75 -0
  559. package/lib/tr-grid-row-selection/es6/RowSelection.js +1447 -0
  560. package/lib/tr-grid-row-selection/es6/index.d.ts +1 -0
  561. package/lib/tr-grid-row-selection/es6/index.js +1 -0
  562. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +64 -0
  563. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +615 -0
  564. package/lib/tr-grid-rowcoloring/es6/index.d.ts +1 -0
  565. package/lib/tr-grid-rowcoloring/es6/index.js +1 -0
  566. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +72 -0
  567. package/lib/tr-grid-textformatting/es6/TextFormatting.js +543 -0
  568. package/lib/tr-grid-textformatting/es6/index.d.ts +1 -0
  569. package/lib/tr-grid-textformatting/es6/index.js +1 -0
  570. package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +27 -0
  571. package/lib/tr-grid-titlewrap/es6/TitleWrap.js +431 -0
  572. package/lib/tr-grid-titlewrap/es6/index.d.ts +1 -0
  573. package/lib/tr-grid-titlewrap/es6/index.js +1 -0
  574. package/lib/tr-grid-util/es6/CellPainter.d.ts +142 -0
  575. package/lib/tr-grid-util/es6/CellPainter.js +1183 -0
  576. package/lib/tr-grid-util/es6/Color.d.ts +40 -0
  577. package/lib/tr-grid-util/es6/Color.js +210 -0
  578. package/lib/tr-grid-util/es6/Conflator.d.ts +34 -0
  579. package/lib/tr-grid-util/es6/Conflator.js +193 -0
  580. package/lib/tr-grid-util/es6/CoralItems.d.ts +10 -0
  581. package/lib/tr-grid-util/es6/CoralItems.js +42 -0
  582. package/lib/tr-grid-util/es6/DateTime.d.ts +57 -0
  583. package/lib/tr-grid-util/es6/DateTime.js +508 -0
  584. package/lib/tr-grid-util/es6/Deferred.d.ts +16 -0
  585. package/lib/tr-grid-util/es6/Deferred.js +108 -0
  586. package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
  587. package/lib/tr-grid-util/es6/Delay.js +96 -0
  588. package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
  589. package/lib/tr-grid-util/es6/Dom.js +350 -0
  590. package/lib/tr-grid-util/es6/DragUI.d.ts +20 -0
  591. package/lib/tr-grid-util/es6/DragUI.js +263 -0
  592. package/lib/tr-grid-util/es6/ElementObserver.d.ts +12 -0
  593. package/lib/tr-grid-util/es6/ElementObserver.js +134 -0
  594. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
  595. package/lib/tr-grid-util/es6/ElementWrapper.js +84 -0
  596. package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
  597. package/lib/tr-grid-util/es6/ElfDate.js +164 -0
  598. package/lib/tr-grid-util/es6/ElfUtil.d.ts +46 -0
  599. package/lib/tr-grid-util/es6/ElfUtil.js +637 -0
  600. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +26 -0
  601. package/lib/tr-grid-util/es6/EventDispatcher.js +161 -0
  602. package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +24 -0
  603. package/lib/tr-grid-util/es6/ExpanderIcon.js +120 -0
  604. package/lib/tr-grid-util/es6/ExpressionParser.d.ts +10 -0
  605. package/lib/tr-grid-util/es6/ExpressionParser.js +408 -0
  606. package/lib/tr-grid-util/es6/Ext.d.ts +10 -0
  607. package/lib/tr-grid-util/es6/Ext.js +52 -0
  608. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +55 -0
  609. package/lib/tr-grid-util/es6/FieldFormatter.js +440 -0
  610. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +54 -0
  611. package/lib/tr-grid-util/es6/FilterBuilder.js +580 -0
  612. package/lib/tr-grid-util/es6/FilterOperators.d.ts +56 -0
  613. package/lib/tr-grid-util/es6/FilterOperators.js +255 -0
  614. package/lib/tr-grid-util/es6/GridPlugin.d.ts +86 -0
  615. package/lib/tr-grid-util/es6/GridPlugin.js +1055 -0
  616. package/lib/tr-grid-util/es6/GroupDefinitions.d.ts +74 -0
  617. package/lib/tr-grid-util/es6/GroupDefinitions.js +642 -0
  618. package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
  619. package/lib/tr-grid-util/es6/Icon.js +62 -0
  620. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
  621. package/lib/tr-grid-util/es6/MouseDownTrait.js +250 -0
  622. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +40 -0
  623. package/lib/tr-grid-util/es6/MultiTableManager.js +611 -0
  624. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +85 -0
  625. package/lib/tr-grid-util/es6/NumberFormatter.js +528 -0
  626. package/lib/tr-grid-util/es6/PercentBar.d.ts +71 -0
  627. package/lib/tr-grid-util/es6/PercentBar.js +600 -0
  628. package/lib/tr-grid-util/es6/Perf.d.ts +32 -0
  629. package/lib/tr-grid-util/es6/Perf.js +163 -0
  630. package/lib/tr-grid-util/es6/Popup.d.ts +98 -0
  631. package/lib/tr-grid-util/es6/Popup.js +991 -0
  632. package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
  633. package/lib/tr-grid-util/es6/RangeBar.js +260 -0
  634. package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
  635. package/lib/tr-grid-util/es6/RequestQueue.js +228 -0
  636. package/lib/tr-grid-util/es6/RowPainter.d.ts +60 -0
  637. package/lib/tr-grid-util/es6/RowPainter.js +448 -0
  638. package/lib/tr-grid-util/es6/SubTable.d.ts +78 -0
  639. package/lib/tr-grid-util/es6/SubTable.js +642 -0
  640. package/lib/tr-grid-util/es6/Table.d.ts +146 -0
  641. package/lib/tr-grid-util/es6/Table.js +832 -0
  642. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +16 -0
  643. package/lib/tr-grid-util/es6/TextHighlighter.js +268 -0
  644. package/lib/tr-grid-util/es6/TickCodes.d.ts +8 -0
  645. package/lib/tr-grid-util/es6/TickCodes.js +33 -0
  646. package/lib/tr-grid-util/es6/Timer.d.ts +16 -0
  647. package/lib/tr-grid-util/es6/Timer.js +49 -0
  648. package/lib/tr-grid-util/es6/TouchProxy.d.ts +46 -0
  649. package/lib/tr-grid-util/es6/TouchProxy.js +212 -0
  650. package/lib/tr-grid-util/es6/Util.d.ts +66 -0
  651. package/lib/tr-grid-util/es6/Util.js +508 -0
  652. package/lib/tr-grid-util/es6/formula/ADCService.d.ts +11 -0
  653. package/lib/tr-grid-util/es6/formula/ADCService.js +72 -0
  654. package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +17 -0
  655. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +317 -0
  656. package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +12 -0
  657. package/lib/tr-grid-util/es6/formula/AdFinService.js +61 -0
  658. package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +19 -0
  659. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +310 -0
  660. package/lib/tr-grid-util/es6/formula/Engine.d.ts +56 -0
  661. package/lib/tr-grid-util/es6/formula/Engine.js +592 -0
  662. package/lib/tr-grid-util/es6/formula/Formula.d.ts +68 -0
  663. package/lib/tr-grid-util/es6/formula/Formula.js +890 -0
  664. package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +16 -0
  665. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +165 -0
  666. package/lib/tr-grid-util/es6/formula/Realtime.d.ts +18 -0
  667. package/lib/tr-grid-util/es6/formula/Realtime.js +279 -0
  668. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +18 -0
  669. package/lib/tr-grid-util/es6/formula/RealtimeService.js +203 -0
  670. package/lib/tr-grid-util/es6/formula/TSIService.d.ts +11 -0
  671. package/lib/tr-grid-util/es6/formula/TSIService.js +51 -0
  672. package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +18 -0
  673. package/lib/tr-grid-util/es6/formula/TSISubscription.js +1015 -0
  674. package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +30 -0
  675. package/lib/tr-grid-util/es6/formula/VariableToken.js +314 -0
  676. package/lib/tr-grid-util/es6/formula/functions/AdFin.d.ts +9 -0
  677. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +1778 -0
  678. package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +8 -0
  679. package/lib/tr-grid-util/es6/formula/functions/Excel.js +21 -0
  680. package/lib/tr-grid-util/es6/formula/functions/Info.d.ts +8 -0
  681. package/lib/tr-grid-util/es6/formula/functions/Info.js +192 -0
  682. package/lib/tr-grid-util/es6/formula/functions/Internal.d.ts +8 -0
  683. package/lib/tr-grid-util/es6/formula/functions/Internal.js +90 -0
  684. package/lib/tr-grid-util/es6/formula/functions/Logic.d.ts +12 -0
  685. package/lib/tr-grid-util/es6/formula/functions/Logic.js +176 -0
  686. package/lib/tr-grid-util/es6/formula/functions/Math.d.ts +18 -0
  687. package/lib/tr-grid-util/es6/formula/functions/Math.js +1624 -0
  688. package/lib/tr-grid-util/es6/formula/functions/Statistics.d.ts +18 -0
  689. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +234 -0
  690. package/lib/tr-grid-util/es6/formula/functions/Text.d.ts +10 -0
  691. package/lib/tr-grid-util/es6/formula/functions/Text.js +676 -0
  692. package/lib/tr-grid-util/es6/index.d.ts +65 -0
  693. package/lib/tr-grid-util/es6/index.js +102 -0
  694. package/lib/tr-grid-util/es6/jet/Adc.d.ts +9 -0
  695. package/lib/tr-grid-util/es6/jet/Adc.js +268 -0
  696. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
  697. package/lib/tr-grid-util/es6/jet/CollectionDict.js +151 -0
  698. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +136 -0
  699. package/lib/tr-grid-util/es6/jet/DataGenerator.js +860 -0
  700. package/lib/tr-grid-util/es6/jet/DataSet.d.ts +8 -0
  701. package/lib/tr-grid-util/es6/jet/DataSet.js +392 -0
  702. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +21 -0
  703. package/lib/tr-grid-util/es6/jet/MockArchive.js +56 -0
  704. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +25 -0
  705. package/lib/tr-grid-util/es6/jet/MockJET.js +71 -0
  706. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +37 -0
  707. package/lib/tr-grid-util/es6/jet/MockQuotes.js +199 -0
  708. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +82 -0
  709. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +890 -0
  710. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +48 -0
  711. package/lib/tr-grid-util/es6/jet/MockRTK.js +82 -0
  712. package/lib/tr-grid-util/es6/jet/MockUtil.d.ts +7 -0
  713. package/lib/tr-grid-util/es6/jet/MockUtil.js +25 -0
  714. package/lib/tr-grid-util/es6/jet/index.d.ts +9 -0
  715. package/lib/tr-grid-util/es6/jet/index.js +18 -0
  716. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +11 -0
  717. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +111 -0
  718. package/lib/tr-grid-util/es6/jsx.d.ts +223 -0
  719. package/lib/tr-grid-util/es6/locale/translation-de.d.ts +7 -0
  720. package/lib/tr-grid-util/es6/locale/translation-de.js +51 -0
  721. package/lib/tr-grid-util/es6/locale/translation-en.d.ts +7 -0
  722. package/lib/tr-grid-util/es6/locale/translation-en.js +51 -0
  723. package/lib/tr-grid-util/es6/locale/translation-ja.d.ts +7 -0
  724. package/lib/tr-grid-util/es6/locale/translation-ja.js +51 -0
  725. package/lib/tr-grid-util/es6/locale/translation-zh-hant.d.ts +7 -0
  726. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +51 -0
  727. package/lib/tr-grid-util/es6/locale/translation-zh.d.ts +7 -0
  728. package/lib/tr-grid-util/es6/locale/translation-zh.js +51 -0
  729. package/lib/tr-grid-util/es6/locale/translation.d.ts +11 -0
  730. package/lib/tr-grid-util/es6/locale/translation.js +18 -0
  731. package/lib/types/es6/AutoTooltip.d.ts +46 -0
  732. package/lib/types/es6/CellSelection.d.ts +70 -0
  733. package/lib/types/es6/Checkbox.d.ts +82 -0
  734. package/lib/types/es6/ColumnDragging.d.ts +51 -0
  735. package/lib/types/es6/ColumnFitter.d.ts +56 -0
  736. package/lib/types/es6/ColumnFormatting.d.ts +92 -0
  737. package/lib/types/es6/ColumnGrouping.d.ts +107 -0
  738. package/lib/types/es6/ColumnResizing.d.ts +68 -0
  739. package/lib/types/es6/ColumnSelection.d.ts +77 -0
  740. package/lib/types/es6/ColumnStack.d.ts +160 -0
  741. package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
  742. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +41 -0
  743. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
  744. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +289 -0
  745. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +23 -0
  746. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +41 -0
  747. package/lib/types/es6/CompositeGrid/Plugin.d.ts +30 -0
  748. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +32 -0
  749. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +44 -0
  750. package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +24 -0
  751. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +46 -0
  752. package/lib/types/es6/CompositeGrid/index.d.ts +9 -0
  753. package/lib/types/es6/ConditionalColoring.d.ts +100 -0
  754. package/lib/types/es6/ContentWrap.d.ts +43 -0
  755. package/lib/types/es6/ContextMenu.d.ts +83 -0
  756. package/lib/types/es6/CoralButtonFormatter.d.ts +20 -0
  757. package/lib/types/es6/CoralCheckboxFormatter.d.ts +12 -0
  758. package/lib/types/es6/CoralComboBoxFormatter.d.ts +23 -0
  759. package/lib/types/es6/CoralIconFormatter.d.ts +21 -0
  760. package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
  761. package/lib/types/es6/CoralRadioButtonFormatter.d.ts +20 -0
  762. package/lib/types/es6/CoralSelectFormatter.d.ts +23 -0
  763. package/lib/types/es6/CoralToggleFormatter.d.ts +12 -0
  764. package/lib/types/es6/Core/data/ColumnStats.d.ts +42 -0
  765. package/lib/types/es6/Core/data/DataCache.d.ts +43 -0
  766. package/lib/types/es6/Core/data/DataTable.d.ts +156 -0
  767. package/lib/types/es6/Core/data/DataView.d.ts +332 -0
  768. package/lib/types/es6/Core/data/Segment.d.ts +91 -0
  769. package/lib/types/es6/Core/data/SegmentCollection.d.ts +84 -0
  770. package/lib/types/es6/Core/data/WrappedView.d.ts +290 -0
  771. package/lib/types/es6/Core/grid/Core.d.ts +455 -0
  772. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +212 -0
  773. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +37 -0
  774. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +28 -0
  775. package/lib/types/es6/Core/grid/components/Cell.d.ts +52 -0
  776. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +21 -0
  777. package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
  778. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +40 -0
  779. package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
  780. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +127 -0
  781. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +28 -0
  782. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +63 -0
  783. package/lib/types/es6/Core/grid/components/StretchedCells.d.ts +17 -0
  784. package/lib/types/es6/Core/grid/components/VScrollbar.d.ts +18 -0
  785. package/lib/types/es6/Core/grid/components/VirtualItems.d.ts +12 -0
  786. package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +16 -0
  787. package/lib/types/es6/Core/grid/event/EventListeners.d.ts +34 -0
  788. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +155 -0
  789. package/lib/types/es6/Core/grid/util/CellBoundPainter.d.ts +16 -0
  790. package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
  791. package/lib/types/es6/Core/grid/util/Reverter.d.ts +14 -0
  792. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +79 -0
  793. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +54 -0
  794. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +92 -0
  795. package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
  796. package/lib/types/es6/Core/grid/util/util.d.ts +20 -0
  797. package/lib/types/es6/Core/index.d.ts +79 -0
  798. package/lib/types/es6/Core/tr-grid-theme.d.ts +5 -0
  799. package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
  800. package/lib/types/es6/EFButtonFormatter.d.ts +20 -0
  801. package/lib/types/es6/EFCheckboxFormatter.d.ts +12 -0
  802. package/lib/types/es6/EFComboBoxFormatter.d.ts +23 -0
  803. package/lib/types/es6/EFDateTimePickerFormatter.d.ts +13 -0
  804. package/lib/types/es6/EFIconFormatter.d.ts +21 -0
  805. package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
  806. package/lib/types/es6/EFRadioButtonFormatter.d.ts +20 -0
  807. package/lib/types/es6/EFSelectFormatter.d.ts +23 -0
  808. package/lib/types/es6/EFTextFieldFormatter.d.ts +12 -0
  809. package/lib/types/es6/EFToggleFormatter.d.ts +12 -0
  810. package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
  811. package/lib/types/es6/ExtensionColumnOptions.d.ts +41 -0
  812. package/lib/types/es6/ExtensionOptions.d.ts +58 -0
  813. package/lib/types/es6/Extensions.d.ts +63 -0
  814. package/lib/types/es6/FilterInput.d.ts +64 -0
  815. package/lib/types/es6/FormatterBuilder.d.ts +26 -0
  816. package/lib/types/es6/GridFormatter.d.ts +63 -0
  817. package/lib/types/es6/HeatMap.d.ts +45 -0
  818. package/lib/types/es6/InCellEditing.d.ts +148 -0
  819. package/lib/types/es6/MenuEventAPI.d.ts +22 -0
  820. package/lib/types/es6/MenuItem.d.ts +41 -0
  821. package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
  822. package/lib/types/es6/Pagination.d.ts +58 -0
  823. package/lib/types/es6/PercentBar.d.ts +60 -0
  824. package/lib/types/es6/PercentBarFormatter.d.ts +25 -0
  825. package/lib/types/es6/PopupMenu.d.ts +33 -0
  826. package/lib/types/es6/RangeBar.d.ts +39 -0
  827. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +176 -0
  828. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +43 -0
  829. package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +40 -0
  830. package/lib/types/es6/RealtimeGrid/Grid.d.ts +413 -0
  831. package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
  832. package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +40 -0
  833. package/lib/types/es6/RealtimeGrid/RowDefSorter.d.ts +19 -0
  834. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +156 -0
  835. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +36 -0
  836. package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +17 -0
  837. package/lib/types/es6/RealtimeGrid/index.d.ts +8 -0
  838. package/lib/types/es6/RowColoring.d.ts +64 -0
  839. package/lib/types/es6/RowDragging.d.ts +81 -0
  840. package/lib/types/es6/RowFiltering.d.ts +159 -0
  841. package/lib/types/es6/RowGrouping.d.ts +123 -0
  842. package/lib/types/es6/RowSegmenting.d.ts +109 -0
  843. package/lib/types/es6/RowSelection.d.ts +75 -0
  844. package/lib/types/es6/SimpleImageFormatter.d.ts +21 -0
  845. package/lib/types/es6/SimpleInputFormatter.d.ts +12 -0
  846. package/lib/types/es6/SimpleLinkFormatter.d.ts +21 -0
  847. package/lib/types/es6/SimpleTickerFormatter.d.ts +23 -0
  848. package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
  849. package/lib/types/es6/StatisticsRow.d.ts +68 -0
  850. package/lib/types/es6/TextFormatter.d.ts +12 -0
  851. package/lib/types/es6/TextFormatting.d.ts +72 -0
  852. package/lib/types/es6/TitleWrap.d.ts +27 -0
  853. package/lib/types/es6/Zoom.d.ts +52 -0
  854. package/lib/types/es6/index.d.ts +80 -0
  855. package/lib/types/index.d.ts +1 -0
  856. package/lib/utils/index.d.ts +7 -0
  857. package/lib/utils/index.js +7 -0
  858. package/lib/versions.json +37 -0
  859. package/lib/window-exporter.js +18 -0
  860. package/lib/zoom/es6/Zoom.d.ts +52 -0
  861. package/lib/zoom/es6/Zoom.js +438 -0
  862. package/lib/zoom/es6/index.d.ts +1 -0
  863. package/lib/zoom/es6/index.js +1 -0
  864. package/package.json +69 -0
@@ -0,0 +1,2155 @@
1
+ import { Ext } from "../../tr-grid-util/es6/Ext.js";
2
+ import { GridPlugin } from "../../tr-grid-util/es6/GridPlugin.js";
3
+ import { Conflator } from "../../tr-grid-util/es6/Conflator.js";
4
+ import { Icon } from "../../tr-grid-util/es6/Icon.js";
5
+ import { ElfUtil } from "../../tr-grid-util/es6/ElfUtil.js";
6
+ import { GroupDefinitions } from "../../tr-grid-util/es6/GroupDefinitions.js";
7
+ import { Dom } from "../../tr-grid-util/es6/Dom.js";
8
+ import { injectCss, prettifyCss } from "../../tr-grid-util/es6/Util.js";
9
+ import { preventDefault } from "../../tr-grid-util/es6/EventDispatcher.js";
10
+
11
+ /** @typedef {Object} ColumnStackPlugin~Options
12
+ * @description Available options describing `columnStack` object specified in grid's option
13
+ * @property {Array.<string>} fields Fields for stacking. The minimum is 2 fields
14
+ * @property {Array.<ColumnStackPlugin~StackDefinition>} stacks List of stacking configuration
15
+ * @property {boolean=} autoStacking Deprecated. Stacks are automatically maintained as long as its members exist
16
+ * @property {Function=} clicked=null Event handler when user clicks on stack/expanding icon
17
+ * @property {Element=} menuElement Element used to display a column selection list
18
+ * @property {Function=} menuItemClicked When the menuElement is specified and menu item is clicked, an event handler is called
19
+ */
20
+
21
+ /** @typedef {Object} ColumnStackPlugin~ColumnOptions
22
+ * @description Extension column options that can be specified on each individual grid's column option.
23
+ * @property {string=} stackId Group ID
24
+ * @property {(string|ColumnStackPlugin~StackOptions)=} stack Group ID or StackOptions object
25
+ */
26
+
27
+ /** @typedef {Object} ColumnStackPlugin~StackOptions
28
+ * @description Available options describing grouped column displaying
29
+ * @property {string} id Group ID
30
+ * @property {boolean=} spreading=false If specified true, this group will be running in collapsing mode
31
+ * @property {boolean=} collapsed=true If disabled, this group will be expanded at the first time
32
+ */
33
+
34
+ /** @typedef {Object} ColumnStackPlugin~StackDefinition
35
+ * @description Available options for setting stack
36
+ * @property {string} id Group Id
37
+ * @property {boolean=} spreading=false If specified true, this group will be running in collapsing mode
38
+ * @property {boolean=} collapsed=true If disabled, this group will be expanded at the first time
39
+ * @property {Array.<string>=} children=null List of column Ids for the stack members. String in this array is assumed to be column ids
40
+ * @property {Array.<string>=} fields=null List of column fields for the stack members. This will override children property
41
+ * @property {string=} name="" Name defined for specific stack
42
+ * @property {string=} activeColumn="" Column Id or field of the active column.
43
+ */
44
+
45
+ /** @typedef {Object} ColumnStackPlugin~StackConfiguration
46
+ * @description Available options describing grouped column displaying
47
+ * @property {boolean=} spreading=false If specified true, this group will be running in collapsing mode
48
+ * @property {boolean=} collapsed=true If disabled, this group will be expanded at the first time
49
+ * @property {string=} activeColumn="" Column index, column id, or field for set as active column
50
+ */
51
+
52
+ /** @event ColumnStackPlugin#clicked
53
+ * @description Fired when user clicks on stack/expanding icon
54
+ * @type {Object}
55
+ * @property {number} colIndex The column index that was clicked
56
+ * @property {number} rowIndex The row index that was clicked
57
+ * @property {Array.<Object>} menuData Data for populating context menu
58
+ * @property {number} activeIndex The index of the item in the menuData that corresponds to the active column
59
+ * @property {Array.<number>} columnIndices Members column index
60
+ * @property {number} activeColIndex The column index that is currently active
61
+ * @property {Event} event Native event argument from click event
62
+ * @property {boolean} spreading True if the column being clicked is a member of the collapsing group
63
+ * @property {boolean} collapsed True If the clicked group is collapsed
64
+ */
65
+
66
+ /** @private
67
+ * @function
68
+ * @param {Object} indexMap
69
+ * @param {*} refA
70
+ * @param {*} refB
71
+ * @return {number}
72
+ */
73
+ let _indexSorter = function(indexMap, refA, refB) {
74
+ let numA = indexMap[refA];
75
+ let numB = indexMap[refB];
76
+ if(numA === numB) {
77
+ return 0;
78
+ }
79
+ if(numA < 0) {
80
+ return 1;
81
+ }
82
+ if(numB < 0) {
83
+ return -1;
84
+ }
85
+ return numA - numB;
86
+ };
87
+ /** @private
88
+ * @function
89
+ * @param {Object} indexMap
90
+ * @param {*} refA
91
+ * @return {boolean}
92
+ */
93
+ let _byValidIndex = function(indexMap, refA) {
94
+ return indexMap[refA] >= 0;
95
+ };
96
+
97
+ /** @private
98
+ * @description Resolve active column from the given stack object, if activeColumn is invalid
99
+ * @param {Object} stackOpt
100
+ * @return {boolean} Return true if there is any change
101
+ */
102
+ let _resolveActiveColumn = function(stackOpt) {
103
+ if(stackOpt) {
104
+ let children = stackOpt.children;
105
+ if(children && children.length) {
106
+ let activeColumn = stackOpt.activeColumn;
107
+ if(!activeColumn || children.indexOf(activeColumn) < 0) {
108
+ stackOpt.activeColumn = stackOpt.spreading ? children[children.length - 1] : children[0];
109
+ return true;
110
+ }
111
+ }
112
+ }
113
+ return false;
114
+ };
115
+
116
+ /** @constructor
117
+ * @extends {GridPlugin}
118
+ */
119
+ let ColumnStackPlugin = function () {
120
+ this._onPreSectionRender = this._onPreSectionRender.bind(this);
121
+ this._onColumnRemoved = this._onColumnRemoved.bind(this);
122
+ this._onColumnMoved = this._onColumnMoved.bind(this);
123
+ this._onColumnAdded = this._onColumnAdded.bind(this);
124
+ this._onBeforeBatchOperation = this._onBeforeBatchOperation.bind(this);
125
+ this._onAfterBatchOperation = this._onAfterBatchOperation.bind(this);
126
+ this._onMenuItemClicked = this._onMenuItemClicked.bind(this);
127
+
128
+ this._onStackButtonClicked = this._onStackButtonClicked.bind(this);
129
+ this._updateUI = this._updateUI.bind(this);
130
+ this._toColumnId = this._toColumnId.bind(this);
131
+ this._requestFilterRefresh = this._requestFilterRefresh.bind(this);
132
+
133
+ this._hosts = [];
134
+ this._groupDefs = new GroupDefinitions();
135
+
136
+ this._filterConflator = new Conflator(50, this._requestFilterRefresh);
137
+ this._conflator = new Conflator(50, this._updateUI);
138
+ };
139
+
140
+ Ext.inherits(ColumnStackPlugin, GridPlugin);
141
+
142
+ /** @type {!GroupDefinitions}
143
+ * @private
144
+ */
145
+ ColumnStackPlugin.prototype._groupDefs;
146
+ /** @type {Object.<string, string>}
147
+ * @private
148
+ */
149
+ ColumnStackPlugin.prototype._pendingStacks;
150
+ /** @type {Object.<string, string>}
151
+ * @private
152
+ */
153
+ ColumnStackPlugin.prototype._usingField = false;
154
+
155
+ /** @type {boolean}
156
+ * @private
157
+ */
158
+ ColumnStackPlugin.prototype._updating = false;
159
+
160
+ /** @type {number}
161
+ * @private
162
+ */
163
+ ColumnStackPlugin.prototype._inReordering = 0;
164
+ /** @type {boolean}
165
+ * @private
166
+ */
167
+ ColumnStackPlugin.prototype._inResetting = false;
168
+ /** @type {Element}
169
+ * @private
170
+ */
171
+ ColumnStackPlugin.prototype._menuElement = null;
172
+ /** @type {Function}
173
+ * @private
174
+ */
175
+ ColumnStackPlugin.prototype._menuItemClicked = null;
176
+
177
+ /** @type {number}
178
+ * @private
179
+ */
180
+ ColumnStackPlugin._runningId = 0;
181
+ /** @private
182
+ * @return {string}
183
+ */
184
+ ColumnStackPlugin.prototype._generateStackId = function() {
185
+ let sid = "Stack" + ColumnStackPlugin._runningId++;
186
+ while(this._groupDefs.getGroup(sid)) {
187
+ sid = "Stack" + ColumnStackPlugin._runningId++;
188
+ }
189
+ return sid;
190
+ };
191
+
192
+ /** @override
193
+ * @return {string}
194
+ */
195
+ ColumnStackPlugin.prototype.getName = function () {
196
+ return "ColumnStackPlugin"; // Readonly
197
+ };
198
+ /** @override
199
+ * @return {boolean}
200
+ */
201
+ ColumnStackPlugin.prototype.hasMultiTableSupport = function() {
202
+ return true;
203
+ };
204
+ /** @public
205
+ * @param {Object} host core grid object
206
+ * @param {Object=} options
207
+ */
208
+ ColumnStackPlugin.prototype.initialize = function (host, options) {
209
+ if(this._hosts.indexOf(host) >= 0) { return; }
210
+ this._hosts.push(host);
211
+
212
+ if(options) {
213
+ if(options["icons"]) {
214
+ let icons = options["icons"]["columnStack"];
215
+ if(icons) {
216
+ this._stackIconName = icons["stack"];
217
+ this._expandIconName = icons["expand"];
218
+ this._collapseIconName = icons["collapse"];
219
+ }
220
+ }
221
+
222
+ let opt = options["columnStack"];
223
+ if(opt && this._hosts.length === 1) {
224
+ let menuElement = opt["menuElement"];
225
+ if(menuElement && typeof menuElement === "object" && menuElement.nodeType === 1) {
226
+ menuElement.addEventListener("item-trigger", this._onMenuItemClicked);
227
+ this._menuElement = menuElement;
228
+ }
229
+
230
+ let menuItemClicked = opt["menuItemClicked"];
231
+ if(typeof menuItemClicked === "function") {
232
+ this._menuItemClicked = menuItemClicked;
233
+ }
234
+ }
235
+ }
236
+
237
+ ColumnStackPlugin._applyThemeColor(host);
238
+
239
+ if(this._hosts.length === 1) {
240
+ this.config(options); // WARNING: Configure only for the first host
241
+ host.listen("columnRemoved", this._onColumnRemoved);
242
+ host.listen("columnMoved", this._onColumnMoved);
243
+ host.listen("columnAdded", this._onColumnAdded);
244
+ host.listen("beforeBatchOperation", this._onBeforeBatchOperation);
245
+ host.listen("afterBatchOperation", this._onAfterBatchOperation);
246
+ }
247
+ host.listen("preSectionRender", this._onPreSectionRender);
248
+
249
+ // In case of lazy loading
250
+ // DO something
251
+ };
252
+ /** @public
253
+ * @param {Object} host core grid object
254
+ */
255
+ ColumnStackPlugin.prototype.unload = function (host) {
256
+ let at = this._hosts.indexOf(host);
257
+ if(at < 0) { return; }
258
+ this._hosts.splice(at, 1);
259
+
260
+ host.unlisten("columnRemoved", this._onColumnRemoved);
261
+ host.unlisten("columnMoved", this._onColumnMoved);
262
+ host.unlisten("columnAdded", this._onColumnAdded);
263
+ host.unlisten("beforeBatchOperation", this._onBeforeBatchOperation);
264
+ host.unlisten("afterBatchOperation", this._onAfterBatchOperation);
265
+ host.unlisten("preSectionRender", this._onPreSectionRender);
266
+
267
+ if(this._menuElement) {
268
+ this._menuElement.removeEventListener("item-trigger", this._onMenuItemClicked);
269
+ }
270
+
271
+ if(this._hosts.length <= 0) {
272
+ this._conflator.reset();
273
+ this._filterConflator.reset();
274
+ this._groupDefs.removeAllGroups();
275
+ }
276
+ this._dispose();
277
+ };
278
+
279
+ /** @private
280
+ * @type {string}
281
+ */
282
+ ColumnStackPlugin._styles = prettifyCss([
283
+ ".tr-grid .collapsed .cell.grouping .valigner", [
284
+ "width: 0;"
285
+ ],
286
+ ".tr-grid .collapsed .cell.grouping .floating-panel", [
287
+ "width: 100%;",
288
+ "margin: 0;",
289
+ "justify-content: center;"
290
+ ],
291
+ ".tr-grid .collapsed .cell.grouping .front-panel," +
292
+ ".tr-grid .collapsed .cell.grouping .floating-panel *:not(.stack-icon)," +
293
+ ".tr-grid .collapsed .cell.grouping .sort-symbol", [ // V3 Hide arrow sorting in collapse state in speading mode
294
+ "display: none;"
295
+ ],
296
+ ".floating-panel .stack-icon", [
297
+ "cursor: pointer;" // change the mouse cursor on the collapsed stack icon to allow for expansion but disallow sorting
298
+ ],
299
+ ".tr-grid .collapsed .cell.grouping .floating-panel .stack-icon", [
300
+ "margin-left: 0;",
301
+ "margin-right: 0;"
302
+ ],
303
+ ".stack-icon", [
304
+ "color: var(--grid-title-filter-icon-color);"
305
+ ],
306
+ ".stack-icon:hover", [
307
+ "color: var(--grid-title-filter-icon-hover-color);"
308
+ ]
309
+ ]);
310
+
311
+ /** @private
312
+ * @param {Object} grid core grid object
313
+ */
314
+ ColumnStackPlugin._applyThemeColor = function(grid) {
315
+ if(!grid._columnStackingStyles) {
316
+ grid._columnStackingStyles = true;
317
+ injectCss(ColumnStackPlugin._styles, grid.getElement());
318
+ }
319
+ };
320
+
321
+ /** @public
322
+ * @param {Object=} options
323
+ */
324
+ ColumnStackPlugin.prototype.config = function (options) {
325
+ if(!options) { return; }
326
+
327
+ let columns = options["columns"];
328
+ if(!columns) {
329
+ columns = [];
330
+ }
331
+
332
+ let i;
333
+ let colCount = columns.length;
334
+
335
+ let columnStack = options.columnStack;
336
+ let stackId = "";
337
+ let stacks = {};
338
+ let hasStack = false;
339
+ let stackConfig = null;
340
+ if(columnStack) {
341
+ this.addListener(columnStack, "clicked");
342
+ this._usingField = false;
343
+
344
+ if(columnStack.fields && columnStack.fields.length > 1) {
345
+ this._usingField = true;
346
+
347
+ hasStack = true;
348
+ stackId = this._generateStackId(); // TODO: Stack id may need to be hardcoded
349
+ stacks[stackId] = {
350
+ id: stackId,
351
+ spreading: columnStack.spreading === true,
352
+ collapsed: columnStack.collapsed !== false,
353
+ fields: columnStack.fields
354
+ };
355
+ } else if(columnStack.stacks && columnStack.stacks.length) {
356
+ hasStack = true;
357
+ let stackLen = columnStack.stacks.length;
358
+ for(i = 0; i < stackLen; i++){
359
+ stackConfig = columnStack.stacks[i];
360
+ stackId = stackConfig.id || this._generateStackId();
361
+ if(stackConfig.collapsed == null){ // TODO: consolidate with the above
362
+ stackConfig.collapsed = true;
363
+ }
364
+ if(stackConfig.spreading == null){
365
+ stackConfig.spreading = false;
366
+ }
367
+ stacks[stackId] = stackConfig;
368
+ }
369
+ }
370
+ }
371
+
372
+ if(!hasStack) {
373
+ for(i = 0; i < colCount; ++i) {
374
+ let column = columns[i];
375
+ let stackOpt = column["stackId"] || column["stack"];
376
+ if(!stackOpt) {
377
+ continue;
378
+ }
379
+
380
+ stackId = "";
381
+ let spreading = false;
382
+ let collapsed = true;
383
+ let activeColumn = "";
384
+ if(typeof stackOpt === "string") {
385
+ stackId = stackOpt;
386
+ } else if(typeof stackOpt === "object") {
387
+ stackConfig = stackOpt;
388
+ stackId = stackConfig["id"] || "";
389
+ spreading = stackConfig["spreading"] === true; // WARNING: Only the first column in the stack has an effect
390
+ collapsed = stackConfig["collapsed"] !== false;
391
+ activeColumn = stackConfig["activeColumn"] || "";
392
+ }
393
+ if(stackId) {
394
+ stackOpt = stacks[stackId];
395
+ if(!stackOpt) {
396
+ stackOpt = stacks[stackId] = {
397
+ id: stackId,
398
+ spreading: spreading, // Default is false (stacking mode)
399
+ collapsed: collapsed // Default is true (columns are hidden)
400
+ };
401
+ if(activeColumn) {
402
+ stackOpt.activeColumn = activeColumn;
403
+ }
404
+ hasStack = true;
405
+ }
406
+ if(!stackOpt.children) {
407
+ stackOpt.children = [];
408
+ }
409
+ stackOpt.children.push(i);
410
+ }
411
+ }
412
+ }
413
+
414
+ if(this._initializedGrid) {
415
+ this._applyUserConfigs(hasStack ? stacks : null);
416
+ } else {
417
+ this._pendingStacks = this._pendingStacks || stacks;
418
+ }
419
+ };
420
+
421
+
422
+ /** @public
423
+ * @param {Object=} gridOptions
424
+ * @return {!Object}
425
+ */
426
+ ColumnStackPlugin.prototype.getConfigObject = function (gridOptions) {
427
+ let obj = gridOptions || {};
428
+
429
+ // TODO: Handle the case where pendingStacks has not been applied
430
+ let stackOptions = this.getStacks();
431
+
432
+ if(stackOptions.length) {
433
+ obj.columnStack = {};
434
+ obj.columnStack.stacks = stackOptions;
435
+ }
436
+ return obj;
437
+ };
438
+
439
+ /** @override
440
+ * @ignore
441
+ */
442
+ ColumnStackPlugin.prototype._afterInit = function () {
443
+ if(this._pendingStacks) {
444
+ this._applyUserConfigs(this._pendingStacks);
445
+ this._pendingStacks = null;
446
+ }
447
+ // In case of lazy loading
448
+ // DO something
449
+ };
450
+
451
+ /** @private
452
+ * @param {*} colRef
453
+ * @return {string} column id
454
+ */
455
+ ColumnStackPlugin.prototype._toColumnId = function(colRef) {
456
+ if(typeof colRef !== "string") {
457
+ if(typeof colRef === "number") {
458
+ return this.getColumnId(colRef);
459
+ }
460
+ return "";
461
+ }
462
+ return colRef || "";
463
+ };
464
+ /** @private
465
+ * @param {Object=} stacks
466
+ */
467
+ ColumnStackPlugin.prototype._applyUserConfigs = function(stacks) {
468
+ if(stacks) {
469
+ this.removeAllStacks(false); // No UI update
470
+ for(let stackId in stacks) {
471
+ let stack = stacks[stackId];
472
+ let children = stack.children;
473
+ let fields = stack.fields;
474
+ if(fields) { // Convert all fields and indices to column Ids
475
+ this._usingField = true;
476
+ children = fields; // override children with fields
477
+ }
478
+ this.stackColumns(children, stackId, stack);
479
+ }
480
+ } else {
481
+ this.removeAllStacks(); // with UI update
482
+ }
483
+ };
484
+
485
+ /** @private
486
+ * @param {number} colIndex
487
+ * @return {Object}
488
+ */
489
+ ColumnStackPlugin.prototype._getColumnStackOptions = function(colIndex) {
490
+ if(colIndex >= 0 && colIndex < this.getColumnCount()) {
491
+ let colId = this.getColumnId(colIndex);
492
+ return this._groupDefs.getParentGroup(colId) || null;
493
+ }
494
+ return null;
495
+ };
496
+ /** @private
497
+ * @return {!Array.<number>} Sorted column indices
498
+ */
499
+ ColumnStackPlugin.prototype._getSelectedColumns = function() {
500
+ let csp = this._getPlugin("ColumnSelectionPlugin");
501
+ return (csp && csp.isEnabled()) ? csp.getSelectedColumns() : [];
502
+ };
503
+ /** Hide the specified column to prevent it from flashing when it is added as a member of the stack
504
+ * @private
505
+ * @param {Object} stack
506
+ * @param {(number|Array.<number>)=} colRefs
507
+ * @param {number=} activeRef
508
+ */
509
+ ColumnStackPlugin.prototype._hideStackedColumns = function(stack, colRefs, activeRef) {
510
+ if(stack.spreading && !stack.collapsed) {
511
+ return; // In spreading mode, columns in an expanded stack don't need to be hidden
512
+ }
513
+ // WARNING: activeIndex may not be valid
514
+ let activeIndex = (typeof activeRef === "number") ? activeRef : this.getColumnIndex(stack.activeColumn);
515
+ let colIndices = null;
516
+ if(typeof colRefs === "number") {
517
+ colIndices = [colRefs];
518
+ } else if(colIndices == null) {
519
+ colIndices = this.getColumnIndices(stack.children);
520
+ } else {
521
+ colIndices = colRefs;
522
+ }
523
+ let validCount = colIndices.length;
524
+ for(let i = 0; i < validCount; ++i) {
525
+ let colIndex = colIndices[i];
526
+ if(colIndex !== activeIndex) {
527
+ this._setColumnVisibility(colIndex, false); // Hide a column
528
+ }
529
+ }
530
+ };
531
+ /** @private
532
+ * @param {number} colIndex
533
+ * @param {boolean} shown
534
+ */
535
+ ColumnStackPlugin.prototype._setColumnVisibility = function(colIndex, shown) {
536
+ if(colIndex >= 0) {
537
+ let dirty = false;
538
+ for(let g = this._hosts.length; --g >= 0;) {
539
+ dirty |= this._hosts[g].setColumnVisibility(colIndex, shown, 2);
540
+ }
541
+
542
+ if(dirty){
543
+ this._requestFilterRefresh();
544
+ }
545
+ }
546
+ };
547
+ /** @private */
548
+ ColumnStackPlugin.prototype._requestFilterRefresh = function() {
549
+ if(this._filterConflator.conflate()) {
550
+ return;
551
+ }
552
+ let rfp = this._getPlugin("RowFilteringPlugin");
553
+ if(rfp && rfp["refresh"]) {
554
+ rfp["refresh"]();
555
+ }
556
+ };
557
+ /** @private
558
+ * @param {Array} colRefs Array of column index, id, or field
559
+ */
560
+ ColumnStackPlugin.prototype._moveStackedColumns = function (colRefs) {
561
+ let colIndices = this.getColumnIndices(colRefs);
562
+ if(colIndices.length > 1) {
563
+ this.reorderColumns(colIndices, colIndices[0]);
564
+ }
565
+ };
566
+ /** @private
567
+ * @return {boolean}
568
+ */
569
+ ColumnStackPlugin.prototype._isIconAvailable = function() {
570
+ return ElfUtil.hasComponent("ef-icon") &&
571
+ (ElfUtil.hasTheme("elf-theme-solar") ||
572
+ ElfUtil.hasTheme("elf-theme-luna"));
573
+ };
574
+ /** @private
575
+ * @param {number} colIndex
576
+ * @param {Object} stackOpt
577
+ */
578
+ ColumnStackPlugin.prototype._updateIcon = function(colIndex, stackOpt) {
579
+ let spreading = (stackOpt) ? stackOpt.spreading : false;
580
+ let gridCount = this._hosts.length;
581
+
582
+ for(let g = 0; g < gridCount; ++g) {
583
+ let host = this._hosts[g];
584
+ let tSect = host.getSection("title");
585
+ let rowCount = tSect.getRowCount();
586
+ let cell = tSect.getCell(colIndex, rowCount - 1, true);
587
+ if(!cell) { continue; }
588
+
589
+ let stackIcon = cell._stackIcon;
590
+ if(stackOpt) {
591
+ let activeStackedColumn = this.isActiveStackedColumn(colIndex);
592
+ if(!stackIcon && activeStackedColumn) {
593
+ if(spreading) {
594
+ cell.addClass("grouping");
595
+ if(this._expandIconName) {
596
+ if(stackOpt.collapsed) {
597
+ stackIcon = Icon.create(this._expandIconName);
598
+ } else {
599
+ stackIcon = Icon.create(this._collapseIconName);
600
+ }
601
+ } else {
602
+ if(stackOpt.collapsed) {
603
+ stackIcon = Dom.text(">");
604
+ } else {
605
+ stackIcon = Dom.text("<");
606
+ }
607
+ }
608
+ } else {
609
+ cell.addClass("stacking");
610
+ if(this._stackIconName) {
611
+ stackIcon = Icon.create(this._stackIconName);
612
+ } else {
613
+ stackIcon = Dom.text("\u2261");
614
+ stackIcon.style.fontSize = "1.3em";
615
+ }
616
+ }
617
+ stackIcon.className = "stack-icon";
618
+ stackIcon.addEventListener("click", this._onStackButtonClicked, false);
619
+ stackIcon.addEventListener("dblclick", preventDefault, false);
620
+ stackIcon.addEventListener("mousedown", preventDefault, false);
621
+ stackIcon.addEventListener("keydown", preventDefault, false);
622
+
623
+ cell.insertFloatingIcon(stackIcon, 20);
624
+ cell._stackIcon = stackIcon;
625
+
626
+ this._dispatch("iconCreated", {"icon": stackIcon, "colIndex": colIndex, "grid": host, "cell": cell});
627
+ } else if(stackIcon && !activeStackedColumn) {
628
+ cell.removeFloatingIcon(cell._stackIcon);
629
+ cell._stackIcon = null;
630
+ }
631
+ } else if(stackIcon) {
632
+ cell.removeFloatingIcon(cell._stackIcon);
633
+ cell._stackIcon = null;
634
+
635
+ // Do not know the previous stacking mode so it needs to remove all the classes here.
636
+ cell.removeClass("grouping");
637
+ cell.removeClass("stacking");
638
+ }
639
+ }
640
+ };
641
+ /** @private */
642
+ ColumnStackPlugin.prototype._updateUI = function() {
643
+ if(this._updating) { // Avoid infinite loop
644
+ return;
645
+ }
646
+ if(this._conflator.conflate()) {
647
+ return;
648
+ }
649
+
650
+ this._updating = true;
651
+ let colCount = this.getColumnCount();
652
+ let gridCount = this._hosts.length;
653
+ let stackOpt, spreading;
654
+ for(let c = 0; c < colCount; ++c) {
655
+ stackOpt = this._getColumnStackOptions(c);
656
+ spreading = (stackOpt) ? stackOpt.spreading : false;
657
+ spreading = spreading === true;
658
+ for(let g = 0; g < gridCount; ++g) {
659
+ let host = this._hosts[g];
660
+ host.enableColumnClass(c, "grouped", spreading);
661
+ }
662
+
663
+ this._updateIcon(c, stackOpt);
664
+ if(stackOpt) {
665
+ if(stackOpt.spreading) {
666
+ this._collapseMember(c, stackOpt.collapsed);
667
+ } else {
668
+ this._setColumnVisibility(c, this._isActiveStackedColumn(c, stackOpt)); // a little slow
669
+ }
670
+ }
671
+ }
672
+ this._updating = false;
673
+ };
674
+ /** @private */
675
+ ColumnStackPlugin.prototype._forceUpdateUI = function() {
676
+ this._conflator.disable();
677
+ this._updateUI();
678
+ this._conflator.enable();
679
+ };
680
+ /** @private
681
+ * @param {number} colIndex
682
+ * @param {boolean} collapsed
683
+ */
684
+ ColumnStackPlugin.prototype._collapseMember = function(colIndex, collapsed) {
685
+ let stackOpt = this._getColumnStackOptions(colIndex);
686
+ if(!stackOpt) {
687
+ return;
688
+ }
689
+
690
+ for(let i = this._hosts.length; --i >= 0;) {
691
+ let host = this._hosts[i];
692
+ host.enableColumnClass(colIndex, "collapsed", collapsed);
693
+
694
+ if(this.isActiveStackedColumn(colIndex)) {
695
+ host.setColumnVisibility(colIndex, true, 2);
696
+ let tSect = host.getSection("title");
697
+ let rowCount = tSect.getRowCount();
698
+ let cell = tSect.getCell(colIndex, rowCount - 1, true);
699
+ if(collapsed) {
700
+ if(stackOpt.collapsed !== collapsed || !stackOpt._origWidth) { // Prevent from getting width while column is collapsed
701
+ stackOpt._origWidth = this._getColumnWidth(host, colIndex);
702
+ stackOpt._scalable = host.getColumnScalability(colIndex);
703
+ }
704
+
705
+ host.setColumnWidth(colIndex, tSect.getRowHeight(0), false);
706
+
707
+ if(cell._stackIcon) {
708
+ if(this._expandIconName) {
709
+ cell._stackIcon.setAttribute("icon", "right");
710
+ } else {
711
+ cell._stackIcon.textContent = ">";
712
+ }
713
+ }
714
+ } else {
715
+ if(stackOpt._origWidth != null) {
716
+ host.setColumnWidth(colIndex, stackOpt._origWidth, stackOpt._scalable);
717
+ }
718
+
719
+ if(cell._stackIcon) {
720
+ if(this._collapseIconName) {
721
+ cell._stackIcon.setAttribute("icon", "left");
722
+ } else {
723
+ cell._stackIcon.textContent = "<";
724
+ }
725
+ }
726
+ }
727
+ } else {
728
+ host.setColumnVisibility(colIndex, !collapsed, 2);
729
+ }
730
+ }
731
+ };
732
+ /** Get column width that is currently defined in the layout inside grid <br>
733
+ * (not included the effect by this extension). <br>
734
+ * Hidden column still gives positive size as oppose to visibly 0 size
735
+ * @private
736
+ * @param {Object} host core grid object
737
+ * @param {number} colIndex
738
+ * @return {number}
739
+ */
740
+ ColumnStackPlugin.prototype._getColumnWidth = function(host, colIndex) {
741
+ if(host) {
742
+ let min = host.getMinimumColumnWidth(colIndex);
743
+ let size = host.getColumnCustomLaneSize(colIndex);
744
+ return (size < min) ? min : size; // Column width cannot be smaller than min
745
+ }
746
+ return NaN;
747
+ };
748
+ /** @public
749
+ * @param {number} colIndex
750
+ * @return {Array.<number>} Null if there is no column data
751
+ */
752
+ ColumnStackPlugin.prototype.getMemberIndices = function(colIndex) {
753
+ let stackOpt = this._getColumnStackOptions(colIndex);
754
+ if(stackOpt) {
755
+ return this.getColumnIndices(stackOpt.children);
756
+ }
757
+ return null;
758
+ };
759
+ /** @public
760
+ * @param {number} colIndex
761
+ * @param {boolean=} collapsed
762
+ * @return {Array.<number>} Null if it is non-grouped column
763
+ */
764
+ ColumnStackPlugin.prototype.collapseGroup = function(colIndex, collapsed) {
765
+ let stackOpt = this._getColumnStackOptions(colIndex);
766
+ if(!stackOpt) {
767
+ return null;
768
+ }
769
+ if(!stackOpt.spreading) {
770
+ return null;
771
+ }
772
+
773
+ collapsed = collapsed !== false;
774
+ if(stackOpt.collapsed !== collapsed) {
775
+ let groupMembers = this.getColumnIndices(stackOpt.children);
776
+ if(groupMembers) {
777
+ for(let j = groupMembers.length; --j >= 0;) {
778
+ this._collapseMember(groupMembers[j], collapsed);
779
+ }
780
+ stackOpt.collapsed = collapsed;
781
+
782
+ return groupMembers;
783
+ }
784
+ }
785
+ return null;
786
+ };
787
+ /** @public
788
+ * @param {number} colIndex
789
+ * @return {Array.<number>} Null if it is non-grouped column
790
+ */
791
+ ColumnStackPlugin.prototype.expandGroup = function(colIndex) {
792
+ return this.collapseGroup(colIndex, false);
793
+ };
794
+ /** Intended for determining if the selected columns can be stacked from the context menu
795
+ * @public
796
+ * @param {Array.<number>} colIndices
797
+ * @return {boolean} Return true if all of the given columns can be stacked together
798
+ */
799
+ ColumnStackPlugin.prototype.isColumnStackable = function(colIndices) {
800
+ if(!colIndices) {
801
+ return false;
802
+ }
803
+ let len = colIndices.length;
804
+ for(let i = 0; i < len; ++i) {
805
+ if(this._getColumnStackOptions(colIndices[i])) {
806
+ return false;
807
+ }
808
+ }
809
+ return true;
810
+ };
811
+ /** Deprecated. Use isColumnInCollection instead.
812
+ * @public
813
+ * @param {Array.<number>=} colIndices
814
+ * @return {boolean} Return true if one of the columns is being stacked
815
+ */
816
+ ColumnStackPlugin.prototype.isColumnStacked = function(colIndices) {
817
+ if(!colIndices) {
818
+ colIndices = this._getSelectedColumns();
819
+ }
820
+ let len = colIndices.length;
821
+ for(let i = 0; i < len; ++i) {
822
+ if(this._getColumnStackOptions(colIndices[i])) {
823
+ return true;
824
+ }
825
+ }
826
+ return false;
827
+ };
828
+ /** This method is deprecated in favor of isColumnActive method. This method checks if the given column is inactive or doesn't have the icon.
829
+ * @public
830
+ * @param {number} colIndex
831
+ * @return {boolean} Return true if the columns is grouped and inactive
832
+ * @see {@link ColumnStackPlugin#isColumnActive}
833
+ */
834
+ ColumnStackPlugin.prototype.isInactiveStackedColumn = function(colIndex) {
835
+ let stackOpt = this._getColumnStackOptions(colIndex);
836
+ if(stackOpt) {
837
+ return !this._isActiveStackedColumn(colIndex, stackOpt);
838
+ }
839
+ return false;
840
+ };
841
+ /** This method is deprecated in favor of isColumnActive method. This method checks if the given column is active and has the icon.
842
+ * @public
843
+ * @param {number} colIndex
844
+ * @return {boolean}
845
+ * @see {@link ColumnStackPlugin#isColumnActive}
846
+ */
847
+ ColumnStackPlugin.prototype.isActiveStackedColumn = function(colIndex) {
848
+ return this._isActiveStackedColumn(colIndex, this._getColumnStackOptions(colIndex));
849
+ };
850
+ /** @private
851
+ * @param {number} colIndex
852
+ * @param {Object} stackOpt
853
+ * @return {boolean}
854
+ */
855
+ ColumnStackPlugin.prototype._isActiveStackedColumn = function(colIndex, stackOpt) {
856
+ if(stackOpt) {
857
+ _resolveActiveColumn(stackOpt);
858
+
859
+ return colIndex === this.getColumnIndex(stackOpt.activeColumn);
860
+ }
861
+ return false;
862
+ };
863
+
864
+ /** @public
865
+ * @param {number} colIndex
866
+ * @return {boolean}
867
+ */
868
+ ColumnStackPlugin.prototype.isStackingMode = function(colIndex) {
869
+ let stackOpt = this._getColumnStackOptions(colIndex);
870
+ if(stackOpt) {
871
+ return stackOpt.spreading !== true;
872
+ }
873
+ return false;
874
+ };
875
+ /** @public
876
+ * @param {number} colIndex
877
+ * @return {boolean}
878
+ */
879
+ ColumnStackPlugin.prototype.isCollapsingMode = function(colIndex) {
880
+ let stackOpt = this._getColumnStackOptions(colIndex);
881
+ if(stackOpt) {
882
+ return stackOpt.spreading === true;
883
+ }
884
+ return false;
885
+ };
886
+ /** @public
887
+ * @param {number} colIndex
888
+ * @return {boolean}
889
+ */
890
+ ColumnStackPlugin.prototype.isColumnInCollection = function(colIndex) {
891
+ return this._getColumnStackOptions(colIndex) ? true : false;
892
+ };
893
+ /** Alias of isColumnInCollection
894
+ * @public
895
+ * @function
896
+ * @param {number} colIndex
897
+ * @return {boolean}
898
+ */
899
+ ColumnStackPlugin.prototype.isInCollection = ColumnStackPlugin.prototype.isColumnInCollection;
900
+ /** Return collapsing state in collapsing mode. Always return false for stacking mode
901
+ * @public
902
+ * @param {number} colIndex
903
+ * @return {boolean}
904
+ */
905
+ ColumnStackPlugin.prototype.isColumnCollapsed = function(colIndex) {
906
+ let stackOpt = this._getColumnStackOptions(colIndex);
907
+ if(stackOpt) {
908
+ return (stackOpt.spreading === true) && (stackOpt.collapsed === true);
909
+ }
910
+ return false;
911
+ };
912
+ /** @public
913
+ * @param {number} colIndex
914
+ * @return {boolean}
915
+ */
916
+ ColumnStackPlugin.prototype.isColumnActive = function(colIndex) {
917
+ let stackOpt = this._getColumnStackOptions(colIndex);
918
+ if(stackOpt) {
919
+ if(stackOpt.spreading) {
920
+ if(!stackOpt.collapsed) {
921
+ return true;
922
+ } else {
923
+ return false;
924
+ }
925
+ } else {
926
+ return colIndex === this.getColumnIndex(stackOpt.activeColumn);
927
+ }
928
+ }
929
+ return false;
930
+ };
931
+
932
+ /** @public
933
+ * @param {number|string} colRef Column Id, index or field
934
+ * @return {string}
935
+ */
936
+ ColumnStackPlugin.prototype.getStackId = function(colRef) {
937
+ let colIndex = (typeof colRef === "number") ? colRef : this.getColumnIndex(colRef);
938
+ if(colIndex >= 0) {
939
+ let stackOpt = this._getColumnStackOptions(colIndex);
940
+ if(stackOpt) {
941
+ return stackOpt.id || "";
942
+ }
943
+ }
944
+ return "";
945
+ };
946
+ /** @public
947
+ * @param {Array.<number|string>=} colRefs Column Ids, indices, or fields. If not specified, selected columns will be used.
948
+ * @param {string=} stackId Must be unique
949
+ * @param {ColumnStackPlugin~StackConfiguration=} options
950
+ * @return {boolean} Return true if there is any change.
951
+ */
952
+ ColumnStackPlugin.prototype.stackColumns = function(colRefs, stackId, options) {
953
+ let updateRequired = false;
954
+ let sid = stackId;
955
+ if(sid) {
956
+ if(this._removeStack(sid)) {
957
+ // TODO: pinning state are removed and may need to be kept
958
+ updateRequired = true;
959
+ }
960
+ } else {
961
+ sid = this._generateStackId();
962
+ }
963
+
964
+ if(!colRefs) {
965
+ colRefs = this._getSelectedColumns();
966
+ }
967
+
968
+ let refCount = colRefs ? colRefs.length : 0;
969
+ if(refCount < 2) {
970
+ if(updateRequired) {
971
+ this._updateUI();
972
+ }
973
+ return updateRequired; // Only two or more columns can be stacked
974
+ }
975
+
976
+ if(!options) {
977
+ options = {};
978
+ }
979
+ // Clone user data
980
+ let isSpreading = options.spreading === true;
981
+ let isCollapsed = options.collapsed !== false;
982
+ let activeColumn = options.activeColumn || ""; // field or id
983
+ // WARNING: fields property in user option is ignored
984
+ let stack = {};
985
+ stack.id = sid;
986
+ stack.name = options.name || "";
987
+ stack.spreading = isSpreading;
988
+ stack.collapsed = isCollapsed;
989
+ stack.activeColumn = activeColumn; // field or id
990
+
991
+ // If grid is not initialized, add setting to pending stacks
992
+ if(!this._initializedGrid) {
993
+ let pendingStacks = this._pendingStacks;
994
+ if(!pendingStacks) {
995
+ pendingStacks = this._pendingStacks = {};
996
+ }
997
+ stack.children = colRefs;
998
+ pendingStacks[sid] = stack;
999
+ return false;
1000
+ }
1001
+
1002
+ let colIndices = this.getColumnIndices(colRefs); // WARNING: Invalid columns are filtered out
1003
+
1004
+ // Prevent columns already in a stack from moving out to another stack
1005
+ if(!this.isColumnStackable(colIndices)) {
1006
+ if(updateRequired) {
1007
+ this._updateUI();
1008
+ }
1009
+ return updateRequired;
1010
+ }
1011
+
1012
+ // WARNING: Invalid columns are filtered out
1013
+ let children = colIndices.map(this._toColumnId); // All fields and indices from colRefs will be converted to column Ids
1014
+ stack.children = children; // Note: children property now contains only valid column ids
1015
+
1016
+ let activeIndex = -1;
1017
+ if(activeColumn && typeof activeColumn === "string") {
1018
+ activeIndex = this.getColumnIndex(activeColumn);
1019
+ stack.activeColumn = activeColumn = this.getColumnId(activeIndex); // Convert field or invalid column id to a valid id
1020
+ } else if(typeof activeColumn === "number"){
1021
+ activeIndex = activeColumn;
1022
+ }
1023
+
1024
+ if(_resolveActiveColumn(stack)) {
1025
+ activeColumn = stack.activeColumn;
1026
+ activeIndex = this.getColumnIndex(activeColumn);
1027
+ }
1028
+
1029
+ this._hideStackedColumns(stack, colIndices, activeIndex);
1030
+
1031
+ // Make sure that all columns stay packed together
1032
+ this.reorderColumns(colIndices, colIndices[0]);
1033
+
1034
+ // Update column selection
1035
+ let validCount = colIndices.length;
1036
+ if(!isSpreading) {
1037
+ let csp = this._getPlugin("ColumnSelectionPlugin");
1038
+ if(csp && csp.isEnabled()){
1039
+ let stackSelection = false;
1040
+ for(let i = 0; i < validCount; ++i){
1041
+ let colIndex = colIndices[i];
1042
+ if(colIndex === activeIndex){
1043
+ continue;
1044
+ }
1045
+ if(csp.isSelectedColumn(colIndex)){
1046
+ stackSelection = true;
1047
+ break;
1048
+ }
1049
+ }
1050
+ if(stackSelection) {
1051
+ csp.selectSingleColumn(activeIndex);
1052
+ if(csp.dispatchSelectionChanged) {
1053
+ csp.dispatchSelectionChanged();
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+
1059
+ this._verifyColumnPinning(stack);
1060
+
1061
+ this._groupDefs.setGroup(sid, stack);
1062
+
1063
+ this._updateUI(); // asyncronuos
1064
+ return true;
1065
+ };
1066
+
1067
+ /** @private
1068
+ * @param {Object} stack
1069
+ */
1070
+ ColumnStackPlugin.prototype._verifyColumnPinning = function(stack) {
1071
+ stack.leftPinned = false;
1072
+ stack.rightPinned = false;
1073
+
1074
+ let host = this._hosts[0];
1075
+ let leftPinnedIndex = host.getFrozenColumnCount() - 1;
1076
+ let rightPinnedIndex = host.getFirstPinnedRightIndex();
1077
+ let colCount = this.getColumnCount();
1078
+
1079
+ if(leftPinnedIndex < 0 && rightPinnedIndex === colCount) {
1080
+ return;
1081
+ }
1082
+
1083
+ let colIndices = this.getColumnIndices(stack.children);
1084
+ let min = colIndices[0];
1085
+ let max = colIndices[0];
1086
+ for(let i = 1; i < colIndices.length; i++) {
1087
+ let colIndex = colIndices[i];
1088
+ if(colIndex > max) { max = colIndex; }
1089
+ if(colIndex < min) { min = colIndex; }
1090
+ }
1091
+
1092
+ if(min <= leftPinnedIndex) {
1093
+ stack.leftPinned = true;
1094
+ if(max > leftPinnedIndex) {
1095
+ this._freezeColumn(max, colCount - rightPinnedIndex);
1096
+ }
1097
+ } else if(max >= rightPinnedIndex) {
1098
+ stack.rightPinned = true;
1099
+ if(min < rightPinnedIndex) {
1100
+ this._freezeColumn(leftPinnedIndex, colCount - min);
1101
+ }
1102
+ }
1103
+ };
1104
+
1105
+ /** @private
1106
+ * @param {number} frozenColIndex
1107
+ * @param {number=} numRightColumn
1108
+ */
1109
+ ColumnStackPlugin.prototype._freezeColumn = function(frozenColIndex, numRightColumn) {
1110
+ let hosts = this._hosts;
1111
+ for(let i = 0; i < hosts.length; i++) {
1112
+ hosts[i].freezeColumn(frozenColIndex, numRightColumn);
1113
+ }
1114
+ };
1115
+
1116
+ /** @public
1117
+ * @description Replace all of the stacking in the Grid with a new one.
1118
+ * @param {Array.<number|string>=} colRefs Column Ids, indices, or fields.
1119
+ * @param {(number|string)=} activeColRef Column Id, index, or field.
1120
+ * @return {boolean} If the stack has been updated, return true.
1121
+ */
1122
+ ColumnStackPlugin.prototype.setStack = function(colRefs, activeColRef) {
1123
+ this.removeAllStacks();
1124
+
1125
+ let stackOptions = {};
1126
+ if(activeColRef) {
1127
+ stackOptions.activeColumn = activeColRef;
1128
+ }
1129
+ // WARNING: Id is hardcoded for assign uniqe stacking id
1130
+ this.stackColumns(colRefs, "_uniqueStack", stackOptions);
1131
+
1132
+ return true;
1133
+ };
1134
+ /** @public
1135
+ * @description Remove all existing stacks and apply the given stack definitions to the Grid
1136
+ * @param {Array.<ColumnStackPlugin~StackDefinition>} stacks Array of stack definition objects
1137
+ */
1138
+ ColumnStackPlugin.prototype.setStacks = function(stacks) {
1139
+ this.removeAllStacks();
1140
+
1141
+ let stackCount = stacks ? stacks.length : 0;
1142
+ for(let i = 0; i < stackCount; ++i) {
1143
+ let stack = stacks[i];
1144
+ if(stack) {
1145
+ if(stack.children) {
1146
+ this.stackColumns(stack.children, stack.id, stack);
1147
+ }
1148
+ }
1149
+ }
1150
+ };
1151
+ /** @public
1152
+ * @description Get stack defintion objects like those returned from getConfigObject
1153
+ * @return {!Array.<ColumnStackPlugin~StackDefinition>} Array of stack definition objects
1154
+ */
1155
+ ColumnStackPlugin.prototype.getStacks = function() {
1156
+ let stacks = this._groupDefs.getGroupMap();
1157
+ let stackOptions = [];
1158
+
1159
+ for(let stackKey in stacks) {
1160
+ let stackOption = stacks[stackKey];
1161
+ let stackId = stackOption.id;
1162
+
1163
+ let stackConfigObj = {
1164
+ id: stackId
1165
+ };
1166
+ let name = stackOption.name;
1167
+ let collapsed = stackOption.collapsed;
1168
+ let spreading = stackOption.spreading;
1169
+
1170
+ if(name) {
1171
+ stackConfigObj.name = name;
1172
+ }
1173
+ if(collapsed !== true) {
1174
+ stackConfigObj.collapsed = collapsed;
1175
+ }
1176
+ if(spreading !== false) {
1177
+ stackConfigObj.spreading = spreading;
1178
+ }
1179
+
1180
+ if(this._usingField) {
1181
+ let colIndices = this.getStackMemberIndices(stackId);
1182
+ let memberCount = colIndices.length;
1183
+ let fields = new Array(memberCount);
1184
+ for(let i = 0; i < memberCount; ++i) {
1185
+ fields[i] = this.getColumnField(colIndices[i]);
1186
+ }
1187
+ stackConfigObj.fields = fields;
1188
+ stackConfigObj.activeColumn = this.getActiveColumnField(stackId);
1189
+ } else {
1190
+ stackConfigObj.children = this.getStackMemberIds(stackId).slice();
1191
+ if(stackOption.activeColumn) {
1192
+ stackConfigObj.activeColumn = stackOption.activeColumn;
1193
+ }
1194
+ }
1195
+ stackOptions.push(stackConfigObj);
1196
+ }
1197
+ return stackOptions;
1198
+ };
1199
+
1200
+ /** @public
1201
+ * @param {Array.<number>=} colIndices Selected columns will be used, if it is not given
1202
+ * @return {boolean}
1203
+ */
1204
+ ColumnStackPlugin.prototype.unstackColumns = function(colIndices) {
1205
+ if(!colIndices) {
1206
+ colIndices = this._getSelectedColumns();
1207
+ }
1208
+
1209
+ let dirty = false;
1210
+ let len = colIndices.length;
1211
+ for(let i = 0; i < len; ++i) {
1212
+ let colIndex = colIndices[i];
1213
+ let stackOpt = this._getColumnStackOptions(colIndex);
1214
+ if(stackOpt) {
1215
+ dirty = true;
1216
+ this._removeStack(stackOpt.id);
1217
+ }
1218
+ }
1219
+ if(dirty) {
1220
+ this._updateUI(); // asyncronuos
1221
+ }
1222
+
1223
+ return dirty;
1224
+ };
1225
+ /** @private
1226
+ * @param {string} stackId
1227
+ * @return {boolean} Returns true if there is any change
1228
+ */
1229
+ ColumnStackPlugin.prototype._removeStack = function(stackId) {
1230
+ let stack = this._groupDefs.getGroup(stackId);
1231
+ if(!stack) {
1232
+ return false;
1233
+ }
1234
+
1235
+ let colIndices = this.getColumnIndices(stack.children);
1236
+ let len = colIndices.length;
1237
+ for(let i = 0; i < len; ++i) {
1238
+ let colIndex = colIndices[i]; // colIndex is guaranteed to be positive (verified)
1239
+ if(stack.spreading && stack.collapsed) {
1240
+ this._collapseMember(colIndex, false);
1241
+ }
1242
+
1243
+ this._setColumnVisibility(colIndex, true);
1244
+ }
1245
+ this._groupDefs.removeGroup(stackId);
1246
+ return true;
1247
+ };
1248
+ /** @public
1249
+ * @param {string} stackId
1250
+ * @return {boolean} Returns true if there is any change
1251
+ */
1252
+ ColumnStackPlugin.prototype.removeStack = function(stackId) {
1253
+ if(this._removeStack(stackId)) {
1254
+ this._updateUI();
1255
+ return true;
1256
+ }
1257
+ return false;
1258
+ };
1259
+ /** @public
1260
+ * @param {boolean=} enableUpdateUI=true Set false if you want to remove without update UI
1261
+ * @return {boolean} true if at least one stacking removed
1262
+ */
1263
+ ColumnStackPlugin.prototype.removeAllStacks = function(enableUpdateUI) {
1264
+ let groupIds = this._groupDefs.getGroupIds();
1265
+ let groupCount = groupIds.length;
1266
+ if(groupCount) {
1267
+ for(let i = 0; i < groupCount; ++i) {
1268
+ this._removeStack(groupIds[i]);
1269
+ }
1270
+ this._groupDefs.removeAllGroups(); // TODO: May not necessary
1271
+
1272
+ if(enableUpdateUI !== false) {
1273
+ this._updateUI(); // asyncronous
1274
+ }
1275
+ }
1276
+ return groupCount ? true : false;
1277
+ };
1278
+ /** If the column is in a stack, the column become an activeColumn of the stack.
1279
+ * @public
1280
+ * @param {number|string} activeColumn Column index, id, or field
1281
+ * @return {boolean}
1282
+ */
1283
+ ColumnStackPlugin.prototype.setActiveColumn = function(activeColumn) {
1284
+ let colIndex = this.getColumnIndex(activeColumn);
1285
+ if(colIndex < 0) {
1286
+ return false;
1287
+ }
1288
+ let colCount = this.getColumnCount();
1289
+ if(colIndex >= colCount) {
1290
+ return false;
1291
+ }
1292
+
1293
+ let colId = this.getColumnId(colIndex);
1294
+ let stack = this._groupDefs.getParentGroup(colId);
1295
+ if(!stack) {
1296
+ return false;
1297
+ }
1298
+ let chdr = stack.children;
1299
+ let memberIndex = chdr.indexOf(colId);
1300
+ if(memberIndex < 0) {
1301
+ return false;
1302
+ }
1303
+ return this._setActiveColumn(stack, chdr[memberIndex]);
1304
+ };
1305
+ /** This method is deprecated in favor of setActiveColumn. Make the specified column switch place with the item in the stack.
1306
+ * @public
1307
+ * @param {number|Event} colRef
1308
+ * @param {number} swappingIndex
1309
+ * @return {boolean}
1310
+ * @see {@link ColumnStackPlugin#setActiveColumn}
1311
+ */
1312
+ ColumnStackPlugin.prototype.swapColumn = function(colRef, swappingIndex) {
1313
+ let colIndex = (typeof colRef === "number") ? colRef : this.getColumnIndex(colRef);
1314
+
1315
+ let stackOpt = this._getColumnStackOptions(colIndex);
1316
+ if(!stackOpt) {
1317
+ return false; // Invalid column index
1318
+ }
1319
+ let children = stackOpt.children;
1320
+ if(!children) {
1321
+ return false; // Invalid column type
1322
+ }
1323
+
1324
+ return this._setActiveColumn(stackOpt, children[swappingIndex]);
1325
+ };
1326
+ /** @private
1327
+ * @param {Object} stack Stack object
1328
+ * @param {string} newActiveColumn Column id or field
1329
+ * @return {boolean}
1330
+ */
1331
+ ColumnStackPlugin.prototype._setActiveColumn = function(stack, newActiveColumn) {
1332
+ if(!newActiveColumn) {
1333
+ return false; // Invalid active column
1334
+ }
1335
+ if(newActiveColumn === stack.activeColumn) {
1336
+ return false; // The given index is already active stacked column
1337
+ }
1338
+
1339
+ let prevActiveColumnIndex = this.getColumnIndex(stack.activeColumn);
1340
+ let newActiveColumnIndex = this.getColumnIndex(newActiveColumn);
1341
+ stack.activeColumn = newActiveColumn; // Change active column
1342
+
1343
+ this._setColumnVisibility(newActiveColumnIndex, true);
1344
+ this._setColumnVisibility(prevActiveColumnIndex, false); // Hide current active column
1345
+
1346
+ this._updateIcon(prevActiveColumnIndex, stack);
1347
+ this._updateIcon(newActiveColumnIndex, stack);
1348
+
1349
+ let csp = this._getPlugin("ColumnSelectionPlugin");
1350
+ if(csp && csp.isEnabled()) {
1351
+ csp.selectSingleColumn(newActiveColumnIndex);
1352
+ if(csp.dispatchSelectionChanged) {
1353
+ csp.dispatchSelectionChanged();
1354
+ }
1355
+ }
1356
+ return true;
1357
+ };
1358
+
1359
+ /** @private
1360
+ * @param {Object} e
1361
+ */
1362
+ ColumnStackPlugin.prototype._onPreSectionRender = function (e) {
1363
+ if(e["sectionType"] !== "title") {
1364
+ return;
1365
+ }
1366
+ this._forceUpdateUI();
1367
+ };
1368
+ /** @private
1369
+ * @param {Object} e
1370
+ */
1371
+ ColumnStackPlugin.prototype._onColumnRemoved = function (e) {
1372
+ if(this._inResetting) {
1373
+ return;
1374
+ }
1375
+
1376
+ let colId = e.colId;
1377
+ let stackOpt = this._groupDefs.getParentGroup(colId);
1378
+
1379
+ if(!stackOpt) {
1380
+ return;
1381
+ }
1382
+ // update members
1383
+ let children = stackOpt.children;
1384
+ if(children.length <= 2) {
1385
+ this._removeStack(stackOpt.id);
1386
+ this._updateUI();
1387
+ } else {
1388
+ this._groupDefs.removeGroupChild(stackOpt.id, colId);
1389
+ this._updateActiveColumn(stackOpt); // This may trigger _updateUI
1390
+ }
1391
+ };
1392
+ /** @private
1393
+ * @param {Object} e
1394
+ */
1395
+ ColumnStackPlugin.prototype._onColumnMoved = function (e) {
1396
+ if(this._inReordering || this._inResetting) {
1397
+ if(this._inReordering) {
1398
+ this._inReordering = 2; // Mark dirty
1399
+ }
1400
+ return; // during the reordering or resetting, there is no need to recalculate stacks
1401
+ }
1402
+
1403
+ let toIndex = e.toColIndex;
1404
+ let colId = this.getColumnId(toIndex);
1405
+ let stackOpt = this._groupDefs.getParentGroup(colId);
1406
+ if(!stackOpt) {
1407
+ return;
1408
+ }
1409
+
1410
+ let leftStackOpt = this._getColumnStackOptions(toIndex - 1);
1411
+ let rightStackOpt = this._getColumnStackOptions(toIndex + 1);
1412
+
1413
+ let stackChange = true;
1414
+ let dirty = false;
1415
+ if(stackOpt) {
1416
+ // The move was within the same stack
1417
+ if(stackOpt === leftStackOpt || stackOpt === rightStackOpt) {
1418
+ this._repositionMembers(stackOpt);
1419
+ stackChange = false;
1420
+ } else { // The move was out from its own stack
1421
+ if(stackOpt.children.length <= 2) {
1422
+ this._removeStack(stackOpt.id);
1423
+ } else {
1424
+ this._removeRefFromStack(stackOpt, colId, toIndex);
1425
+ }
1426
+ }
1427
+ dirty = true;
1428
+ }
1429
+
1430
+ if(stackChange) {
1431
+ if(this._isWithinStack(toIndex)) {
1432
+ if(this._addRefToStack(leftStackOpt, toIndex)) {
1433
+ dirty = true;
1434
+ }
1435
+ }
1436
+ }
1437
+
1438
+ if(dirty) {
1439
+ this._updateUI();
1440
+ }
1441
+ };
1442
+ /** @private
1443
+ * @param {Object} e
1444
+ */
1445
+ ColumnStackPlugin.prototype._onColumnAdded = function (e) {
1446
+ if(this._inResetting) {
1447
+ return;
1448
+ }
1449
+
1450
+ let colIndex = e.colIndex;
1451
+ let stackOpt = this._isWithinStack(colIndex);
1452
+ if(stackOpt) {
1453
+ if(this._addRefToStack(stackOpt, colIndex)) {
1454
+ this._updateUI();
1455
+ }
1456
+ }
1457
+ };
1458
+ /** @private
1459
+ * @param {Object} e
1460
+ */
1461
+ ColumnStackPlugin.prototype._onBeforeBatchOperation = function (e) {
1462
+ if(e.batchType === "reset") {
1463
+ this._inResetting = true;
1464
+ } else if(e.batchType === "move") {
1465
+ this._inReordering = 1;
1466
+ }
1467
+ };
1468
+ /** @private
1469
+ * @param {Object} e
1470
+ */
1471
+ ColumnStackPlugin.prototype._onAfterBatchOperation = function (e) {
1472
+ let groups, groupCount, i, group;
1473
+ if(e.batchType === "reset") {
1474
+ this._inResetting = false;
1475
+
1476
+ groups = this._groupDefs.getGroups();
1477
+ groupCount = groups.length;
1478
+ for(i = 0; i < groupCount; ++i) {
1479
+ this._repositionMembers(groups[i], true); // validate the group
1480
+ }
1481
+ groups = this._groupDefs.getGroups();
1482
+ groupCount = groups.length;
1483
+ for(i = 0; i < groupCount; ++i) {
1484
+ group = groups[i];
1485
+ this._updateActiveColumn(group);
1486
+ this._hideStackedColumns(group);
1487
+ }
1488
+ } else if(e.batchType === "move") {
1489
+ if(this._inReordering === 2) {
1490
+ groups = this._groupDefs.getGroups();
1491
+ groupCount = groups.length;
1492
+ for(i = 0; i < groupCount; ++i) {
1493
+ this._repositionMembers(groups[i]);
1494
+ }
1495
+ }
1496
+ this._inReordering = 0;
1497
+ }
1498
+ };
1499
+ /** @private
1500
+ * @param {number} colIndex
1501
+ * @return {Object} stackOption
1502
+ */
1503
+ ColumnStackPlugin.prototype._isWithinStack = function (colIndex) {
1504
+ let leftStackOpt = this._getColumnStackOptions(colIndex - 1);
1505
+ if(leftStackOpt) {
1506
+ let rightStackOpt = this._getColumnStackOptions(colIndex + 1);
1507
+ if(leftStackOpt === rightStackOpt) {
1508
+ return leftStackOpt;
1509
+ }
1510
+ }
1511
+ return null;
1512
+ };
1513
+ /** Add unique ref of the specified index to the proper position within the stack
1514
+ * @private
1515
+ * @param {Object} stackOption
1516
+ * @param {number} colIndex
1517
+ * @return {boolean}
1518
+ */
1519
+ ColumnStackPlugin.prototype._addRefToStack = function (stackOption, colIndex) {
1520
+ let colId = this._toColumnId(colIndex);
1521
+
1522
+ this._hideStackedColumns(stackOption, colIndex);
1523
+
1524
+ // Find a position to be placed in the stack
1525
+ let rightColRef = this._toColumnId(colIndex + 1);
1526
+ let children = stackOption.children;
1527
+ let pos = children.indexOf(rightColRef); // WARNING This does not work for field
1528
+ return this._groupDefs.addGroupChild(stackOption.id, colId, pos);
1529
+ };
1530
+ /** Remove unique ref of the specified index from the stack
1531
+ * @private
1532
+ * @param {Object} stackOption
1533
+ * @param {string} colId For removing state
1534
+ * @param {number} colIndex For updating UI
1535
+ * @return {boolean}
1536
+ */
1537
+ ColumnStackPlugin.prototype._removeRefFromStack = function (stackOption, colId, colIndex) {
1538
+ if(!this._groupDefs.removeGroupChild(stackOption.id, colId)) {
1539
+ return false;
1540
+ }
1541
+
1542
+ let isCollapsed = stackOption.spreading && stackOption.collapsed;
1543
+ if(isCollapsed) {
1544
+ this._collapseMember(colIndex, false);
1545
+ } else {
1546
+ this._setColumnVisibility(colIndex, true);
1547
+ }
1548
+ this._updateActiveColumn(stackOption); // This may trigger _updateUI
1549
+
1550
+ return true;
1551
+ };
1552
+
1553
+ /** @private
1554
+ * @param {Object} stackOption
1555
+ * @param {boolean=} validate Remove invalid members and stack
1556
+ */
1557
+ ColumnStackPlugin.prototype._repositionMembers = function (stackOption, validate) {
1558
+ let children = stackOption.children;
1559
+ let refCount = children ? children.length : 0;
1560
+
1561
+ let indexMap = {};
1562
+ let prevIndex = -1;
1563
+ let dirty = false;
1564
+ let hasInvalid = false;
1565
+ for(let i = 0; i < refCount; i++) {
1566
+ let colRef = children[i];
1567
+ let colIndex = this.getColumnIndex(colRef);
1568
+ indexMap[colRef] = colIndex;
1569
+ if(colIndex >= 0) {
1570
+ if(colIndex < prevIndex) {
1571
+ dirty = true;
1572
+ }
1573
+ } else { // Found invalid member
1574
+ hasInvalid = true;
1575
+ }
1576
+ prevIndex = colIndex;
1577
+ }
1578
+ if(validate && hasInvalid) {
1579
+ children = children.filter(_byValidIndex.bind(null, indexMap));
1580
+ // WARNING: this._groupDefs._childToParent may be out of sync after children are filtered
1581
+ // TODO: Create a new API to rebuild childToParent map
1582
+ this._groupDefs.removeAllChildren(stackOption.id);
1583
+ stackOption.children = children;
1584
+ this._groupDefs.setGroup(stackOption.id, stackOption);
1585
+
1586
+ refCount = children.length;
1587
+ }
1588
+
1589
+ if(refCount < 2) {
1590
+ if(validate) {
1591
+ this._removeStack(stackOption.id);
1592
+ this._updateUI();
1593
+ }
1594
+ return;
1595
+ }
1596
+
1597
+ if(dirty || hasInvalid) {
1598
+ children.sort(_indexSorter.bind(null, indexMap));
1599
+ }
1600
+ };
1601
+ /** @private
1602
+ * @param {Object} e
1603
+ */
1604
+ ColumnStackPlugin.prototype._onStackButtonClicked = function(e) {
1605
+ let elem = e.currentTarget;
1606
+ if(e.button) { // right click or middle click
1607
+ return;
1608
+ }
1609
+
1610
+ let grid = this.getRelativeGrid(e);
1611
+ let pos = grid.getRelativePosition(e);
1612
+ let colIndex = pos["colIndex"];
1613
+ let colData = this._getColumnStackOptions(colIndex);
1614
+ if(!colData) { return; }
1615
+
1616
+ e.stopPropagation();
1617
+
1618
+ let children = colData.children;
1619
+ let colIndices = this.getColumnIndices(children);
1620
+ if(colData.spreading) {
1621
+ let collapsed = !colData.collapsed;
1622
+ this.collapseGroup(colIndex, collapsed);
1623
+ pos["menuData"] = null;
1624
+ pos["activeIndex"] = -1;
1625
+ pos["collapsed"] = collapsed;
1626
+ } else {
1627
+ let activeIndex = children.indexOf(colData.activeColumn);
1628
+ let len = children.length;
1629
+ let menuData = new Array(len);
1630
+ for(let i = len; --i >= 0;) {
1631
+ menuData[i] = {
1632
+ value: i,
1633
+ selected: i === activeIndex,
1634
+ label: this.getColumnName(colIndices[i]),
1635
+ field: this.getColumnField(colIndices[i]),
1636
+ colId: children[i]
1637
+ };
1638
+ }
1639
+ pos["menuData"] = menuData;
1640
+ pos["activeIndex"] = activeIndex;
1641
+ pos["collapsed"] = false;
1642
+ }
1643
+ pos["spreading"] = colData.spreading;
1644
+ pos["columnIndices"] = colIndices;
1645
+ pos["activeColIndex"] = this.getColumnIndex(colData.activeColumn);
1646
+ pos["event"] = e;
1647
+ pos["stackId"] = colData.id;
1648
+
1649
+ elem.focus();
1650
+
1651
+ if(this._menuElement && !colData.spreading) {
1652
+ // Populate stack member
1653
+ let button = pos.event.srcElement;
1654
+ let el = this._menuElement;
1655
+ el.data = pos["menuData"];
1656
+ el.positionTarget = button;
1657
+ el.opened = true;
1658
+ }
1659
+ this._dispatch("clicked", pos);
1660
+ };
1661
+ /** @private
1662
+ * @param {Object} e
1663
+ */
1664
+ ColumnStackPlugin.prototype._onMenuItemClicked = function(e) {
1665
+ if(e.detail) {
1666
+ let selectedIndex = parseInt(e.detail.value, 0);
1667
+ let menuData = this._menuElement.data[selectedIndex];
1668
+ let colId = menuData.colId;
1669
+ this.setActiveColumn(colId);
1670
+ }
1671
+ this._menuElement.opened = false;
1672
+
1673
+ if(this._menuItemClicked) {
1674
+ this._menuItemClicked(e);
1675
+ }
1676
+ };
1677
+ /** @public
1678
+ * @description Get member column indices in a stack
1679
+ * @param {string} stackId
1680
+ * @return {!Array.<number>} Member column indices
1681
+ */
1682
+ ColumnStackPlugin.prototype.getStackMemberIndices = function(stackId) {
1683
+ return this.getColumnIndices(this.getStackMemberIds(stackId));
1684
+ };
1685
+
1686
+ /** @public
1687
+ * @description Get list member column id in a stack
1688
+ * @param {string} stackId
1689
+ * @return {!Array.<string>} Member column ids
1690
+ */
1691
+ ColumnStackPlugin.prototype.getStackMemberIds = function(stackId) { // WARNING: This does not filter out invalid members
1692
+ if(stackId) {
1693
+ let stack = this._groupDefs.getGroup(stackId);
1694
+ if(stack){
1695
+ return stack.children;
1696
+ }
1697
+ }
1698
+ return [];
1699
+ };
1700
+
1701
+ /** @public
1702
+ * @description Get column id by column index or indices
1703
+ * @param {number|Array<number>} colIndices
1704
+ * @return {!Array.<string>} Column ids
1705
+ */
1706
+ ColumnStackPlugin.prototype.getColumnIdsByIndex = function(colIndices) {
1707
+ if(!Array.isArray(colIndices)){
1708
+ colIndices = [colIndices];
1709
+ }
1710
+ let colIds = [];
1711
+ let colId;
1712
+ for(let i = 0; i < colIndices.length; ++i) {
1713
+ colId = this.getColumnId(colIndices[i]);
1714
+ colIds.push(colId);
1715
+ }
1716
+ return colIds;
1717
+ };
1718
+
1719
+ /** @public
1720
+ * @description Get column indices by column ids
1721
+ * @param {string|Array<string>} colIds
1722
+ * @return {!Array.<string>} Column indices
1723
+ */
1724
+ ColumnStackPlugin.prototype.getColumnIndicesByColumnIds = function(colIds) {
1725
+ if(!Array.isArray(colIds)){
1726
+ colIds = [colIds];
1727
+ }
1728
+ let colIndices = [];
1729
+ let colIndex;
1730
+ for(let i = 0; i < colIds.length; ++i) {
1731
+ colIndex = this.getColumnIndex(colIds[i]);
1732
+ colIndices.push(colIndex);
1733
+ }
1734
+ return colIndices;
1735
+ };
1736
+
1737
+ /** @public
1738
+ * @description Get column ids by fields
1739
+ * @param {string|Array<string>} fields
1740
+ * @return {!Array.<string>} Column indices
1741
+ */
1742
+ ColumnStackPlugin.prototype.getColumnIdsByFields = function(fields) {
1743
+ if(!fields) {
1744
+ return [];
1745
+ }
1746
+ let ary = Array.isArray(fields) ? fields : [fields];
1747
+ let count = fields.length;
1748
+ let outAry = new Array(count);
1749
+ for(let i = 0; i < count; ++i) {
1750
+ let ref = ary[i];
1751
+ let colIndex = -1;
1752
+ if(typeof ref === "number") {
1753
+ colIndex = ref;
1754
+ } else if(ref) {
1755
+ if(typeof ref === "string") {
1756
+ colIndex = this.getColumnIndex(ref);
1757
+ }
1758
+ }
1759
+ outAry[i] = (colIndex >= 0) ? this.getColumnId(colIndex) : "";
1760
+ }
1761
+ return outAry;
1762
+ };
1763
+
1764
+ /** @public
1765
+ * @description Add specific column to a stack
1766
+ * @param {number|string} colRef column field or column index
1767
+ * @param {string} stackId
1768
+ */
1769
+ ColumnStackPlugin.prototype.addColumnToStack = function(colRef, stackId) {
1770
+ let colId = this._toColumnId(colRef);
1771
+
1772
+ let stack = this._groupDefs.getGroup(stackId);
1773
+ let isColumnStackable = !this._groupDefs.getParentGroup(colId);
1774
+
1775
+ // if column not stackable or destination stack not exist, do nothing
1776
+ if(!isColumnStackable || !stack){
1777
+ return;
1778
+ }
1779
+
1780
+ this._hideStackedColumns(stack, this.getColumnIndex(colId));
1781
+
1782
+ // apply stacking
1783
+ this._groupDefs.addGroupChild(stackId, colId);
1784
+
1785
+ // To avoid state interference from Core Grid, keep the pin state before moving the columns
1786
+ let host = this._hosts[0];
1787
+ let leftPinnedIndex = host.getFrozenColumnCount() - 1;
1788
+ let rightPinnedCount = host.getPinnedRightColumnCount();
1789
+ let colIndex = this.getColumnIndex(colId);
1790
+
1791
+ // Pack stacked columns together
1792
+ this._moveStackedColumns(stack.children);
1793
+
1794
+ // If an unpinned column is added to a pinned stack, the pinning position should be updated
1795
+ if(stack.leftPinned || stack.rightPinned) {
1796
+ let colCount = this.getColumnCount();
1797
+ if(stack.leftPinned && colIndex > leftPinnedIndex) {
1798
+ leftPinnedIndex++;
1799
+ this._freezeColumn(leftPinnedIndex, rightPinnedCount);
1800
+ } else if(stack.rightPinned && colIndex < (colCount - rightPinnedCount)) {
1801
+ rightPinnedCount++;
1802
+ this._freezeColumn(leftPinnedIndex, rightPinnedCount);
1803
+ }
1804
+ }
1805
+
1806
+ this._updateUI();
1807
+ };
1808
+
1809
+ /** @public
1810
+ * @description Remove specific column from its own stack
1811
+ * @param {number|string} colRef column field or column index
1812
+ */
1813
+ ColumnStackPlugin.prototype.removeColumnFromStack = function(colRef) {
1814
+ let colIndex = (typeof colRef === "string") ? this.getColumnIndex(colRef) : colRef;
1815
+ if(colIndex < 0) {
1816
+ return;
1817
+ }
1818
+
1819
+ let colId = this.getColumnId(colIndex);
1820
+ let stack = this._groupDefs.getParentGroup(colId);
1821
+
1822
+ if(!stack) {
1823
+ return;
1824
+ }
1825
+
1826
+ let children = stack.children;
1827
+ let memberCount = children.length;
1828
+ if(memberCount <= 2) {
1829
+ if(memberCount === 2) {
1830
+ if(colId === children[0]) { // If the first column is removed from the stack, move it to the end of stack
1831
+ // This assumes that the column order is already in correct position
1832
+ this.moveColumnById(colIndex, this.getColumnIndex(children[1]) + 1);
1833
+ }
1834
+ }
1835
+ this.removeStack(stack.id); // updateUI will be called
1836
+ return;
1837
+ }
1838
+
1839
+ let colIndices = this.getColumnIndices(children);
1840
+ this._removeRefFromStack(stack, colId, colIndex);
1841
+
1842
+ this.moveColumnById(colIndex, colIndices[memberCount - 1] + 1); // This assumes that the column order is already in correct position
1843
+
1844
+ this._updateUI();
1845
+ };
1846
+
1847
+ /** @public
1848
+ * @description Reorder columns in a stack
1849
+ * @param {Array.<number|string>} colRefs Column Ids, indices, or fields
1850
+ * @param {string} stackId
1851
+ */
1852
+ ColumnStackPlugin.prototype.reorderStackColumns = function(colRefs, stackId) {
1853
+ let stack = this._groupDefs.getGroup(stackId);
1854
+ if(!stack) {
1855
+ return;
1856
+ }
1857
+ if(!colRefs || !colRefs.length) {
1858
+ return; // Nothing to be reordered
1859
+ }
1860
+ let colIndices = this.getColumnIndices(colRefs); // Slow
1861
+ if(!colIndices.length) {
1862
+ return; // Given input has no valid column
1863
+ }
1864
+
1865
+ let curMemberIndices = this.getStackMemberIndices(stackId); // Slow
1866
+ let memberCount = curMemberIndices.length;
1867
+ let indexMap = {};
1868
+ for(let i = 0; i < memberCount; ++i) {
1869
+ let colIndex = curMemberIndices[i];
1870
+ indexMap[colIndex] = colIndices.indexOf(colIndex);
1871
+ }
1872
+
1873
+ curMemberIndices.sort(_indexSorter.bind(null, indexMap));
1874
+ this.reorderColumns(curMemberIndices, curMemberIndices[0]);
1875
+ };
1876
+
1877
+ /** @public
1878
+ * @description Set stack name to a stack
1879
+ * @param {string} stackId
1880
+ * @param {string} name
1881
+ */
1882
+ ColumnStackPlugin.prototype.setStackName = function(stackId, name) {
1883
+ this._groupDefs.setGroupName(stackId, name);
1884
+ };
1885
+
1886
+ /** @public
1887
+ * @description Get stack name from specific stack
1888
+ * @param {string} stackId
1889
+ * @return {string} Stack name
1890
+ */
1891
+ ColumnStackPlugin.prototype.getStackName = function(stackId) {
1892
+ return this._groupDefs.getGroupName(stackId);
1893
+ };
1894
+
1895
+ /** @public
1896
+ * @description Get active column id of specific stack
1897
+ * @param {string} stackId
1898
+ * @return {string} active column id
1899
+ */
1900
+ ColumnStackPlugin.prototype.getActiveColumnId = function(stackId) {
1901
+ let stack = this._groupDefs.getGroup(stackId);
1902
+ if(stack){
1903
+ return stack.activeColumn || "";
1904
+ }
1905
+ return "";
1906
+ };
1907
+ /** @public
1908
+ * @description Get active column field of specific stack
1909
+ * @param {string} stackId
1910
+ * @return {string} active column field
1911
+ */
1912
+ ColumnStackPlugin.prototype.getActiveColumnField = function(stackId) {
1913
+ return this.getColumnField(this.getActiveColumnIndex(stackId));
1914
+ };
1915
+
1916
+ /** @public
1917
+ * @description Get active column index of specific stack
1918
+ * @param {string} stackId
1919
+ * @return {number} active column index
1920
+ */
1921
+ ColumnStackPlugin.prototype.getActiveColumnIndex = function(stackId) {
1922
+ let stack = this._groupDefs.getGroup(stackId);
1923
+ if(stack){
1924
+ return this.getColumnIndex(stack.activeColumn);
1925
+ }
1926
+ return -1;
1927
+ };
1928
+
1929
+ /** @public
1930
+ * @param {string} stackId
1931
+ * @param {number|string} colRef Column Id, index or field
1932
+ */
1933
+ ColumnStackPlugin.prototype.addStackChild = function(stackId, colRef) {
1934
+ this.addColumnToStack(colRef, stackId);
1935
+ };
1936
+ /**
1937
+ * @public
1938
+ * @param {string} stackId
1939
+ * @param {number|string} colRef Column Id, index or field
1940
+ */
1941
+ ColumnStackPlugin.prototype.removeStackChild = function(stackId, colRef) {
1942
+ if(stackId === this.getStackId(colRef)) {
1943
+ this.removeColumnFromStack(colRef);
1944
+ }
1945
+ };
1946
+ /** @public
1947
+ * @function
1948
+ * @param {number|string} colRef Column Id, index or field
1949
+ */
1950
+ ColumnStackPlugin.prototype.unsetParent = ColumnStackPlugin.prototype.removeColumnFromStack;
1951
+
1952
+ /** Move and reorder the specified columns to position before the destination
1953
+ * @public
1954
+ * @param {Array.<number|string>} colList Column list to be reordered
1955
+ * @param {(number|string)=} destCol Destination column id or index
1956
+ * @return {boolean}
1957
+ */
1958
+ ColumnStackPlugin.prototype.reorderColumns = function(colList, destCol) {
1959
+ return this._reorderColumns(colList, destCol);
1960
+ };
1961
+ /** Move the specified column to position before the destination
1962
+ * @public
1963
+ * @param {number|string} srcCol Source column id or index
1964
+ * @param {(number|string)=} destCol Destination column id or index
1965
+ * @return {boolean}
1966
+ */
1967
+ ColumnStackPlugin.prototype.moveColumnById = function(srcCol, destCol) {
1968
+ return this._moveColumnById(srcCol, destCol);
1969
+ };
1970
+
1971
+ /** @private
1972
+ * @description Check for active column in a stack if it needs an update.
1973
+ * @param {Object} stackOpt
1974
+ */
1975
+ ColumnStackPlugin.prototype._updateActiveColumn = function(stackOpt) {
1976
+ if(_resolveActiveColumn(stackOpt)) {
1977
+ // TODO: Add a proper way to set visibility to activeColumn when activeColumn is changed
1978
+ let activeColIndex = this.getColumnIndex(stackOpt.activeColumn);
1979
+ if(activeColIndex >= 0) {
1980
+ this._setColumnVisibility(activeColIndex, true);
1981
+ this._updateUI();
1982
+ }
1983
+ }
1984
+ };
1985
+
1986
+ /** @public
1987
+ * @description Hide specific stack from grid
1988
+ * @param {string} stackId
1989
+ * @param {boolean=} hidden
1990
+ */
1991
+ ColumnStackPlugin.prototype.hideStack = function(stackId, hidden) {
1992
+ if(!stackId){
1993
+ return;
1994
+ }
1995
+ let stackOption = this._groupDefs.getGroup(stackId);
1996
+ if(!stackOption){
1997
+ return;
1998
+ }
1999
+
2000
+ if(hidden == null){
2001
+ hidden = true;
2002
+ }
2003
+ let children = stackOption.children;
2004
+ for(let i = 0; i < children.length; i++){
2005
+ for(let g = this._hosts.length; --g >= 0;) {
2006
+ this._hosts[g].hideColumn(this.getColumnIndex(children[i]), hidden);
2007
+ }
2008
+ }
2009
+ };
2010
+
2011
+ /** @public
2012
+ * @description Show specific stack from grid
2013
+ * @param {string} stackId
2014
+ */
2015
+ ColumnStackPlugin.prototype.showStack = function(stackId) {
2016
+ if(!stackId){
2017
+ return;
2018
+ }
2019
+ this.hideStack(stackId, false);
2020
+ };
2021
+
2022
+ /** @public
2023
+ * @description Get hidden status of specific stack
2024
+ * @param {string} stackId
2025
+ * @return {boolean|null}
2026
+ */
2027
+ ColumnStackPlugin.prototype.isStackHidden = function(stackId) {
2028
+ let stackOption = this._groupDefs.getGroup(stackId);
2029
+ let host = this._host || this._hosts[0];
2030
+
2031
+ if(!stackOption || !host){
2032
+ return null;
2033
+ }
2034
+
2035
+ let activeColIndex = this.getColumnIndex(stackOption.activeColumn);
2036
+ let isVisible = host.isColumnVisible(activeColIndex);
2037
+
2038
+ return !isVisible;
2039
+ };
2040
+ /** Move an entire stack to position before the destination
2041
+ * @public
2042
+ * @param {string} stackId Stack id to be moved
2043
+ * @param {(number|string)=} destCol Destination column id or index
2044
+ * @return {boolean}
2045
+ */
2046
+ ColumnStackPlugin.prototype.moveStack = function(stackId, destCol) {
2047
+ if(!stackId){
2048
+ return false;
2049
+ }
2050
+ let colList = this.getStackMemberIds(stackId);
2051
+ let dirty = this.reorderColumns(colList, destCol);
2052
+ return dirty;
2053
+ };
2054
+
2055
+ /** @public
2056
+ * @param {string} stackId
2057
+ * @param {string=} side Available values are: left|right. If no value is supplied, all columns will be pinned to the left.
2058
+ */
2059
+ ColumnStackPlugin.prototype.pinStack = function(stackId, side) {
2060
+ if(!stackId) {
2061
+ return;
2062
+ }
2063
+
2064
+ let stack = this._groupDefs.getGroup(stackId);
2065
+ if(!stack) {
2066
+ return;
2067
+ }
2068
+
2069
+ let host = this._hosts[0];
2070
+ let leftPinnedIndex = host.getFrozenColumnCount() - 1;
2071
+ let rightPinnedCount = host.getPinnedRightColumnCount();
2072
+ let colCount = this.getColumnCount();
2073
+ let colList = this.getStackMemberIds(stackId);
2074
+ let len = colList.length;
2075
+
2076
+ let dest;
2077
+ if(side === "right") {
2078
+ if(stack.rightPinned) {
2079
+ return;
2080
+ }
2081
+ if(stack.leftPinned) {
2082
+ this.unpinStack(stackId);
2083
+ leftPinnedIndex = host.getFrozenColumnCount() - 1;
2084
+ }
2085
+ stack.rightPinned = true;
2086
+ dest = colCount - rightPinnedCount;
2087
+ rightPinnedCount = rightPinnedCount + len;
2088
+ } else {
2089
+ if(stack.leftPinned) {
2090
+ return;
2091
+ }
2092
+ if(stack.rightPinned) {
2093
+ this.unpinStack(stackId);
2094
+ rightPinnedCount = host.getPinnedRightColumnCount();
2095
+ }
2096
+ stack.leftPinned = true;
2097
+ dest = leftPinnedIndex === -1 ? 0 : leftPinnedIndex + 1;
2098
+ leftPinnedIndex = leftPinnedIndex + len;
2099
+ }
2100
+
2101
+ this.reorderColumns(colList, dest);
2102
+ this._freezeColumn(leftPinnedIndex, rightPinnedCount);
2103
+ };
2104
+
2105
+ /** @public
2106
+ * @param {string} stackId
2107
+ * @param {(number|string)=} dest The unpinned stack will be placed before the destination position after the operation
2108
+ */
2109
+ ColumnStackPlugin.prototype.unpinStack = function(stackId, dest) {
2110
+ if(!stackId) {
2111
+ return;
2112
+ }
2113
+
2114
+ let stack = this._groupDefs.getGroup(stackId);
2115
+ if(!stack) {
2116
+ return;
2117
+ }
2118
+
2119
+ if(!stack.leftPinned && !stack.rightPinned) {
2120
+ return;
2121
+ }
2122
+
2123
+ let host = this._hosts[0];
2124
+ let leftPinnedCount = host.getFrozenColumnCount();
2125
+ let rightPinnedCount = host.getPinnedRightColumnCount();
2126
+ let colCount = this.getColumnCount();
2127
+ let firstRightPinnedIndex = colCount - rightPinnedCount;
2128
+ let colList = this.getStackMemberIds(stackId);
2129
+ let len = colList.length;
2130
+
2131
+ let destId = null;
2132
+ if(dest != null) {
2133
+ let destIdx = this.getColumnIndex(dest);
2134
+ destId = this.getColumnId(destIdx);
2135
+ }
2136
+
2137
+ if(stack.leftPinned) {
2138
+ stack.leftPinned = false;
2139
+ this.reorderColumns(colList, leftPinnedCount);
2140
+ this._freezeColumn(leftPinnedCount - (1 + len));
2141
+ } else if(stack.rightPinned) {
2142
+ stack.rightPinned = false;
2143
+ this.reorderColumns(colList, firstRightPinnedIndex);
2144
+ this._freezeColumn(leftPinnedCount - 1, rightPinnedCount - len);
2145
+ }
2146
+
2147
+ if(destId != null) {
2148
+ this.reorderColumns(colList, destId);
2149
+ }
2150
+ };
2151
+
2152
+
2153
+
2154
+ export default ColumnStackPlugin;
2155
+ export { ColumnStackPlugin, ColumnStackPlugin as ColumnStack, ColumnStackPlugin as ColumnStackExtension };