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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (837) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +61 -0
  3. package/lib/column-format-dialog/index.d.ts +1 -0
  4. package/lib/column-format-dialog/index.js +1 -0
  5. package/lib/column-format-dialog/lib/column-format-dialog.d.ts +64 -0
  6. package/lib/column-format-dialog/lib/column-format-dialog.js +2713 -0
  7. package/lib/column-format-dialog/lib/locale/translation-de.d.ts +7 -0
  8. package/lib/column-format-dialog/lib/locale/translation-de.js +94 -0
  9. package/lib/column-format-dialog/lib/locale/translation-en.d.ts +7 -0
  10. package/lib/column-format-dialog/lib/locale/translation-en.js +94 -0
  11. package/lib/column-format-dialog/lib/locale/translation-ja.d.ts +7 -0
  12. package/lib/column-format-dialog/lib/locale/translation-ja.js +94 -0
  13. package/lib/column-format-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  14. package/lib/column-format-dialog/lib/locale/translation-zh-hant.js +94 -0
  15. package/lib/column-format-dialog/lib/locale/translation-zh.d.ts +7 -0
  16. package/lib/column-format-dialog/lib/locale/translation-zh.js +94 -0
  17. package/lib/column-format-dialog/lib/locale/translation.d.ts +11 -0
  18. package/lib/column-format-dialog/lib/locale/translation.js +18 -0
  19. package/lib/column-format-dialog/lib/preview-table.d.ts +151 -0
  20. package/lib/column-format-dialog/lib/preview-table.js +995 -0
  21. package/lib/column-format-dialog/themes/base.less +429 -0
  22. package/lib/column-format-dialog/themes/elemental/column-format-dialog.less +1 -0
  23. package/lib/column-format-dialog/themes/elemental/dark/column-format-dialog.js +4 -0
  24. package/lib/column-format-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  25. package/lib/column-format-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
  26. package/lib/column-format-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
  27. package/lib/column-format-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
  28. package/lib/column-format-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  29. package/lib/column-format-dialog/themes/elemental/dark.js +16 -0
  30. package/lib/column-format-dialog/themes/elemental/defaults.less +1 -0
  31. package/lib/column-format-dialog/themes/elemental/index.less +5 -0
  32. package/lib/column-format-dialog/themes/elemental/light/column-format-dialog.js +4 -0
  33. package/lib/column-format-dialog/themes/elemental/light/css/native-elements.css +0 -0
  34. package/lib/column-format-dialog/themes/elemental/light/es5/all-elements.js +2 -0
  35. package/lib/column-format-dialog/themes/elemental/light/imports/all-elements.js +1 -0
  36. package/lib/column-format-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
  37. package/lib/column-format-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  38. package/lib/column-format-dialog/themes/elemental/light.js +16 -0
  39. package/lib/column-format-dialog/themes/halo/column-format-dialog.less +6 -0
  40. package/lib/column-format-dialog/themes/halo/dark/column-format-dialog.js +4 -0
  41. package/lib/column-format-dialog/themes/halo/dark/css/native-elements.css +0 -0
  42. package/lib/column-format-dialog/themes/halo/dark/es5/all-elements.js +2 -0
  43. package/lib/column-format-dialog/themes/halo/dark/imports/all-elements.js +1 -0
  44. package/lib/column-format-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
  45. package/lib/column-format-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  46. package/lib/column-format-dialog/themes/halo/dark.js +16 -0
  47. package/lib/column-format-dialog/themes/halo/defaults.less +1 -0
  48. package/lib/column-format-dialog/themes/halo/index.less +5 -0
  49. package/lib/column-format-dialog/themes/halo/light/column-format-dialog.js +4 -0
  50. package/lib/column-format-dialog/themes/halo/light/css/native-elements.css +0 -0
  51. package/lib/column-format-dialog/themes/halo/light/es5/all-elements.js +2 -0
  52. package/lib/column-format-dialog/themes/halo/light/imports/all-elements.js +1 -0
  53. package/lib/column-format-dialog/themes/halo/light/imports/custom-elements.js +1 -0
  54. package/lib/column-format-dialog/themes/halo/light/imports/native-elements.js +0 -0
  55. package/lib/column-format-dialog/themes/halo/light.js +16 -0
  56. package/lib/column-format-dialog/themes/luna/column-format-dialog.less +1 -0
  57. package/lib/column-format-dialog/themes/luna/default/column-format-dialog.js +4 -0
  58. package/lib/column-format-dialog/themes/luna/default/css/native-elements.css +0 -0
  59. package/lib/column-format-dialog/themes/luna/default/es5/all-elements.js +2 -0
  60. package/lib/column-format-dialog/themes/luna/default/imports/all-elements.js +1 -0
  61. package/lib/column-format-dialog/themes/luna/default/imports/custom-elements.js +1 -0
  62. package/lib/column-format-dialog/themes/luna/default/imports/native-elements.js +0 -0
  63. package/lib/column-format-dialog/themes/luna/defaults.less +1 -0
  64. package/lib/column-format-dialog/themes/luna/index.less +5 -0
  65. package/lib/column-format-dialog/themes/solar/charcoal/column-format-dialog.js +4 -0
  66. package/lib/column-format-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  67. package/lib/column-format-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
  68. package/lib/column-format-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
  69. package/lib/column-format-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
  70. package/lib/column-format-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  71. package/lib/column-format-dialog/themes/solar/charcoal.js +16 -0
  72. package/lib/column-format-dialog/themes/solar/column-format-dialog.less +6 -0
  73. package/lib/column-format-dialog/themes/solar/defaults.less +1 -0
  74. package/lib/column-format-dialog/themes/solar/index.less +5 -0
  75. package/lib/column-format-dialog/themes/solar/pearl/column-format-dialog.js +4 -0
  76. package/lib/column-format-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  77. package/lib/column-format-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
  78. package/lib/column-format-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
  79. package/lib/column-format-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
  80. package/lib/column-format-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  81. package/lib/column-format-dialog/themes/solar/pearl.js +16 -0
  82. package/lib/column-selection-dialog/index.d.ts +1 -0
  83. package/lib/column-selection-dialog/index.js +1 -0
  84. package/lib/column-selection-dialog/lib/column-selection-dialog.d.ts +41 -0
  85. package/lib/column-selection-dialog/lib/column-selection-dialog.js +1410 -0
  86. package/lib/column-selection-dialog/lib/locale/translation-de.d.ts +7 -0
  87. package/lib/column-selection-dialog/lib/locale/translation-de.js +19 -0
  88. package/lib/column-selection-dialog/lib/locale/translation-en.d.ts +7 -0
  89. package/lib/column-selection-dialog/lib/locale/translation-en.js +19 -0
  90. package/lib/column-selection-dialog/lib/locale/translation-ja.d.ts +7 -0
  91. package/lib/column-selection-dialog/lib/locale/translation-ja.js +19 -0
  92. package/lib/column-selection-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  93. package/lib/column-selection-dialog/lib/locale/translation-zh-hant.js +19 -0
  94. package/lib/column-selection-dialog/lib/locale/translation-zh.d.ts +7 -0
  95. package/lib/column-selection-dialog/lib/locale/translation-zh.js +19 -0
  96. package/lib/column-selection-dialog/lib/locale/translation.d.ts +11 -0
  97. package/lib/column-selection-dialog/lib/locale/translation.js +18 -0
  98. package/lib/column-selection-dialog/themes/base.less +189 -0
  99. package/lib/column-selection-dialog/themes/elemental/column-selection-dialog.less +1 -0
  100. package/lib/column-selection-dialog/themes/elemental/dark/column-selection-dialog.js +4 -0
  101. package/lib/column-selection-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  102. package/lib/column-selection-dialog/themes/elemental/dark/es5/all-elements.js +2 -0
  103. package/lib/column-selection-dialog/themes/elemental/dark/imports/all-elements.js +1 -0
  104. package/lib/column-selection-dialog/themes/elemental/dark/imports/custom-elements.js +1 -0
  105. package/lib/column-selection-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  106. package/lib/column-selection-dialog/themes/elemental/dark.js +6 -0
  107. package/lib/column-selection-dialog/themes/elemental/defaults.less +1 -0
  108. package/lib/column-selection-dialog/themes/elemental/index.less +5 -0
  109. package/lib/column-selection-dialog/themes/elemental/light/column-selection-dialog.js +4 -0
  110. package/lib/column-selection-dialog/themes/elemental/light/css/native-elements.css +0 -0
  111. package/lib/column-selection-dialog/themes/elemental/light/es5/all-elements.js +2 -0
  112. package/lib/column-selection-dialog/themes/elemental/light/imports/all-elements.js +1 -0
  113. package/lib/column-selection-dialog/themes/elemental/light/imports/custom-elements.js +1 -0
  114. package/lib/column-selection-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  115. package/lib/column-selection-dialog/themes/elemental/light.js +6 -0
  116. package/lib/column-selection-dialog/themes/halo/column-selection-dialog.less +22 -0
  117. package/lib/column-selection-dialog/themes/halo/dark/column-selection-dialog.js +4 -0
  118. package/lib/column-selection-dialog/themes/halo/dark/css/native-elements.css +0 -0
  119. package/lib/column-selection-dialog/themes/halo/dark/es5/all-elements.js +2 -0
  120. package/lib/column-selection-dialog/themes/halo/dark/imports/all-elements.js +1 -0
  121. package/lib/column-selection-dialog/themes/halo/dark/imports/custom-elements.js +1 -0
  122. package/lib/column-selection-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  123. package/lib/column-selection-dialog/themes/halo/dark.js +6 -0
  124. package/lib/column-selection-dialog/themes/halo/defaults.less +1 -0
  125. package/lib/column-selection-dialog/themes/halo/index.less +6 -0
  126. package/lib/column-selection-dialog/themes/halo/light/column-selection-dialog.js +4 -0
  127. package/lib/column-selection-dialog/themes/halo/light/css/native-elements.css +0 -0
  128. package/lib/column-selection-dialog/themes/halo/light/es5/all-elements.js +2 -0
  129. package/lib/column-selection-dialog/themes/halo/light/imports/all-elements.js +1 -0
  130. package/lib/column-selection-dialog/themes/halo/light/imports/custom-elements.js +1 -0
  131. package/lib/column-selection-dialog/themes/halo/light/imports/native-elements.js +0 -0
  132. package/lib/column-selection-dialog/themes/halo/light.js +6 -0
  133. package/lib/column-selection-dialog/themes/solar/charcoal/column-selection-dialog.js +4 -0
  134. package/lib/column-selection-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  135. package/lib/column-selection-dialog/themes/solar/charcoal/es5/all-elements.js +2 -0
  136. package/lib/column-selection-dialog/themes/solar/charcoal/imports/all-elements.js +1 -0
  137. package/lib/column-selection-dialog/themes/solar/charcoal/imports/custom-elements.js +1 -0
  138. package/lib/column-selection-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  139. package/lib/column-selection-dialog/themes/solar/charcoal.js +6 -0
  140. package/lib/column-selection-dialog/themes/solar/column-selection-dialog.less +1 -0
  141. package/lib/column-selection-dialog/themes/solar/defaults.less +1 -0
  142. package/lib/column-selection-dialog/themes/solar/index.less +6 -0
  143. package/lib/column-selection-dialog/themes/solar/pearl/column-selection-dialog.js +4 -0
  144. package/lib/column-selection-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  145. package/lib/column-selection-dialog/themes/solar/pearl/es5/all-elements.js +2 -0
  146. package/lib/column-selection-dialog/themes/solar/pearl/imports/all-elements.js +1 -0
  147. package/lib/column-selection-dialog/themes/solar/pearl/imports/custom-elements.js +1 -0
  148. package/lib/column-selection-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  149. package/lib/column-selection-dialog/themes/solar/pearl.js +6 -0
  150. package/lib/core/dist/core.css +1 -0
  151. package/lib/core/dist/core.js +28075 -0
  152. package/lib/core/dist/core.min.js +1 -0
  153. package/lib/core/es6/data/ColumnStats.d.ts +42 -0
  154. package/lib/core/es6/data/ColumnStats.js +428 -0
  155. package/lib/core/es6/data/DataCache.d.ts +81 -0
  156. package/lib/core/es6/data/DataCache.js +1317 -0
  157. package/lib/core/es6/data/DataTable.d.ts +125 -0
  158. package/lib/core/es6/data/DataTable.js +1655 -0
  159. package/lib/core/es6/data/DataView.d.ts +280 -0
  160. package/lib/core/es6/data/DataView.js +3654 -0
  161. package/lib/core/es6/data/Segment.d.ts +38 -0
  162. package/lib/core/es6/data/Segment.js +193 -0
  163. package/lib/core/es6/data/SegmentCollection.d.ts +58 -0
  164. package/lib/core/es6/data/SegmentCollection.js +431 -0
  165. package/lib/core/es6/grid/Core.d.ts +387 -0
  166. package/lib/core/es6/grid/Core.js +4939 -0
  167. package/lib/core/es6/grid/ILayoutGrid.d.ts +204 -0
  168. package/lib/core/es6/grid/ILayoutGrid.js +658 -0
  169. package/lib/core/es6/grid/LayoutGrid.d.ts +23 -0
  170. package/lib/core/es6/grid/LayoutGrid.js +2602 -0
  171. package/lib/core/es6/grid/VirtualizedLayoutGrid.d.ts +18 -0
  172. package/lib/core/es6/grid/VirtualizedLayoutGrid.js +907 -0
  173. package/lib/core/es6/grid/components/Cell.d.ts +50 -0
  174. package/lib/core/es6/grid/components/Cell.js +740 -0
  175. package/lib/core/es6/grid/components/CellFloatingPanel.d.ts +19 -0
  176. package/lib/core/es6/grid/components/CellFloatingPanel.js +123 -0
  177. package/lib/core/es6/grid/components/CellSpan.d.ts +18 -0
  178. package/lib/core/es6/grid/components/CellSpan.js +99 -0
  179. package/lib/core/es6/grid/components/CellSpans.d.ts +38 -0
  180. package/lib/core/es6/grid/components/CellSpans.js +341 -0
  181. package/lib/core/es6/grid/components/Column.d.ts +22 -0
  182. package/lib/core/es6/grid/components/Column.js +612 -0
  183. package/lib/core/es6/grid/components/ElementWrapper.d.ts +125 -0
  184. package/lib/core/es6/grid/components/ElementWrapper.js +714 -0
  185. package/lib/core/es6/grid/components/HScrollbar.d.ts +24 -0
  186. package/lib/core/es6/grid/components/HScrollbar.js +222 -0
  187. package/lib/core/es6/grid/components/Scrollbar.d.ts +61 -0
  188. package/lib/core/es6/grid/components/Scrollbar.js +1374 -0
  189. package/lib/core/es6/grid/components/StretchedCells.d.ts +17 -0
  190. package/lib/core/es6/grid/components/StretchedCells.js +328 -0
  191. package/lib/core/es6/grid/components/VScrollbar.d.ts +18 -0
  192. package/lib/core/es6/grid/components/VScrollbar.js +139 -0
  193. package/lib/core/es6/grid/components/VirtualItems.d.ts +12 -0
  194. package/lib/core/es6/grid/components/VirtualItems.js +51 -0
  195. package/lib/core/es6/grid/event/EventDispatcher.d.ts +16 -0
  196. package/lib/core/es6/grid/event/EventDispatcher.js +138 -0
  197. package/lib/core/es6/grid/event/EventListeners.d.ts +34 -0
  198. package/lib/core/es6/grid/event/EventListeners.js +163 -0
  199. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
  200. package/lib/core/es6/grid/plugins/DragAndDropTitlePlugin.js +615 -0
  201. package/lib/core/es6/grid/plugins/Plugin.d.ts +28 -0
  202. package/lib/core/es6/grid/plugins/Plugin.js +272 -0
  203. package/lib/core/es6/grid/plugins/SortableTitlePlugin.d.ts +127 -0
  204. package/lib/core/es6/grid/plugins/SortableTitlePlugin.js +1707 -0
  205. package/lib/core/es6/grid/util/Conflator.d.ts +32 -0
  206. package/lib/core/es6/grid/util/Conflator.js +191 -0
  207. package/lib/core/es6/grid/util/ElementFrameWork.d.ts +18 -0
  208. package/lib/core/es6/grid/util/ElementFrameWork.js +227 -0
  209. package/lib/core/es6/grid/util/HttpRequest.d.ts +53 -0
  210. package/lib/core/es6/grid/util/HttpRequest.js +371 -0
  211. package/lib/core/es6/grid/util/PercentBar.d.ts +43 -0
  212. package/lib/core/es6/grid/util/PercentBar.js +390 -0
  213. package/lib/core/es6/grid/util/PercentBarRenderer.d.ts +41 -0
  214. package/lib/core/es6/grid/util/PercentBarRenderer.js +316 -0
  215. package/lib/core/es6/grid/util/RangeBar.d.ts +25 -0
  216. package/lib/core/es6/grid/util/RangeBar.js +255 -0
  217. package/lib/core/es6/grid/util/Reverter.d.ts +14 -0
  218. package/lib/core/es6/grid/util/Reverter.js +79 -0
  219. package/lib/core/es6/grid/util/SectionSettings.d.ts +79 -0
  220. package/lib/core/es6/grid/util/SectionSettings.js +674 -0
  221. package/lib/core/es6/grid/util/SelectionList.d.ts +50 -0
  222. package/lib/core/es6/grid/util/SelectionList.js +422 -0
  223. package/lib/core/es6/grid/util/TrackLayout.d.ts +84 -0
  224. package/lib/core/es6/grid/util/TrackLayout.js +850 -0
  225. package/lib/core/es6/grid/util/Virtualizer.d.ts +40 -0
  226. package/lib/core/es6/grid/util/Virtualizer.js +340 -0
  227. package/lib/core/es6/grid/util/util.d.ts +18 -0
  228. package/lib/core/es6/grid/util/util.js +450 -0
  229. package/lib/core/es6/index.d.ts +84 -0
  230. package/lib/core/es6/index.js +132 -0
  231. package/lib/core/es6/tr-grid-theme.d.ts +5 -0
  232. package/lib/core/es6/tr-grid-theme.js +5 -0
  233. package/lib/filter-dialog/index.d.ts +1 -0
  234. package/lib/filter-dialog/index.js +1 -0
  235. package/lib/filter-dialog/lib/checkbox-list.d.ts +27 -0
  236. package/lib/filter-dialog/lib/checkbox-list.js +336 -0
  237. package/lib/filter-dialog/lib/filter-dialog.d.ts +53 -0
  238. package/lib/filter-dialog/lib/filter-dialog.js +860 -0
  239. package/lib/filter-dialog/lib/locale/translation-de.d.ts +7 -0
  240. package/lib/filter-dialog/lib/locale/translation-de.js +37 -0
  241. package/lib/filter-dialog/lib/locale/translation-en.d.ts +7 -0
  242. package/lib/filter-dialog/lib/locale/translation-en.js +37 -0
  243. package/lib/filter-dialog/lib/locale/translation-ja.d.ts +7 -0
  244. package/lib/filter-dialog/lib/locale/translation-ja.js +37 -0
  245. package/lib/filter-dialog/lib/locale/translation-zh-hant.d.ts +7 -0
  246. package/lib/filter-dialog/lib/locale/translation-zh-hant.js +37 -0
  247. package/lib/filter-dialog/lib/locale/translation-zh.d.ts +7 -0
  248. package/lib/filter-dialog/lib/locale/translation-zh.js +37 -0
  249. package/lib/filter-dialog/lib/locale/translation.d.ts +11 -0
  250. package/lib/filter-dialog/lib/locale/translation.js +18 -0
  251. package/lib/filter-dialog/themes/base-checkbox.less +37 -0
  252. package/lib/filter-dialog/themes/base.less +102 -0
  253. package/lib/filter-dialog/themes/elemental/checkbox-list.less +3 -0
  254. package/lib/filter-dialog/themes/elemental/dark/checkbox-list.js +4 -0
  255. package/lib/filter-dialog/themes/elemental/dark/css/native-elements.css +0 -0
  256. package/lib/filter-dialog/themes/elemental/dark/es5/all-elements.js +4 -0
  257. package/lib/filter-dialog/themes/elemental/dark/filter-dialog.js +5 -0
  258. package/lib/filter-dialog/themes/elemental/dark/imports/all-elements.js +2 -0
  259. package/lib/filter-dialog/themes/elemental/dark/imports/custom-elements.js +2 -0
  260. package/lib/filter-dialog/themes/elemental/dark/imports/native-elements.js +0 -0
  261. package/lib/filter-dialog/themes/elemental/dark.js +11 -0
  262. package/lib/filter-dialog/themes/elemental/defaults.less +3 -0
  263. package/lib/filter-dialog/themes/elemental/filter-dialog.less +1 -0
  264. package/lib/filter-dialog/themes/elemental/index.less +6 -0
  265. package/lib/filter-dialog/themes/elemental/light/checkbox-list.js +4 -0
  266. package/lib/filter-dialog/themes/elemental/light/css/native-elements.css +0 -0
  267. package/lib/filter-dialog/themes/elemental/light/es5/all-elements.js +4 -0
  268. package/lib/filter-dialog/themes/elemental/light/filter-dialog.js +5 -0
  269. package/lib/filter-dialog/themes/elemental/light/imports/all-elements.js +2 -0
  270. package/lib/filter-dialog/themes/elemental/light/imports/custom-elements.js +2 -0
  271. package/lib/filter-dialog/themes/elemental/light/imports/native-elements.js +0 -0
  272. package/lib/filter-dialog/themes/elemental/light.js +11 -0
  273. package/lib/filter-dialog/themes/halo/checkbox-list.less +3 -0
  274. package/lib/filter-dialog/themes/halo/dark/checkbox-list.js +4 -0
  275. package/lib/filter-dialog/themes/halo/dark/css/native-elements.css +0 -0
  276. package/lib/filter-dialog/themes/halo/dark/es5/all-elements.js +4 -0
  277. package/lib/filter-dialog/themes/halo/dark/filter-dialog.js +5 -0
  278. package/lib/filter-dialog/themes/halo/dark/imports/all-elements.js +2 -0
  279. package/lib/filter-dialog/themes/halo/dark/imports/custom-elements.js +2 -0
  280. package/lib/filter-dialog/themes/halo/dark/imports/native-elements.js +0 -0
  281. package/lib/filter-dialog/themes/halo/dark.js +11 -0
  282. package/lib/filter-dialog/themes/halo/defaults.less +3 -0
  283. package/lib/filter-dialog/themes/halo/filter-dialog.less +9 -0
  284. package/lib/filter-dialog/themes/halo/index.less +6 -0
  285. package/lib/filter-dialog/themes/halo/light/checkbox-list.js +4 -0
  286. package/lib/filter-dialog/themes/halo/light/css/native-elements.css +0 -0
  287. package/lib/filter-dialog/themes/halo/light/es5/all-elements.js +4 -0
  288. package/lib/filter-dialog/themes/halo/light/filter-dialog.js +5 -0
  289. package/lib/filter-dialog/themes/halo/light/imports/all-elements.js +2 -0
  290. package/lib/filter-dialog/themes/halo/light/imports/custom-elements.js +2 -0
  291. package/lib/filter-dialog/themes/halo/light/imports/native-elements.js +0 -0
  292. package/lib/filter-dialog/themes/halo/light.js +11 -0
  293. package/lib/filter-dialog/themes/solar/charcoal/checkbox-list.js +4 -0
  294. package/lib/filter-dialog/themes/solar/charcoal/css/native-elements.css +0 -0
  295. package/lib/filter-dialog/themes/solar/charcoal/es5/all-elements.js +4 -0
  296. package/lib/filter-dialog/themes/solar/charcoal/filter-dialog.js +5 -0
  297. package/lib/filter-dialog/themes/solar/charcoal/imports/all-elements.js +2 -0
  298. package/lib/filter-dialog/themes/solar/charcoal/imports/custom-elements.js +2 -0
  299. package/lib/filter-dialog/themes/solar/charcoal/imports/native-elements.js +0 -0
  300. package/lib/filter-dialog/themes/solar/charcoal.js +11 -0
  301. package/lib/filter-dialog/themes/solar/checkbox-list.less +3 -0
  302. package/lib/filter-dialog/themes/solar/defaults.less +3 -0
  303. package/lib/filter-dialog/themes/solar/filter-dialog.less +5 -0
  304. package/lib/filter-dialog/themes/solar/index.less +6 -0
  305. package/lib/filter-dialog/themes/solar/pearl/checkbox-list.js +4 -0
  306. package/lib/filter-dialog/themes/solar/pearl/css/native-elements.css +0 -0
  307. package/lib/filter-dialog/themes/solar/pearl/es5/all-elements.js +4 -0
  308. package/lib/filter-dialog/themes/solar/pearl/filter-dialog.js +5 -0
  309. package/lib/filter-dialog/themes/solar/pearl/imports/all-elements.js +2 -0
  310. package/lib/filter-dialog/themes/solar/pearl/imports/custom-elements.js +2 -0
  311. package/lib/filter-dialog/themes/solar/pearl/imports/native-elements.js +0 -0
  312. package/lib/filter-dialog/themes/solar/pearl.js +11 -0
  313. package/lib/formatters/es6/CoralButtonFormatter.d.ts +22 -0
  314. package/lib/formatters/es6/CoralButtonFormatter.js +40 -0
  315. package/lib/formatters/es6/CoralCheckboxFormatter.d.ts +12 -0
  316. package/lib/formatters/es6/CoralCheckboxFormatter.js +45 -0
  317. package/lib/formatters/es6/CoralComboBoxFormatter.d.ts +23 -0
  318. package/lib/formatters/es6/CoralComboBoxFormatter.js +102 -0
  319. package/lib/formatters/es6/CoralIconFormatter.d.ts +23 -0
  320. package/lib/formatters/es6/CoralIconFormatter.js +45 -0
  321. package/lib/formatters/es6/CoralInputFormatter.d.ts +12 -0
  322. package/lib/formatters/es6/CoralInputFormatter.js +40 -0
  323. package/lib/formatters/es6/CoralRadioButtonFormatter.d.ts +22 -0
  324. package/lib/formatters/es6/CoralRadioButtonFormatter.js +80 -0
  325. package/lib/formatters/es6/CoralSelectFormatter.d.ts +23 -0
  326. package/lib/formatters/es6/CoralSelectFormatter.js +66 -0
  327. package/lib/formatters/es6/CoralToggleFormatter.d.ts +12 -0
  328. package/lib/formatters/es6/CoralToggleFormatter.js +47 -0
  329. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
  330. package/lib/formatters/es6/DuplexEmeraldDateTimePickerFormatter.js +119 -0
  331. package/lib/formatters/es6/EFButtonFormatter.d.ts +22 -0
  332. package/lib/formatters/es6/EFButtonFormatter.js +40 -0
  333. package/lib/formatters/es6/EFCheckboxFormatter.d.ts +12 -0
  334. package/lib/formatters/es6/EFCheckboxFormatter.js +45 -0
  335. package/lib/formatters/es6/EFComboBoxFormatter.d.ts +23 -0
  336. package/lib/formatters/es6/EFComboBoxFormatter.js +68 -0
  337. package/lib/formatters/es6/EFDateTimePickerFormatter.d.ts +13 -0
  338. package/lib/formatters/es6/EFDateTimePickerFormatter.js +55 -0
  339. package/lib/formatters/es6/EFIconFormatter.d.ts +23 -0
  340. package/lib/formatters/es6/EFIconFormatter.js +45 -0
  341. package/lib/formatters/es6/EFNumberFieldFormatter.d.ts +12 -0
  342. package/lib/formatters/es6/EFNumberFieldFormatter.js +40 -0
  343. package/lib/formatters/es6/EFRadioButtonFormatter.d.ts +22 -0
  344. package/lib/formatters/es6/EFRadioButtonFormatter.js +80 -0
  345. package/lib/formatters/es6/EFSelectFormatter.d.ts +23 -0
  346. package/lib/formatters/es6/EFSelectFormatter.js +66 -0
  347. package/lib/formatters/es6/EFTextFieldFormatter.d.ts +12 -0
  348. package/lib/formatters/es6/EFTextFieldFormatter.js +40 -0
  349. package/lib/formatters/es6/EFToggleFormatter.d.ts +12 -0
  350. package/lib/formatters/es6/EFToggleFormatter.js +47 -0
  351. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
  352. package/lib/formatters/es6/EmeraldDateTimePickerFormatter.js +55 -0
  353. package/lib/formatters/es6/FormatterBuilder.d.ts +22 -0
  354. package/lib/formatters/es6/FormatterBuilder.js +334 -0
  355. package/lib/formatters/es6/NumericInputFormatter.d.ts +13 -0
  356. package/lib/formatters/es6/NumericInputFormatter.js +64 -0
  357. package/lib/formatters/es6/PercentBarFormatter.d.ts +25 -0
  358. package/lib/formatters/es6/PercentBarFormatter.js +62 -0
  359. package/lib/formatters/es6/SimpleImageFormatter.d.ts +21 -0
  360. package/lib/formatters/es6/SimpleImageFormatter.js +64 -0
  361. package/lib/formatters/es6/SimpleInputFormatter.d.ts +12 -0
  362. package/lib/formatters/es6/SimpleInputFormatter.js +40 -0
  363. package/lib/formatters/es6/SimpleLinkFormatter.d.ts +21 -0
  364. package/lib/formatters/es6/SimpleLinkFormatter.js +48 -0
  365. package/lib/formatters/es6/SimpleTickerFormatter.d.ts +25 -0
  366. package/lib/formatters/es6/SimpleTickerFormatter.js +65 -0
  367. package/lib/formatters/es6/SimpleToggleFormatter.d.ts +22 -0
  368. package/lib/formatters/es6/SimpleToggleFormatter.js +132 -0
  369. package/lib/formatters/es6/TextFormatter.d.ts +12 -0
  370. package/lib/formatters/es6/TextFormatter.js +30 -0
  371. package/lib/formatters/es6/index.d.ts +43 -0
  372. package/lib/formatters/es6/index.js +67 -0
  373. package/lib/grid/index.d.ts +1 -0
  374. package/lib/grid/index.js +2 -0
  375. package/lib/grid/lib/efx-grid.d.ts +32 -0
  376. package/lib/grid/lib/efx-grid.js +469 -0
  377. package/lib/grid/themes/base.less +134 -0
  378. package/lib/grid/themes/halo/dark/css/native-elements.css +0 -0
  379. package/lib/grid/themes/halo/dark/efx-grid.js +4 -0
  380. package/lib/grid/themes/halo/dark/es5/all-elements.js +2 -0
  381. package/lib/grid/themes/halo/dark/imports/all-elements.js +1 -0
  382. package/lib/grid/themes/halo/dark/imports/custom-elements.js +1 -0
  383. package/lib/grid/themes/halo/dark/imports/native-elements.js +0 -0
  384. package/lib/grid/themes/halo/dark.js +3 -0
  385. package/lib/grid/themes/halo/efx-grid.less +92 -0
  386. package/lib/grid/themes/halo/index.less +3 -0
  387. package/lib/grid/themes/halo/light/css/native-elements.css +0 -0
  388. package/lib/grid/themes/halo/light/efx-grid.js +4 -0
  389. package/lib/grid/themes/halo/light/es5/all-elements.js +2 -0
  390. package/lib/grid/themes/halo/light/imports/all-elements.js +1 -0
  391. package/lib/grid/themes/halo/light/imports/custom-elements.js +1 -0
  392. package/lib/grid/themes/halo/light/imports/native-elements.js +0 -0
  393. package/lib/grid/themes/halo/light.js +3 -0
  394. package/lib/grid/themes/solar/charcoal/css/native-elements.css +0 -0
  395. package/lib/grid/themes/solar/charcoal/efx-grid.js +4 -0
  396. package/lib/grid/themes/solar/charcoal/es5/all-elements.js +2 -0
  397. package/lib/grid/themes/solar/charcoal/imports/all-elements.js +1 -0
  398. package/lib/grid/themes/solar/charcoal/imports/custom-elements.js +1 -0
  399. package/lib/grid/themes/solar/charcoal/imports/native-elements.js +0 -0
  400. package/lib/grid/themes/solar/charcoal.js +3 -0
  401. package/lib/grid/themes/solar/efx-grid.less +27 -0
  402. package/lib/grid/themes/solar/index.less +3 -0
  403. package/lib/grid/themes/solar/pearl/css/native-elements.css +0 -0
  404. package/lib/grid/themes/solar/pearl/efx-grid.js +4 -0
  405. package/lib/grid/themes/solar/pearl/es5/all-elements.js +2 -0
  406. package/lib/grid/themes/solar/pearl/imports/all-elements.js +1 -0
  407. package/lib/grid/themes/solar/pearl/imports/custom-elements.js +1 -0
  408. package/lib/grid/themes/solar/pearl/imports/native-elements.js +0 -0
  409. package/lib/grid/themes/solar/pearl.js +3 -0
  410. package/lib/index.d.ts +102 -0
  411. package/lib/index.js +102 -0
  412. package/lib/row-segmenting/es6/RowSegmenting.d.ts +83 -0
  413. package/lib/row-segmenting/es6/RowSegmenting.js +592 -0
  414. package/lib/row-segmenting/es6/index.d.ts +1 -0
  415. package/lib/row-segmenting/es6/index.js +1 -0
  416. package/lib/rt-grid/dist/rt-grid.js +44672 -0
  417. package/lib/rt-grid/dist/rt-grid.min.js +1 -0
  418. package/lib/rt-grid/es6/ColumnDefinition.d.ts +141 -0
  419. package/lib/rt-grid/es6/ColumnDefinition.js +1074 -0
  420. package/lib/rt-grid/es6/DataConnector.d.ts +37 -0
  421. package/lib/rt-grid/es6/DataConnector.js +266 -0
  422. package/lib/rt-grid/es6/FieldDefinition.d.ts +20 -0
  423. package/lib/rt-grid/es6/FieldDefinition.js +418 -0
  424. package/lib/rt-grid/es6/Grid.d.ts +261 -0
  425. package/lib/rt-grid/es6/Grid.js +2893 -0
  426. package/lib/rt-grid/es6/PredefinedFormula.d.ts +16 -0
  427. package/lib/rt-grid/es6/PredefinedFormula.js +33 -0
  428. package/lib/rt-grid/es6/ReferenceCounter.d.ts +38 -0
  429. package/lib/rt-grid/es6/ReferenceCounter.js +230 -0
  430. package/lib/rt-grid/es6/RowDefinition.d.ts +120 -0
  431. package/lib/rt-grid/es6/RowDefinition.js +873 -0
  432. package/lib/rt-grid/es6/SnapshotFiller.d.ts +21 -0
  433. package/lib/rt-grid/es6/SnapshotFiller.js +252 -0
  434. package/lib/rt-grid/es6/StyleLoader.d.ts +17 -0
  435. package/lib/rt-grid/es6/StyleLoader.js +47 -0
  436. package/lib/rt-grid/es6/index.d.ts +8 -0
  437. package/lib/rt-grid/es6/index.js +43 -0
  438. package/lib/statistics-row/es6/StatisticsRow.d.ts +67 -0
  439. package/lib/statistics-row/es6/StatisticsRow.js +786 -0
  440. package/lib/statistics-row/es6/index.d.ts +1 -0
  441. package/lib/statistics-row/es6/index.js +1 -0
  442. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.d.ts +45 -0
  443. package/lib/tr-grid-auto-tooltip/es6/AutoTooltip.js +431 -0
  444. package/lib/tr-grid-auto-tooltip/es6/index.d.ts +1 -0
  445. package/lib/tr-grid-auto-tooltip/es6/index.js +1 -0
  446. package/lib/tr-grid-cell-selection/es6/CellSelection.d.ts +67 -0
  447. package/lib/tr-grid-cell-selection/es6/CellSelection.js +1777 -0
  448. package/lib/tr-grid-cell-selection/es6/index.d.ts +1 -0
  449. package/lib/tr-grid-cell-selection/es6/index.js +1 -0
  450. package/lib/tr-grid-checkbox/es6/Checkbox.d.ts +69 -0
  451. package/lib/tr-grid-checkbox/es6/Checkbox.js +1476 -0
  452. package/lib/tr-grid-checkbox/es6/index.d.ts +1 -0
  453. package/lib/tr-grid-checkbox/es6/index.js +1 -0
  454. package/lib/tr-grid-column-fitter/es6/ColumnFitter.d.ts +56 -0
  455. package/lib/tr-grid-column-fitter/es6/ColumnFitter.js +1000 -0
  456. package/lib/tr-grid-column-fitter/es6/index.d.ts +1 -0
  457. package/lib/tr-grid-column-fitter/es6/index.js +1 -0
  458. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.d.ts +89 -0
  459. package/lib/tr-grid-column-formatting/es6/ColumnFormatting.js +615 -0
  460. package/lib/tr-grid-column-formatting/es6/index.d.ts +1 -0
  461. package/lib/tr-grid-column-formatting/es6/index.js +1 -0
  462. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.d.ts +60 -0
  463. package/lib/tr-grid-column-grouping/es6/ColumnGrouping.js +913 -0
  464. package/lib/tr-grid-column-grouping/es6/index.d.ts +1 -0
  465. package/lib/tr-grid-column-grouping/es6/index.js +1 -0
  466. package/lib/tr-grid-column-resizing/es6/ColumnResizing.d.ts +68 -0
  467. package/lib/tr-grid-column-resizing/es6/ColumnResizing.js +1013 -0
  468. package/lib/tr-grid-column-resizing/es6/index.d.ts +1 -0
  469. package/lib/tr-grid-column-resizing/es6/index.js +1 -0
  470. package/lib/tr-grid-column-selection/es6/ColumnSelection.d.ts +70 -0
  471. package/lib/tr-grid-column-selection/es6/ColumnSelection.js +928 -0
  472. package/lib/tr-grid-column-selection/es6/index.d.ts +1 -0
  473. package/lib/tr-grid-column-selection/es6/index.js +1 -0
  474. package/lib/tr-grid-column-stack/es6/ColumnStack.d.ts +76 -0
  475. package/lib/tr-grid-column-stack/es6/ColumnStack.js +1227 -0
  476. package/lib/tr-grid-column-stack/es6/index.d.ts +1 -0
  477. package/lib/tr-grid-column-stack/es6/index.js +1 -0
  478. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.d.ts +70 -0
  479. package/lib/tr-grid-conditional-coloring/es6/ConditionalColoring.js +947 -0
  480. package/lib/tr-grid-conditional-coloring/es6/index.d.ts +1 -0
  481. package/lib/tr-grid-conditional-coloring/es6/index.js +1 -0
  482. package/lib/tr-grid-content-wrap/es6/ContentWrap.d.ts +43 -0
  483. package/lib/tr-grid-content-wrap/es6/ContentWrap.js +478 -0
  484. package/lib/tr-grid-content-wrap/es6/index.d.ts +1 -0
  485. package/lib/tr-grid-content-wrap/es6/index.js +1 -0
  486. package/lib/tr-grid-contextmenu/es6/ContextMenu.d.ts +83 -0
  487. package/lib/tr-grid-contextmenu/es6/ContextMenu.js +471 -0
  488. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.d.ts +22 -0
  489. package/lib/tr-grid-contextmenu/es6/MenuEventAPI.js +133 -0
  490. package/lib/tr-grid-contextmenu/es6/MenuItem.d.ts +39 -0
  491. package/lib/tr-grid-contextmenu/es6/MenuItem.js +245 -0
  492. package/lib/tr-grid-contextmenu/es6/PopupMenu.d.ts +29 -0
  493. package/lib/tr-grid-contextmenu/es6/PopupMenu.js +292 -0
  494. package/lib/tr-grid-contextmenu/es6/index.d.ts +1 -0
  495. package/lib/tr-grid-contextmenu/es6/index.js +1 -0
  496. package/lib/tr-grid-filter-input/es6/FilterInput.d.ts +57 -0
  497. package/lib/tr-grid-filter-input/es6/FilterInput.js +928 -0
  498. package/lib/tr-grid-filter-input/es6/index.d.ts +1 -0
  499. package/lib/tr-grid-filter-input/es6/index.js +1 -0
  500. package/lib/tr-grid-heat-map/es6/HeatMap.d.ts +44 -0
  501. package/lib/tr-grid-heat-map/es6/HeatMap.js +394 -0
  502. package/lib/tr-grid-heat-map/es6/index.d.ts +1 -0
  503. package/lib/tr-grid-heat-map/es6/index.js +1 -0
  504. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.d.ts +129 -0
  505. package/lib/tr-grid-in-cell-editing/es6/InCellEditing.js +1977 -0
  506. package/lib/tr-grid-in-cell-editing/es6/index.d.ts +1 -0
  507. package/lib/tr-grid-in-cell-editing/es6/index.js +1 -0
  508. package/lib/tr-grid-pagination/es6/Pagination.d.ts +57 -0
  509. package/lib/tr-grid-pagination/es6/Pagination.js +427 -0
  510. package/lib/tr-grid-pagination/es6/index.d.ts +1 -0
  511. package/lib/tr-grid-pagination/es6/index.js +1 -0
  512. package/lib/tr-grid-percent-bar/es6/PercentBar.d.ts +60 -0
  513. package/lib/tr-grid-percent-bar/es6/PercentBar.js +801 -0
  514. package/lib/tr-grid-percent-bar/es6/index.d.ts +1 -0
  515. package/lib/tr-grid-percent-bar/es6/index.js +1 -0
  516. package/lib/tr-grid-printer/es6/CellWriter.d.ts +49 -0
  517. package/lib/tr-grid-printer/es6/CellWriter.js +226 -0
  518. package/lib/tr-grid-printer/es6/ColumnWriter.d.ts +12 -0
  519. package/lib/tr-grid-printer/es6/ColumnWriter.js +21 -0
  520. package/lib/tr-grid-printer/es6/GridPrinter.d.ts +32 -0
  521. package/lib/tr-grid-printer/es6/GridPrinter.js +761 -0
  522. package/lib/tr-grid-printer/es6/PrintTrait.d.ts +38 -0
  523. package/lib/tr-grid-printer/es6/PrintTrait.js +481 -0
  524. package/lib/tr-grid-printer/es6/SectionWriter.d.ts +54 -0
  525. package/lib/tr-grid-printer/es6/SectionWriter.js +205 -0
  526. package/lib/tr-grid-printer/es6/index.d.ts +1 -0
  527. package/lib/tr-grid-printer/es6/index.js +1 -0
  528. package/lib/tr-grid-range-bar/es6/RangeBar.d.ts +39 -0
  529. package/lib/tr-grid-range-bar/es6/RangeBar.js +353 -0
  530. package/lib/tr-grid-range-bar/es6/index.d.ts +1 -0
  531. package/lib/tr-grid-range-bar/es6/index.js +1 -0
  532. package/lib/tr-grid-row-dragging/es6/RowDragging.d.ts +53 -0
  533. package/lib/tr-grid-row-dragging/es6/RowDragging.js +794 -0
  534. package/lib/tr-grid-row-dragging/es6/index.d.ts +1 -0
  535. package/lib/tr-grid-row-dragging/es6/index.js +1 -0
  536. package/lib/tr-grid-row-filtering/es6/RowFiltering.d.ts +118 -0
  537. package/lib/tr-grid-row-filtering/es6/RowFiltering.js +1884 -0
  538. package/lib/tr-grid-row-filtering/es6/index.d.ts +1 -0
  539. package/lib/tr-grid-row-filtering/es6/index.js +1 -0
  540. package/lib/tr-grid-row-grouping/es6/RowGrouping.d.ts +109 -0
  541. package/lib/tr-grid-row-grouping/es6/RowGrouping.js +1541 -0
  542. package/lib/tr-grid-row-grouping/es6/index.d.ts +1 -0
  543. package/lib/tr-grid-row-grouping/es6/index.js +1 -0
  544. package/lib/tr-grid-row-selection/es6/RowSelection.d.ts +74 -0
  545. package/lib/tr-grid-row-selection/es6/RowSelection.js +1202 -0
  546. package/lib/tr-grid-row-selection/es6/index.d.ts +1 -0
  547. package/lib/tr-grid-row-selection/es6/index.js +1 -0
  548. package/lib/tr-grid-rowcoloring/es6/RowColoring.d.ts +60 -0
  549. package/lib/tr-grid-rowcoloring/es6/RowColoring.js +611 -0
  550. package/lib/tr-grid-rowcoloring/es6/index.d.ts +1 -0
  551. package/lib/tr-grid-rowcoloring/es6/index.js +1 -0
  552. package/lib/tr-grid-textformatting/es6/TextFormatting.d.ts +77 -0
  553. package/lib/tr-grid-textformatting/es6/TextFormatting.js +574 -0
  554. package/lib/tr-grid-textformatting/es6/index.d.ts +1 -0
  555. package/lib/tr-grid-textformatting/es6/index.js +1 -0
  556. package/lib/tr-grid-titlewrap/es6/TitleWrap.d.ts +29 -0
  557. package/lib/tr-grid-titlewrap/es6/TitleWrap.js +431 -0
  558. package/lib/tr-grid-titlewrap/es6/index.d.ts +1 -0
  559. package/lib/tr-grid-titlewrap/es6/index.js +1 -0
  560. package/lib/tr-grid-util/es6/CellPainter.d.ts +136 -0
  561. package/lib/tr-grid-util/es6/CellPainter.js +1128 -0
  562. package/lib/tr-grid-util/es6/Conflator.d.ts +34 -0
  563. package/lib/tr-grid-util/es6/Conflator.js +193 -0
  564. package/lib/tr-grid-util/es6/CoralItems.d.ts +10 -0
  565. package/lib/tr-grid-util/es6/CoralItems.js +42 -0
  566. package/lib/tr-grid-util/es6/DateTime.d.ts +57 -0
  567. package/lib/tr-grid-util/es6/DateTime.js +508 -0
  568. package/lib/tr-grid-util/es6/Deferred.d.ts +14 -0
  569. package/lib/tr-grid-util/es6/Deferred.js +98 -0
  570. package/lib/tr-grid-util/es6/Delay.d.ts +20 -0
  571. package/lib/tr-grid-util/es6/Delay.js +85 -0
  572. package/lib/tr-grid-util/es6/Dom.d.ts +32 -0
  573. package/lib/tr-grid-util/es6/Dom.js +346 -0
  574. package/lib/tr-grid-util/es6/ElementObserver.d.ts +10 -0
  575. package/lib/tr-grid-util/es6/ElementObserver.js +101 -0
  576. package/lib/tr-grid-util/es6/ElementWrapper.d.ts +23 -0
  577. package/lib/tr-grid-util/es6/ElementWrapper.js +83 -0
  578. package/lib/tr-grid-util/es6/ElfDate.d.ts +26 -0
  579. package/lib/tr-grid-util/es6/ElfDate.js +163 -0
  580. package/lib/tr-grid-util/es6/ElfUtil.d.ts +33 -0
  581. package/lib/tr-grid-util/es6/ElfUtil.js +458 -0
  582. package/lib/tr-grid-util/es6/EventDispatcher.d.ts +26 -0
  583. package/lib/tr-grid-util/es6/EventDispatcher.js +161 -0
  584. package/lib/tr-grid-util/es6/ExpanderIcon.d.ts +27 -0
  585. package/lib/tr-grid-util/es6/ExpanderIcon.js +169 -0
  586. package/lib/tr-grid-util/es6/Ext.d.ts +10 -0
  587. package/lib/tr-grid-util/es6/Ext.js +52 -0
  588. package/lib/tr-grid-util/es6/FieldFormatter.d.ts +55 -0
  589. package/lib/tr-grid-util/es6/FieldFormatter.js +432 -0
  590. package/lib/tr-grid-util/es6/FilterBuilder.d.ts +48 -0
  591. package/lib/tr-grid-util/es6/FilterBuilder.js +521 -0
  592. package/lib/tr-grid-util/es6/FilterOperators.d.ts +41 -0
  593. package/lib/tr-grid-util/es6/FilterOperators.js +181 -0
  594. package/lib/tr-grid-util/es6/GridPlugin.d.ts +72 -0
  595. package/lib/tr-grid-util/es6/GridPlugin.js +747 -0
  596. package/lib/tr-grid-util/es6/Icon.d.ts +14 -0
  597. package/lib/tr-grid-util/es6/Icon.js +61 -0
  598. package/lib/tr-grid-util/es6/MouseDownTrait.d.ts +42 -0
  599. package/lib/tr-grid-util/es6/MouseDownTrait.js +237 -0
  600. package/lib/tr-grid-util/es6/MultiTableManager.d.ts +32 -0
  601. package/lib/tr-grid-util/es6/MultiTableManager.js +506 -0
  602. package/lib/tr-grid-util/es6/NumberFormatter.d.ts +83 -0
  603. package/lib/tr-grid-util/es6/NumberFormatter.js +471 -0
  604. package/lib/tr-grid-util/es6/PercentBar.d.ts +71 -0
  605. package/lib/tr-grid-util/es6/PercentBar.js +600 -0
  606. package/lib/tr-grid-util/es6/Perf.d.ts +32 -0
  607. package/lib/tr-grid-util/es6/Perf.js +162 -0
  608. package/lib/tr-grid-util/es6/Popup.d.ts +84 -0
  609. package/lib/tr-grid-util/es6/Popup.js +818 -0
  610. package/lib/tr-grid-util/es6/RangeBar.d.ts +33 -0
  611. package/lib/tr-grid-util/es6/RangeBar.js +259 -0
  612. package/lib/tr-grid-util/es6/RequestQueue.d.ts +30 -0
  613. package/lib/tr-grid-util/es6/RequestQueue.js +239 -0
  614. package/lib/tr-grid-util/es6/RowPainter.d.ts +23 -0
  615. package/lib/tr-grid-util/es6/RowPainter.js +188 -0
  616. package/lib/tr-grid-util/es6/SubTable.d.ts +74 -0
  617. package/lib/tr-grid-util/es6/SubTable.js +558 -0
  618. package/lib/tr-grid-util/es6/Table.d.ts +125 -0
  619. package/lib/tr-grid-util/es6/Table.js +790 -0
  620. package/lib/tr-grid-util/es6/TextHighlighter.d.ts +18 -0
  621. package/lib/tr-grid-util/es6/TextHighlighter.js +273 -0
  622. package/lib/tr-grid-util/es6/TickCodes.d.ts +8 -0
  623. package/lib/tr-grid-util/es6/TickCodes.js +33 -0
  624. package/lib/tr-grid-util/es6/Timer.d.ts +16 -0
  625. package/lib/tr-grid-util/es6/Timer.js +49 -0
  626. package/lib/tr-grid-util/es6/TouchProxy.d.ts +46 -0
  627. package/lib/tr-grid-util/es6/TouchProxy.js +212 -0
  628. package/lib/tr-grid-util/es6/Util.d.ts +65 -0
  629. package/lib/tr-grid-util/es6/Util.js +528 -0
  630. package/lib/tr-grid-util/es6/formula/ADCService.d.ts +11 -0
  631. package/lib/tr-grid-util/es6/formula/ADCService.js +72 -0
  632. package/lib/tr-grid-util/es6/formula/ADCSubscription.d.ts +17 -0
  633. package/lib/tr-grid-util/es6/formula/ADCSubscription.js +317 -0
  634. package/lib/tr-grid-util/es6/formula/AdFinService.d.ts +12 -0
  635. package/lib/tr-grid-util/es6/formula/AdFinService.js +61 -0
  636. package/lib/tr-grid-util/es6/formula/AdFinSubscription.d.ts +19 -0
  637. package/lib/tr-grid-util/es6/formula/AdFinSubscription.js +310 -0
  638. package/lib/tr-grid-util/es6/formula/Engine.d.ts +56 -0
  639. package/lib/tr-grid-util/es6/formula/Engine.js +592 -0
  640. package/lib/tr-grid-util/es6/formula/Formula.d.ts +68 -0
  641. package/lib/tr-grid-util/es6/formula/Formula.js +882 -0
  642. package/lib/tr-grid-util/es6/formula/IntervalSubscription.d.ts +16 -0
  643. package/lib/tr-grid-util/es6/formula/IntervalSubscription.js +165 -0
  644. package/lib/tr-grid-util/es6/formula/Realtime.d.ts +18 -0
  645. package/lib/tr-grid-util/es6/formula/Realtime.js +279 -0
  646. package/lib/tr-grid-util/es6/formula/RealtimeService.d.ts +18 -0
  647. package/lib/tr-grid-util/es6/formula/RealtimeService.js +203 -0
  648. package/lib/tr-grid-util/es6/formula/TSIService.d.ts +11 -0
  649. package/lib/tr-grid-util/es6/formula/TSIService.js +51 -0
  650. package/lib/tr-grid-util/es6/formula/TSISubscription.d.ts +18 -0
  651. package/lib/tr-grid-util/es6/formula/TSISubscription.js +1015 -0
  652. package/lib/tr-grid-util/es6/formula/VariableToken.d.ts +30 -0
  653. package/lib/tr-grid-util/es6/formula/VariableToken.js +314 -0
  654. package/lib/tr-grid-util/es6/formula/functions/AdFin.d.ts +9 -0
  655. package/lib/tr-grid-util/es6/formula/functions/AdFin.js +1778 -0
  656. package/lib/tr-grid-util/es6/formula/functions/Excel.d.ts +8 -0
  657. package/lib/tr-grid-util/es6/formula/functions/Excel.js +21 -0
  658. package/lib/tr-grid-util/es6/formula/functions/Info.d.ts +8 -0
  659. package/lib/tr-grid-util/es6/formula/functions/Info.js +192 -0
  660. package/lib/tr-grid-util/es6/formula/functions/Internal.d.ts +8 -0
  661. package/lib/tr-grid-util/es6/formula/functions/Internal.js +90 -0
  662. package/lib/tr-grid-util/es6/formula/functions/Logic.d.ts +12 -0
  663. package/lib/tr-grid-util/es6/formula/functions/Logic.js +176 -0
  664. package/lib/tr-grid-util/es6/formula/functions/Math.d.ts +18 -0
  665. package/lib/tr-grid-util/es6/formula/functions/Math.js +1624 -0
  666. package/lib/tr-grid-util/es6/formula/functions/Statistics.d.ts +18 -0
  667. package/lib/tr-grid-util/es6/formula/functions/Statistics.js +234 -0
  668. package/lib/tr-grid-util/es6/formula/functions/Text.d.ts +10 -0
  669. package/lib/tr-grid-util/es6/formula/functions/Text.js +676 -0
  670. package/lib/tr-grid-util/es6/index.d.ts +63 -0
  671. package/lib/tr-grid-util/es6/index.js +99 -0
  672. package/lib/tr-grid-util/es6/jet/CollectionDict.d.ts +28 -0
  673. package/lib/tr-grid-util/es6/jet/CollectionDict.js +141 -0
  674. package/lib/tr-grid-util/es6/jet/DataGenerator.d.ts +114 -0
  675. package/lib/tr-grid-util/es6/jet/DataGenerator.js +827 -0
  676. package/lib/tr-grid-util/es6/jet/DataSet.d.ts +8 -0
  677. package/lib/tr-grid-util/es6/jet/DataSet.js +392 -0
  678. package/lib/tr-grid-util/es6/jet/MockArchive.d.ts +21 -0
  679. package/lib/tr-grid-util/es6/jet/MockArchive.js +56 -0
  680. package/lib/tr-grid-util/es6/jet/MockJET.d.ts +25 -0
  681. package/lib/tr-grid-util/es6/jet/MockJET.js +63 -0
  682. package/lib/tr-grid-util/es6/jet/MockQuotes.d.ts +37 -0
  683. package/lib/tr-grid-util/es6/jet/MockQuotes.js +199 -0
  684. package/lib/tr-grid-util/es6/jet/MockQuotes2.d.ts +72 -0
  685. package/lib/tr-grid-util/es6/jet/MockQuotes2.js +564 -0
  686. package/lib/tr-grid-util/es6/jet/MockRTK.d.ts +8 -0
  687. package/lib/tr-grid-util/es6/jet/MockRTK.js +43 -0
  688. package/lib/tr-grid-util/es6/jet/index.d.ts +9 -0
  689. package/lib/tr-grid-util/es6/jet/index.js +18 -0
  690. package/lib/tr-grid-util/es6/jet/mockDataAPI.d.ts +11 -0
  691. package/lib/tr-grid-util/es6/jet/mockDataAPI.js +131 -0
  692. package/lib/tr-grid-util/es6/locale/translation-de.d.ts +7 -0
  693. package/lib/tr-grid-util/es6/locale/translation-de.js +51 -0
  694. package/lib/tr-grid-util/es6/locale/translation-en.d.ts +7 -0
  695. package/lib/tr-grid-util/es6/locale/translation-en.js +51 -0
  696. package/lib/tr-grid-util/es6/locale/translation-ja.d.ts +7 -0
  697. package/lib/tr-grid-util/es6/locale/translation-ja.js +51 -0
  698. package/lib/tr-grid-util/es6/locale/translation-zh-hant.d.ts +7 -0
  699. package/lib/tr-grid-util/es6/locale/translation-zh-hant.js +51 -0
  700. package/lib/tr-grid-util/es6/locale/translation-zh.d.ts +7 -0
  701. package/lib/tr-grid-util/es6/locale/translation-zh.js +51 -0
  702. package/lib/tr-grid-util/es6/locale/translation.d.ts +11 -0
  703. package/lib/tr-grid-util/es6/locale/translation.js +18 -0
  704. package/lib/types/es6/AutoTooltip.d.ts +45 -0
  705. package/lib/types/es6/CellSelection.d.ts +67 -0
  706. package/lib/types/es6/Checkbox.d.ts +69 -0
  707. package/lib/types/es6/ColumnFitter.d.ts +56 -0
  708. package/lib/types/es6/ColumnFormatting.d.ts +90 -0
  709. package/lib/types/es6/ColumnGrouping.d.ts +60 -0
  710. package/lib/types/es6/ColumnResizing.d.ts +68 -0
  711. package/lib/types/es6/ColumnSelection.d.ts +70 -0
  712. package/lib/types/es6/ColumnStack.d.ts +76 -0
  713. package/lib/types/es6/CompositeGrid/CollapsibleHeaderPlugin.d.ts +11 -0
  714. package/lib/types/es6/CompositeGrid/ColumnSelectionPlugin.d.ts +38 -0
  715. package/lib/types/es6/CompositeGrid/ColumnWidthAdjustingPlugin.d.ts +45 -0
  716. package/lib/types/es6/CompositeGrid/CompositeGrid.d.ts +287 -0
  717. package/lib/types/es6/CompositeGrid/DragAndDropTitlePlugin.d.ts +22 -0
  718. package/lib/types/es6/CompositeGrid/DraggableContentPlugin.d.ts +44 -0
  719. package/lib/types/es6/CompositeGrid/ResizableTitlePlugin.d.ts +30 -0
  720. package/lib/types/es6/CompositeGrid/RowSelectionPlugin.d.ts +42 -0
  721. package/lib/types/es6/CompositeGrid/TextWidthCalculator.d.ts +24 -0
  722. package/lib/types/es6/CompositeGrid/TreeIndentingPlugin.d.ts +46 -0
  723. package/lib/types/es6/CompositeGrid/index.d.ts +9 -0
  724. package/lib/types/es6/ConditionalColoring.d.ts +70 -0
  725. package/lib/types/es6/ContentWrap.d.ts +43 -0
  726. package/lib/types/es6/ContextMenu.d.ts +83 -0
  727. package/lib/types/es6/CoralButtonFormatter.d.ts +22 -0
  728. package/lib/types/es6/CoralCheckboxFormatter.d.ts +12 -0
  729. package/lib/types/es6/CoralComboBoxFormatter.d.ts +23 -0
  730. package/lib/types/es6/CoralIconFormatter.d.ts +23 -0
  731. package/lib/types/es6/CoralInputFormatter.d.ts +12 -0
  732. package/lib/types/es6/CoralRadioButtonFormatter.d.ts +22 -0
  733. package/lib/types/es6/CoralSelectFormatter.d.ts +23 -0
  734. package/lib/types/es6/CoralToggleFormatter.d.ts +12 -0
  735. package/lib/types/es6/Core/data/ColumnStats.d.ts +42 -0
  736. package/lib/types/es6/Core/data/DataCache.d.ts +81 -0
  737. package/lib/types/es6/Core/data/DataTable.d.ts +125 -0
  738. package/lib/types/es6/Core/data/DataView.d.ts +280 -0
  739. package/lib/types/es6/Core/data/Segment.d.ts +38 -0
  740. package/lib/types/es6/Core/data/SegmentCollection.d.ts +58 -0
  741. package/lib/types/es6/Core/grid/Core.d.ts +387 -0
  742. package/lib/types/es6/Core/grid/ILayoutGrid.d.ts +204 -0
  743. package/lib/types/es6/Core/grid/LayoutGrid.d.ts +23 -0
  744. package/lib/types/es6/Core/grid/VirtualizedLayoutGrid.d.ts +18 -0
  745. package/lib/types/es6/Core/grid/components/Cell.d.ts +50 -0
  746. package/lib/types/es6/Core/grid/components/CellFloatingPanel.d.ts +19 -0
  747. package/lib/types/es6/Core/grid/components/CellSpan.d.ts +18 -0
  748. package/lib/types/es6/Core/grid/components/CellSpans.d.ts +38 -0
  749. package/lib/types/es6/Core/grid/components/Column.d.ts +22 -0
  750. package/lib/types/es6/Core/grid/components/ElementWrapper.d.ts +125 -0
  751. package/lib/types/es6/Core/grid/components/HScrollbar.d.ts +24 -0
  752. package/lib/types/es6/Core/grid/components/Scrollbar.d.ts +61 -0
  753. package/lib/types/es6/Core/grid/components/StretchedCells.d.ts +17 -0
  754. package/lib/types/es6/Core/grid/components/VScrollbar.d.ts +18 -0
  755. package/lib/types/es6/Core/grid/components/VirtualItems.d.ts +12 -0
  756. package/lib/types/es6/Core/grid/event/EventDispatcher.d.ts +16 -0
  757. package/lib/types/es6/Core/grid/event/EventListeners.d.ts +34 -0
  758. package/lib/types/es6/Core/grid/plugins/DragAndDropTitlePlugin.d.ts +24 -0
  759. package/lib/types/es6/Core/grid/plugins/Plugin.d.ts +28 -0
  760. package/lib/types/es6/Core/grid/plugins/SortableTitlePlugin.d.ts +127 -0
  761. package/lib/types/es6/Core/grid/util/Conflator.d.ts +32 -0
  762. package/lib/types/es6/Core/grid/util/ElementFrameWork.d.ts +18 -0
  763. package/lib/types/es6/Core/grid/util/HttpRequest.d.ts +53 -0
  764. package/lib/types/es6/Core/grid/util/PercentBar.d.ts +43 -0
  765. package/lib/types/es6/Core/grid/util/PercentBarRenderer.d.ts +41 -0
  766. package/lib/types/es6/Core/grid/util/RangeBar.d.ts +25 -0
  767. package/lib/types/es6/Core/grid/util/Reverter.d.ts +14 -0
  768. package/lib/types/es6/Core/grid/util/SectionSettings.d.ts +79 -0
  769. package/lib/types/es6/Core/grid/util/SelectionList.d.ts +50 -0
  770. package/lib/types/es6/Core/grid/util/TrackLayout.d.ts +84 -0
  771. package/lib/types/es6/Core/grid/util/Virtualizer.d.ts +40 -0
  772. package/lib/types/es6/Core/grid/util/util.d.ts +18 -0
  773. package/lib/types/es6/Core/index.d.ts +84 -0
  774. package/lib/types/es6/Core/tr-grid-theme.d.ts +5 -0
  775. package/lib/types/es6/DuplexEmeraldDateTimePickerFormatter.d.ts +14 -0
  776. package/lib/types/es6/EFButtonFormatter.d.ts +22 -0
  777. package/lib/types/es6/EFCheckboxFormatter.d.ts +12 -0
  778. package/lib/types/es6/EFComboBoxFormatter.d.ts +23 -0
  779. package/lib/types/es6/EFDateTimePickerFormatter.d.ts +13 -0
  780. package/lib/types/es6/EFIconFormatter.d.ts +23 -0
  781. package/lib/types/es6/EFNumberFieldFormatter.d.ts +12 -0
  782. package/lib/types/es6/EFRadioButtonFormatter.d.ts +22 -0
  783. package/lib/types/es6/EFSelectFormatter.d.ts +23 -0
  784. package/lib/types/es6/EFTextFieldFormatter.d.ts +12 -0
  785. package/lib/types/es6/EFToggleFormatter.d.ts +12 -0
  786. package/lib/types/es6/EmeraldDateTimePickerFormatter.d.ts +13 -0
  787. package/lib/types/es6/ExtensionColumnOptions.d.ts +41 -0
  788. package/lib/types/es6/ExtensionOptions.d.ts +52 -0
  789. package/lib/types/es6/Extensions.d.ts +61 -0
  790. package/lib/types/es6/FilterInput.d.ts +57 -0
  791. package/lib/types/es6/FormatterBuilder.d.ts +22 -0
  792. package/lib/types/es6/GridFormatter.d.ts +63 -0
  793. package/lib/types/es6/HeatMap.d.ts +44 -0
  794. package/lib/types/es6/InCellEditing.d.ts +129 -0
  795. package/lib/types/es6/MenuEventAPI.d.ts +22 -0
  796. package/lib/types/es6/MenuItem.d.ts +39 -0
  797. package/lib/types/es6/NumericInputFormatter.d.ts +13 -0
  798. package/lib/types/es6/Pagination.d.ts +57 -0
  799. package/lib/types/es6/PercentBar.d.ts +60 -0
  800. package/lib/types/es6/PercentBarFormatter.d.ts +25 -0
  801. package/lib/types/es6/PopupMenu.d.ts +29 -0
  802. package/lib/types/es6/RangeBar.d.ts +39 -0
  803. package/lib/types/es6/RealtimeGrid/ColumnDefinition.d.ts +143 -0
  804. package/lib/types/es6/RealtimeGrid/DataConnector.d.ts +37 -0
  805. package/lib/types/es6/RealtimeGrid/FieldDefinition.d.ts +20 -0
  806. package/lib/types/es6/RealtimeGrid/Grid.d.ts +263 -0
  807. package/lib/types/es6/RealtimeGrid/PredefinedFormula.d.ts +16 -0
  808. package/lib/types/es6/RealtimeGrid/ReferenceCounter.d.ts +38 -0
  809. package/lib/types/es6/RealtimeGrid/RowDefinition.d.ts +120 -0
  810. package/lib/types/es6/RealtimeGrid/SnapshotFiller.d.ts +21 -0
  811. package/lib/types/es6/RealtimeGrid/StyleLoader.d.ts +17 -0
  812. package/lib/types/es6/RealtimeGrid/index.d.ts +8 -0
  813. package/lib/types/es6/RowColoring.d.ts +60 -0
  814. package/lib/types/es6/RowDragging.d.ts +53 -0
  815. package/lib/types/es6/RowFiltering.d.ts +118 -0
  816. package/lib/types/es6/RowGrouping.d.ts +109 -0
  817. package/lib/types/es6/RowSegmenting.d.ts +83 -0
  818. package/lib/types/es6/RowSelection.d.ts +74 -0
  819. package/lib/types/es6/SimpleImageFormatter.d.ts +21 -0
  820. package/lib/types/es6/SimpleInputFormatter.d.ts +12 -0
  821. package/lib/types/es6/SimpleLinkFormatter.d.ts +21 -0
  822. package/lib/types/es6/SimpleTickerFormatter.d.ts +25 -0
  823. package/lib/types/es6/SimpleToggleFormatter.d.ts +22 -0
  824. package/lib/types/es6/StatisticsRow.d.ts +67 -0
  825. package/lib/types/es6/TextFormatter.d.ts +12 -0
  826. package/lib/types/es6/TextFormatting.d.ts +77 -0
  827. package/lib/types/es6/TitleWrap.d.ts +29 -0
  828. package/lib/types/es6/Zoom.d.ts +51 -0
  829. package/lib/types/es6/index.d.ts +76 -0
  830. package/lib/types/index.d.ts +1 -0
  831. package/lib/versions.json +36 -0
  832. package/lib/window-exporter.js +13 -0
  833. package/lib/zoom/es6/Zoom.d.ts +51 -0
  834. package/lib/zoom/es6/Zoom.js +419 -0
  835. package/lib/zoom/es6/index.d.ts +1 -0
  836. package/lib/zoom/es6/index.js +1 -0
  837. package/package.json +42 -0
@@ -0,0 +1,2713 @@
1
+ import { customElement } from "@refinitiv-ui/core/decorators/custom-element.js";
2
+ import {
3
+ BasicElement,
4
+ html
5
+ } from "@refinitiv-ui/core";
6
+ // import "@elf/atlas-autosuggest/lib/atlas-autosuggest.js"; //TODO: Not been use at the moment, But possible to use in the future
7
+ import "@refinitiv-ui/elements/button";
8
+ import "@refinitiv-ui/elements/checkbox";
9
+ import "@refinitiv-ui/elements/collapse";
10
+ import "@refinitiv-ui/elements/dialog";
11
+ import "@refinitiv-ui/elements/icon";
12
+ import "@refinitiv-ui/elements/text-field";
13
+ import "@refinitiv-ui/elements/number-field";
14
+ import "@refinitiv-ui/elements/list";
15
+ import "@refinitiv-ui/elements/radio-button";
16
+ import "@refinitiv-ui/elements/select";
17
+ import "@refinitiv-ui/elements/button-bar";
18
+ import "@refinitiv-ui/elements/tooltip";
19
+ import "@refinitiv-ui/elements/item";
20
+ import "@refinitiv-ui/elements/color-dialog";
21
+ import ElfUtil from "../../tr-grid-util/es6/ElfUtil.js";
22
+ import { DATE_TIME, toDateTimeType } from "../../tr-grid-util/es6/FieldFormatter.js";
23
+ import translation from "./locale/translation.js";
24
+ import { PercentBar } from "../../tr-grid-util/es6/PercentBar.js";
25
+ import ElementObserver from "../../tr-grid-util/es6/ElementObserver.js";
26
+ import { PreviewTable } from "./preview-table.js";
27
+
28
+ /**
29
+ * @typedef {Object} ColumnFormatDialog~SupportDisplayStyleOptions
30
+ * @property {boolean} bar support "bar"
31
+ */
32
+
33
+ /**
34
+ * @typedef {Object} ColumnFormatDialog~SupportValueFormatOptions
35
+ * @property {boolean} fx support "fx"
36
+ */
37
+
38
+ /**
39
+ * @typedef {Object} ColumnFormatDialog~Config
40
+ * @property {Object} data Context object indicating current states of the column
41
+ * @property {boolean=} supportHighlightApplyToSwitch support HighlightApplyToSwitch
42
+ * @property {ColumnFormatDialog~SupportValueFormatOptions=} supportValueFormatOptions Support FxFormat
43
+ * @property {ColumnFormatDialog~SupportDisplayStyleOptions=} supportDisplayStyleOptions Support items in "Display Style" dropdown
44
+ * @property {Array.<string>=} fields List of available fields to be shown in the dialog
45
+ * @property {Function=} confirm Confirm event callback
46
+ * @property {Function=} cancel Cancel event callback
47
+ */
48
+
49
+ const conditionDict = {
50
+ "GREATER_THAN": {
51
+ text: "Greater than",
52
+ expression: "[{0}] > {1}",
53
+ valueType: "number",
54
+ displayFormat: "Value > {0}",
55
+ regExp: /^\[[^[\]]+]\s*>\s*([+\-eE\d.]+)$/ // for auto-detect type of expression
56
+ },
57
+ "GREATER_THAN_OR_EQUAL_TO": {
58
+ text: "Greater than or equal to",
59
+ expression: "[{0}] >= {1}",
60
+ valueType: "number",
61
+ displayFormat: "Value >= {0}",
62
+ regExp: /^\[[^[\]]+]\s*>=\s*([+\-eE\d.]+)$/ // for auto-detect type of expression
63
+ },
64
+ "EQUAL_TO": {
65
+ text: "Equal to",
66
+ expression: "[{0}] === {1}",
67
+ valueType: "number",
68
+ displayFormat: "Value = {0}",
69
+ regExp: /^\[[^[\]]+]\s*===\s*([+\-eE\d.]+)$/ // for auto-detect type of expression
70
+ },
71
+ "LESS_THAN": {
72
+ text: "Less than",
73
+ expression: "[{0}] < {1}",
74
+ valueType: "number",
75
+ displayFormat: "Value < {0}",
76
+ regExp: /^\[[^[\]]+]\s*<\s*([+\-eE\d.]+)$/ // for auto-detect type of expression
77
+ },
78
+ "LESS_THAN_OR_EQUAL_TO": {
79
+ text: "Less than or equal to",
80
+ expression: "[{0}] <= {1}",
81
+ valueType: "number",
82
+ displayFormat: "Value <= {0}",
83
+ regExp: /^\[[^[\]]+]\s*<=\s*([+\-eE\d.]+)$/ // for auto-detect type of expression
84
+ },
85
+ "BETWEEN": {
86
+ text: "Between",
87
+ expression: "[{0}] > {1} && [{0}] < {2}",
88
+ valueType: "twoNumbers",
89
+ displayFormat: "Value Between {0} And {1}",
90
+ regExp: new RegExp(/^\[[^[\]]+]\s*>\s*([+\-eE\d.]+)\s*&&\s*\[[^[\]]+]\s*<\s*([+\-eE\d.]+)$/) // for auto-detect type of expression
91
+ },
92
+ "TEXT_THAT_CONTAINS": {
93
+ text: "Text that contains",
94
+ expression: 'String([{0}]).indexOf("{1}") > -1',
95
+ valueType: "text",
96
+ displayFormat: 'Text that contains \'{0}\'',
97
+ regExp: new RegExp(/^String\(\[[^[\]]+]\)\.indexOf\("([^()]+)"\)\s*>\s*-1$/) // for auto-detect type of expression
98
+ },
99
+ "TEXT_THAT_NOT_CONTAINS": {
100
+ text: "Text that not contains",
101
+ expression: 'String([{0}]).indexOf("{1}") < 0',
102
+ valueType: "text",
103
+ displayFormat: 'Text that not contains \'{0}\'',
104
+ regExp: new RegExp(/^String\(\[[^[\]]+]\)\.indexOf\("([^()]+)"\)\s*<\s*0$/) // for auto-detect type of expression
105
+ },
106
+ "TEXT_IS": {
107
+ text: "Text is",
108
+ expression: 'String([{0}]) === "{1}"',
109
+ valueType: "text",
110
+ displayFormat: 'Value = \'{0}\'',
111
+ regExp: new RegExp(/String\(\[[^[\]]+]\)\s*===\s*"(.+)"/) // for auto-detect type of expression
112
+ },
113
+ "BLANK": { // undefined, null, '', NaN
114
+ text: "Value is blank",
115
+ expression: "![{0}] && [{0}] !== 0",
116
+ valueType: "none",
117
+ displayFormat: "Value is blank",
118
+ regExp: new RegExp(/!\[[^[\]]+]\s*&&\s*\[[^[\]]+]\s*!==\s*0/) // for auto-detect type of expression
119
+ },
120
+ "NOT_BLANK": { // Has a value
121
+ text: "Value is not blank",
122
+ expression: "[{0}] || [{0}] === 0",
123
+ valueType: "none",
124
+ displayFormat: "Value is not blank",
125
+ regExp: new RegExp(/\[[^[\]]+]\s*\|\|\s*\[[^[\]]+]\s*===\s*0/) // for auto-detect type of expression
126
+ }
127
+ };
128
+
129
+ /**
130
+ * @class
131
+ * @public
132
+ */
133
+ class ColumnFormatDialog extends BasicElement {
134
+
135
+ static get properties() {
136
+ return {
137
+ config: { type: Object },
138
+ data: { type: Object },
139
+ isShown: { type: Boolean },
140
+ lang: { type: String, reflect: true }
141
+ };
142
+ }
143
+
144
+ constructor() {
145
+ super();
146
+ this.$ = {}; // WORKAROUND
147
+ this.isShown = false;
148
+ this._colors = null;
149
+
150
+ this.lang = "en";
151
+ this._lang = "en";
152
+ this._translation = translation;
153
+
154
+ this._onThemeLoaded = this._onThemeLoaded.bind(this);
155
+
156
+ this._constSelfColumn = "THIS_COLUMN";
157
+ this._colorConditionEditState = {
158
+ expression: {
159
+ name: "GREATER_THAN",
160
+ values: []
161
+ },
162
+ color: "",
163
+ backgroundColor: ""
164
+ };
165
+ this._atLeastOneBidOffer = false;
166
+
167
+ ElfUtil.getThemeColors().then(this._onThemeLoaded);
168
+ ElementObserver.addLanguageListener(this);
169
+ }
170
+
171
+ /**
172
+ * @private
173
+ * @param {Object} changedProperties
174
+ */
175
+ update(changedProperties) {
176
+ if(changedProperties.has("lang")) {
177
+ this._lang = ElfUtil.toLangString(this.lang);
178
+ }
179
+ if (changedProperties.has("config")) {
180
+ this._config = Object.assign({
181
+ supportValueFormatOptions: {},
182
+ supportDisplayStyleOptions: {}
183
+ }, this.config);
184
+ if (!changedProperties.has("data")) {
185
+ if (this._config.data != null) {
186
+ this.data = this._config.data; // Assign data from user config
187
+ }
188
+ }
189
+
190
+ // allow config.lang overrides default lang
191
+ if (this._config.lang) {
192
+ this._lang = ElfUtil.toLangString(this._config.lang);
193
+ }
194
+ }
195
+
196
+ super.update(changedProperties);
197
+ }
198
+
199
+ /** A `TemplateResult` that will be used to render the updated internal template
200
+ * @private
201
+ * @return {*}
202
+ */
203
+ render() {
204
+ var lang = this._translation[this._lang] ? this._lang : "en";
205
+ var t = this._translation[lang];
206
+ return html`
207
+ <ef-dialog style="width: inherit; " header="${t["Format"]}" id="formatDialog" lang="${lang}">
208
+ <div class="format-dialog dialog-theme-wrapper">
209
+ <div class="preview section-panel">
210
+ <div class="left-panel">
211
+ <div>${t["Preview"]}</div>
212
+ </div>
213
+ <div class="right-panel" >
214
+ <div id="preview_table" ></div>
215
+ </div>
216
+ </div>
217
+ <div class="options">
218
+ <!-- Value Format Section -->
219
+ <ef-collapse class="value-format" header="${t["Value Format"]}" expanded="true">
220
+ <div class="section-panel">
221
+ <div class="left-panel">
222
+ <div class="value-format__inner">
223
+ <ef-select class="ef-select-wrapper" id="valueFormatMenu"></ef-select>
224
+ <div class="value-menu-description" title="{{valueMenuDescription}}" id="valueMenuDesc">
225
+ <ef-icon icon="info"></ef-icon>
226
+ </div>
227
+ <ef-tooltip selector=".value-menu-description"></ef-tooltip>
228
+ </div>
229
+ </div>
230
+ <div class="right-panel">
231
+ <div style="display:none" id="valueFormatOther">
232
+ <div id="valueFormatNumberOrPercentage" style="padding-bottom: 3px; padding-top: 1px; display:none">
233
+ ${t["Decimal Places"]}:
234
+ <ef-number-field id="colFormatValueDecimalPlaces" min="0" max="9" style="width: 75px;" value="2"/>
235
+ </div>
236
+ <div style="margin-top: 3px;">
237
+ <ef-checkbox id="colFormatValueUseSeparator"/>
238
+ <label for="col-format-value-use-separator">${t["Use 1000 Separator (,)"]}</label>
239
+ </div>
240
+ <div style="padding-top: 8px;">
241
+ <ef-checkbox id="colFormatPlusSign"/>
242
+ <label for="col-format-plus-sign">${t["Show + Sign"]}</label>
243
+ </div>
244
+ <div style="padding-top: 18px;" id="valueFormatScaledValues">
245
+ ${t["Scale to"]}:
246
+ <ef-radio-button name="group1" id="colFormatValueScaledMillions" value="million" checked>${t["Millions"]}</ef-radio-button>
247
+ <ef-radio-button name="group1" id="colFormatValueScaledBillions" value="billion">${t["Billions"]}</ef-radio-button>
248
+ </div>
249
+ <div style="padding-top: 8px;" id="valueFormatPercentage">
250
+ <ef-checkbox id="colFormatPercentageMultiply"/>
251
+ <label for="col-format-percentage-multiply-by-100">${t["Multiply the cell value by 100"]}</label>
252
+ </div>
253
+ </div>
254
+
255
+ <div style="display:none" id="valueFormatDateTime">
256
+ <div style="margin-top: 1px; margin-bottom: 5px;">
257
+ <ef-list id="dateTimeList" items="dateFormatMenu" selected-item="dateFormatSelected" style="width: 100%; height: 115px"/>
258
+ </div>
259
+ <div style="width:100%; display:none" id="customDateFormatWrapper">
260
+ <ef-text-field id="customDateFormatInput" type="text" placeholder="${t["Custom"]}" style="width: 100%;"/>
261
+ </div>
262
+ <div style="margin-top: 8px;">
263
+ <ef-checkbox id="colFormatDateUseUtcTime"/>
264
+ <label for="colFormatDateUseUtcTime">${t["Convert to GMT Time"]}</label>
265
+ </div>
266
+ </div>
267
+
268
+ <div style="display: flex; flex-direction: column;" id="valueFormatFx">
269
+ <div style="margin-bottom: 20px;">
270
+ <div style="margin-bottom: 10px;">
271
+ <ef-checkbox id="colFormatFxEmphasize" checked/>
272
+ <label for="colFormatFxEmphasize">${t["Emphasize"]}</label>
273
+ </div>
274
+ <div>
275
+ <span>${t["Number of Pips digits (maximum 5)"]}:</span>
276
+ </div>
277
+ <div style="margin-bottom: 10px;">
278
+ <ef-number-field placeholder="${t["Number"]}" min="0" max="5" id="colFormatFxPipLength"/>
279
+ </div>
280
+ <div>
281
+ <span>${t["Pips Offset"]}:</span>
282
+ </div>
283
+ <div style="margin-bottom: 10px;">
284
+ <ef-number-field placeholder="${t["Number"]}" min="-10" max="10" id="colFormatFxPipOffset"/>
285
+ </div>
286
+ <div>
287
+ <span>${t["Number of half pips digits"]}:</span>
288
+ </div>
289
+ <div>
290
+ <ef-number-field placeholder="${t["Number"]}" min="0" max="10" id="colFormatFxSubPipLength"/>
291
+ </div>
292
+ </div>
293
+ <div>
294
+ <ef-button id="fxReset">${t["Reset to default"]}</ef-button>
295
+ </div>
296
+ </div>
297
+
298
+ <div style="display:none" id="valueFormatMessage">
299
+ "${t["Multiple columns are selected. Select a format or/and style to be applied to all of them."]}"
300
+ </div>
301
+
302
+ </div>
303
+ </div>
304
+ </ef-collapse>
305
+
306
+ <!-- Display Style Section -->
307
+ <ef-collapse class="display-style" header="${t["Display Style"]}" expanded="true">
308
+ <div class="section-panel display-style-panel">
309
+ <div class="display-style-panel__header">
310
+ <div class="left-panel">
311
+ <ef-select class="ef-select-wrapper display-style-panel__menu" id="displayFormatMenu"></ef-select>
312
+ </div>
313
+ <div class="right-panel">
314
+ <section class="align-section">
315
+ <label class="left-panel">${t["Alignment"]}:</label>
316
+ <div class="right-panel">
317
+ <tab-buttons mode="icon" tab-list="alignmentButtons" selected-id="generalAlignment"></tab-buttons>
318
+ <ef-button-bar
319
+ managed id="alignmentButtonsWrapper"
320
+ class="button-split"
321
+ mode="icon"
322
+ tab-list="alignmentButtons"
323
+ selected-id="generalAlignment"
324
+ >
325
+ <ef-button toggles id="tab-left" class="split-action icon"
326
+ icon="text-left" tabindex="0" textpos="after"
327
+ aria-disabled="false" aria-pressed="false" empty=""
328
+ highlight="false"
329
+ ></ef-button>
330
+ <ef-button
331
+ toggles id="tab-center" class="split-action icon"
332
+ icon="text-center" tabindex="0" textpos="after"
333
+ aria-disabled="false" aria-pressed="false" empty=""
334
+ highlight="false"
335
+ ></ef-button>
336
+ <ef-button
337
+ toggles id="tab-right" class="split-action icon"
338
+ icon="text-right" tabindex="0" textpos="after"
339
+ aria-disabled="false" aria-pressed="true" empty=""
340
+ highlight="true"
341
+ ></ef-button>
342
+ </ef-button-bar>
343
+ </div>
344
+ </section>
345
+ </div>
346
+ </div>
347
+
348
+ <div class="display-style-panel__content">
349
+ <div class="left-panel"></div>
350
+ <div class="right-panel">
351
+ <div style="display:block" id="displayFormatGeneral"></div>
352
+
353
+ <div style="display:none" id="displayFormatBar">
354
+ <div style="padding-bottom: 10px;">
355
+ <ef-checkbox id="colFormatBarShowValues" checked/>
356
+ <label for="colFormatBarShowValues">${t["Show Values"]}</label>
357
+ </div>
358
+ <div style="padding-bottom: 10px;">
359
+ <ef-checkbox id="colFormatBarUseMovementColor" checked/>
360
+ <label for="colFormatBarUseMovementColor">${t["Use Movement Colors"]}</label>
361
+ </div>
362
+ </div>
363
+
364
+ <div class="display-format-heatmap" style="display:none" id="displayFormatHeatmap">
365
+ <div class="display-format-heatmap__apply">
366
+ <label class="left-panel">${t["Apply to"]}:</label>
367
+ <div class="right-panel" id="heatmapApplyContainer">
368
+ <ef-radio-button name="heatmapRadio" id="colFormatHeatmapApplyCell"
369
+ value="cell"
370
+ checked>${t["Cell"]}</ef-radio-button>
371
+ <ef-radio-button name="heatmapRadio" id="colFormatHeatmapApplyText"
372
+ value="text">${t["Text"]}</ef-radio-button>
373
+ </div>
374
+ </div>
375
+ <div class="display-format-heatmap__midpoint">
376
+ <label class="left-panel">${t["Midpoint"]}:</label>
377
+ <div class="right-panel">
378
+ <ef-number-field id="colFormatHeatmapMidpoint" style="width: 75px;" value="0" />
379
+ </div>
380
+ </div>
381
+ </div>
382
+
383
+ <div style="display:none" id="displayFormatConditionalColor"></div>
384
+
385
+ <div style="display:none" id="displayFormatMessage">
386
+ ${t["Multiple columns are selected. Select a format or/and style to be applied to all of them."]}
387
+ </div>
388
+ </div>
389
+ </div>
390
+
391
+ <div class="conditions-panel" style="display:none" id="displayFormatConditionsPanel">
392
+ <div class="conditions-panel__inner">
393
+ <div class="conditions-panel__header">
394
+ <div class="left-panel">
395
+ <label>${t["Based On"]}:</label>
396
+ <ef-select class="ef-select-wrapper" id="conditionalColorBasedonDropdown"></ef-select>
397
+ </div>
398
+ <div class="right-panel">
399
+ <ef-text-field class="ef-another-field" id="conditionalColorBasedonAutosuggestInput" style="display:none;"></ef-text-field>
400
+ <!--<atlas-autosuggest id="conditionalColorBasedonAutosuggest"></atlas-autosuggest>-->
401
+ </div>
402
+ </div>
403
+ </div>
404
+
405
+ <div class="conditions-container">
406
+ <div class="left-panel">${t["Conditions"]}: (${t["Stop If True"]})</div>
407
+ <div class="conditions-container__order right-panel">
408
+ <label>${t["Order"]}:</label>
409
+ <ef-button title="${t["Increase condition precedence"]}" id="moveUpConditionButton" icon="up"></ef-button>
410
+ <ef-button title="${t["Decrease condition precedence"]}" id="moveDownConditionButton" icon="down"></ef-button>
411
+ <ef-button class="conditions-container__add" title="${t["Add a condition"]}" id="addConditionButton">
412
+ ${t["Add"]}...
413
+ </ef-button>
414
+ </div>
415
+ </div>
416
+ <div>
417
+ <ef-list id="conditionList"></ef-list>
418
+ </div>
419
+ </div>
420
+ </div>
421
+ </ef-collapse>
422
+
423
+ <!-- Updates Section -->
424
+ <ef-collapse class="updates" header="${t["Updates"]}" expanded="true">
425
+ <div class="section-panel">
426
+ <div class="colors-panel">
427
+ <div class="left-panel">
428
+ <ef-checkbox id="colFormatUpdatesUseColor"/>
429
+ <label for="colFormatUpdatesUseColor">${t["Color Based On"]}</label>
430
+ </div>
431
+
432
+ <div class="right-panel">
433
+ <div class="colortext-basedon">
434
+ <ef-select class="ef-select-wrapper left-panel" id="colorTextBasedonDropdown" disabled></ef-select>
435
+ <div class="right-panel" id="colorTextBasedonAutosuggestWrapper" style="display: none;">
436
+ <ef-text-field class="ef-another-field" id="colorTextBasedonAutosuggestInput" style="width: 100%">
437
+ </ef-text-field>
438
+ <!--<atlas-autosuggest id="colorTextBasedonAutosuggest"></atlas-autosuggest>-->
439
+ </div>
440
+ </div>
441
+ </div>
442
+ </div>
443
+
444
+ <div class="highlight-panel">
445
+ <div class="left-panel">
446
+ <ef-checkbox id="colFormatUpdatesUseHighlight"/>
447
+ <label for="colFormatUpdatesUseHighlight">${t["Background Based On"]}</label>
448
+ </div>
449
+
450
+ <div class="right-panel">
451
+ <div class="highlight-basedon">
452
+ <ef-select class="ef-select-wrapper left-panel" id="highlightBasedonDropdown" disabled></ef-select>
453
+ <div class="right-panel" id="highlightBasedonAutosuggestWrapper" style="display: none;">
454
+ <ef-text-field class="ef-another-field" id="highlightBasedonAutosuggestInput"></ef-text-field>
455
+ <!--<atlas-autosuggest id="highlightBasedonAutosuggest"></atlas-autosuggest>-->
456
+ </div>
457
+ </div>
458
+
459
+ <div class="highlight-apply-block" id="highlightApplyToBlock">
460
+ <div class="highlight-apply-block__inner">
461
+ <label class="left-panel">${t["Apply to"]}:</label>
462
+ <div class="right-panel">
463
+ <ef-radio-button name="highlightRadio" id="colFormatUpdatesApplyCell"
464
+ value="cell" checked disabled>${t["Cell"]}</ef-radio-button>
465
+ <ef-radio-button name="highlightRadio" id="colFormatUpdatesApplyBorder"
466
+ value="border" disabled>${t["Border"]}</ef-radio-button>
467
+ </div>
468
+ </div>
469
+ </div>
470
+ </div>
471
+ </div>
472
+ </div>
473
+ </ef-collapse>
474
+ </div>
475
+ </div>
476
+ </ef-dialog>
477
+
478
+ <ef-dialog id="colorConditionDialog" header="${t["Edit Condition"]}" lang="${lang}">
479
+ <ef-color-dialog id="colorDialog" no-color allow-nocolor></ef-color-dialog>
480
+ <ef-color-dialog id="backgroundColorDialog" no-color allow-nocolor></ef-color-dialog>
481
+ <div class="container">
482
+ <!-- Preview -->
483
+ <div class="section">
484
+ <div class="input-group">
485
+ <div class="input-side">
486
+ <label>${t["Preview"]}:</label>
487
+ </div><!-- prevent space
488
+ --><div class="input-side">
489
+ <div id="colorDialogSample">${t["Sample Format"]}</div>
490
+ </div>
491
+ </div>
492
+ </div>
493
+ <!-- Condition Type -->
494
+ <div class="section">
495
+ <div class="input-group">
496
+ <div class="input-side">
497
+ <label for="conditionSelect">${t["Condition"]}:</label>
498
+ </div><!-- prevent space
499
+ --><div class="input-side">
500
+ <ef-select class="ef-select-wrapper" id="conditionSelect"></ef-select>
501
+ </div>
502
+ </div>
503
+ </div>
504
+ <!-- Number Value -->
505
+ <div class="section" id="conditionNumber">
506
+ <div class="input-group">
507
+ <div class="input-side">
508
+ <label for="conditionNumberValue" id="numberValueLabel">${t["Greater than"]}:</label>
509
+ </div><!-- prevent space
510
+ --><div class="input-side">
511
+ <ef-number-field id="conditionNumberValue" value="0"></ef-number-field>
512
+ </div>
513
+ </div>
514
+ </div>
515
+ <!-- TwoNumber Value -->
516
+ <div class="section" id="conditionTwoNumbers" style="display:none">
517
+ <div class="input-group">
518
+ <div class="input-side">
519
+ <label for="conditionFirstValue">${t["Low Value"]}:</label>
520
+ </div><!-- prevent space
521
+ --><div class="input-side">
522
+ <ef-number-field id="conditionFirstValue" value="0"></ef-number-field>
523
+ </div>
524
+ </div>
525
+ <div class="input-group">
526
+ <div class="input-side">
527
+ <label for="conditionSecondValue">${t["High Value"]}:</label>
528
+ </div><!-- prevent space
529
+ --><div class="input-side">
530
+ <ef-number-field id="conditionSecondValue" value="0"></ef-number-field>
531
+ </div>
532
+ </div>
533
+ </div>
534
+ <!-- Test Value -->
535
+ <div class="section" id="conditionText" style="display:none">
536
+ <div class="input-group">
537
+ <div class="input-side">
538
+ <label for="conditionTextValue">${t["Text"]}:</label>
539
+ </div><!-- prevent space
540
+ --><div class="input-side">
541
+ <ef-text-field id="conditionTextValue">
542
+ </div>
543
+ </div>
544
+ </div>
545
+ <!-- None Value -->
546
+ <div class="section" id="conditionNone" style="display:none">
547
+ <div style="height: 39px;"></div>
548
+ </div>
549
+ <!-- Color selection -->
550
+ <div class="section">
551
+ <div class="input-group">
552
+ <div class="input-side">
553
+ <label>${t["Text Color"]}:</label>
554
+ </div><!-- prevent space
555
+ --><div class="input-side">
556
+ <div class="color-example" id="textColorExample"></div>
557
+ </div>
558
+ </div>
559
+ <div class="input-group">
560
+ <div class="input-side">
561
+ <label>${t["Cell Color"]}:</label>
562
+ </div><!-- prevent space
563
+ --><div class="input-side">
564
+ <div class="color-example input-side" id="backgroundColorExample"></div>
565
+ </div>
566
+ </div>
567
+ </div>
568
+ </div>
569
+ </ef-dialog>
570
+ `;
571
+ }
572
+
573
+ /**
574
+ * @private
575
+ * @override
576
+ */
577
+ firstUpdated(changedProperties) {
578
+ this._initElements();
579
+ this._initHandlers();
580
+ this._initAutosuggests();
581
+ }
582
+
583
+ /**
584
+ * @private
585
+ * @override
586
+ */
587
+ updated(changedProperties) {
588
+ var dirty = false;
589
+ if (changedProperties.has("config") || changedProperties.has("data")) {
590
+ var fields = null;
591
+ if (this._config) {
592
+ fields = this._config.fields;
593
+
594
+ var onConfirmHandler = this._config.confirm;
595
+ if (typeof onConfirmHandler === "function") {
596
+ this.addEventListener("confirm", onConfirmHandler);
597
+ }
598
+
599
+ var onCancelHandler = this._config.cancel;
600
+ if (typeof onCancelHandler === "function") {
601
+ this.addEventListener("cancel", onCancelHandler);
602
+ }
603
+ }
604
+ if (changedProperties.has("config")) {
605
+ this._fillBaseFieldSelectors(fields); // populate dropdown items
606
+ }
607
+
608
+ this._initData(); // TODO: Data and states modification should be done in the "update" phase to prevent infinite loop
609
+ if (this._config) { // TODO: Make it so that we can bind data without a config object
610
+ dirty = true;
611
+ }
612
+ }
613
+ if (changedProperties.has("isShown")) {
614
+ this.$.formatDialog.opened = this.isShown;
615
+ if (!this.isShown) {
616
+ this.remove();
617
+ }
618
+ }
619
+ if (changedProperties.has("lang")) {
620
+ dirty = true;
621
+ }
622
+ if (dirty) {
623
+ this._bindData(this._data);
624
+ }
625
+ }
626
+
627
+ /**
628
+ * @public
629
+ * @param {ColumnFormatDialog~Config=} userConfig Configuration object used to initialize dialog and populate data
630
+ */
631
+ init(userConfig) {
632
+ this.config = userConfig;
633
+ }
634
+
635
+ /** Show the dialog
636
+ * @public
637
+ */
638
+ show() {
639
+ if (!this.parentNode) {
640
+ document.body.appendChild(this); // custom element only work when it is in the document
641
+ }
642
+ this.isShown = true;
643
+ }
644
+
645
+ /** Hide the dialog
646
+ * @public
647
+ */
648
+ hide() {
649
+ this.isShown = false;
650
+ }
651
+
652
+ /**
653
+ * @private
654
+ * @return {Object}
655
+ */
656
+ _getTranslation() {
657
+ var lang = this._translation[this._lang] ? this._lang : "en";
658
+ return this._translation[lang];
659
+ }
660
+
661
+ /**
662
+ * @private
663
+ * @param {Object} colors
664
+ */
665
+ _onThemeLoaded(colors) {
666
+ this._colors = colors;
667
+ }
668
+
669
+ /**
670
+ * @private
671
+ */
672
+ _initData() {
673
+ const t = this;
674
+ var data = t._data = {
675
+ valueFormatTab: {
676
+ formatType: "general"
677
+ },
678
+ displayStyleTab: {
679
+ mode: "general",
680
+ alignment: "left",
681
+ general: {}
682
+ },
683
+ colorTextTab: {}
684
+ };
685
+
686
+ // prevent from changing user"s object
687
+ if (t.data.valueFormatTab) {
688
+ Object.assign(data.valueFormatTab, t.data.valueFormatTab);
689
+ }
690
+
691
+ if (t.data.displayStyleTab) {
692
+ Object.assign(data.displayStyleTab, t.data.displayStyleTab);
693
+ }
694
+
695
+ if (t.data.colorTextTab) {
696
+ Object.assign(data.colorTextTab, t.data.colorTextTab);
697
+ }
698
+
699
+ var formatType = data.valueFormatTab.formatType;
700
+ if (!formatType) {
701
+ data.valueFormatTab.formatType = "general";
702
+ } else {
703
+ var dateType = toDateTimeType(formatType);
704
+ if (dateType) {
705
+ data.valueFormatTab.formatType = DATE_TIME;
706
+ }
707
+ }
708
+ if (!data.displayStyleTab.mode) {
709
+ data.displayStyleTab.mode = "general";
710
+ }
711
+ if (!data.displayStyleTab.alignment) {
712
+ data.displayStyleTab.alignment = "left";
713
+ }
714
+
715
+ // TODO: t.conditions should not be public property. It should be prefixed with underscore
716
+ t.conditions = t._getDeepValue(t._data.displayStyleTab, "conditionalColor.conditions", []);
717
+ t.conditions.forEach((condition) => {
718
+ if (typeof condition.expression === "string") {
719
+ condition.expression = t._expresionStringToObject(condition.expression);
720
+ }
721
+ });
722
+ }
723
+
724
+ /** Convert expression string to object
725
+ * @private
726
+ * @param {string} expresionString String describing condition for coloring
727
+ * @returns {{name: string, text: string, values: Array}} An object used by ELF components
728
+ */
729
+ _expresionStringToObject(expresionString) {
730
+ let cond = {};
731
+ Object.keys(conditionDict).find(key => {
732
+ const matches = conditionDict[key].regExp.exec(expresionString);
733
+ if (Array.isArray(matches)) {
734
+ cond = {
735
+ name: key,
736
+ text: expresionString,
737
+ values: [matches[1], matches[2]]
738
+ };
739
+ return true;
740
+ }
741
+ return false;
742
+ });
743
+ return cond;
744
+ }
745
+
746
+ /**
747
+ * @private
748
+ */
749
+ _initElements() {
750
+ const _s = this.shadowRoot;
751
+ var preivewTableElement = _s.getElementById("preview_table");
752
+ this._previewTable = new PreviewTable(preivewTableElement);
753
+ /**
754
+ * Initialize
755
+ */
756
+ this.$.alignmentButtonsWrapper = _s.getElementById("alignmentButtonsWrapper");
757
+ this.$.dateTimeList = _s.getElementById("dateTimeList");
758
+ this.$.colFormatValueDecimalPlaces = _s.getElementById("colFormatValueDecimalPlaces");
759
+ this.$.colFormatValueUseSeparator = _s.getElementById("colFormatValueUseSeparator");
760
+ this.$.colFormatPlusSign = _s.getElementById("colFormatPlusSign");
761
+ this.$.colFormatValueScaledBillions = _s.getElementById("colFormatValueScaledBillions");
762
+ this.$.colFormatValueScaledMillions = _s.getElementById("colFormatValueScaledMillions");
763
+ this.$.colFormatPercentageMultiply = _s.getElementById("colFormatPercentageMultiply");
764
+ this.$.colFormatDateUseUtcTime = _s.getElementById("colFormatDateUseUtcTime");
765
+ this.$.displayFormatGeneral = _s.getElementById("displayFormatGeneral");
766
+ this.$.displayFormatBar = _s.getElementById("displayFormatBar");
767
+ this.$.displayFormatHeatmap = _s.getElementById("displayFormatHeatmap");
768
+ this.$.displayFormatConditionalColor = _s.getElementById("displayFormatConditionalColor");
769
+ this.$.displayFormatConditionsPanel = _s.getElementById("displayFormatConditionsPanel");
770
+ this.$.displayFormatMessage = _s.getElementById("displayFormatMessage");
771
+ this.$.conditionalColorBasedonAutosuggestInput = _s.getElementById("conditionalColorBasedonAutosuggestInput");
772
+ this.$.conditionalColorBasedonDropdown = _s.getElementById("conditionalColorBasedonDropdown");
773
+ this.$.colorConditionDialog = _s.getElementById("colorConditionDialog");
774
+ this.$.colorTextBasedonAutosuggestInput = _s.getElementById("colorTextBasedonAutosuggestInput");
775
+ this.$.colorTextBasedonAutosuggestWrapper = _s.getElementById("colorTextBasedonAutosuggestWrapper");
776
+ this.$.colorTextBasedonDropdown = _s.getElementById("colorTextBasedonDropdown");
777
+ this.$.highlightBasedonAutosuggestInput = _s.getElementById("highlightBasedonAutosuggestInput");
778
+ this.$.highlightBasedonAutosuggestWrapper = _s.getElementById("highlightBasedonAutosuggestWrapper");
779
+ this.$.highlightBasedonDropdown = _s.getElementById("highlightBasedonDropdown");
780
+ this.$.colFormatFxEmphasize = _s.getElementById("colFormatFxEmphasize");
781
+ this.$.colFormatFxPipLength = _s.getElementById("colFormatFxPipLength");
782
+ this.$.colFormatFxPipOffset = _s.getElementById("colFormatFxPipOffset");
783
+ this.$.colFormatFxSubPipLength = _s.getElementById("colFormatFxSubPipLength");
784
+ this.$.colFormatBarShowValues = _s.getElementById("colFormatBarShowValues");
785
+ this.$.colFormatBarUseMovementColor = _s.getElementById("colFormatBarUseMovementColor");
786
+ this.$.colFormatHeatmapMidpoint = _s.getElementById("colFormatHeatmapMidpoint");
787
+ this.$.colFormatHeatmapApplyText = _s.getElementById("colFormatHeatmapApplyText");
788
+ this.$.colFormatHeatmapApplyCell = _s.getElementById("colFormatHeatmapApplyCell");
789
+ this.$.colFormatUpdatesUseColor = _s.getElementById("colFormatUpdatesUseColor");
790
+ this.$.colorTextBasedonDropdown = _s.getElementById("colorTextBasedonDropdown");
791
+ this.$.colorTextBasedonAutosuggestInput = _s.getElementById("colorTextBasedonAutosuggestInput");
792
+ this.$.colFormatUpdatesUseHighlight = _s.getElementById("colFormatUpdatesUseHighlight");
793
+ this.$.colFormatUpdatesApplyCell = _s.getElementById("colFormatUpdatesApplyCell");
794
+ this.$.colFormatUpdatesApplyBorder = _s.getElementById("colFormatUpdatesApplyBorder");
795
+ this.$.highlightApplyToBlock = _s.getElementById("highlightApplyToBlock");
796
+ this.$.conditionSelect = _s.getElementById("conditionSelect");
797
+ this.$.conditionList = _s.getElementById("conditionList");
798
+ this.$.valueFormatMenu = _s.getElementById("valueFormatMenu");
799
+ this.$.displayFormatMenu = _s.getElementById("displayFormatMenu");
800
+ this.$.valueFormatOther = _s.getElementById("valueFormatOther");
801
+ this.$.valueFormatNumberOrPercentage = _s.getElementById("valueFormatNumberOrPercentage");
802
+ this.$.valueFormatScaledValues = _s.getElementById("valueFormatScaledValues");
803
+ this.$.valueFormatPercentage = _s.getElementById("valueFormatPercentage");
804
+ this.$.valueFormatDateTime = _s.getElementById("valueFormatDateTime");
805
+ this.$.valueFormatFx = _s.getElementById("valueFormatFx");
806
+ this.$.valueFormatMessage = _s.getElementById("valueFormatMessage");
807
+ this.$.formatDialog = _s.getElementById("formatDialog");
808
+ this.$.addConditionButton = _s.getElementById("addConditionButton");
809
+ this.$.backgroundColorDialog = _s.getElementById("backgroundColorDialog");
810
+ this.$.backgroundColorExample = _s.getElementById("backgroundColorExample");
811
+ this.$.colorDialog = _s.getElementById("colorDialog");
812
+ this.$.colorDialogSample = _s.getElementById("colorDialogSample");
813
+ this.$.textColorExample = _s.getElementById("textColorExample");
814
+ this.$.moveUpConditionButton = _s.getElementById("moveUpConditionButton");
815
+ this.$.moveDownConditionButton = _s.getElementById("moveDownConditionButton");
816
+ this.$.customDateFormatInput = _s.getElementById("customDateFormatInput");
817
+ this.$.customDateFormatWrapper = _s.getElementById("customDateFormatWrapper");
818
+ this.$.fxReset = _s.getElementById("fxReset");
819
+ this.$.valueMenuDesc = _s.getElementById("valueMenuDesc");
820
+ this.$.conditionNumber = _s.getElementById("conditionNumber");
821
+ this.$.conditionTwoNumbers = _s.getElementById("conditionTwoNumbers");
822
+ this.$.conditionText = _s.getElementById("conditionText");
823
+ this.$.conditionNone = _s.getElementById("conditionNone");
824
+ this.$.numberValueLabel = _s.getElementById("numberValueLabel");
825
+ this.$.conditionNumberValue = _s.getElementById("conditionNumberValue");
826
+ this.$.conditionFirstValue = _s.getElementById("conditionFirstValue");
827
+ this.$.conditionSecondValue = _s.getElementById("conditionSecondValue");
828
+ this.$.conditionTextValue = _s.getElementById("conditionTextValue");
829
+
830
+ // TODO: Redundant variables remove these
831
+ this._conditionSelect = this.$.conditionSelect;
832
+ this._conditionList = this.$.conditionList;
833
+ this._valueFormatSelect = this.$.valueFormatMenu;
834
+ this._displayFormatSelect = this.$.displayFormatMenu;
835
+ this._colorConditionDialog = this.$.colorConditionDialog;
836
+ this._conditionalFieldInput = this.$.conditionalColorBasedonAutosuggestInput;
837
+ this._colorTextFieldInput = this.$.colorTextBasedonAutosuggestInput;
838
+
839
+ // inject percent bar style to elem
840
+ PercentBar.injectCss(this);
841
+ }
842
+
843
+ /**
844
+ * @private
845
+ * @param {Object=} opt_data - initial data
846
+ */
847
+ _bindData(opt_data) { // TODO: opt_data and this._data are actually the same thing
848
+ var trans = this._getTranslation();
849
+
850
+ this._conditionalColorField = this.$.conditionalColorBasedonDropdown.value;
851
+ this.$.dateTimeList.data = this._getDateTimeListData();
852
+ this._setVisibleDisplayFormatOptions(this._data.displayStyleTab.mode);
853
+ this.$.colFormatValueDecimalPlaces.value = this._data.valueFormatTab.decimalPlaces || 2;
854
+ this.$.colFormatValueUseSeparator.checked = this._data.valueFormatTab.separator;
855
+ this.$.colFormatPlusSign.checked = this._data.valueFormatTab.plusSign;
856
+
857
+ if (this._data.valueFormatTab.scalingUnit === "billion") {
858
+ this.$.colFormatValueScaledBillions.checked = true;
859
+ this.$.colFormatValueScaledMillions.checked = false;
860
+ }
861
+ else {
862
+ this.$.colFormatValueScaledMillions.checked = true;
863
+ this.$.colFormatValueScaledBillions.checked = false;
864
+ }
865
+
866
+ this.$.colFormatPercentageMultiply.checked = this._data.valueFormatTab.multiplyBy100;
867
+
868
+ // Date Time Check when data loaded
869
+ if (this._data.valueFormatTab.formatType === DATE_TIME) {
870
+ this.$.colFormatDateUseUtcTime.checked = this._data.valueFormatTab.useUTCTime;
871
+ this.$.dateTimeList.value = this._data.valueFormatTab.dateTimeFormat;
872
+
873
+ if (this._data.valueFormatTab.isCustomDateFormat) { // Check use custom format
874
+ this.$.customDateFormatWrapper.style.display = "inline-flex";
875
+ this.$.customDateFormatInput.value = this._data.valueFormatTab.dateTimeFormat;
876
+ this._data.isCustomDateFormat = true;
877
+ this.$.dateTimeList.value = "customDateFormat";
878
+ } else {
879
+ this._data.isCustomDateFormat = false;
880
+ this.$.customDateFormatWrapper.style.display = "none";
881
+ this.$.dateTimeList.value = this._data.valueFormatTab.dateTimeFormat;
882
+ }
883
+ this._previewTable.setDateFormatString(this._data.valueFormatTab.dateTimeFormat);
884
+ this._previewTable.setDateFormatUseGMT(this._data.valueFormatTab.useUTCTime);
885
+ }
886
+
887
+ // Check fx section
888
+ if (this._atLeastOneBidOffer && this._config.supportValueFormatOptions.fx) {
889
+ this.$.colFormatFxEmphasize.checked = this._data.valueFormatTab.fxOptions.isEmphasize;
890
+ this.$.colFormatFxPipLength.value = this._data.valueFormatTab.fxOptions.pipLength;
891
+ this.$.colFormatFxPipOffset.value = this._data.valueFormatTab.fxOptions.pipStart;
892
+ this.$.colFormatFxSubPipLength.value = this._data.valueFormatTab.fxOptions.subPipLength;
893
+ }
894
+
895
+ this.$.colFormatBarShowValues.checked = this._data.displayStyleTab.bar ? this._data.displayStyleTab.bar.showValues : false;
896
+ this.$.colFormatBarUseMovementColor.checked = this._data.displayStyleTab.bar ? this._data.displayStyleTab.bar.useMovementColor : false;
897
+ {
898
+ // Init heatmap section
899
+
900
+ const heatmap = this._data.displayStyleTab.heatmap || {};
901
+ this.$.colFormatHeatmapMidpoint.value = heatmap.midPoint || 0;
902
+
903
+ if (heatmap.mode === "text") { // heatmap should choose one
904
+ this.$.colFormatHeatmapApplyText.checked = true;
905
+ this.$.colFormatHeatmapApplyCell.checked = false;
906
+ }
907
+ else {
908
+ this.$.colFormatHeatmapApplyCell.checked = true;
909
+ this.$.colFormatHeatmapApplyText.checked = false;
910
+ }
911
+
912
+ }
913
+
914
+ {
915
+
916
+ // Hide colorText update becuase displayStyle invisible
917
+ if (this._data.displayStyleTab.mode === "heatmap" || this._data.displayStyleTab.mode === "conditionalColor") {
918
+ this.$.colFormatUpdatesUseColor.disabled = true;
919
+ }
920
+
921
+ // Set accessibility for "Color Based On" block
922
+ const isColorText = !!this._data.colorTextTab.colorText;
923
+
924
+ this.$.colFormatUpdatesUseColor.checked = isColorText;
925
+ this.$.colorTextBasedonDropdown.disabled = !isColorText;
926
+ this.$.colorTextBasedonAutosuggestInput.disabled = !isColorText;
927
+
928
+ // When user send a blink another field
929
+ if (isColorText && isColorText.field !== this._constSelfColumn) {
930
+ this.$.colorTextBasedonAutosuggestWrapper.style.display = "inline-flex";
931
+ this.$.colorTextBasedonDropdown.value = "ANOTHER";
932
+ this.$.colorTextBasedonAutosuggestInput.value = this._data.colorTextTab.colorText.field;
933
+ }
934
+
935
+ this._previewTable.setUpdateStyleValueText(isColorText);
936
+ // ------------------------------------------------------
937
+
938
+ // Set accessibility for "Background Based On" block
939
+ const highlight = this._data.colorTextTab.highlight;
940
+ const isHighlight = !!highlight;
941
+
942
+ if (isHighlight) {
943
+ this._previewTable.setUpdateStyleValueCell(isHighlight);
944
+ }
945
+
946
+ this.$.colFormatUpdatesUseHighlight.checked = isHighlight;
947
+ this.$.highlightBasedonDropdown.disabled = !isHighlight;
948
+ this.$.highlightBasedonAutosuggestInput.disabled = !isHighlight;
949
+ this.$.colFormatUpdatesApplyCell.disabled = !isHighlight;
950
+ this.$.colFormatUpdatesApplyBorder.disabled = !isHighlight;
951
+
952
+
953
+ if (highlight && highlight.mode === "border") {
954
+ this.$.colFormatUpdatesApplyBorder.checked = true;
955
+ this.$.colFormatUpdatesApplyCell.checked = false;
956
+ } else {
957
+ this.$.colFormatUpdatesApplyCell.checked = true;
958
+ this.$.colFormatUpdatesApplyBorder.checked = false;
959
+ }
960
+
961
+ // When user send a blink another feild
962
+ if (highlight && highlight.field === "ANOTHER") {
963
+ this.$.highlightBasedonAutosuggestWrapper.style.display = "inline-flex";
964
+ this.$.highlightBasedonDropdown.value = "ANOTHER";
965
+ this.$.highlightBasedonAutosuggestInput.value = this._data.colorTextTab.highlight.field;
966
+ }
967
+
968
+ // Check support highlighting border and background
969
+ this.$.highlightApplyToBlock.style.display = this._config.supportHighlightApplyToSwitch !== false ? "block" : "none";
970
+ // -------------------------------------------------------
971
+ }
972
+
973
+ this._conditionDict = conditionDict;
974
+ var dropdownItems = [];
975
+
976
+ for (var key in conditionDict) {
977
+ if (conditionDict[key] != null) {
978
+ dropdownItems.push({ id: key, "value": key, "label": trans[conditionDict[key].text] });
979
+ }
980
+ }
981
+
982
+ this._conditionSelect.data = dropdownItems;
983
+ var conditionList = this.$.conditionList;
984
+ conditionList.renderer = this._conditionRenderer.bind(this);
985
+ this._initDefaultCondition();
986
+ this._createConditionListItems();
987
+
988
+
989
+ this._valueFormatSelect.data = this._getValueFormatMenu(opt_data);
990
+ this._setVisibleValueFormatOptions(this._data.valueFormatTab.formatType);
991
+ this._valueFormatSelected(this._data.valueFormatTab.formatType);
992
+ this._displayFormatSelect.data = this._getDisplayStyleMenu();
993
+
994
+
995
+ {
996
+ // Set align for all group of buttons
997
+ // Use ef-button-bar standard api `manageCoralButtons()` not working currently
998
+ // Because elem.managedCoralButtons will be undefined during this point
999
+ let textAlignment = this._data.displayStyleTab[this._data.displayStyleTab.mode].alignment;
1000
+ const positions = ["left", "center", "right"];
1001
+ if (positions.indexOf(textAlignment) < 0) {
1002
+ textAlignment = "left";
1003
+ }
1004
+ for (let i = 0; i < positions.length; i++) {
1005
+ const button = this.$.alignmentButtonsWrapper.children[i];
1006
+ /**
1007
+ * WORKAROUND: Set active attrivute directly instead of standard method alignmentButtonsWrapper.manageCoralButtons(button)
1008
+ * {@link https://git.sami.int.thomsonreuters.com/elf/ef-button-bar/blob/v4/src/ef-button-bar.ts#L194}
1009
+ */
1010
+ button.active = textAlignment === positions[i];
1011
+ }
1012
+ this._setAlignment(textAlignment);
1013
+ }
1014
+ this._checkDataForLoadStructurePreview();
1015
+ }
1016
+
1017
+ /**
1018
+ * @private
1019
+ */
1020
+ _initHandlers() {
1021
+ this.$.formatDialog.addEventListener("confirm", this._onConfirm.bind(this));
1022
+ this.$.formatDialog.addEventListener("cancel", this._onCancel.bind(this));
1023
+ this.$.addConditionButton.onclick = this._addConditionButtonClick.bind(this);
1024
+ this._valueFormatSelect.addEventListener("value-changed", function (e) {
1025
+ var val;
1026
+ if (e && e.detail) {
1027
+ val = e.detail.value;
1028
+ }
1029
+ if (val) {
1030
+ this._valueFormatSelected(val);
1031
+ }
1032
+ }.bind(this));
1033
+ this.$.colFormatValueDecimalPlaces.addEventListener("value-changed", function (e) {
1034
+ // manupulate input value and set to our cache value this._data.valueFormatTab.decimalPlaces
1035
+
1036
+ var value = Number(e.target.value);
1037
+ var max = Number(e.target.getAttribute("max"));
1038
+ var min = Number(e.target.getAttribute("min"));
1039
+ if (value > max) {
1040
+ value = max;
1041
+ } else if (value < min) {
1042
+ value = min;
1043
+ }
1044
+ this._previewTable.setValueFormatDecimalPlaces(value);
1045
+ }.bind(this));
1046
+
1047
+ this.$.colFormatValueUseSeparator.addEventListener("checked-changed", function (e) {
1048
+ this._previewTable.setValueFormatShowSeparatorSign(e.target.checked);
1049
+ }.bind(this));
1050
+
1051
+ this.$.colFormatPlusSign.addEventListener("checked-changed", function (e) {
1052
+ this._previewTable.setValueFormatShowPlusSign(e.target.checked);
1053
+ }.bind(this));
1054
+
1055
+ this.$.colFormatPercentageMultiply.addEventListener("checked-changed", function (e) {
1056
+ this._previewTable.setValueFormatShowPercentSignWithMultiply100(e.target.checked);
1057
+ }.bind(this));
1058
+
1059
+ this.$.colFormatBarShowValues.addEventListener("checked-changed", function (e) {
1060
+ this._previewTable.setDisplayStylePercentBarShowValue(e.target.checked);
1061
+ }.bind(this));
1062
+
1063
+ this.$.colFormatBarUseMovementColor.addEventListener("checked-changed", function (e) {
1064
+ this._previewTable.setDisplayStylePercentBarIsUsedMovement(e.target.checked);
1065
+
1066
+ }.bind(this));
1067
+
1068
+ this.$.colFormatValueScaledMillions.addEventListener("click", function (e) {
1069
+ if (e.target.checked) {
1070
+ this._previewTable.setValueFormatScaled("m");
1071
+ }
1072
+
1073
+ }.bind(this));
1074
+
1075
+ this.$.colFormatValueScaledBillions.addEventListener("click", function (e) {
1076
+ if (e.target.checked) {
1077
+ this._previewTable.setValueFormatScaled("b");
1078
+ }
1079
+ }.bind(this));
1080
+
1081
+ this._displayFormatSelect.addEventListener("value-changed", function (e) {
1082
+ var val;
1083
+ if (e && e.detail) {
1084
+ val = e.detail.value;
1085
+ }
1086
+ this._displayFormatSelected(val);
1087
+ }.bind(this));
1088
+ this._conditionSelect.addEventListener("value-changed", function (e) {
1089
+ var val;
1090
+ if (e && e.detail) {
1091
+ val = e.detail.value;
1092
+ }
1093
+ if (val) {
1094
+ this._setColorCondition(val);
1095
+ }
1096
+ }.bind(this));
1097
+
1098
+ this.$.textColorExample.onclick = function () {
1099
+ this.$.colorDialog.opened = true;
1100
+ }.bind(this);
1101
+
1102
+ this.$.backgroundColorExample.onclick = function () {
1103
+ this.$.backgroundColorDialog.opened = true;
1104
+ }.bind(this);
1105
+
1106
+ this.$.colorDialog.addEventListener("value-changed", function (e) {
1107
+ if (e && e.detail) {
1108
+ this._colorConditionColor = e.detail.value;
1109
+ this.$.textColorExample.style.backgroundColor = e.detail.value;
1110
+ this.$.colorDialogSample.style.color = e.detail.value;
1111
+ this.$.textColorExample.classList.toggle("no-color", !e.detail.value);
1112
+ }
1113
+ }.bind(this));
1114
+
1115
+ this.$.backgroundColorDialog.addEventListener("value-changed", function (e) {
1116
+ if (e && e.detail) {
1117
+ this._colorConditionBackgroundColor = e.detail.value;
1118
+ this.$.backgroundColorExample.style.backgroundColor = e.detail.value;
1119
+ this.$.backgroundColorExample.classList.toggle("no-color", !e.detail.value);
1120
+ this.$.colorDialogSample.style.backgroundColor = e.detail.value;
1121
+ }
1122
+ }.bind(this));
1123
+
1124
+ this.$.colFormatHeatmapMidpoint.addEventListener("value-changed", function (e) {
1125
+ if (this.$.colFormatHeatmapApplyCell.checked) {
1126
+ this._previewTable.setDisplayStyleHeatmap("cell", this.$.colFormatHeatmapMidpoint.value);
1127
+ } else {
1128
+ this._previewTable.setDisplayStyleHeatmap("text", this.$.colFormatHeatmapMidpoint.value);
1129
+ }
1130
+
1131
+ }.bind(this));
1132
+
1133
+ this.$.colFormatHeatmapApplyCell.addEventListener("click", function (e) {
1134
+ if (e.target.checked) {
1135
+ this._previewTable.setDisplayStyleHeatmap("cell", this.$.colFormatHeatmapMidpoint.value);
1136
+ }
1137
+ }.bind(this));
1138
+
1139
+ this.$.colFormatHeatmapApplyText.addEventListener("click", function (e) {
1140
+ if (e.target.checked) {
1141
+ this._previewTable.setDisplayStyleHeatmap("text", this.$.colFormatHeatmapMidpoint.value);
1142
+ }
1143
+ }.bind(this));
1144
+
1145
+ this.$.colorConditionDialog.addEventListener("confirm", this._onColorConditionDialogConfirm.bind(this));
1146
+ this.$.colorConditionDialog.addEventListener("cancel", this._onColorConditionDialogCancel.bind(this));
1147
+
1148
+ this._conditionList.addEventListener("value-changed", function (e) {
1149
+ this._selectedConditionIdx = e.detail.value.id;
1150
+ }.bind(this));
1151
+
1152
+ this.$.moveUpConditionButton.onclick = this._onMoveUpConditionClick.bind(this);
1153
+ this.$.moveDownConditionButton.onclick = this._onMoveDownConditionClick.bind(this);
1154
+
1155
+ this.$.conditionalColorBasedonDropdown.addEventListener("value-changed", function (e) {
1156
+ var val;
1157
+ if (e && e.detail) {
1158
+ val = e.detail.value;
1159
+ }
1160
+ this._setColorBaseOn(val);
1161
+ }.bind(this));
1162
+
1163
+ this.$.colorTextBasedonDropdown.addEventListener("value-changed", this._colorTextBasedOnDropdownValueChanged.bind(this));
1164
+ this.$.highlightBasedonDropdown.addEventListener("value-changed", this._highlightBasedOnDropdownValueChanged.bind(this));
1165
+ this.$.colorTextBasedonAutosuggestInput.addEventListener("value-changed", (e) => {
1166
+ if (this._data.colorTextTab.colorText) { // TODO: Handle the case where value-changed is triggered when tab is not opened
1167
+ this._data.colorTextTab.colorText.field = e.detail.value;
1168
+ }
1169
+ });
1170
+ this.$.highlightBasedonAutosuggestInput.addEventListener("value-changed", (e) => {
1171
+ if (this._data.colorTextTab.highlight) { // TODO: Handle the case where value-changed is triggered when tab is not opened
1172
+ this._data.colorTextTab.highlight.field = e.detail.value;
1173
+ }
1174
+ });
1175
+ this.$.dateTimeList.addEventListener("value-changed", function (e) {
1176
+ if (e && e.detail && e.detail.value) {
1177
+ if (e.detail.value === "customDateFormat") {
1178
+ this.$.customDateFormatWrapper.style.display = "inline-flex";
1179
+ this._data.isCustomDateFormat = true;
1180
+ } else {
1181
+ this._data.isCustomDateFormat = false;
1182
+ this.$.customDateFormatWrapper.style.display = "none";
1183
+ this._previewTable.setDateFormatString(e.detail.value);
1184
+ }
1185
+
1186
+ }
1187
+ }.bind(this));
1188
+
1189
+ this.$.colFormatDateUseUtcTime.addEventListener("checked-changed", function (e) {
1190
+ this._previewTable.setDateFormatUseGMT(e.target.checked);
1191
+ }.bind(this));
1192
+
1193
+ this.$.customDateFormatInput.addEventListener("value-changed", function (e) {
1194
+ this._previewTable.setDateFormatString(e.detail.value);
1195
+ }.bind(this));
1196
+
1197
+ this.$.alignmentButtonsWrapper.addEventListener("click", function (e) {
1198
+ if (!e || !e.target || e.target.id === "alignmentButtonsWrapper") {
1199
+ return;
1200
+ }
1201
+ this._setAlignment(e.target.id);
1202
+ }.bind(this));
1203
+
1204
+ this.$.colFormatFxEmphasize.addEventListener("checked-changed", function (e) {
1205
+ this._data.valueFormatTab.fxOptions.isEmphasize = e.target.checked;
1206
+
1207
+ }.bind(this));
1208
+
1209
+ this.$.colFormatFxPipLength.addEventListener("value-changed", function (e) {
1210
+ this._data.valueFormatTab.fxOptions.pipLength = e.detail.value;
1211
+
1212
+ }.bind(this));
1213
+ /* colFormatFxSubPipLength.addEventListener check migrate */
1214
+ this.$.colFormatFxPipOffset.addEventListener("value-changed", function (e) {
1215
+ this._data.valueFormatTab.fxOptions.pipStart = e.detail.value;
1216
+
1217
+ }.bind(this));
1218
+
1219
+ this.$.colFormatFxSubPipLength.addEventListener("value-changed", function (e) {
1220
+ this._data.valueFormatTab.fxOptions.subPipLength = e.detail.value;
1221
+
1222
+ }.bind(this));
1223
+
1224
+ this.$.fxReset.onclick = function (e) {
1225
+ this.$.colFormatFxEmphasize.checked = true;
1226
+ this.$.colFormatFxPipLength.value = null;
1227
+ this.$.colFormatFxPipOffset.value = null;
1228
+ this.$.colFormatFxSubPipLength.value = null;
1229
+ }.bind(this);
1230
+
1231
+ this.$.colFormatUpdatesUseColor.addEventListener("checked-changed", function (e) {
1232
+ const isChecked = e.target.checked;
1233
+ this._previewTable.setUpdateStyleValueText(isChecked);
1234
+ this.$.colorTextBasedonDropdown.disabled = !isChecked;
1235
+ this.$.colorTextBasedonAutosuggestInput.disabled = !isChecked;
1236
+ if (isChecked) {
1237
+ this._data.colorTextTab.colorText = {
1238
+ field: this.$.colorTextBasedonDropdown.value
1239
+ };
1240
+ } else if (this._data.colorTextTab) {
1241
+ this._data.colorTextTab.colorText = null;
1242
+ }
1243
+
1244
+ }.bind(this));
1245
+
1246
+ this.$.colFormatUpdatesUseHighlight.addEventListener("checked-changed", function (e) {
1247
+ const isChecked = e.target.checked;
1248
+ this._previewTable.setUpdateStyleValueCell(isChecked);
1249
+ this.$.highlightBasedonDropdown.disabled = !isChecked;
1250
+ this.$.highlightBasedonAutosuggestInput.disabled = !isChecked;
1251
+ this.$.colFormatUpdatesApplyCell.disabled = !isChecked;
1252
+ this.$.colFormatUpdatesApplyBorder.disabled = !isChecked;
1253
+ // Set initial border or cell when user check base on background
1254
+ if (isChecked) {
1255
+ this._data.colorTextTab.highlight = {
1256
+ mode: this.$.colFormatUpdatesApplyBorder.checked ? "border" : "cell",
1257
+ field: this.$.highlightBasedonDropdown.value
1258
+ };
1259
+ this._previewTable.setUpdateStyleValueCellBlinking(this.$.colFormatUpdatesApplyCell.checked); // set cell or border blinking defualt is cell blinking
1260
+ } else if (this._data.colorTextTab) {
1261
+ this._data.colorTextTab.highlight = null;
1262
+ }
1263
+
1264
+
1265
+ }.bind(this));
1266
+
1267
+ this.$.colFormatUpdatesApplyCell.addEventListener("click", function (e) {
1268
+ if (e.target.checked) {
1269
+ if (this._data.colorTextTab.highlight) {
1270
+ this._data.colorTextTab.highlight.mode = "cell";
1271
+ }
1272
+ else {
1273
+ this._data.colorTextTab.highlight = {
1274
+ field: this.$.highlightBasedonDropdown.value,
1275
+ mode: "cell"
1276
+ };
1277
+ }
1278
+ this._previewTable.setUpdateStyleValueCellBlinking(e.target.checked); // set cell blinking
1279
+ }
1280
+
1281
+ }.bind(this));
1282
+
1283
+ this.$.colFormatUpdatesApplyBorder.addEventListener("click", function (e) {
1284
+ if (e.target.checked) {
1285
+ if (this._data.colorTextTab.highlight) {
1286
+ this._data.colorTextTab.highlight.mode = "border";
1287
+ }
1288
+ else {
1289
+ this._data.colorTextTab.highlight = {
1290
+ field: this.$.highlightBasedonDropdown.value,
1291
+ mode: "border"
1292
+ };
1293
+ }
1294
+ this._previewTable.setUpdateStyleValueCellBlinking(false); // set border blinking
1295
+ }
1296
+ }.bind(this));
1297
+
1298
+ }
1299
+
1300
+ /**
1301
+ * @private
1302
+ */
1303
+ _initDefaultCondition() {
1304
+ if (this.conditions.length) {
1305
+ this._generateConditions();
1306
+ return;
1307
+ }
1308
+
1309
+ // var movementColor = userSettings["movementColor"];
1310
+ var bgColor = ""; // WORKAROUNND: Check again when color dialog has "no color"
1311
+
1312
+ this.conditions = [
1313
+ {
1314
+ "expression": {
1315
+ "name": "GREATER_THAN",
1316
+ "values": [0]
1317
+ },
1318
+ "color": "green",
1319
+ "backgroundColor": bgColor
1320
+ },
1321
+ {
1322
+ "expression": {
1323
+ "name": "EQUAL_TO",
1324
+ "values": [0]
1325
+ },
1326
+ "color": "",
1327
+ "backgroundColor": bgColor
1328
+ },
1329
+ {
1330
+ "expression": {
1331
+ "name": "LESS_THAN",
1332
+ "values": [0]
1333
+ },
1334
+ "color": "red",
1335
+ "backgroundColor": bgColor
1336
+ }
1337
+ ];
1338
+
1339
+ this._generateConditions();
1340
+ }
1341
+
1342
+ /**
1343
+ * @private
1344
+ * @param {Object} e - event obj
1345
+ */
1346
+ _colorTextBasedOnDropdownValueChanged(e) {
1347
+ var val;
1348
+
1349
+ if (!this.$.colFormatUpdatesUseColor.checked) {
1350
+ return;
1351
+ }
1352
+
1353
+ if (e && e.detail) {
1354
+ val = e.detail.value;
1355
+ }
1356
+
1357
+ if (val === "ANOTHER") {
1358
+ this.$.colorTextBasedonAutosuggestWrapper.style.display = "inline-flex";
1359
+ } else {
1360
+ if (!this._data.colorTextTab) {
1361
+ this._data.colorTextTab = {};
1362
+ }
1363
+ this._data.colorTextTab.colorText = {
1364
+ field: val
1365
+ };
1366
+ this.$.colorTextBasedonAutosuggestWrapper.style.display = "none";
1367
+ }
1368
+ }
1369
+
1370
+ /**
1371
+ * @private
1372
+ * @param {Object} e - event object
1373
+ */
1374
+ _highlightBasedOnDropdownValueChanged(e) {
1375
+ var val;
1376
+
1377
+ if (!this.$.colFormatUpdatesUseHighlight.checked) {
1378
+ return;
1379
+ }
1380
+
1381
+ if (e && e.detail) {
1382
+ val = e.detail.value;
1383
+ }
1384
+
1385
+ if (val === "ANOTHER") {
1386
+ this.$.highlightBasedonAutosuggestWrapper.style.display = "inline-flex";
1387
+ } else if (this._data.colorTextTab && this._data.colorTextTab.highlight) {
1388
+ this._data.colorTextTab.highlight.field = val;
1389
+ this.$.highlightBasedonAutosuggestWrapper.style.display = "none";
1390
+ } else {
1391
+ if (!this._data.colorTextTab) {
1392
+ this._data.colorTextTab = {};
1393
+ }
1394
+ this._data.colorTextTab.highlight = {
1395
+ field: val
1396
+ };
1397
+ this.$.highlightBasedonAutosuggestWrapper.style.display = "none";
1398
+ }
1399
+ }
1400
+
1401
+ /**
1402
+ * @private
1403
+ * @param {*} val - Value
1404
+ */
1405
+ _displayFormatSelected(val) {
1406
+ this._previewTable.setDisplayStyleMode(val);
1407
+ this._setVisibleDisplayFormatOptions(val);
1408
+ this._setDisplayFormat(val);
1409
+ }
1410
+
1411
+ /**
1412
+ * @private
1413
+ * @param {*} val - Value
1414
+ */
1415
+ _valueFormatSelected(val) {
1416
+ this._previewTable.setFormatType(val);
1417
+ this._setVisibleValueFormatOptions(val);
1418
+ this._setValueFormat(val);
1419
+ this._setValueMenuDescription(val);
1420
+ }
1421
+
1422
+ /**
1423
+ * @private
1424
+ */
1425
+ _addConditionButtonClick() {
1426
+ this._conditionSelect.value = "GREATER_THAN";
1427
+ this._colorConditionColor = "green";
1428
+ this._colorConditionBackgroundColor = "";
1429
+ this.$.textColorExample.style.backgroundColor = "green";
1430
+ this.$.textColorExample.classList.remove("no-color");
1431
+ this.$.backgroundColorExample.style.backgroundColor = "";
1432
+ this.$.backgroundColorExample.classList.add("no-color");
1433
+ this.$.colorDialogSample.style.color = "green";
1434
+ this.$.colorDialogSample.style.backgroundColor = "";
1435
+ this._colorConditionDialog.opened = true;
1436
+ }
1437
+
1438
+ /**
1439
+ * @private
1440
+ * @param {Object} optData - initial data
1441
+ * @return {Array} - menu items
1442
+ */
1443
+ _getValueFormatMenu(optData) {
1444
+ var trans = this._getTranslation();
1445
+ const menu = [
1446
+ { value: "general", label: trans["General"], "disabled": false },
1447
+ { value: "number", label: trans["Number"], "disabled": false },
1448
+ { value: "scaled", label: trans["Scaled Values"], "disabled": false },
1449
+ { value: "percent", label: trans["Percentage"], "disabled": false },
1450
+ { value: DATE_TIME, label: trans["Date & Time"], "disabled": false }
1451
+ ];
1452
+ const fxItem = { value: "fx", label: trans["FX"], "disabled": false };
1453
+
1454
+ if (this._config.supportValueFormatOptions.fx) {
1455
+ menu.push(fxItem);
1456
+ }
1457
+
1458
+ menu.forEach(item => {
1459
+ item.selected = item.value === this._data.valueFormatTab.formatType;
1460
+ });
1461
+
1462
+ if (this._config.supportValueFormatOptions.fx) {
1463
+ // need requirements for implementation
1464
+ if (optData.fieldDataType === "fx") {
1465
+ fxItem.disabled = true;
1466
+ }
1467
+ else {
1468
+ menu.forEach(item => {
1469
+ if (item !== fxItem) {
1470
+ item.disabled = true;
1471
+ }
1472
+ });
1473
+ }
1474
+ }
1475
+ return menu;
1476
+ }
1477
+
1478
+ /** Generate DisplayStyle items
1479
+ * @private
1480
+ * @returns {Array.<{label: string, value: string}>} Object used by ELF"s coral list
1481
+ */
1482
+ _getDisplayStyleMenu() {
1483
+ var trans = this._getTranslation();
1484
+ const menu = [
1485
+ { value: "general", label: trans["General"] }
1486
+ ];
1487
+ if (this._config.supportDisplayStyleOptions.bar) {
1488
+ menu.push({ value: "bar", label: trans["Bar"] });
1489
+ }
1490
+
1491
+ if (this._config.supportDisplayStyleOptions.heatmap) {
1492
+ menu.push({ value: "heatmap", label: trans["Heatmap"]}); // Check hidden
1493
+ }
1494
+
1495
+ if (this._config.supportDisplayStyleOptions.conditionalColor) {
1496
+ menu.push( { value: "conditionalColor", label: trans["Conditional Color"] });
1497
+ }
1498
+
1499
+ menu.forEach(item => {
1500
+ item.selected = item.value === this._data.displayStyleTab.mode;
1501
+ });
1502
+
1503
+ return menu;
1504
+ }
1505
+
1506
+ /**
1507
+ * @private
1508
+ */
1509
+ _initAutosuggests() {
1510
+ let conditionalFieldAutoSuggest = this.$.conditionalColorBasedonAutosuggest;
1511
+
1512
+ if (conditionalFieldAutoSuggest) {
1513
+ conditionalFieldAutoSuggest.setAttribute("api-key", "czZTQ5MjY4");
1514
+ conditionalFieldAutoSuggest.profile = "Field Selector";
1515
+ conditionalFieldAutoSuggest.url = "http://localhost:3133/synapse/service/suggestions/suggest";
1516
+ this._conditionalFieldAutoSuggest = conditionalFieldAutoSuggest;
1517
+ }
1518
+
1519
+ this._initAutosuggest(this._conditionalFieldInput, this._conditionalFieldAutoSuggest);
1520
+ let colorTextFieldAutoSuggest = this.$.colorTextBasedonAutosuggest;
1521
+
1522
+ if (colorTextFieldAutoSuggest) {
1523
+ colorTextFieldAutoSuggest.setAttribute("api-key", "czZTQ5MjY4");
1524
+ colorTextFieldAutoSuggest.profile = "Field Selector";
1525
+ colorTextFieldAutoSuggest.url = "http://localhost:3133/synapse/service/suggestions/suggest";
1526
+ this._colorTextFieldAutoSuggest = colorTextFieldAutoSuggest;
1527
+ // this._colorText.append(colorTextFieldAutoSuggest);
1528
+ }
1529
+
1530
+ this._initAutosuggest(this._colorTextFieldInput, this._colorTextFieldAutoSuggest);
1531
+ this._highlightFieldInput = this.$.highlightBasedonAutosuggestInput;
1532
+ let highlightFieldAutoSuggest = this.$.highlightBasedonAutosuggest;
1533
+
1534
+ if (highlightFieldAutoSuggest) {
1535
+ highlightFieldAutoSuggest.setAttribute("api-key", "czZTQ5MjY4");
1536
+ highlightFieldAutoSuggest.profile = "Field Selector";
1537
+ highlightFieldAutoSuggest.url = "http://localhost:3133/synapse/service/suggestions/suggest";
1538
+ this._highlightFieldAutoSuggest = highlightFieldAutoSuggest;
1539
+ }
1540
+
1541
+ this._initAutosuggest(this._highlightFieldInput, this._highlightFieldAutoSuggest);
1542
+ }
1543
+
1544
+ /**
1545
+ * @private
1546
+ * @param {Object} input - input element
1547
+ * @param {Object} autoSuggest - atlas-autosuggest element
1548
+ */
1549
+ _initAutosuggest(input, autoSuggest) {
1550
+ if (input && autoSuggest) {
1551
+ autoSuggest.renderer = function (suggestion) {
1552
+ if (suggestion.renderer) {
1553
+ return suggestion.renderer(suggestion);
1554
+ }
1555
+ var el = document.createElement("atlas-suggest-item");
1556
+ el.value = suggestion.value.subtitle;
1557
+ el.asset = suggestion.value.vc;
1558
+ el.label = suggestion.label;
1559
+ el.description = suggestion.value.title;
1560
+ el.symbol = (suggestion.value["p"]) ? /* Field */ suggestion.value["p"]["fn"] : /* Formula*/ suggestion.value["cmd"];
1561
+ el.highlighted = suggestion.highlighted;
1562
+ if (suggestion.hidden) {
1563
+ el.style.display = "none";
1564
+ }
1565
+ return el;
1566
+ };
1567
+
1568
+ autoSuggest.attach = input;
1569
+
1570
+ autoSuggest.addEventListener("item-select", function (e) {
1571
+ if (!e || !e.detail) {
1572
+ return;
1573
+ }
1574
+
1575
+ if ((e.detail.method !== "click") && (e.detail.method !== "enter")) {
1576
+ return;
1577
+ }
1578
+
1579
+ if (!e.detail.suggestion) {
1580
+ return;
1581
+ }
1582
+ var selectedItem = {
1583
+ "label": e.detail.suggestion.label,
1584
+ "field": e.detail.suggestion.value.p.fn,
1585
+ "src": e.detail.suggestion.value.p.fsrc
1586
+ };
1587
+ this.updateDataWithAutosuggest(selectedItem, e.target);
1588
+
1589
+ }.bind(this));
1590
+
1591
+ autoSuggest.addEventListener("icon-click", function (e) {
1592
+ // TODO: opening Udip dialog
1593
+ });
1594
+
1595
+ autoSuggest.addEventListener("input", function (e) {
1596
+ var value = e.srcElement.value;
1597
+ if (value !== scope.selectedItem.label && value !== scope.selectedItem.field) {
1598
+ var selectedItem = {
1599
+ "label": value,
1600
+ "field": value,
1601
+ "src": ""
1602
+ };
1603
+ this.updateDataWithAutosuggest(selectedItem, e.target);
1604
+ }
1605
+ }.bind(this));
1606
+ }
1607
+ }
1608
+
1609
+ /**
1610
+ * @public
1611
+ * @param {Object} selectedItem - autosuggest selection
1612
+ * @param {Object} autoSuggest - source autosuggest element
1613
+ */
1614
+ updateDataWithAutosuggest(selectedItem, autoSuggest) {
1615
+ switch (autoSuggest.id) {
1616
+ case "conditionalColorBasedonAutosuggest":
1617
+ this._data.displayStyleTab.conditionalColor.field = selectedItem.field;
1618
+ break;
1619
+ case "colorTextBasedonAutosuggest":
1620
+ this._data.colorTextTab.colorText.field = selectedItem.field;
1621
+ break;
1622
+ case "highlightBasedonAutosuggest":
1623
+ this._data.colorTextTab.highlight.field = selectedItem.field;
1624
+ break;
1625
+ default:
1626
+ break;
1627
+ }
1628
+ }
1629
+
1630
+ /**
1631
+ * @private
1632
+ * @description for load data from preview table
1633
+ */
1634
+ _checkDataForLoadStructurePreview() {
1635
+ if (this._data) {
1636
+
1637
+ // Parse condition color before send to preview table
1638
+ if (this._config.data.displayStyleTab && this._config.data.displayStyleTab.conditionalColor) {
1639
+ this._config.data.displayStyleTab.conditionalColor.conditions = this._config.data.displayStyleTab.conditionalColor.conditions.map(e => {
1640
+ e.colors = {
1641
+ color: e.color,
1642
+ backgroundColor: e.backgroundColor
1643
+ };
1644
+ e.conditionSequence = this._parseRowCondition(e.expression.text);
1645
+ e.expressionObject = e.expression;
1646
+ return e;
1647
+ });
1648
+ }
1649
+
1650
+ // load data from preview table by config from user
1651
+ this._previewTable.loadDisplayData(this._data);
1652
+ }
1653
+ }
1654
+
1655
+ /**
1656
+ * @private
1657
+ * @param {string} expression - expression string
1658
+ * @return {Function} - condition function
1659
+ */
1660
+ _parseRowCondition(expression) {
1661
+ if (!expression) {
1662
+ return null;
1663
+ }
1664
+
1665
+ var regEx = new RegExp(/\[[^[]*\]/g); // Regex for matching the field token E.g. "[CF_BID]"
1666
+ expression = expression.replace(regEx, "value");
1667
+ var finalExp = "(function(value) { return " + expression + "; })";
1668
+
1669
+ var fn = null;
1670
+ try {
1671
+ // TODO: find a better way to avoid using eval
1672
+ fn = eval(finalExp); // eslint-disable-line
1673
+ } catch (err) { }
1674
+ return fn;
1675
+ }
1676
+
1677
+ /**
1678
+ * @private
1679
+ * @param {Object} item - condition item
1680
+ * @param {*} composer
1681
+ * @param {Element} element
1682
+ * @return {Object} - condition DOM element
1683
+ */
1684
+ _conditionRenderer(item, composer, element) {
1685
+ var trans = this._getTranslation();
1686
+ var deleteButton, modifyButton, sampleDiv, conditionTitle, sampleLabel;
1687
+ if (!element) {
1688
+ element = document.createElement("ef-item");
1689
+
1690
+ var container = document.createElement("div");
1691
+ container.className = "condition-item";
1692
+
1693
+ conditionTitle = document.createElement("div");
1694
+ conditionTitle.className = "condition-item-title left-panel";
1695
+
1696
+ var right = document.createElement("div");
1697
+ right.className = "right-panel";
1698
+
1699
+ var sampleDivOuter = document.createElement("div");
1700
+ sampleDivOuter.className = "condition-sample-outer";
1701
+ sampleDiv = document.createElement("div");
1702
+ sampleDiv.className = "condition-sample";
1703
+ sampleDivOuter.appendChild(sampleDiv);
1704
+
1705
+ sampleLabel = document.createElement("label");
1706
+ sampleDiv.appendChild(sampleLabel);
1707
+
1708
+ var buttonDiv = document.createElement("div");
1709
+ buttonDiv.className = "condition-button";
1710
+
1711
+ modifyButton = document.createElement("ef-button");
1712
+ modifyButton.className = "modify-button";
1713
+ modifyButton.icon = "edit";
1714
+ buttonDiv.appendChild(modifyButton);
1715
+
1716
+ deleteButton = document.createElement("ef-button");
1717
+ deleteButton.className = "delete-button";
1718
+ deleteButton.icon = "cross-circle";
1719
+ buttonDiv.appendChild(deleteButton);
1720
+
1721
+ right.appendChild(sampleDivOuter);
1722
+ right.appendChild(buttonDiv);
1723
+
1724
+ container.appendChild(conditionTitle);
1725
+ container.appendChild(right);
1726
+
1727
+ element.appendChild(container);
1728
+ } else {
1729
+ deleteButton = element.querySelector(".delete-button");
1730
+ modifyButton = element.querySelector(".modify-button");
1731
+ sampleDiv = element.querySelector(".condition-sample");
1732
+ sampleLabel = sampleDiv.getElementsByTagName("label")[0];
1733
+ conditionTitle = element.querySelector("div.condition-item-title");
1734
+ }
1735
+
1736
+ element.selected = this._selectedConditionIdx === item.value.id;
1737
+
1738
+ // Recommended to use tap event instead of click by elf team
1739
+ if (deleteButton._onDeleteConditionClick) {
1740
+ deleteButton.removeEventListener("tap", deleteButton._onDeleteConditionClick);
1741
+ }
1742
+ deleteButton._onDeleteConditionClick = this._onDeleteConditionClick.bind(this, item.value.id);
1743
+ deleteButton.addEventListener("tap", deleteButton._onDeleteConditionClick);
1744
+ deleteButton.title = trans["Remove"];
1745
+
1746
+ // Recommended to use tap event instead of click by elf team
1747
+ if (modifyButton._onEditConditionClick) {
1748
+ modifyButton.removeEventListener("tap", modifyButton._onEditConditionClick);
1749
+ }
1750
+ modifyButton._onEditConditionClick = this._onEditConditionClick.bind(this, item.value.id);
1751
+ modifyButton.addEventListener("tap", modifyButton._onEditConditionClick);
1752
+ modifyButton.title = trans["Edit"];
1753
+
1754
+ sampleLabel.innerText = trans["Sample Format"];
1755
+
1756
+ this._applyStyleObject(sampleDiv, {
1757
+ "background-color": item.value.backgroundColor
1758
+ });
1759
+
1760
+ this._applyStyleObject(sampleLabel, {
1761
+ "color": item.value.color,
1762
+ "text-align": this.conditionAlignment
1763
+ });
1764
+
1765
+ conditionTitle.title = item.label;
1766
+ conditionTitle.innerText = item.label;
1767
+
1768
+ return element;
1769
+ }
1770
+
1771
+ /**
1772
+ * @private
1773
+ * @param {string} id - condition id
1774
+ */
1775
+ _onDeleteConditionClick(id) {
1776
+ var selectedConditionIdx = this._isEmpty(id) ? this._selectedConditionIdx : id;
1777
+
1778
+ if (this._isEmpty(selectedConditionIdx) || selectedConditionIdx < 0 || selectedConditionIdx >= this.conditions.length) {
1779
+ return;
1780
+ }
1781
+
1782
+ this.conditions.splice(selectedConditionIdx, 1);
1783
+ this._createConditionListItems();
1784
+ this._setConditionalColor();
1785
+
1786
+ }
1787
+
1788
+ /**
1789
+ * @private
1790
+ * @param {string} id - condition id
1791
+ */
1792
+ _onEditConditionClick(id) {
1793
+ var selectedConditionIdx = this._isEmpty(id) ? this._selectedConditionIdx : id;
1794
+ this._selectedConditionIdx = selectedConditionIdx;
1795
+
1796
+ if (this._isEmpty(selectedConditionIdx) || selectedConditionIdx < 0 || selectedConditionIdx >= this.conditions.length) {
1797
+ return;
1798
+ }
1799
+
1800
+ var data = this.conditions[selectedConditionIdx];
1801
+
1802
+ if (data && data.expression) {
1803
+ this._conditionSelect.value = data.expression.name;
1804
+ this._colorConditionColor = data.color;
1805
+ this.$.conditionTextValue.value = data.expression.values[0];
1806
+ this.$.conditionNumberValue.value = data.expression.values[0];
1807
+ this.$.conditionFirstValue.value = data.expression.values[0];
1808
+ this.$.conditionSecondValue.value = data.expression.values[1];
1809
+ this.$.textColorExample.style.backgroundColor = data.color;
1810
+ this.$.textColorExample.classList.toggle("no-color", !data.color);
1811
+ this._colorConditionBackgroundColor = data.backgroundColor;
1812
+ this.$.backgroundColorExample.style.backgroundColor = data.backgroundColor;
1813
+ this.$.backgroundColorExample.classList.toggle("no-color", !data.backgroundColor);
1814
+ this.$.colorDialogSample.style.color = data.color;
1815
+ this.$.colorDialogSample.style.backgroundColor = data.backgroundColor;
1816
+ }
1817
+
1818
+ this._isConditionEditing = true;
1819
+ this._colorConditionDialog.opened = true;
1820
+ }
1821
+
1822
+ /**
1823
+ * @private
1824
+ * @param {number} selectedIndex -selected condition index
1825
+ * @param {number} moveCount - number of moves to do
1826
+ */
1827
+ _swapCondition(selectedIndex, moveCount) {
1828
+ var temp = this.conditions[selectedIndex];
1829
+ var move = selectedIndex + moveCount;
1830
+
1831
+ this.conditions[selectedIndex] = this.conditions[move];
1832
+ this.conditions[move] = temp;
1833
+ this._createConditionListItems(move);
1834
+ this._setConditionalColor();
1835
+ }
1836
+
1837
+ /**
1838
+ * @private
1839
+ */
1840
+ _onMoveUpConditionClick() {
1841
+ var selectedConditionIdx = this._selectedConditionIdx;
1842
+
1843
+ if (this._isEmpty(selectedConditionIdx) || selectedConditionIdx <= 0 || selectedConditionIdx >= this.conditions.length) {
1844
+ return;
1845
+ }
1846
+
1847
+ this._swapCondition(selectedConditionIdx, -1);
1848
+ this._setConditionalColor();
1849
+
1850
+ }
1851
+
1852
+ /**
1853
+ * @private
1854
+ */
1855
+ _onMoveDownConditionClick() {
1856
+ var selectedConditionIdx = this._selectedConditionIdx;
1857
+
1858
+ if (this._isEmpty(selectedConditionIdx) || selectedConditionIdx < 0 || selectedConditionIdx >= (this.conditions.length - 1)) {
1859
+ return;
1860
+ }
1861
+
1862
+ this._swapCondition(selectedConditionIdx, 1);
1863
+ this._setConditionalColor();
1864
+ }
1865
+
1866
+ /**
1867
+ * @private
1868
+ * @param {Array=} opt_fields - fields for dropdowns
1869
+ */
1870
+ _fillBaseFieldSelectors(opt_fields) {
1871
+ var trans = this._getTranslation();
1872
+ var i;
1873
+ let data = [
1874
+ { "id": "this-column", "label": trans["This Column"], "value": this._constSelfColumn },
1875
+ { "id": "another-field", "label": trans["Another Field"], "value": "ANOTHER" },
1876
+ { "type": "divider" }
1877
+ ];
1878
+
1879
+ if (opt_fields && opt_fields.length > 0) {
1880
+ for (i = 0; i < opt_fields.length; i++) {
1881
+ data.push({ "id": opt_fields[i], "label": opt_fields[i], "value": opt_fields[i] });
1882
+ }
1883
+ }
1884
+ var condFieldData = JSON.parse(JSON.stringify(data));
1885
+ var condFieldIndex = this._config.defaultToSelf ? 0 : 1;
1886
+
1887
+ var displayStyleTab = this._data ? this._data.displayStyleTab : null;
1888
+ var conditionalColor = displayStyleTab ? displayStyleTab.conditionalColor : null;
1889
+ var condColorField = conditionalColor ? conditionalColor.field : "";
1890
+ if (!condColorField) {
1891
+ condColorField = this._constSelfColumn;
1892
+ }
1893
+
1894
+ if (condColorField) {
1895
+ for (i = 0; i < condFieldData.length; i++) {
1896
+ if (condFieldData[i].value === condColorField) {
1897
+ condFieldIndex = i;
1898
+ condFieldData[i].selected = true;
1899
+ }
1900
+ }
1901
+ }
1902
+
1903
+ if (condColorField !== "MULTIPLE" && condColorField !== "default") {
1904
+ condFieldData[condFieldIndex].selected = true;
1905
+ }
1906
+
1907
+ if (condFieldIndex === 1) {
1908
+ this.$.conditionalColorBasedonAutosuggestInput.value = condColorField;
1909
+ this.$.conditionalColorBasedonAutosuggestInput.style.display = "inline-flex";
1910
+ }
1911
+
1912
+ this.$.conditionalColorBasedonDropdown.data = condFieldData;
1913
+ var colorFieldData = JSON.parse(JSON.stringify(data));
1914
+ var colorFieldIndex = this._config.defaultToSelf ? 0 : 1;
1915
+ var colorField;
1916
+
1917
+ var colorTextTab = this._data ? this._data.colorTextTab : null;
1918
+ if (colorTextTab && colorTextTab.colorText && colorTextTab.colorText.field) {
1919
+ colorField = colorTextTab.colorText.field;
1920
+ }
1921
+ else {
1922
+ colorField = this._config.defaultToSelf ? "SELF" : "CF_NETCHNG";
1923
+ }
1924
+
1925
+ if (colorField) {
1926
+ for (i = 0; i < colorFieldData.length; i++) {
1927
+ if (colorFieldData[i].value === colorField) {
1928
+ colorFieldIndex = i;
1929
+ }
1930
+ }
1931
+ }
1932
+
1933
+ if (colorField !== "MULTIPLE" && colorField.toLowerCase() !== "default") {
1934
+ colorFieldData[colorFieldIndex].selected = true;
1935
+ }
1936
+
1937
+ if (colorFieldIndex === 1) {
1938
+ this.$.colorTextBasedonAutosuggestInput.value = colorField;
1939
+ this.$.colorTextBasedonAutosuggestWrapper.style.display = "inline-flex";
1940
+ }
1941
+
1942
+ this.$.colorTextBasedonDropdown.data = colorFieldData;
1943
+ var highlightFieldData = JSON.parse(JSON.stringify(data));
1944
+ var highlightFieldIndex = this._config.defaultToSelf ? 0 : 1;
1945
+ var highlightField;
1946
+
1947
+ if (colorTextTab && colorTextTab.highlight && colorTextTab.highlight.field) {
1948
+ highlightField = colorTextTab.highlight.field;
1949
+ }
1950
+ else {
1951
+ highlightField = this._config.defaultToSelf ? "SELF" : "CF_TICK";
1952
+ }
1953
+
1954
+ if (colorField) {
1955
+ for (i = 0; i < highlightFieldData.length; i++) {
1956
+ if (highlightFieldData[i].value === highlightField) {
1957
+ highlightFieldIndex = i;
1958
+ }
1959
+ }
1960
+ }
1961
+
1962
+ if (highlightField !== "MULTIPLE" && highlightField.toLowerCase() !== "default") {
1963
+ highlightFieldData[highlightFieldIndex].selected = true;
1964
+ }
1965
+
1966
+ if (highlightFieldIndex === 1) {
1967
+ this.$.highlightBasedonAutosuggestInput.value = colorField;
1968
+ this.$.highlightBasedonAutosuggestWrapper.style.display = "inline-flex";
1969
+ }
1970
+
1971
+ this.$.highlightBasedonDropdown.data = highlightFieldData;
1972
+ }
1973
+
1974
+ /**
1975
+ * @private
1976
+ * @param {*} value - Value
1977
+ */
1978
+ _setAlignment(value) {
1979
+ if (!value) return;
1980
+
1981
+ if (value.includes("left")) {
1982
+ this._previewTable.setDisplayStyleAlignment("left");
1983
+ }
1984
+
1985
+ else if (value.includes("center")) {
1986
+ this._previewTable.setDisplayStyleAlignment("center");
1987
+ }
1988
+
1989
+ else if (value.includes("right")) {
1990
+ this._previewTable.setDisplayStyleAlignment("right");
1991
+
1992
+ }
1993
+
1994
+ }
1995
+
1996
+ /**
1997
+ * @private
1998
+ * @param {string} value - selected value
1999
+ */
2000
+ _setVisibleValueFormatOptions(value) {
2001
+ if (value !== "general" && value !== DATE_TIME && value !== "fx") {
2002
+ this.$.valueFormatOther.style.display = "block";
2003
+ if (value === "percent" || value === "number" || value === "scaled") {
2004
+ this.$.valueFormatNumberOrPercentage.style.display = "block";
2005
+ }
2006
+ else {
2007
+ this.$.valueFormatNumberOrPercentage.style.display = "none";
2008
+ }
2009
+ if (value === "scaled") {
2010
+ this.$.valueFormatScaledValues.style.display = "block";
2011
+ }
2012
+ else {
2013
+ this.$.valueFormatScaledValues.style.display = "none";
2014
+ }
2015
+ if (value === "percent") {
2016
+ this.$.valueFormatPercentage.style.display = "block";
2017
+ }
2018
+ else {
2019
+ this.$.valueFormatPercentage.style.display = "none";
2020
+ }
2021
+ }
2022
+ else {
2023
+ this.$.valueFormatOther.style.display = "none";
2024
+ }
2025
+
2026
+ if (value === DATE_TIME) {
2027
+ this.$.valueFormatDateTime.style.display = "block";
2028
+ }
2029
+ else {
2030
+ this.$.valueFormatDateTime.style.display = "none";
2031
+ }
2032
+
2033
+ if (value === "fx") {
2034
+ this.$.valueFormatFx.style.display = "block";
2035
+ }
2036
+ else {
2037
+ this.$.valueFormatFx.style.display = "none";
2038
+ }
2039
+
2040
+ if (!value) {
2041
+ this.$.valueFormatMessage.style.display = "block";
2042
+ }
2043
+ else {
2044
+ this.$.valueFormatMessage.style.display = "none";
2045
+ }
2046
+
2047
+ }
2048
+
2049
+ /**
2050
+ * @private
2051
+ * @param {string} value - selected value
2052
+ */
2053
+ _setValueFormat(value) {
2054
+ if (value) {
2055
+ this._data.valueFormatTab.formatType = value;
2056
+ }
2057
+
2058
+ var decimalPlacesValue = Number(this.$.colFormatValueDecimalPlaces.value);
2059
+
2060
+
2061
+ switch (value) {
2062
+ case "general":
2063
+ this._previewTable.setValueFormatGeneral();
2064
+ break;
2065
+ case "number":
2066
+ this._previewTable.setValueFormatDecimalPlaces(decimalPlacesValue);
2067
+ this._previewTable.setValueFormatShowSeparatorSign(this.$.colFormatValueUseSeparator.checked);
2068
+ this._previewTable.setValueFormatShowPlusSign(this.$.colFormatPlusSign.checked);
2069
+ break;
2070
+ case "scaled":
2071
+ var scaleUnit = this.$.colFormatValueScaledMillions.checked ? "m" : "b";
2072
+ this._previewTable.setValueFormatScaled(scaleUnit);
2073
+ this._previewTable.setValueFormatShowSeparatorSign(this.$.colFormatValueUseSeparator.checked);
2074
+ this._previewTable.setValueFormatShowPlusSign(this.$.colFormatPlusSign.checked);
2075
+ break;
2076
+ case "percent":
2077
+ this._previewTable.setValueFormatShowPercentSignWithMultiply100(this.$.colFormatPercentageMultiply.checked);
2078
+ this._previewTable.setValueFormatShowSeparatorSign(this.$.colFormatValueUseSeparator.checked);
2079
+ this._previewTable.setValueFormatShowPlusSign(this.$.colFormatPlusSign.checked);
2080
+ break;
2081
+ case DATE_TIME:
2082
+ this._previewTable.setDateFormatString(this.$.dateTimeList.value || "M/D/YY");
2083
+ this._previewTable.setDateFormatUseGMT(this.$.colFormatDateUseUtcTime.checked);
2084
+ this._previewTable.setDateFormatLanguage(this._lang);
2085
+ break;
2086
+ case "fx":
2087
+ this._data.valueFormatTab.fxOptions = {
2088
+ isEmphasize: this.$.colFormatFxEmphasize.checked,
2089
+ pipLength: this.$.colFormatFxPipLength.value,
2090
+ pipStart: this.$.colFormatFxPipOffset.value,
2091
+ subPipLength: this.$.colFormatFxSubPipLength.value
2092
+ };
2093
+ break;
2094
+ default:
2095
+ break;
2096
+ }
2097
+
2098
+
2099
+ }
2100
+
2101
+ /**
2102
+ * @private
2103
+ * @param {string} value - selected value
2104
+ */
2105
+ _setVisibleDisplayFormatOptions(value) {
2106
+ if (value === "general") {
2107
+ this.$.displayFormatGeneral.style.display = "block";
2108
+ }
2109
+ else {
2110
+ this.$.displayFormatGeneral.style.display = "none";
2111
+ }
2112
+
2113
+ if (value === "bar") {
2114
+ this.$.displayFormatBar.style.display = "block";
2115
+ }
2116
+ else {
2117
+ this.$.displayFormatBar.style.display = "none";
2118
+ }
2119
+
2120
+ if (value === "heatmap") {
2121
+ this.$.displayFormatHeatmap.style.display = "block";
2122
+ }
2123
+ else {
2124
+ this.$.displayFormatHeatmap.style.display = "none";
2125
+ }
2126
+
2127
+ if (value === "conditionalColor") {
2128
+ this.$.displayFormatConditionalColor.style.display = "block";
2129
+ this.$.displayFormatConditionsPanel.style.display = "block";
2130
+ }
2131
+ else {
2132
+ this.$.displayFormatConditionalColor.style.display = "none";
2133
+ this.$.displayFormatConditionsPanel.style.display = "none";
2134
+ }
2135
+
2136
+ if (!value) {
2137
+ this.$.displayFormatMessage.style.display = "block";
2138
+ }
2139
+ else {
2140
+ this.$.displayFormatMessage.style.display = "none";
2141
+ }
2142
+ }
2143
+
2144
+ /**
2145
+ * @private
2146
+ * @param {string} value - selected value
2147
+ */
2148
+ _setDisplayFormat(value) {
2149
+ this._data.displayStyleTab.mode = value;
2150
+ if (value === "general") {
2151
+ this._previewTable.setDisplayStyleMode("general");
2152
+ this.$.colFormatUpdatesUseColor.disabled = false;
2153
+
2154
+ } else if (value === "bar") {
2155
+ this._previewTable.setDisplayStylePercentBarShowValue(this.$.colFormatBarShowValues.checked);
2156
+ this._previewTable.setDisplayStylePercentBarIsUsedMovement(this.$.colFormatBarUseMovementColor.checked);
2157
+ this.$.colFormatUpdatesUseColor.disabled = false;
2158
+
2159
+ } else if (value === "heatmap") {
2160
+ var midPoint = this.$.colFormatHeatmapMidpoint.value ? this.$.colFormatHeatmapMidpoint.value : 0;
2161
+ var mode = this.$.colFormatHeatmapApplyText.checked ? "text" : "cell";
2162
+ this.$.colFormatUpdatesUseColor.checked = false;
2163
+ this.$.colFormatUpdatesUseColor.disabled = true;
2164
+ this._previewTable.setUpdateStyleValueText(false);
2165
+ this._previewTable.setDisplayStyleHeatmap(mode, midPoint);
2166
+ this._previewTable.setUpdateStyleValueText(false);
2167
+ } else if (value === "conditionalColor") {
2168
+ this.$.colFormatUpdatesUseColor.checked = false;
2169
+ this.$.colFormatUpdatesUseColor.disabled = true;
2170
+ this._previewTable.setUpdateStyleValueText(false);
2171
+ this._data.displayStyleTab.conditionalColor = {};
2172
+ this._data.displayStyleTab.conditionalColor.conditions = this.conditions;
2173
+ this._setConditionalColor();
2174
+ }
2175
+ }
2176
+
2177
+ /**
2178
+ * @private
2179
+ */
2180
+ _setConditionalColor() {
2181
+ var conditionFunctions = this.conditions.map(e => {
2182
+ return {
2183
+ conditionSequence: this._parseRowCondition(e.expression.text),
2184
+ colors: {
2185
+ color: e.color,
2186
+ backgroundColor: e.backgroundColor
2187
+ },
2188
+ expressionObject: e.expression,
2189
+ expression: e.expression.text,
2190
+ fields: e.fields
2191
+ };
2192
+ });
2193
+
2194
+ this._previewTable.setDisplayStyleConditional(conditionFunctions);
2195
+ }
2196
+
2197
+ /**
2198
+ * @private
2199
+ * @param {string} value
2200
+ */
2201
+ _setColorBaseOn(value) {
2202
+ if (value && !this._data.displayStyleTab.conditionalColor) {
2203
+ this._data.displayStyleTab.conditionalColor = {};
2204
+ }
2205
+ if (value === "ANOTHER") {
2206
+ this.$.conditionalColorBasedonAutosuggestInput.style.display = "block";
2207
+ }
2208
+ else {
2209
+ this.$.conditionalColorBasedonAutosuggestInput.style.display = "none";
2210
+ this._data.displayStyleTab.conditionalColor.field = value;
2211
+ }
2212
+ this._generateConditions();
2213
+ }
2214
+ /**
2215
+ * @private
2216
+ * @param {string} value - selected value
2217
+ */
2218
+ _setColorCondition(value) {
2219
+ let condition = this._conditionDict[value];
2220
+
2221
+ if (condition) {
2222
+ if (condition.valueType === "number") {
2223
+ this.$.conditionNumber.style.display = "block";
2224
+ this.$.numberValueLabel.innerText = condition.text + ":";
2225
+ }
2226
+ else {
2227
+ this.$.conditionNumber.style.display = "none";
2228
+ }
2229
+
2230
+ if (condition.valueType === "twoNumbers") {
2231
+ this.$.conditionTwoNumbers.style.display = "block";
2232
+ }
2233
+ else {
2234
+ this.$.conditionTwoNumbers.style.display = "none";
2235
+ }
2236
+
2237
+ if (condition.valueType === "text") {
2238
+ this.$.conditionText.style.display = "block";
2239
+ }
2240
+ else {
2241
+ this.$.conditionText.style.display = "none";
2242
+ }
2243
+
2244
+ if (!condition.valueType && condition.valueType === "none") {
2245
+ this.$.conditionNone.style.display = "block";
2246
+ }
2247
+ else {
2248
+ this.$.conditionNone.style.display = "none";
2249
+ }
2250
+ }
2251
+ }
2252
+
2253
+ /**
2254
+ * @private
2255
+ * @param {string} value - selected value;
2256
+ */
2257
+ _setValueMenuDescription(value) {
2258
+ var trans = this._getTranslation();
2259
+ switch (value) {
2260
+ case "general":
2261
+ this.$.valueMenuDesc.title = trans["General format items have no specific number format."];
2262
+ break;
2263
+ case "number":
2264
+ this.$.valueMenuDesc.title = trans["Number format is used for general display of numbers."];
2265
+ break;
2266
+ case "scaled":
2267
+ this.$.valueMenuDesc.title = trans["Scaled values format is used for displaying large numbers."];
2268
+ break;
2269
+ case "percent":
2270
+ this.$.valueMenuDesc.title = trans["Percentage format is used to display the result with a percent sign."];
2271
+ break;
2272
+ case DATE_TIME:
2273
+ this.$.valueMenuDesc.title = trans["Date & time format displays date and time serial numbers as date values"];
2274
+ break;
2275
+ case "fx":
2276
+ this.$.valueMenuDesc.title = trans["FX format is used for Bid/Offer columns."];
2277
+ break;
2278
+ default:
2279
+ this.$.valueMenuDesc.title = trans["General format items have no specific number format."];
2280
+ break;
2281
+ }
2282
+ }
2283
+
2284
+ /**
2285
+ * @private
2286
+ * @param {Object} e - event object
2287
+ */
2288
+ _onColorConditionDialogConfirm(e) {
2289
+ if (e.cancelled) {
2290
+ return;
2291
+ }
2292
+
2293
+ let condition = this._conditionDict[this._conditionSelect.value];
2294
+ this._colorConditionEditState.expression.name = this._conditionSelect.value;
2295
+
2296
+ if (condition) {
2297
+ if (condition.valueType === "number") {
2298
+ this._colorConditionEditState.expression.values = [this.$.conditionNumberValue.value];
2299
+ }
2300
+ if (condition.valueType === "twoNumbers") {
2301
+ this._colorConditionEditState.expression.values = [this.$.conditionFirstValue.value, this.$.conditionSecondValue.value];
2302
+ }
2303
+ if (condition.valueType === "text") {
2304
+ this._colorConditionEditState.expression.values = [this.$.conditionTextValue.value];
2305
+ }
2306
+ }
2307
+
2308
+ this._colorConditionEditState.color = this._colorConditionColor;
2309
+ this._colorConditionEditState.backgroundColor = this._colorConditionBackgroundColor;
2310
+ var newCondition = JSON.parse(JSON.stringify(this._colorConditionEditState));
2311
+
2312
+ if (this._isConditionEditing) {
2313
+ this.conditions[this._selectedConditionIdx] = newCondition;
2314
+ this._isConditionEditing = false;
2315
+ }
2316
+ else {
2317
+ this.conditions.push(newCondition);
2318
+ }
2319
+
2320
+ this._generateConditions();
2321
+ this._createConditionListItems();
2322
+ this._setConditionalColor();
2323
+ }
2324
+
2325
+ /**
2326
+ * @private
2327
+ */
2328
+ _onColorConditionDialogCancel() {
2329
+ this._isConditionEditing = false;
2330
+ }
2331
+
2332
+ /**
2333
+ * @private
2334
+ */
2335
+ _generateConditions() {
2336
+ if (!this.conditions) {
2337
+ return;
2338
+ }
2339
+
2340
+ var len = this.conditions.length;
2341
+
2342
+ for (var i = 0; i < len; i++) {
2343
+ this._createCondition(this.conditions[i]);
2344
+ }
2345
+ }
2346
+
2347
+ /**
2348
+ * @private
2349
+ * @param {Object} newCondition - new condition object
2350
+ */
2351
+ _createCondition(newCondition) {
2352
+ let conditionalColorField;
2353
+
2354
+ if (this._data.displayStyleTab && this._data.displayStyleTab.conditionalColor) {
2355
+ conditionalColorField = this._data.displayStyleTab.conditionalColor.field;
2356
+ }
2357
+
2358
+ if (!conditionalColorField) {
2359
+ conditionalColorField = this._constSelfColumn;
2360
+ }
2361
+
2362
+ newCondition["fields"] = [{
2363
+ "field": conditionalColorField,
2364
+ "displayName": "",
2365
+ "src": ""
2366
+ }];
2367
+
2368
+ if (Array.isArray(newCondition.expression.values)) {
2369
+ newCondition.expression.text = this._getExpression(conditionalColorField, newCondition["expression"]);
2370
+ }
2371
+ }
2372
+
2373
+ /**
2374
+ * @private
2375
+ * @param {string} field - base field
2376
+ * @param {Object} expression - condition expression
2377
+ * @return {string} - formatted expression string
2378
+ */
2379
+ _getExpression(field, expression) {
2380
+ const val0 = expression.values[0];
2381
+ const val1 = expression.values[1];
2382
+
2383
+ return this._formatCondition(this._conditionDict[expression.name].expression, field, val0, val1);
2384
+ }
2385
+
2386
+ /**
2387
+ * @private
2388
+ * @param {string} format - formatting template
2389
+ * @return {string} - formatted condition
2390
+ */
2391
+ _formatCondition(format) {
2392
+ var args = Array.prototype.slice.call(arguments, 1);
2393
+ return format.replace(/{(\d+)}/g, (function (match, number) {
2394
+ return void 0 !== args[number] ? args[number] : match;
2395
+ }));
2396
+ }
2397
+
2398
+ /**
2399
+ * @private
2400
+ * @param {Object} data - condition data object
2401
+ * @return {string} - condition string
2402
+ */
2403
+ _conditionToString(data) {
2404
+ var trans = this._getTranslation();
2405
+
2406
+ // eslint-disable-next-line no-undefined
2407
+ if (data === undefined || !conditionDict[data.name]) { // TODO: Fix this
2408
+ return "";
2409
+ }
2410
+
2411
+ var def = conditionDict[data.name];
2412
+ var text;
2413
+
2414
+ switch (def.valueType) {
2415
+ case "number":
2416
+ text = this._formatCondition(trans[def.displayFormat], data.values[0]);
2417
+ break;
2418
+ case "twoNumbers":
2419
+ text = this._formatCondition(trans[def.displayFormat], data.values[0], data.values[1]);
2420
+ break;
2421
+ case "none":
2422
+ text = trans[def.displayFormat];
2423
+ break;
2424
+ default:
2425
+ text = this._formatCondition(trans[def.displayFormat], data.values[0]);
2426
+ }
2427
+ return text;
2428
+ }
2429
+
2430
+ /**
2431
+ * @private
2432
+ * @param {number} optSelectedIndex - selected condition index
2433
+ */
2434
+ _createConditionListItems(optSelectedIndex) {
2435
+ var conditions = this.conditions;
2436
+ var conditionList = this._conditionList;
2437
+
2438
+ if (!conditions || !conditionList) {
2439
+ return;
2440
+ }
2441
+
2442
+ // Create list
2443
+ var data = [];
2444
+
2445
+ for (var i = conditions.length; --i >= 0;) {
2446
+ var condition = conditions[i];
2447
+ data.unshift({
2448
+ label: this._conditionToString(condition.expression), // Need to convert
2449
+ value: Object.assign({
2450
+ id: i
2451
+ }, condition)
2452
+ });
2453
+ }
2454
+ conditionList.data = data;
2455
+
2456
+ if (this._isEmpty(optSelectedIndex) || optSelectedIndex < 0 || optSelectedIndex >= data.length) {
2457
+ // eslint-disable-next-line no-undefined
2458
+ this._selectedConditionIdx = undefined;
2459
+ }
2460
+ else {
2461
+ this._selectedConditionIdx = optSelectedIndex;
2462
+
2463
+ // Set selection
2464
+ conditionList.selectItem(conditionList.data[optSelectedIndex]);
2465
+ }
2466
+ if (this._data && this._data.displayStyleTab && this._data.displayStyleTab.conditionalColor) {
2467
+ this._data.displayStyleTab.conditionalColor.conditions = this.conditions;
2468
+ }
2469
+
2470
+
2471
+ }
2472
+
2473
+
2474
+ /**
2475
+ * @private
2476
+ * @return {Object} - dialog output object
2477
+ */
2478
+ _createOutput() {
2479
+ // TODO: Handle the case where there is no data
2480
+
2481
+ var formatType = this._data.valueFormatTab.formatType;
2482
+
2483
+ let output = this._previewTable.getStructureFormat();
2484
+
2485
+ // restore user"s formatType for datetime type
2486
+ var userFormatType = this.data.valueFormatTab.formatType;
2487
+ if (formatType === DATE_TIME ) {
2488
+ output.valueFormatTab.isCustomDateFormat = this._data.isCustomDateFormat ? this._data.isCustomDateFormat : false;
2489
+ if(toDateTimeType(userFormatType)) {
2490
+ output.valueFormatTab.formatType = userFormatType;
2491
+ }
2492
+ }
2493
+
2494
+
2495
+ // Check fx section
2496
+ if (formatType === "fx") {
2497
+ const fxOptions = Object.assign({}, this._data.valueFormatTab.fxOptions);
2498
+ output.valueFormatTab = this._data.valueFormatTab;
2499
+ output.valueFormatTab.fxOptions = {
2500
+ isEmphasize: fxOptions.isEmphasize,
2501
+ pipLength: fxOptions.pipLength,
2502
+ pipStart: fxOptions.pipStart,
2503
+ subPipLength: fxOptions.subPipLength
2504
+ };
2505
+ }
2506
+
2507
+ // Conditional section
2508
+ if (output.displayStyleTab && output.displayStyleTab.mode === "conditionalColor") {
2509
+ output.displayStyleTab = output.displayStyleTab;
2510
+
2511
+ const field = output.displayStyleTab.conditionalColor.field || this._constSelfColumn;
2512
+ // compatibility with general and monitor
2513
+ output.displayStyleTab.conditionalColor.conditions.forEach(condition => {
2514
+ if (typeof condition.expression !== "string") {
2515
+ condition.expressionObject = condition.expression;
2516
+ condition.expression = condition.expression.text.replace(this._constSelfColumn, field);
2517
+ }
2518
+ });
2519
+ }
2520
+
2521
+ // ColorTextTab section when data updated
2522
+ if (output.colorTextTab && (output.colorTextTab.isTextChangedStyle || output.colorTextTab.isCellChangeStyle)) {
2523
+ output.colorTextTab = {};
2524
+ if (this.$.colFormatUpdatesUseColor.checked) {
2525
+ output.colorTextTab.colorText = this._data.colorTextTab.colorText; // Field of base on color text changed defualt is "THIS_COLUMN"
2526
+ }
2527
+ if (this.$.colFormatUpdatesUseHighlight.checked) {
2528
+ output.colorTextTab.highlight = this._data.colorTextTab.highlight; // Field of base on color background or border changed defualt is "THIS_COLUMN"
2529
+ // compatibility with def-Grid
2530
+ output.colorTextTab.blinking = {
2531
+ field: this._data.colorTextTab.highlight.field,
2532
+ border: this._data.colorTextTab.highlight.mode === "border"
2533
+ };
2534
+
2535
+ }
2536
+ }
2537
+
2538
+ return output;
2539
+ }
2540
+
2541
+ /**
2542
+ * @private
2543
+ */
2544
+ _onConfirm() {
2545
+ var output = this._createOutput();
2546
+ var event = new CustomEvent("confirm", {
2547
+ cancelable: true,
2548
+ detail: {
2549
+ data: output,
2550
+ value: output
2551
+ }
2552
+ });
2553
+ this.dispatchEvent(event);
2554
+ this.hide();
2555
+ }
2556
+
2557
+ /**
2558
+ * @private
2559
+ */
2560
+ _onCancel() {
2561
+ var event = new CustomEvent("cancel");
2562
+ this.dispatchEvent(event);
2563
+ this.hide();
2564
+ }
2565
+
2566
+ /**
2567
+ * @private
2568
+ * @param {Object} el - dom element to apply styles
2569
+ * @param {Object} styleObject - styles to apply
2570
+ * @param {boolean} append - true if append styles, false if replace
2571
+ */
2572
+ _applyStyleObject(el, styleObject, append) {
2573
+ var styleString = "";
2574
+
2575
+ if (!el) {
2576
+ return;
2577
+ }
2578
+
2579
+ for (var property in styleObject) {
2580
+ if (styleObject[property] == null) {
2581
+ continue;
2582
+ }
2583
+
2584
+ styleString += property + ":" + styleObject[property] + "; ";
2585
+ }
2586
+
2587
+ var elStyle = el.style;
2588
+
2589
+ if (typeof elStyle.cssText === "undefined") {
2590
+ el.setAttribute("style", styleString);
2591
+
2592
+ return;
2593
+ }
2594
+
2595
+ if (append) {
2596
+ // TODO: Add regexp for checking the character `;` at the end of line.
2597
+ elStyle.cssText += styleString;
2598
+ }
2599
+ else {
2600
+ elStyle.cssText = styleString;
2601
+ }
2602
+ }
2603
+
2604
+ /**
2605
+ * @private
2606
+ * @param {Object} value - value to check
2607
+ * @param {boolean} allowEmptyString - allow empty strings
2608
+ * @return {boolean} - boolean check result
2609
+ */
2610
+ _isEmpty(value, allowEmptyString) {
2611
+ return (value === null || typeof value === "undefined") || (!allowEmptyString ? value === "" : false) || (this._isArray(value) && value.length === 0);
2612
+ }
2613
+
2614
+ /**
2615
+ * @private
2616
+ * @param {Object} value - value to check
2617
+ * @return {boolean} - boolean check result
2618
+ */
2619
+ _isArray(value) {
2620
+ return Object.prototype.toString.call(value) === "[object Array]";
2621
+ }
2622
+
2623
+
2624
+ /**
2625
+ * @private
2626
+ * @return {Array}
2627
+ */
2628
+ _getDateTimeListData() {
2629
+ var lang = this._translation[this._lang] ? this._lang : "en";
2630
+ var trans = this._getTranslation();
2631
+ return [
2632
+ { type: "header", label: trans["Date"] },
2633
+ { value: "M/D/YY", label: "M/D/YY" },
2634
+ { value: "MM/DD/YY", label: "MM/DD/YY" },
2635
+ { value: "M/D/YYYY", label: "M/D/YYYY" },
2636
+ { value: "MM/DD/YYYY", label: "MM/DD/YYYY" },
2637
+ { value: "D-MMM-YY", label: "D-MMM-YY" },
2638
+ { value: "DD-MMM-YY", label: "DD-MMM-YY" },
2639
+ { value: "D-MMM-YYYY", label: "D-MMM-YYYY" },
2640
+ { value: "DD-MMM-YYYY", label: "DD-MMM-YYYY" },
2641
+ { value: "MMMM D, YYYY", label: "MMMM D, YYYY" },
2642
+ { value: "YYYY-MM-DD", label: "YYYY-MM-DD" },
2643
+ { value: "YYYYMMDD", label: "YYYYMMDD" },
2644
+ { value: "YYYY/M/D", label: "YYYY/M/D" },
2645
+ { value: "YYYY/MM/DD", label: "YYYY/MM/DD" },
2646
+ { value: "YYYY年M月D日", label: "YYYY年M月D日", hidden: (lang !== "ja" && lang !== "zh") }, // Show when set to Japanese or Chinese
2647
+
2648
+ { type: "header", label: trans["Time"] },
2649
+ { value: "h:mm A", label: "h:mm A" },
2650
+ { value: "hh:mm A", label: "hh:mm A" },
2651
+ { value: "h:mm:ss A", label: "h:mm:ss A" },
2652
+ { value: "hh:mm:ss A", label: "hh:mm:ss A" },
2653
+ { value: "H:mm", label: "H:mm" },
2654
+ { value: "HH:mm", label: "HH:mm" },
2655
+ { value: "H:mm:ss", label: "H:mm:ss" },
2656
+ { value: "HH:mm:ss", label: "HH:mm:ss" },
2657
+
2658
+ { type: "header", label: trans["Date & Time"] },
2659
+ { value: "M/D/YY h:mm A", label: "M/D/YY h:mm A" },
2660
+ { value: "M/D/YY h:mm:ss A", label: "M/D/YY h:mm:ss A" },
2661
+ { value: "M/D/YY H:mm", label: "M/D/YY H:mm" },
2662
+ { value: "M/D/YY H:mm:ss", label: "M/D/YY H:mm:ss" },
2663
+ { value: "MM/DD/YY h:mm A", label: "MM/DD/YY h:mm A" },
2664
+ { value: "MM/DD/YY h:mm:ss A", label: "MM/DD/YY h:mm:ss A" },
2665
+ { value: "MM/DD/YY H:mm", label: "MM/DD/YY H:mm" },
2666
+ { value: "MM/DD/YY H:mm:ss", label: "MM/DD/YY H:mm:ss" },
2667
+ { value: "M/D/YYYY h:mm A", label: "M/D/YYYY h:mm A" },
2668
+ { value: "M/D/YYYY h:mm:ss A", label: "M/D/YYYY h:mm:ss A" },
2669
+ { value: "M/D/YYYY H:mm", label: "M/D/YYYY H:mm" },
2670
+ { value: "M/D/YYYY H:mm:ss", label: "M/D/YYYY H:mm:ss" },
2671
+ { value: "MM/DD/YYYY h:mm A", label: "MM/DD/YYYY h:mm A" },
2672
+ { value: "MM/DD/YYYY h:mm:ss A", label: "MM/DD/YYYY h:mm:ss A" },
2673
+ { value: "MM/DD/YYYY H:mm", label: "MM/DD/YYYY H:mm" },
2674
+ { value: "MM/DD/YYYY H:mm:ss", label: "MM/DD/YYYY H:mm:ss" },
2675
+ { value: "YYYY年M月D日 H:mm", label: "YYYY年M月D日 H:mm", hidden: (lang !== "ja" && lang !== "zh") }, // Show when set to Japanese or Chinese
2676
+
2677
+ { type: "header", label: trans["Custom"] },
2678
+ { value: "customDateFormat", label: trans["User Defined"] }
2679
+ ];
2680
+ }
2681
+
2682
+ /** Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place.
2683
+ * @private
2684
+ * @param {Object} obj The object to query
2685
+ * @param {string} path The path of the property to get.
2686
+ * @param {*} defaultValue The value returned for undefined resolved values.
2687
+ * @returns {*} Returns the resolved value
2688
+ */
2689
+ _getDeepValue(obj, path, defaultValue) {
2690
+ const paths = path.split(".");
2691
+ const length = paths.length;
2692
+ let current = obj;
2693
+
2694
+ for (let i = 0; i < length; i++) {
2695
+ const key = paths[i];
2696
+ // eslint-disable-next-line no-undefined
2697
+ if (current[key] === undefined) { // TODO: Fix this
2698
+ return defaultValue;
2699
+ }
2700
+ else {
2701
+ current = current[key];
2702
+ }
2703
+ }
2704
+
2705
+ return current;
2706
+ }
2707
+
2708
+ }
2709
+
2710
+ customElement("column-format-dialog")(ColumnFormatDialog);
2711
+
2712
+ export { ColumnFormatDialog };
2713
+ export default ColumnFormatDialog;