@refinitiv-ui/elements 7.0.0-next.0 → 7.0.0-next.2

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 (385) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/cli.mjs +21 -0
  3. package/lib/accordion/index.js +1 -10
  4. package/lib/appstate-bar/custom-elements.json +2 -2
  5. package/lib/appstate-bar/custom-elements.md +4 -4
  6. package/lib/appstate-bar/index.d.ts +2 -2
  7. package/lib/appstate-bar/index.js +2 -8
  8. package/lib/appstate-bar/themes/halo/dark/index.js +1 -1
  9. package/lib/appstate-bar/themes/halo/light/index.js +1 -1
  10. package/lib/appstate-bar/themes/solar/charcoal/index.js +1 -1
  11. package/lib/appstate-bar/themes/solar/pearl/index.js +1 -1
  12. package/lib/autosuggest/custom-elements.json +8 -8
  13. package/lib/autosuggest/custom-elements.md +8 -8
  14. package/lib/autosuggest/helpers/types.d.ts +18 -18
  15. package/lib/autosuggest/index.d.ts +9 -32
  16. package/lib/autosuggest/index.js +112 -187
  17. package/lib/autosuggest/themes/halo/dark/index.js +1 -1
  18. package/lib/autosuggest/themes/halo/light/index.js +1 -1
  19. package/lib/autosuggest/themes/solar/charcoal/index.js +1 -1
  20. package/lib/autosuggest/themes/solar/pearl/index.js +1 -1
  21. package/lib/button/custom-elements.json +1 -1
  22. package/lib/button/custom-elements.md +1 -1
  23. package/lib/button/index.d.ts +1 -1
  24. package/lib/button/index.js +1 -1
  25. package/lib/button/themes/halo/dark/index.js +2 -1
  26. package/lib/button/themes/halo/light/index.js +2 -1
  27. package/lib/button/themes/solar/charcoal/index.js +2 -1
  28. package/lib/button/themes/solar/pearl/index.js +2 -1
  29. package/lib/button-bar/index.js +0 -5
  30. package/lib/calendar/custom-elements.json +2 -2
  31. package/lib/calendar/custom-elements.md +4 -4
  32. package/lib/calendar/index.d.ts +9 -2
  33. package/lib/calendar/index.js +27 -29
  34. package/lib/calendar/themes/halo/dark/index.js +1 -1
  35. package/lib/calendar/themes/halo/light/index.js +1 -1
  36. package/lib/calendar/themes/solar/charcoal/index.js +1 -1
  37. package/lib/calendar/themes/solar/pearl/index.js +1 -1
  38. package/lib/calendar/types.d.ts +5 -5
  39. package/lib/calendar/utils.d.ts +2 -13
  40. package/lib/calendar/utils.js +2 -20
  41. package/lib/canvas/custom-elements.json +1 -1
  42. package/lib/canvas/custom-elements.md +1 -1
  43. package/lib/canvas/index.d.ts +1 -1
  44. package/lib/canvas/index.js +10 -9
  45. package/lib/card/custom-elements.json +1 -1
  46. package/lib/card/custom-elements.md +3 -3
  47. package/lib/card/helpers/types.d.ts +1 -1
  48. package/lib/card/index.d.ts +2 -1
  49. package/lib/card/index.js +5 -4
  50. package/lib/card/themes/halo/dark/index.js +1 -1
  51. package/lib/card/themes/halo/light/index.js +1 -1
  52. package/lib/card/themes/solar/charcoal/index.js +1 -1
  53. package/lib/card/themes/solar/pearl/index.js +1 -1
  54. package/lib/chart/bare.d.ts +1 -0
  55. package/lib/chart/bare.js +1 -0
  56. package/lib/chart/custom-elements.json +10 -5
  57. package/lib/chart/custom-elements.md +9 -8
  58. package/lib/chart/elements/chart.d.ts +182 -0
  59. package/lib/chart/elements/chart.js +509 -0
  60. package/lib/chart/helpers/index.d.ts +1 -1
  61. package/lib/chart/helpers/index.js +1 -1
  62. package/lib/chart/helpers/merge.d.ts +3 -3
  63. package/lib/chart/helpers/merge.js +1 -1
  64. package/lib/chart/helpers/types.d.ts +1 -66
  65. package/lib/chart/index.d.ts +1 -192
  66. package/lib/chart/index.js +5 -485
  67. package/lib/chart/plugins/doughnut-center-label.d.ts +22 -3
  68. package/lib/chart/plugins/doughnut-center-label.js +62 -51
  69. package/lib/chart/plugins/index.d.ts +1 -0
  70. package/lib/chart/plugins/index.js +1 -0
  71. package/lib/chart/themes/halo/dark/index.js +1 -1
  72. package/lib/chart/themes/halo/light/index.js +1 -1
  73. package/lib/chart/themes/solar/charcoal/index.js +1 -1
  74. package/lib/chart/themes/solar/pearl/index.js +1 -1
  75. package/lib/checkbox/custom-elements.json +1 -1
  76. package/lib/checkbox/custom-elements.md +3 -3
  77. package/lib/checkbox/index.d.ts +1 -1
  78. package/lib/checkbox/index.js +1 -2
  79. package/lib/checkbox/themes/halo/dark/index.js +1 -1
  80. package/lib/checkbox/themes/halo/light/index.js +1 -1
  81. package/lib/checkbox/themes/solar/charcoal/index.js +1 -1
  82. package/lib/checkbox/themes/solar/pearl/index.js +1 -1
  83. package/lib/clock/custom-elements.json +2 -2
  84. package/lib/clock/custom-elements.md +2 -2
  85. package/lib/clock/index.d.ts +2 -2
  86. package/lib/clock/index.js +2 -6
  87. package/lib/clock/utils/TickManager.d.ts +1 -1
  88. package/lib/collapse/custom-elements.json +1 -1
  89. package/lib/collapse/custom-elements.md +3 -3
  90. package/lib/collapse/index.d.ts +7 -1
  91. package/lib/collapse/index.js +27 -30
  92. package/lib/collapse/themes/halo/dark/index.js +1 -1
  93. package/lib/collapse/themes/halo/light/index.js +1 -1
  94. package/lib/collapse/themes/solar/charcoal/index.js +1 -1
  95. package/lib/collapse/themes/solar/pearl/index.js +1 -1
  96. package/lib/color-dialog/custom-elements.json +2 -2
  97. package/lib/color-dialog/custom-elements.md +4 -4
  98. package/lib/color-dialog/helpers/value-model.js +4 -5
  99. package/lib/color-dialog/index.d.ts +4 -4
  100. package/lib/color-dialog/index.js +4 -4
  101. package/lib/color-picker/custom-elements.json +1 -1
  102. package/lib/color-picker/custom-elements.md +3 -3
  103. package/lib/color-picker/index.d.ts +1 -1
  104. package/lib/color-picker/index.js +3 -5
  105. package/lib/combo-box/custom-elements.json +3 -6
  106. package/lib/combo-box/custom-elements.md +5 -6
  107. package/lib/combo-box/helpers/types.d.ts +2 -2
  108. package/lib/combo-box/index.d.ts +3 -12
  109. package/lib/combo-box/index.js +15 -30
  110. package/lib/combo-box/themes/halo/dark/index.js +2 -1
  111. package/lib/combo-box/themes/halo/light/index.js +2 -1
  112. package/lib/combo-box/themes/solar/charcoal/index.js +2 -1
  113. package/lib/combo-box/themes/solar/pearl/index.js +2 -1
  114. package/lib/counter/themes/halo/dark/index.js +2 -1
  115. package/lib/counter/themes/halo/light/index.js +2 -1
  116. package/lib/counter/themes/solar/charcoal/index.js +2 -1
  117. package/lib/counter/themes/solar/pearl/index.js +2 -1
  118. package/lib/datetime-field/index.d.ts +2 -2
  119. package/lib/datetime-field/index.js +7 -12
  120. package/lib/datetime-field/types.d.ts +3 -3
  121. package/lib/datetime-field/utils.d.ts +2 -2
  122. package/lib/datetime-field/utils.js +2 -2
  123. package/lib/datetime-picker/custom-elements.json +4 -4
  124. package/lib/datetime-picker/custom-elements.md +4 -4
  125. package/lib/datetime-picker/index.d.ts +4 -4
  126. package/lib/datetime-picker/index.js +9 -13
  127. package/lib/datetime-picker/themes/halo/dark/index.js +2 -1
  128. package/lib/datetime-picker/themes/halo/light/index.js +2 -1
  129. package/lib/datetime-picker/themes/solar/charcoal/index.js +2 -1
  130. package/lib/datetime-picker/themes/solar/pearl/index.js +2 -1
  131. package/lib/datetime-picker/types.d.ts +1 -1
  132. package/lib/dialog/custom-elements.json +2 -13
  133. package/lib/dialog/custom-elements.md +4 -5
  134. package/lib/dialog/index.d.ts +11 -43
  135. package/lib/dialog/index.js +21 -80
  136. package/lib/dialog/themes/halo/dark/index.js +1 -1
  137. package/lib/dialog/themes/halo/light/index.js +1 -1
  138. package/lib/dialog/themes/solar/charcoal/index.js +1 -1
  139. package/lib/dialog/themes/solar/pearl/index.js +1 -1
  140. package/lib/email-field/custom-elements.json +3 -3
  141. package/lib/email-field/custom-elements.md +5 -5
  142. package/lib/email-field/index.d.ts +3 -3
  143. package/lib/email-field/index.js +5 -4
  144. package/lib/email-field/themes/halo/dark/index.js +2 -1
  145. package/lib/email-field/themes/halo/light/index.js +2 -1
  146. package/lib/email-field/themes/solar/charcoal/index.js +2 -1
  147. package/lib/email-field/themes/solar/pearl/index.js +2 -1
  148. package/lib/events.d.ts +13 -13
  149. package/lib/flag/custom-elements.json +2 -14
  150. package/lib/flag/custom-elements.md +3 -6
  151. package/lib/flag/index.d.ts +21 -9
  152. package/lib/flag/index.js +43 -24
  153. package/lib/header/themes/halo/dark/index.js +1 -1
  154. package/lib/header/themes/halo/light/index.js +1 -1
  155. package/lib/header/themes/solar/charcoal/index.js +1 -1
  156. package/lib/header/themes/solar/pearl/index.js +1 -1
  157. package/lib/heatmap/helpers/color.js +2 -1
  158. package/lib/heatmap/helpers/text.d.ts +1 -1
  159. package/lib/heatmap/helpers/text.js +1 -1
  160. package/lib/heatmap/helpers/types.d.ts +7 -7
  161. package/lib/heatmap/index.js +156 -140
  162. package/lib/icon/custom-elements.json +0 -13
  163. package/lib/icon/custom-elements.md +0 -1
  164. package/lib/icon/index.d.ts +20 -2
  165. package/lib/icon/index.js +41 -14
  166. package/lib/icon/themes/halo/dark/index.js +1 -1
  167. package/lib/icon/themes/halo/light/index.js +1 -1
  168. package/lib/icon/themes/solar/charcoal/index.js +1 -1
  169. package/lib/icon/themes/solar/pearl/index.js +1 -1
  170. package/lib/interactive-chart/custom-elements.json +1 -1
  171. package/lib/interactive-chart/custom-elements.md +3 -3
  172. package/lib/interactive-chart/helpers/merge.d.ts +2 -2
  173. package/lib/interactive-chart/helpers/types.d.ts +7 -7
  174. package/lib/interactive-chart/index.d.ts +1 -1
  175. package/lib/interactive-chart/index.js +5 -3
  176. package/lib/item/custom-elements.json +4 -4
  177. package/lib/item/custom-elements.md +2 -2
  178. package/lib/item/helpers/types.d.ts +2 -2
  179. package/lib/item/index.d.ts +2 -1
  180. package/lib/item/index.js +2 -1
  181. package/lib/item/themes/halo/dark/index.js +1 -1
  182. package/lib/item/themes/halo/light/index.js +1 -1
  183. package/lib/item/themes/solar/charcoal/index.js +1 -1
  184. package/lib/item/themes/solar/pearl/index.js +1 -1
  185. package/lib/label/index.js +9 -34
  186. package/lib/layout/index.js +0 -13
  187. package/lib/led-gauge/index.js +7 -7
  188. package/lib/list/custom-elements.json +1 -1
  189. package/lib/list/custom-elements.md +3 -3
  190. package/lib/list/elements/list.d.ts +1 -1
  191. package/lib/list/elements/list.js +4 -8
  192. package/lib/list/helpers/renderer.d.ts +0 -4
  193. package/lib/list/helpers/renderer.js +5 -5
  194. package/lib/list/helpers/types.d.ts +1 -1
  195. package/lib/list/themes/halo/dark/index.js +2 -2
  196. package/lib/list/themes/halo/light/index.js +2 -2
  197. package/lib/list/themes/solar/charcoal/index.js +2 -2
  198. package/lib/list/themes/solar/pearl/index.js +2 -2
  199. package/lib/multi-input/custom-elements.json +5 -5
  200. package/lib/multi-input/custom-elements.md +5 -5
  201. package/lib/multi-input/helpers/types.d.ts +3 -3
  202. package/lib/multi-input/index.d.ts +5 -17
  203. package/lib/multi-input/index.js +8 -21
  204. package/lib/multi-input/themes/halo/dark/index.js +1 -1
  205. package/lib/multi-input/themes/halo/light/index.js +1 -1
  206. package/lib/multi-input/themes/solar/charcoal/index.js +1 -1
  207. package/lib/multi-input/themes/solar/pearl/index.js +1 -1
  208. package/lib/notification/custom-elements.json +2 -2
  209. package/lib/notification/custom-elements.md +4 -4
  210. package/lib/notification/elements/notification.d.ts +2 -2
  211. package/lib/notification/elements/notification.js +2 -2
  212. package/lib/notification/helpers/types.d.ts +2 -2
  213. package/lib/number-field/custom-elements.json +2 -2
  214. package/lib/number-field/custom-elements.md +4 -4
  215. package/lib/number-field/index.d.ts +4 -4
  216. package/lib/number-field/index.js +24 -19
  217. package/lib/number-field/themes/halo/dark/index.js +2 -1
  218. package/lib/number-field/themes/halo/light/index.js +2 -1
  219. package/lib/number-field/themes/solar/charcoal/index.js +2 -1
  220. package/lib/number-field/themes/solar/pearl/index.js +2 -1
  221. package/lib/overlay/custom-elements.json +6 -9
  222. package/lib/overlay/custom-elements.md +7 -8
  223. package/lib/overlay/elements/overlay-backdrop.d.ts +1 -8
  224. package/lib/overlay/elements/overlay-backdrop.js +3 -13
  225. package/lib/overlay/elements/overlay-viewport.d.ts +1 -8
  226. package/lib/overlay/elements/overlay-viewport.js +3 -13
  227. package/lib/overlay/elements/overlay.d.ts +7 -15
  228. package/lib/overlay/elements/overlay.js +13 -55
  229. package/lib/overlay/helpers/types.d.ts +13 -13
  230. package/lib/overlay/managers/close-manager.d.ts +1 -1
  231. package/lib/overlay/managers/close-manager.js +6 -4
  232. package/lib/overlay/managers/focus-manager.js +2 -1
  233. package/lib/overlay/managers/interaction-lock-manager.js +1 -1
  234. package/lib/overlay/managers/viewport-manager.js +3 -0
  235. package/lib/overlay/managers/zindex-manager.d.ts +1 -1
  236. package/lib/overlay/managers/zindex-manager.js +1 -1
  237. package/lib/overlay/themes/halo/dark/index.js +1 -1
  238. package/lib/overlay/themes/halo/light/index.js +1 -1
  239. package/lib/overlay/themes/solar/charcoal/index.js +1 -1
  240. package/lib/overlay/themes/solar/pearl/index.js +1 -1
  241. package/lib/overlay-menu/custom-elements.json +2 -2
  242. package/lib/overlay-menu/custom-elements.md +2 -2
  243. package/lib/overlay-menu/helpers/types.d.ts +2 -2
  244. package/lib/overlay-menu/index.d.ts +2 -2
  245. package/lib/overlay-menu/index.js +36 -42
  246. package/lib/overlay-menu/managers/menu-manager.d.ts +0 -1
  247. package/lib/overlay-menu/managers/menu-manager.js +1 -5
  248. package/lib/overlay-menu/themes/halo/dark/index.js +1 -1
  249. package/lib/overlay-menu/themes/halo/light/index.js +1 -1
  250. package/lib/overlay-menu/themes/solar/charcoal/index.js +1 -1
  251. package/lib/overlay-menu/themes/solar/pearl/index.js +1 -1
  252. package/lib/pagination/custom-elements.json +1 -1
  253. package/lib/pagination/custom-elements.md +3 -3
  254. package/lib/pagination/index.d.ts +1 -2
  255. package/lib/pagination/index.js +3 -7
  256. package/lib/pagination/themes/halo/dark/index.js +1 -1
  257. package/lib/pagination/themes/halo/light/index.js +1 -1
  258. package/lib/pagination/themes/solar/charcoal/index.js +1 -1
  259. package/lib/pagination/themes/solar/pearl/index.js +1 -1
  260. package/lib/password-field/custom-elements.json +2 -6
  261. package/lib/password-field/custom-elements.md +4 -5
  262. package/lib/password-field/index.d.ts +2 -3
  263. package/lib/password-field/index.js +2 -3
  264. package/lib/password-field/themes/halo/dark/index.js +2 -1
  265. package/lib/password-field/themes/halo/light/index.js +2 -1
  266. package/lib/password-field/themes/solar/charcoal/index.js +2 -1
  267. package/lib/password-field/themes/solar/pearl/index.js +2 -1
  268. package/lib/pill/custom-elements.json +1 -1
  269. package/lib/pill/custom-elements.md +3 -3
  270. package/lib/pill/index.d.ts +1 -1
  271. package/lib/pill/index.js +2 -2
  272. package/lib/pill/themes/halo/dark/index.js +2 -1
  273. package/lib/pill/themes/halo/light/index.js +2 -1
  274. package/lib/pill/themes/solar/charcoal/index.js +2 -1
  275. package/lib/pill/themes/solar/pearl/index.js +2 -1
  276. package/lib/radio-button/custom-elements.json +1 -1
  277. package/lib/radio-button/custom-elements.md +3 -3
  278. package/lib/radio-button/index.d.ts +1 -1
  279. package/lib/radio-button/index.js +1 -6
  280. package/lib/radio-button/themes/halo/dark/index.js +1 -1
  281. package/lib/radio-button/themes/halo/light/index.js +1 -1
  282. package/lib/radio-button/themes/solar/charcoal/index.js +1 -1
  283. package/lib/radio-button/themes/solar/pearl/index.js +1 -1
  284. package/lib/rating/custom-elements.json +1 -1
  285. package/lib/rating/custom-elements.md +3 -3
  286. package/lib/rating/index.d.ts +1 -1
  287. package/lib/rating/index.js +1 -5
  288. package/lib/search-field/custom-elements.json +3 -3
  289. package/lib/search-field/custom-elements.md +5 -5
  290. package/lib/search-field/index.d.ts +3 -3
  291. package/lib/search-field/index.js +6 -7
  292. package/lib/search-field/themes/halo/dark/index.js +2 -1
  293. package/lib/search-field/themes/halo/light/index.js +2 -1
  294. package/lib/search-field/themes/solar/charcoal/index.js +2 -1
  295. package/lib/search-field/themes/solar/pearl/index.js +2 -1
  296. package/lib/select/custom-elements.json +2 -2
  297. package/lib/select/custom-elements.md +4 -4
  298. package/lib/select/helpers/types.d.ts +2 -2
  299. package/lib/select/index.d.ts +2 -2
  300. package/lib/select/index.js +15 -20
  301. package/lib/select/themes/halo/dark/index.js +2 -1
  302. package/lib/select/themes/halo/light/index.js +2 -1
  303. package/lib/select/themes/solar/charcoal/index.js +2 -1
  304. package/lib/select/themes/solar/pearl/index.js +2 -1
  305. package/lib/sidebar-layout/index.js +2 -3
  306. package/lib/sidebar-layout/themes/halo/dark/index.js +1 -1
  307. package/lib/sidebar-layout/themes/halo/light/index.js +1 -1
  308. package/lib/sidebar-layout/themes/solar/charcoal/index.js +1 -1
  309. package/lib/sidebar-layout/themes/solar/pearl/index.js +1 -1
  310. package/lib/slider/custom-elements.json +3 -3
  311. package/lib/slider/custom-elements.md +5 -5
  312. package/lib/slider/index.d.ts +3 -3
  313. package/lib/slider/index.js +117 -111
  314. package/lib/swing-gauge/types.d.ts +1 -1
  315. package/lib/tab/custom-elements.json +1 -1
  316. package/lib/tab/custom-elements.md +3 -3
  317. package/lib/tab/index.d.ts +1 -1
  318. package/lib/tab/index.js +1 -1
  319. package/lib/tab/themes/halo/dark/index.js +1 -1
  320. package/lib/tab/themes/halo/light/index.js +1 -1
  321. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  322. package/lib/tab/themes/solar/pearl/index.js +1 -1
  323. package/lib/tab-bar/custom-elements.json +1 -1
  324. package/lib/tab-bar/custom-elements.md +3 -3
  325. package/lib/tab-bar/index.d.ts +1 -1
  326. package/lib/tab-bar/index.js +1 -5
  327. package/lib/tab-bar/themes/halo/dark/index.js +1 -1
  328. package/lib/tab-bar/themes/halo/light/index.js +1 -1
  329. package/lib/text-field/custom-elements.json +3 -3
  330. package/lib/text-field/custom-elements.md +5 -5
  331. package/lib/text-field/index.d.ts +4 -10
  332. package/lib/text-field/index.js +11 -26
  333. package/lib/text-field/themes/halo/dark/index.js +2 -1
  334. package/lib/text-field/themes/halo/light/index.js +2 -1
  335. package/lib/text-field/themes/solar/charcoal/index.js +2 -1
  336. package/lib/text-field/themes/solar/pearl/index.js +2 -1
  337. package/lib/time-picker/custom-elements.json +1 -1
  338. package/lib/time-picker/custom-elements.md +3 -3
  339. package/lib/time-picker/index.d.ts +1 -1
  340. package/lib/time-picker/index.js +19 -20
  341. package/lib/time-picker/themes/halo/dark/index.js +2 -1
  342. package/lib/time-picker/themes/halo/light/index.js +2 -1
  343. package/lib/time-picker/themes/solar/charcoal/index.js +2 -1
  344. package/lib/time-picker/themes/solar/pearl/index.js +2 -1
  345. package/lib/toggle/custom-elements.json +1 -1
  346. package/lib/toggle/custom-elements.md +3 -3
  347. package/lib/toggle/index.d.ts +1 -1
  348. package/lib/toggle/index.js +2 -5
  349. package/lib/toggle/themes/halo/dark/index.js +1 -1
  350. package/lib/toggle/themes/halo/light/index.js +1 -1
  351. package/lib/toggle/themes/solar/charcoal/index.js +1 -1
  352. package/lib/toggle/themes/solar/pearl/index.js +1 -1
  353. package/lib/tooltip/elements/tooltip-element.js +1 -1
  354. package/lib/tooltip/helpers/types.d.ts +10 -10
  355. package/lib/tooltip/index.js +5 -4
  356. package/lib/tooltip/managers/tooltip-manager.js +2 -5
  357. package/lib/tornado-chart/elements/tornado-item.js +8 -9
  358. package/lib/tornado-chart/themes/halo/dark/index.js +2 -2
  359. package/lib/tornado-chart/themes/halo/light/index.js +2 -2
  360. package/lib/tornado-chart/themes/solar/charcoal/index.js +1 -1
  361. package/lib/tornado-chart/themes/solar/pearl/index.js +1 -1
  362. package/lib/tree/custom-elements.json +2 -2
  363. package/lib/tree/custom-elements.md +2 -2
  364. package/lib/tree/elements/tree.d.ts +2 -2
  365. package/lib/tree/elements/tree.js +2 -4
  366. package/lib/tree/helpers/renderer.d.ts +0 -4
  367. package/lib/tree/helpers/renderer.js +5 -5
  368. package/lib/tree/helpers/types.d.ts +2 -2
  369. package/lib/tree/themes/halo/dark/index.js +2 -2
  370. package/lib/tree/themes/halo/light/index.js +2 -2
  371. package/lib/tree/themes/solar/charcoal/index.js +2 -2
  372. package/lib/tree/themes/solar/pearl/index.js +2 -2
  373. package/lib/tree-select/custom-elements.json +7 -7
  374. package/lib/tree-select/custom-elements.md +7 -7
  375. package/lib/tree-select/helpers/types.d.ts +2 -2
  376. package/lib/tree-select/index.d.ts +5 -6
  377. package/lib/tree-select/index.js +23 -23
  378. package/lib/tree-select/themes/halo/dark/index.js +2 -1
  379. package/lib/tree-select/themes/halo/light/index.js +2 -1
  380. package/lib/tree-select/themes/solar/charcoal/index.js +2 -1
  381. package/lib/tree-select/themes/solar/pearl/index.js +2 -1
  382. package/lib/version.js +1 -1
  383. package/package.json +32 -30
  384. package/lib/chart/helpers/legend.d.ts +0 -5
  385. package/lib/chart/helpers/legend.js +0 -78
@@ -0,0 +1,509 @@
1
+ import { __decorate } from "tslib";
2
+ import { BasicElement, html, css, nothing } from '@refinitiv-ui/core';
3
+ import { customElement } from '@refinitiv-ui/core/decorators/custom-element.js';
4
+ import { property } from '@refinitiv-ui/core/decorators/property.js';
5
+ import { ref, createRef } from '@refinitiv-ui/core/directives/ref.js';
6
+ import { color as parseColor } from '@refinitiv-ui/utils/color.js';
7
+ import { VERSION } from '../../version.js';
8
+ import { Chart as ChartJS } from 'chart.js';
9
+ import 'chartjs-adapter-date-fns';
10
+ import { merge } from '../helpers/index.js';
11
+ import '../../header/index.js';
12
+ const CSS_COLOR_PREFIX = '--chart-color-';
13
+ /**
14
+ * Charting component that uses ChartJS library
15
+ */
16
+ let Chart = class Chart extends BasicElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ /**
20
+ * Chart.js object
21
+ * @type {ChartJS | null}
22
+ */
23
+ this.chart = null;
24
+ /**
25
+ * Chart configurations. Same configuration as ChartJS
26
+ * @type {ChartConfiguration | null}
27
+ */
28
+ this.config = null;
29
+ /**
30
+ * Canvas element used to render Chart
31
+ */
32
+ this.canvas = createRef();
33
+ /**
34
+ * Inject theme color into each datasets
35
+ * @param chart Chart.js instance
36
+ * @returns {void}
37
+ */
38
+ this.decorateColors = (chart) => {
39
+ chart.config.data.datasets.forEach((dataset, datasetIndex) => {
40
+ let colors;
41
+ let borderColor;
42
+ let backgroundColor;
43
+ const isMultipleDatasets = (chart.config.data.datasets.length > 1);
44
+ // From old requirement, Only line, radar, scatter, polarArea type are opaque backgroundColor
45
+ switch (dataset.type ?? this.config?.type) {
46
+ case 'line':
47
+ case 'radar':
48
+ case 'scatter':
49
+ colors = this.generateColors(false, 1, datasetIndex);
50
+ if (!dataset.borderColor) {
51
+ dataset.borderColor = colors.solid;
52
+ }
53
+ if (!dataset.backgroundColor) {
54
+ dataset.backgroundColor = colors.opaque;
55
+ }
56
+ if (!dataset.pointBackgroundColor) {
57
+ dataset.pointBackgroundColor = colors.solid;
58
+ }
59
+ if (!dataset.pointBorderColor) {
60
+ dataset.pointBorderColor = colors.solid;
61
+ }
62
+ break;
63
+ // These types, Colors are set to an array.
64
+ case 'doughnut':
65
+ case 'pie':
66
+ case 'polarArea':
67
+ const index = isMultipleDatasets ? 0 : datasetIndex;
68
+ colors = this.generateColors(true, dataset.data ? dataset.data.length : 1, index);
69
+ borderColor = isMultipleDatasets ? this.getComputedVariable('--multi-dataset-border-color', '#fff') : colors.solid;
70
+ backgroundColor = this.config?.type === 'polarArea' ? colors.opaque : colors.solid;
71
+ if (!dataset.borderColor) {
72
+ dataset.borderColor = borderColor;
73
+ }
74
+ if (!dataset.backgroundColor) {
75
+ dataset.backgroundColor = backgroundColor;
76
+ }
77
+ // Add more colors if items aren't enough
78
+ if (Array.isArray(dataset.borderColor) && Array.isArray(borderColor) && dataset.borderColor.length < borderColor.length) {
79
+ merge(dataset.borderColor, borderColor);
80
+ }
81
+ if (Array.isArray(dataset.backgroundColor) && Array.isArray(backgroundColor) && dataset.backgroundColor.length < backgroundColor.length) {
82
+ merge(dataset.backgroundColor, backgroundColor);
83
+ }
84
+ break;
85
+ // These types, Colors could be string or array
86
+ case 'bar':
87
+ case 'bubble':
88
+ colors = this.generateColors(!isMultipleDatasets, !isMultipleDatasets && dataset.data ? dataset.data.length : 1, datasetIndex);
89
+ borderColor = colors.solid;
90
+ backgroundColor = this.config?.type === 'bubble' ? colors.opaque : colors.solid;
91
+ if (!dataset.borderColor) {
92
+ dataset.borderColor = borderColor;
93
+ }
94
+ if (!dataset.backgroundColor) {
95
+ dataset.backgroundColor = backgroundColor;
96
+ }
97
+ // Add more colors if items aren't enough
98
+ if (Array.isArray(dataset.borderColor) && Array.isArray(borderColor) && dataset.borderColor.length < borderColor.length) {
99
+ merge(dataset.borderColor, borderColor);
100
+ }
101
+ if (Array.isArray(dataset.backgroundColor) && Array.isArray(backgroundColor) && dataset.backgroundColor.length < backgroundColor.length) {
102
+ merge(dataset.backgroundColor, backgroundColor);
103
+ }
104
+ break;
105
+ // For other types
106
+ default:
107
+ colors = this.generateColors(false, dataset.data.length, datasetIndex);
108
+ if (!dataset.borderColor) {
109
+ dataset.borderColor = colors.solid;
110
+ }
111
+ if (!dataset.backgroundColor) {
112
+ dataset.backgroundColor = colors.solid;
113
+ }
114
+ break;
115
+ }
116
+ });
117
+ };
118
+ /**
119
+ * Generates the legend labels on a given chart
120
+ * @param chart Chart.js instance
121
+ * @returns Array of label configurations
122
+ */
123
+ this.generateLegendLabels = (chart) => {
124
+ const chartType = chart.config.type;
125
+ if (!chartType) {
126
+ return [];
127
+ }
128
+ let legends = [];
129
+ const datasets = chart.config.data.datasets;
130
+ if (datasets.length
131
+ && chart?.config?.options?.plugins?.legend
132
+ && Array.isArray(datasets[0].backgroundColor)) {
133
+ if (ChartJS.overrides.pie.plugins.legend.labels.generateLabels) {
134
+ legends = ChartJS.overrides.pie.plugins.legend.labels.generateLabels(chart);
135
+ }
136
+ // Customize for doughnut chart change border color to background color
137
+ if (['pie', 'doughnut'].includes(chartType) && this.datasets.length > 1) {
138
+ legends.forEach((label) => {
139
+ label.strokeStyle = label.fillStyle;
140
+ });
141
+ }
142
+ return legends;
143
+ }
144
+ if (ChartJS.defaults.plugins.legend.labels.generateLabels) {
145
+ legends = ChartJS.defaults.plugins.legend.labels.generateLabels(chart);
146
+ }
147
+ legends.forEach((legend, i) => {
148
+ legend.lineWidth = Number(datasets[i].borderWidth) || 0;
149
+ switch (datasets[i].type ?? chartType) {
150
+ case 'line':
151
+ case 'radar':
152
+ case 'bubble':
153
+ case 'polarArea':
154
+ legend.fillStyle = datasets[i].borderColor;
155
+ break;
156
+ // For other chart types
157
+ default:
158
+ break;
159
+ }
160
+ });
161
+ return legends;
162
+ };
163
+ }
164
+ /**
165
+ * Element version number
166
+ * @returns version number
167
+ */
168
+ static get version() {
169
+ return VERSION;
170
+ }
171
+ /**
172
+ * A `CSSResultGroup` that will be used
173
+ * to style the host, slotted children
174
+ * and the internal template of the element.
175
+ * @return CSS template
176
+ */
177
+ static get styles() {
178
+ return css `
179
+ :host {
180
+ display: block;
181
+ overflow: hidden;
182
+ position: relative;
183
+ }
184
+ :host::before {
185
+ content: '';
186
+ display: block;
187
+ padding-top: 60%;
188
+ min-height: 300px;
189
+ box-sizing: border-box;
190
+ }
191
+ [part=container] {
192
+ position: absolute;
193
+ top: 0;
194
+ right: 0;
195
+ bottom: 0;
196
+ left: 0;
197
+ display: flex;
198
+ flex-direction: column;
199
+ }
200
+ [part=chart] {
201
+ flex: 1 1 auto;
202
+ position: relative;
203
+ }
204
+ [part=title] {
205
+ margin-bottom: 12px;
206
+ }
207
+ canvas {
208
+ position: absolute;
209
+ top: 0;
210
+ right: 0;
211
+ bottom: 0;
212
+ left: 0;
213
+ }
214
+ `;
215
+ }
216
+ /**
217
+ * Required properties, needed for chart to work correctly.
218
+ * @returns config
219
+ */
220
+ get requiredConfig() {
221
+ return {
222
+ responsive: true,
223
+ maintainAspectRatio: false,
224
+ plugins: {
225
+ title: {
226
+ display: false
227
+ }
228
+ }
229
+ };
230
+ }
231
+ /**
232
+ * List of available chart colors
233
+ * @type {string[]}
234
+ * @returns {string[]}List of available chart colors
235
+ */
236
+ get colors() {
237
+ const colors = [];
238
+ for (let index = 1;; index++) {
239
+ const color = this.getComputedVariable(`${CSS_COLOR_PREFIX}${index}`);
240
+ if (!color) {
241
+ break;
242
+ }
243
+ colors.push(color);
244
+ }
245
+ return colors;
246
+ }
247
+ /**
248
+ * Returns the chart title
249
+ * @returns chart title
250
+ */
251
+ get chartTitle() {
252
+ const title = this.config?.options?.plugins?.title?.text;
253
+ if (title) {
254
+ return typeof title === 'string' ? title : title.join();
255
+ }
256
+ return '';
257
+ }
258
+ /**
259
+ * Returns a dataset array
260
+ * @returns dataset array
261
+ */
262
+ get datasets() {
263
+ return this.config?.data?.datasets || [];
264
+ }
265
+ /**
266
+ * Invoked whenever the element is updated
267
+ * @param changedProperties Map of changed properties with old values
268
+ * @returns {void}
269
+ */
270
+ updated(changedProperties) {
271
+ super.updated(changedProperties);
272
+ if (changedProperties.has('config')) {
273
+ this.onConfigChange();
274
+ }
275
+ }
276
+ /**
277
+ * Element connected
278
+ * @returns {void}
279
+ */
280
+ connectedCallback() {
281
+ super.connectedCallback();
282
+ this.setGlobalConfig();
283
+ if (this.canvas.value) {
284
+ this.createChart();
285
+ }
286
+ }
287
+ /**
288
+ * Element disconnected
289
+ * @returns {void}
290
+ */
291
+ disconnectedCallback() {
292
+ super.disconnectedCallback();
293
+ this.destroyChart();
294
+ }
295
+ /**
296
+ * Create plugin to set our theme into ChartJS lifecycle
297
+ * @returns Created plugin
298
+ */
299
+ createPlugin() {
300
+ return {
301
+ id: 'ef-chart',
302
+ beforeInit: (chart) => {
303
+ const option = this.themableChartOption;
304
+ merge(chart.config.options, option);
305
+ },
306
+ beforeUpdate: this.decorateColors
307
+ };
308
+ }
309
+ /**
310
+ * Themable parts of the config.
311
+ * This will be merged into the configuration object.
312
+ * @returns Chart option with theme
313
+ */
314
+ get themableChartOption() {
315
+ const boxWidth = this.cssVarAsNumber('--legend-key-box-width', '10');
316
+ let boxHeight = Number(getComputedStyle(this).getPropertyValue('font-size').replace('px', ''));
317
+ if (this.config?.options?.plugins?.legend?.labels?.usePointStyle) {
318
+ boxHeight = boxWidth;
319
+ }
320
+ return {
321
+ animation: {
322
+ duration: this.cssVarAsNumber('--animation-duration', '0')
323
+ },
324
+ elements: {
325
+ line: {
326
+ borderWidth: this.cssVarAsNumber('--line-width', '1'),
327
+ tension: this.cssVarAsNumber('--line-tension', '0.5')
328
+ }
329
+ },
330
+ plugins: {
331
+ tooltip: {
332
+ backgroundColor: this.getComputedVariable('--tooltip-background-color', 'transparent'),
333
+ titleColor: this.getComputedVariable('--tooltip-title-color', 'transparent'),
334
+ bodyColor: this.getComputedVariable('--tooltip-body-color', 'transparent'),
335
+ cornerRadius: this.cssVarAsNumber('--tooltip-border-radius', '0'),
336
+ caretSize: this.cssVarAsNumber('--tooltip-caret-size', '0'),
337
+ padding: {
338
+ x: this.cssVarAsNumber('--tooltip-padding-x', '--tooltip-padding', '0'),
339
+ y: this.cssVarAsNumber('--tooltip-padding-y', '--tooltip-padding', '0')
340
+ },
341
+ titleSpacing: this.cssVarAsNumber('--tooltip-title-spacing', '0'),
342
+ displayColors: false
343
+ },
344
+ legend: {
345
+ position: ['pie', 'doughnut'].includes(this.config?.type || '') ? 'right' : 'top',
346
+ labels: {
347
+ boxWidth,
348
+ boxHeight,
349
+ generateLabels: this.generateLegendLabels
350
+ }
351
+ }
352
+ }
353
+ };
354
+ }
355
+ /**
356
+ * Set global configuration of ChartJS
357
+ * @returns {void}
358
+ */
359
+ setGlobalConfig() {
360
+ const cssStyle = getComputedStyle(this);
361
+ // Set font globals
362
+ ChartJS.defaults.color = cssStyle.getPropertyValue('color');
363
+ ChartJS.defaults.font.family = cssStyle.getPropertyValue('font-family');
364
+ ChartJS.defaults.font.size = Number(cssStyle.getPropertyValue('font-size').replace('px', ''));
365
+ ChartJS.defaults.font.style = cssStyle.getPropertyValue('font-style');
366
+ // Set global grid color
367
+ ChartJS.defaults.scale.grid.color = (line) => {
368
+ return line.index === 0 ? this.getComputedVariable('--zero-line-color', 'transparent') : this.getComputedVariable('--grid-line-color', 'transparent');
369
+ };
370
+ if (this.config?.type === 'polarArea' || this.config?.type === 'radar') {
371
+ ChartJS.defaults.scales.radialLinear.ticks.showLabelBackdrop = false;
372
+ }
373
+ }
374
+ /**
375
+ * Handles a change of configuration object.
376
+ * This does not fire when a property of the config object changes,
377
+ * for this use this.updateChart() to apply changes.
378
+ * @returns {void}
379
+ */
380
+ onConfigChange() {
381
+ if (this.config) {
382
+ this.createChart();
383
+ }
384
+ }
385
+ /**
386
+ * Get as CSS variable and tries to convert it into a usable number
387
+ * @returns The value as a number, or, undefined if NaN.
388
+ */
389
+ cssVarAsNumber(...args) {
390
+ const result = Number(this.getComputedVariable(...args).replace(/\D/g, ''));
391
+ return isNaN(result) ? undefined : result;
392
+ }
393
+ /**
394
+ * Merges all the different layers of the config.
395
+ * @returns {void}
396
+ */
397
+ mergeConfigs() {
398
+ if (!this.config) {
399
+ return;
400
+ }
401
+ let plugins = [
402
+ this.createPlugin()
403
+ ];
404
+ if (Array.isArray(this.config.plugins) && this.config.plugins.length > 0) {
405
+ plugins = [
406
+ ...plugins,
407
+ ...this.config.plugins
408
+ ];
409
+ }
410
+ merge(this.config, {
411
+ plugins,
412
+ options: this.requiredConfig
413
+ }, true);
414
+ }
415
+ /**
416
+ * Generates internal solid and opaque color set for a dataset
417
+ * @param isArray Flag to return result in array or not e.g. doughnut, pie, etc
418
+ * @param amount Amount of colors required
419
+ * @param shift Positional shift of the color start point
420
+ * @returns Solid and opaque color values
421
+ */
422
+ generateColors(isArray, amount, shift) {
423
+ const solid = [];
424
+ const opaque = [];
425
+ const alpha = Number(this.getComputedVariable('--fill-opacity', '0.2'));
426
+ amount = isArray ? amount : 1;
427
+ for (let i = shift; i < amount + shift; i++) {
428
+ const color = this.colors[i % this.colors.length];
429
+ solid.push(color);
430
+ const opaqueColor = parseColor(color);
431
+ if (opaqueColor) {
432
+ opaqueColor.opacity = alpha;
433
+ opaque.push(opaqueColor.toString());
434
+ }
435
+ }
436
+ return {
437
+ solid: isArray ? solid : solid[0],
438
+ opaque: isArray ? opaque : opaque[0]
439
+ };
440
+ }
441
+ /**
442
+ * Creates a chart after config has changed,
443
+ * or, the element has been connected to the DOM
444
+ * @returns {void}
445
+ */
446
+ createChart() {
447
+ const canvas = this.canvas.value;
448
+ if (canvas && this.config) {
449
+ this.destroyChart();
450
+ this.mergeConfigs();
451
+ this.chart = new ChartJS(canvas, this.config);
452
+ }
453
+ }
454
+ /**
455
+ * Destroys the chart.js object
456
+ * @returns True if a chart object has been destroyed
457
+ */
458
+ destroyChart() {
459
+ if (this.chart) {
460
+ this.chart.destroy();
461
+ this.chart = null;
462
+ return true;
463
+ }
464
+ return false;
465
+ }
466
+ /**
467
+ * Update all data, title, scales, legends and re-render the chart based on its config
468
+ * @param updateMode Additional configuration for control an animation in the update process.
469
+ * @returns {void}
470
+ */
471
+ updateChart(updateMode) {
472
+ if (!this.chart || !this.config) {
473
+ return;
474
+ }
475
+ this.chart.stop();
476
+ this.mergeConfigs();
477
+ this.requestUpdate();
478
+ this.chart?.update(updateMode);
479
+ }
480
+ /**
481
+ * Template for title
482
+ * Rendered when `config.plugins.title.text` is set
483
+ * @returns Header template from title of config
484
+ */
485
+ get titleTemplate() {
486
+ return this.chartTitle ? html `<ef-header part="title">${this.chartTitle}</ef-header>` : nothing;
487
+ }
488
+ /**
489
+ * A `TemplateResult` that will be used
490
+ * to render the updated internal template.
491
+ * @return Render template
492
+ */
493
+ render() {
494
+ return html `
495
+ <div part="container">
496
+ ${this.titleTemplate}
497
+ <div part="chart">
498
+ <canvas ${ref(this.canvas)}></canvas>
499
+ </div>
500
+ </div>`;
501
+ }
502
+ };
503
+ __decorate([
504
+ property({ type: Object })
505
+ ], Chart.prototype, "config", void 0);
506
+ Chart = __decorate([
507
+ customElement('ef-chart')
508
+ ], Chart);
509
+ export { Chart };
@@ -1,2 +1,2 @@
1
- export * from './legend.js';
1
+ export * from './types.js';
2
2
  export * from './merge.js';
@@ -1,2 +1,2 @@
1
- export * from './legend.js';
1
+ export * from './types.js';
2
2
  export * from './merge.js';
@@ -1,12 +1,12 @@
1
- declare type UnknownObject = {
1
+ type UnknownObject = {
2
2
  [key: string]: unknown;
3
3
  };
4
- declare type MergeObject = UnknownObject | Array<unknown>;
4
+ type MergeObject = UnknownObject | Array<unknown>;
5
5
  /**
6
6
  * Merge objects recursively
7
7
  *
8
8
  * @param {MergeObject} object The destination object.
9
- * @param {MergeObject} sources The source objects.
9
+ * @param {MergeObject} sources The source object.
10
10
  * @param {boolean} force Force merge if a key of destination object is already exists and a value is not object
11
11
  * @param {MergeObject[]} record The record object which record merged objects recursively
12
12
  * @returns voids
@@ -2,7 +2,7 @@
2
2
  * Merge objects recursively
3
3
  *
4
4
  * @param {MergeObject} object The destination object.
5
- * @param {MergeObject} sources The source objects.
5
+ * @param {MergeObject} sources The source object.
6
6
  * @param {boolean} force Force merge if a key of destination object is already exists and a value is not object
7
7
  * @param {MergeObject[]} record The record object which record merged objects recursively
8
8
  * @returns voids
@@ -1,69 +1,4 @@
1
- /// <reference types="chart.js" />
2
- export declare type DatasetColors = {
1
+ export type DatasetColors = {
3
2
  solid: string | string[];
4
3
  opaque: string | string[];
5
4
  };
6
- export declare type ChartDataSetsColor = Chart.ChartColor | Chart.ChartColor[] | Chart.Scriptable<Chart.ChartColor> | undefined;
7
- export declare type ChartConfig = Chart.ChartConfiguration;
8
- export declare type ChartUpdateProps = Chart.ChartUpdateProps;
9
- export interface MetaData {
10
- _chart: Chart;
11
- _datasetIndex: number;
12
- _index: number;
13
- _model: Model;
14
- _view: Model;
15
- _xScale: Chart.ChartScales;
16
- _yScale: Chart.ChartScales;
17
- hidden?: boolean;
18
- }
19
- interface Model {
20
- backgroundColor: string;
21
- borderAlign?: Chart.BorderAlignment;
22
- borderColor: string;
23
- borderWidth?: number;
24
- circumference?: number;
25
- controlPointNextX: number;
26
- controlPointNextY: number;
27
- controlPointPreviousX: number;
28
- controlPointPreviousY: number;
29
- endAngle?: number;
30
- hitRadius: number;
31
- innerRadius?: number;
32
- outerRadius?: number;
33
- pointStyle: string;
34
- radius: string;
35
- skip?: boolean;
36
- startAngle?: number;
37
- steppedLine?: undefined;
38
- tension: number;
39
- x: number;
40
- y: number;
41
- base: number;
42
- head: number;
43
- }
44
- export interface ChartHelpers {
45
- draw(): void;
46
- }
47
- export interface ChartJS extends Chart {
48
- new (context: string | CanvasRenderingContext2D | HTMLCanvasElement | ArrayLike<CanvasRenderingContext2D | HTMLCanvasElement>, options: ChartConfig): Chart;
49
- defaults: {
50
- global: Chart.ChartOptions & Chart.ChartFontOptions & {
51
- tooltips: Chart.ChartTooltipOptions;
52
- defaultColor: string;
53
- defaultLineHeight: number;
54
- };
55
- scale: {
56
- gridLines: {
57
- color: string;
58
- zeroLineColor: string;
59
- };
60
- };
61
- [key: string]: any;
62
- };
63
- helpers: {
64
- getHoverColor(value: string): string;
65
- [key: string]: any;
66
- };
67
- isDatasetVisible(isDatasetVisible: number): boolean;
68
- }
69
- export {};