@refinitiv-ui/elements 5.3.3 → 5.3.4

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 (558) hide show
  1. package/lib/accordion/custom-elements.json +49 -0
  2. package/lib/accordion/index.d.ts +76 -0
  3. package/lib/accordion/index.js +139 -0
  4. package/lib/accordion/themes/halo/dark/index.js +3 -0
  5. package/lib/accordion/themes/halo/light/index.js +3 -0
  6. package/lib/accordion/themes/solar/charcoal/index.js +3 -0
  7. package/lib/accordion/themes/solar/pearl/index.js +3 -0
  8. package/lib/appstate-bar/custom-elements.json +49 -0
  9. package/lib/appstate-bar/index.d.ts +65 -0
  10. package/lib/appstate-bar/index.js +103 -0
  11. package/lib/appstate-bar/themes/halo/dark/index.js +3 -0
  12. package/lib/appstate-bar/themes/halo/light/index.js +3 -0
  13. package/lib/appstate-bar/themes/solar/charcoal/index.js +3 -0
  14. package/lib/appstate-bar/themes/solar/pearl/index.js +3 -0
  15. package/lib/autosuggest/custom-elements.json +223 -0
  16. package/lib/autosuggest/helpers/const.d.ts +2 -0
  17. package/lib/autosuggest/helpers/const.js +3 -0
  18. package/lib/autosuggest/helpers/types.d.ts +54 -0
  19. package/lib/autosuggest/helpers/types.js +1 -0
  20. package/lib/autosuggest/helpers/utils.d.ts +39 -0
  21. package/lib/autosuggest/helpers/utils.js +76 -0
  22. package/lib/autosuggest/index.d.ts +533 -0
  23. package/lib/autosuggest/index.js +1248 -0
  24. package/lib/autosuggest/themes/halo/dark/index.js +5 -0
  25. package/lib/autosuggest/themes/halo/light/index.js +5 -0
  26. package/lib/autosuggest/themes/solar/charcoal/index.js +5 -0
  27. package/lib/autosuggest/themes/solar/pearl/index.js +5 -0
  28. package/lib/button/custom-elements.json +119 -0
  29. package/lib/button/index.d.ts +132 -0
  30. package/lib/button/index.js +213 -0
  31. package/lib/button/themes/halo/dark/index.js +3 -0
  32. package/lib/button/themes/halo/light/index.js +3 -0
  33. package/lib/button/themes/solar/charcoal/index.js +3 -0
  34. package/lib/button/themes/solar/pearl/index.js +3 -0
  35. package/lib/button-bar/custom-elements.json +26 -0
  36. package/lib/button-bar/index.d.ts +76 -0
  37. package/lib/button-bar/index.js +157 -0
  38. package/lib/button-bar/themes/halo/dark/index.js +3 -0
  39. package/lib/button-bar/themes/halo/light/index.js +3 -0
  40. package/lib/button-bar/themes/solar/charcoal/index.js +3 -0
  41. package/lib/button-bar/themes/solar/pearl/index.js +3 -0
  42. package/lib/calendar/custom-elements.json +199 -0
  43. package/lib/calendar/index.d.ts +321 -0
  44. package/lib/calendar/index.js +926 -0
  45. package/lib/calendar/locales.d.ts +31 -0
  46. package/lib/calendar/locales.js +144 -0
  47. package/lib/calendar/themes/halo/dark/index.js +3 -0
  48. package/lib/calendar/themes/halo/light/index.js +3 -0
  49. package/lib/calendar/themes/solar/charcoal/index.js +3 -0
  50. package/lib/calendar/themes/solar/pearl/index.js +3 -0
  51. package/lib/calendar/types.d.ts +33 -0
  52. package/lib/calendar/types.js +6 -0
  53. package/lib/calendar/utils.d.ts +12 -0
  54. package/lib/calendar/utils.js +17 -0
  55. package/lib/canvas/custom-elements.json +69 -0
  56. package/lib/canvas/index.d.ts +100 -0
  57. package/lib/canvas/index.js +175 -0
  58. package/lib/canvas/themes/halo/dark/index.js +2 -0
  59. package/lib/canvas/themes/halo/light/index.js +2 -0
  60. package/lib/canvas/themes/solar/charcoal/index.js +2 -0
  61. package/lib/canvas/themes/solar/pearl/index.js +2 -0
  62. package/lib/card/custom-elements.json +59 -0
  63. package/lib/card/helpers/types.d.ts +12 -0
  64. package/lib/card/helpers/types.js +1 -0
  65. package/lib/card/index.d.ts +140 -0
  66. package/lib/card/index.js +247 -0
  67. package/lib/card/themes/halo/dark/index.js +5 -0
  68. package/lib/card/themes/halo/light/index.js +5 -0
  69. package/lib/card/themes/solar/charcoal/index.js +5 -0
  70. package/lib/card/themes/solar/pearl/index.js +5 -0
  71. package/lib/chart/custom-elements.json +42 -0
  72. package/lib/chart/helpers/index.d.ts +2 -0
  73. package/lib/chart/helpers/index.js +2 -0
  74. package/lib/chart/helpers/legend.d.ts +5 -0
  75. package/lib/chart/helpers/legend.js +78 -0
  76. package/lib/chart/helpers/merge.d.ts +15 -0
  77. package/lib/chart/helpers/merge.js +28 -0
  78. package/lib/chart/helpers/types.d.ts +69 -0
  79. package/lib/chart/helpers/types.js +1 -0
  80. package/lib/chart/index.d.ts +187 -0
  81. package/lib/chart/index.js +493 -0
  82. package/lib/chart/plugins/doughnut-center-label.d.ts +3 -0
  83. package/lib/chart/plugins/doughnut-center-label.js +196 -0
  84. package/lib/chart/themes/halo/dark/index.js +4 -0
  85. package/lib/chart/themes/halo/light/index.js +4 -0
  86. package/lib/chart/themes/solar/charcoal/index.js +4 -0
  87. package/lib/chart/themes/solar/pearl/index.js +4 -0
  88. package/lib/checkbox/custom-elements.json +71 -0
  89. package/lib/checkbox/index.d.ts +89 -0
  90. package/lib/checkbox/index.js +170 -0
  91. package/lib/checkbox/themes/halo/dark/index.js +4 -0
  92. package/lib/checkbox/themes/halo/light/index.js +4 -0
  93. package/lib/checkbox/themes/solar/charcoal/index.js +4 -0
  94. package/lib/checkbox/themes/solar/pearl/index.js +4 -0
  95. package/lib/clock/custom-elements.json +108 -0
  96. package/lib/clock/index.d.ts +309 -0
  97. package/lib/clock/index.js +564 -0
  98. package/lib/clock/themes/halo/dark/index.js +2 -0
  99. package/lib/clock/themes/halo/light/index.js +2 -0
  100. package/lib/clock/themes/solar/charcoal/index.js +2 -0
  101. package/lib/clock/themes/solar/pearl/index.js +2 -0
  102. package/lib/clock/utils/TickManager.d.ts +14 -0
  103. package/lib/clock/utils/TickManager.js +66 -0
  104. package/lib/clock/utils/timestamps.d.ts +6 -0
  105. package/lib/clock/utils/timestamps.js +6 -0
  106. package/lib/collapse/custom-elements.json +79 -0
  107. package/lib/collapse/index.d.ts +119 -0
  108. package/lib/collapse/index.js +199 -0
  109. package/lib/collapse/themes/halo/dark/index.js +5 -0
  110. package/lib/collapse/themes/halo/light/index.js +5 -0
  111. package/lib/collapse/themes/solar/charcoal/index.js +5 -0
  112. package/lib/collapse/themes/solar/pearl/index.js +5 -0
  113. package/lib/color-dialog/custom-elements.json +193 -0
  114. package/lib/color-dialog/elements/color-palettes.d.ts +52 -0
  115. package/lib/color-dialog/elements/color-palettes.js +105 -0
  116. package/lib/color-dialog/elements/grayscale-palettes.d.ts +67 -0
  117. package/lib/color-dialog/elements/grayscale-palettes.js +164 -0
  118. package/lib/color-dialog/elements/palettes.d.ts +58 -0
  119. package/lib/color-dialog/elements/palettes.js +119 -0
  120. package/lib/color-dialog/helpers/color-helpers.d.ts +62 -0
  121. package/lib/color-dialog/helpers/color-helpers.js +258 -0
  122. package/lib/color-dialog/helpers/value-model.d.ts +75 -0
  123. package/lib/color-dialog/helpers/value-model.js +139 -0
  124. package/lib/color-dialog/index.d.ts +232 -0
  125. package/lib/color-dialog/index.js +457 -0
  126. package/lib/color-dialog/themes/halo/dark/index.js +7 -0
  127. package/lib/color-dialog/themes/halo/light/index.js +7 -0
  128. package/lib/color-dialog/themes/solar/charcoal/index.js +7 -0
  129. package/lib/color-dialog/themes/solar/pearl/index.js +7 -0
  130. package/lib/combo-box/custom-elements.json +207 -0
  131. package/lib/combo-box/helpers/filter.d.ts +10 -0
  132. package/lib/combo-box/helpers/filter.js +29 -0
  133. package/lib/combo-box/helpers/keyboard-event.d.ts +17 -0
  134. package/lib/combo-box/helpers/keyboard-event.js +19 -0
  135. package/lib/combo-box/helpers/types.d.ts +11 -0
  136. package/lib/combo-box/helpers/types.js +1 -0
  137. package/lib/combo-box/index.d.ts +523 -0
  138. package/lib/combo-box/index.js +1146 -0
  139. package/lib/combo-box/themes/halo/dark/index.js +8 -0
  140. package/lib/combo-box/themes/halo/light/index.js +8 -0
  141. package/lib/combo-box/themes/solar/charcoal/index.js +8 -0
  142. package/lib/combo-box/themes/solar/pearl/index.js +8 -0
  143. package/lib/counter/custom-elements.json +35 -0
  144. package/lib/counter/index.d.ts +89 -0
  145. package/lib/counter/index.js +155 -0
  146. package/lib/counter/themes/halo/dark/index.js +3 -0
  147. package/lib/counter/themes/halo/light/index.js +3 -0
  148. package/lib/counter/themes/solar/charcoal/index.js +3 -0
  149. package/lib/counter/themes/solar/pearl/index.js +3 -0
  150. package/lib/counter/utils.d.ts +13 -0
  151. package/lib/counter/utils.js +52 -0
  152. package/lib/datetime-picker/custom-elements.json +333 -0
  153. package/lib/datetime-picker/index.d.ts +498 -0
  154. package/lib/datetime-picker/index.js +1164 -0
  155. package/lib/datetime-picker/locales.d.ts +8 -0
  156. package/lib/datetime-picker/locales.js +46 -0
  157. package/lib/datetime-picker/themes/halo/dark/index.js +7 -0
  158. package/lib/datetime-picker/themes/halo/light/index.js +7 -0
  159. package/lib/datetime-picker/themes/solar/charcoal/index.js +7 -0
  160. package/lib/datetime-picker/themes/solar/pearl/index.js +7 -0
  161. package/lib/datetime-picker/types.d.ts +3 -0
  162. package/lib/datetime-picker/types.js +1 -0
  163. package/lib/datetime-picker/utils.d.ts +55 -0
  164. package/lib/datetime-picker/utils.js +92 -0
  165. package/lib/dialog/custom-elements.json +136 -0
  166. package/lib/dialog/draggable-element.d.ts +14 -0
  167. package/lib/dialog/draggable-element.js +221 -0
  168. package/lib/dialog/index.d.ts +199 -0
  169. package/lib/dialog/index.js +331 -0
  170. package/lib/dialog/themes/halo/dark/index.js +7 -0
  171. package/lib/dialog/themes/halo/light/index.js +7 -0
  172. package/lib/dialog/themes/solar/charcoal/index.js +7 -0
  173. package/lib/dialog/themes/solar/pearl/index.js +7 -0
  174. package/lib/email-field/custom-elements.json +199 -0
  175. package/lib/email-field/index.d.ts +152 -0
  176. package/lib/email-field/index.js +287 -0
  177. package/lib/email-field/themes/halo/dark/index.js +3 -0
  178. package/lib/email-field/themes/halo/light/index.js +3 -0
  179. package/lib/email-field/themes/solar/charcoal/index.js +3 -0
  180. package/lib/email-field/themes/solar/pearl/index.js +3 -0
  181. package/lib/events.d.ts +121 -0
  182. package/lib/events.js +2 -0
  183. package/lib/flag/custom-elements.json +35 -0
  184. package/lib/flag/index.d.ts +94 -0
  185. package/lib/flag/index.js +168 -0
  186. package/lib/flag/themes/halo/dark/index.js +2 -0
  187. package/lib/flag/themes/halo/light/index.js +2 -0
  188. package/lib/flag/themes/solar/charcoal/index.js +2 -0
  189. package/lib/flag/themes/solar/pearl/index.js +2 -0
  190. package/lib/flag/utils/FlagLoader.d.ts +47 -0
  191. package/lib/flag/utils/FlagLoader.js +86 -0
  192. package/lib/header/custom-elements.json +36 -0
  193. package/lib/header/index.d.ts +46 -0
  194. package/lib/header/index.js +76 -0
  195. package/lib/header/themes/halo/dark/index.js +2 -0
  196. package/lib/header/themes/halo/light/index.js +2 -0
  197. package/lib/header/themes/solar/charcoal/index.js +2 -0
  198. package/lib/header/themes/solar/pearl/index.js +2 -0
  199. package/lib/heatmap/custom-elements.json +151 -0
  200. package/lib/heatmap/helpers/color.d.ts +30 -0
  201. package/lib/heatmap/helpers/color.js +68 -0
  202. package/lib/heatmap/helpers/text.d.ts +26 -0
  203. package/lib/heatmap/helpers/text.js +91 -0
  204. package/lib/heatmap/helpers/track.d.ts +102 -0
  205. package/lib/heatmap/helpers/track.js +160 -0
  206. package/lib/heatmap/helpers/types.d.ts +40 -0
  207. package/lib/heatmap/helpers/types.js +1 -0
  208. package/lib/heatmap/index.d.ts +453 -0
  209. package/lib/heatmap/index.js +1104 -0
  210. package/lib/heatmap/themes/halo/dark/index.js +4 -0
  211. package/lib/heatmap/themes/halo/light/index.js +4 -0
  212. package/lib/heatmap/themes/solar/charcoal/index.js +4 -0
  213. package/lib/heatmap/themes/solar/pearl/index.js +4 -0
  214. package/lib/icon/custom-elements.json +34 -0
  215. package/lib/icon/index.d.ts +87 -0
  216. package/lib/icon/index.js +161 -0
  217. package/lib/icon/themes/halo/dark/index.js +2 -0
  218. package/lib/icon/themes/halo/light/index.js +2 -0
  219. package/lib/icon/themes/solar/charcoal/index.js +2 -0
  220. package/lib/icon/themes/solar/pearl/index.js +2 -0
  221. package/lib/icon/utils/IconLoader.d.ts +47 -0
  222. package/lib/icon/utils/IconLoader.js +86 -0
  223. package/lib/index.d.ts +2 -0
  224. package/lib/index.js +2 -0
  225. package/lib/interactive-chart/custom-elements.json +86 -0
  226. package/lib/interactive-chart/helpers/merge.d.ts +15 -0
  227. package/lib/interactive-chart/helpers/merge.js +28 -0
  228. package/lib/interactive-chart/helpers/types.d.ts +45 -0
  229. package/lib/interactive-chart/helpers/types.js +6 -0
  230. package/lib/interactive-chart/index.d.ts +380 -0
  231. package/lib/interactive-chart/index.js +1093 -0
  232. package/lib/interactive-chart/themes/halo/dark/index.js +3 -0
  233. package/lib/interactive-chart/themes/halo/light/index.js +3 -0
  234. package/lib/interactive-chart/themes/solar/charcoal/index.js +3 -0
  235. package/lib/interactive-chart/themes/solar/pearl/index.js +3 -0
  236. package/lib/item/custom-elements.json +153 -0
  237. package/lib/item/helpers/types.d.ts +57 -0
  238. package/lib/item/helpers/types.js +1 -0
  239. package/lib/item/index.d.ts +149 -0
  240. package/lib/item/index.js +252 -0
  241. package/lib/item/themes/halo/dark/index.js +4 -0
  242. package/lib/item/themes/halo/light/index.js +4 -0
  243. package/lib/item/themes/solar/charcoal/index.js +4 -0
  244. package/lib/item/themes/solar/pearl/index.js +4 -0
  245. package/lib/jsx.d.ts +223 -0
  246. package/lib/label/custom-elements.json +52 -0
  247. package/lib/label/index.d.ts +102 -0
  248. package/lib/label/index.js +252 -0
  249. package/lib/label/themes/halo/dark/index.js +3 -0
  250. package/lib/label/themes/halo/light/index.js +3 -0
  251. package/lib/label/themes/solar/charcoal/index.js +3 -0
  252. package/lib/label/themes/solar/pearl/index.js +3 -0
  253. package/lib/layout/custom-elements.json +163 -0
  254. package/lib/layout/index.d.ts +107 -0
  255. package/lib/layout/index.js +215 -0
  256. package/lib/layout/themes/halo/dark/index.js +2 -0
  257. package/lib/layout/themes/halo/light/index.js +2 -0
  258. package/lib/layout/themes/solar/charcoal/index.js +2 -0
  259. package/lib/layout/themes/solar/pearl/index.js +2 -0
  260. package/lib/led-gauge/custom-elements.json +113 -0
  261. package/lib/led-gauge/index.d.ts +143 -0
  262. package/lib/led-gauge/index.js +440 -0
  263. package/lib/led-gauge/themes/halo/dark/index.js +3 -0
  264. package/lib/led-gauge/themes/halo/light/index.js +3 -0
  265. package/lib/led-gauge/themes/solar/charcoal/index.js +3 -0
  266. package/lib/led-gauge/themes/solar/pearl/index.js +3 -0
  267. package/lib/list/custom-elements.json +111 -0
  268. package/lib/list/extensible-function.d.ts +8 -0
  269. package/lib/list/extensible-function.js +13 -0
  270. package/lib/list/helpers/list-renderer.d.ts +9 -0
  271. package/lib/list/helpers/list-renderer.js +35 -0
  272. package/lib/list/helpers/types.d.ts +3 -0
  273. package/lib/list/helpers/types.js +1 -0
  274. package/lib/list/index.d.ts +292 -0
  275. package/lib/list/index.js +604 -0
  276. package/lib/list/renderer.d.ts +36 -0
  277. package/lib/list/renderer.js +9 -0
  278. package/lib/list/themes/halo/dark/index.js +3 -0
  279. package/lib/list/themes/halo/light/index.js +3 -0
  280. package/lib/list/themes/solar/charcoal/index.js +3 -0
  281. package/lib/list/themes/solar/pearl/index.js +3 -0
  282. package/lib/loader/custom-elements.json +9 -0
  283. package/lib/loader/index.d.ts +41 -0
  284. package/lib/loader/index.js +65 -0
  285. package/lib/loader/themes/halo/dark/index.js +2 -0
  286. package/lib/loader/themes/halo/light/index.js +2 -0
  287. package/lib/loader/themes/solar/charcoal/index.js +2 -0
  288. package/lib/loader/themes/solar/pearl/index.js +2 -0
  289. package/lib/multi-input/custom-elements.json +238 -0
  290. package/lib/multi-input/helpers/types.d.ts +11 -0
  291. package/lib/multi-input/helpers/types.js +1 -0
  292. package/lib/multi-input/index.d.ts +297 -0
  293. package/lib/multi-input/index.js +591 -0
  294. package/lib/multi-input/themes/halo/dark/index.js +4 -0
  295. package/lib/multi-input/themes/halo/light/index.js +4 -0
  296. package/lib/multi-input/themes/solar/charcoal/index.js +4 -0
  297. package/lib/multi-input/themes/solar/pearl/index.js +4 -0
  298. package/lib/notification/custom-elements.json +95 -0
  299. package/lib/notification/elements/notification-tray.d.ts +97 -0
  300. package/lib/notification/elements/notification-tray.js +170 -0
  301. package/lib/notification/elements/notification.d.ts +90 -0
  302. package/lib/notification/elements/notification.js +157 -0
  303. package/lib/notification/helpers/status.d.ts +30 -0
  304. package/lib/notification/helpers/status.js +130 -0
  305. package/lib/notification/helpers/types.d.ts +10 -0
  306. package/lib/notification/helpers/types.js +1 -0
  307. package/lib/notification/index.d.ts +2 -0
  308. package/lib/notification/index.js +2 -0
  309. package/lib/notification/themes/halo/dark/index.js +5 -0
  310. package/lib/notification/themes/halo/light/index.js +5 -0
  311. package/lib/notification/themes/solar/charcoal/index.js +5 -0
  312. package/lib/notification/themes/solar/pearl/index.js +5 -0
  313. package/lib/number-field/custom-elements.json +200 -0
  314. package/lib/number-field/index.d.ts +294 -0
  315. package/lib/number-field/index.js +708 -0
  316. package/lib/number-field/themes/halo/dark/index.js +3 -0
  317. package/lib/number-field/themes/halo/light/index.js +3 -0
  318. package/lib/number-field/themes/solar/charcoal/index.js +3 -0
  319. package/lib/number-field/themes/solar/pearl/index.js +3 -0
  320. package/lib/overlay/custom-elements.json +342 -0
  321. package/lib/overlay/elements/overlay-backdrop.d.ts +46 -0
  322. package/lib/overlay/elements/overlay-backdrop.js +67 -0
  323. package/lib/overlay/elements/overlay-viewport.d.ts +40 -0
  324. package/lib/overlay/elements/overlay-viewport.js +56 -0
  325. package/lib/overlay/elements/overlay.d.ts +403 -0
  326. package/lib/overlay/elements/overlay.js +1427 -0
  327. package/lib/overlay/helpers/functions.d.ts +13 -0
  328. package/lib/overlay/helpers/functions.js +16 -0
  329. package/lib/overlay/helpers/types.d.ts +97 -0
  330. package/lib/overlay/helpers/types.js +16 -0
  331. package/lib/overlay/index.d.ts +2 -0
  332. package/lib/overlay/index.js +1 -0
  333. package/lib/overlay/managers/backdrop-manager.d.ts +45 -0
  334. package/lib/overlay/managers/backdrop-manager.js +96 -0
  335. package/lib/overlay/managers/close-manager.d.ts +54 -0
  336. package/lib/overlay/managers/close-manager.js +138 -0
  337. package/lib/overlay/managers/focus-manager.d.ts +71 -0
  338. package/lib/overlay/managers/focus-manager.js +228 -0
  339. package/lib/overlay/managers/interaction-lock-manager.d.ts +138 -0
  340. package/lib/overlay/managers/interaction-lock-manager.js +375 -0
  341. package/lib/overlay/managers/viewport-manager.d.ts +93 -0
  342. package/lib/overlay/managers/viewport-manager.js +207 -0
  343. package/lib/overlay/managers/zindex-manager.d.ts +80 -0
  344. package/lib/overlay/managers/zindex-manager.js +195 -0
  345. package/lib/overlay/themes/halo/dark/index.js +4 -0
  346. package/lib/overlay/themes/halo/light/index.js +4 -0
  347. package/lib/overlay/themes/solar/charcoal/index.js +4 -0
  348. package/lib/overlay/themes/solar/pearl/index.js +4 -0
  349. package/lib/overlay-menu/custom-elements.json +196 -0
  350. package/lib/overlay-menu/helpers/types.d.ts +8 -0
  351. package/lib/overlay-menu/helpers/types.js +1 -0
  352. package/lib/overlay-menu/helpers/uuid.d.ts +7 -0
  353. package/lib/overlay-menu/helpers/uuid.js +13 -0
  354. package/lib/overlay-menu/index.d.ts +380 -0
  355. package/lib/overlay-menu/index.js +921 -0
  356. package/lib/overlay-menu/managers/menu-manager.d.ts +98 -0
  357. package/lib/overlay-menu/managers/menu-manager.js +240 -0
  358. package/lib/overlay-menu/themes/halo/dark/index.js +5 -0
  359. package/lib/overlay-menu/themes/halo/light/index.js +5 -0
  360. package/lib/overlay-menu/themes/solar/charcoal/index.js +5 -0
  361. package/lib/overlay-menu/themes/solar/pearl/index.js +5 -0
  362. package/lib/pagination/custom-elements.json +93 -0
  363. package/lib/pagination/helpers/types.d.ts +9 -0
  364. package/lib/pagination/helpers/types.js +1 -0
  365. package/lib/pagination/index.d.ts +207 -0
  366. package/lib/pagination/index.js +400 -0
  367. package/lib/pagination/themes/halo/dark/index.js +6 -0
  368. package/lib/pagination/themes/halo/light/index.js +6 -0
  369. package/lib/pagination/themes/solar/charcoal/index.js +6 -0
  370. package/lib/pagination/themes/solar/pearl/index.js +6 -0
  371. package/lib/panel/custom-elements.json +39 -0
  372. package/lib/panel/index.d.ts +48 -0
  373. package/lib/panel/index.js +77 -0
  374. package/lib/panel/themes/halo/dark/index.js +2 -0
  375. package/lib/panel/themes/halo/light/index.js +2 -0
  376. package/lib/panel/themes/solar/charcoal/index.js +2 -0
  377. package/lib/panel/themes/solar/pearl/index.js +2 -0
  378. package/lib/password-field/custom-elements.json +156 -0
  379. package/lib/password-field/index.d.ts +140 -0
  380. package/lib/password-field/index.js +258 -0
  381. package/lib/password-field/themes/halo/dark/index.js +3 -0
  382. package/lib/password-field/themes/halo/light/index.js +3 -0
  383. package/lib/password-field/themes/solar/charcoal/index.js +3 -0
  384. package/lib/password-field/themes/solar/pearl/index.js +3 -0
  385. package/lib/pill/custom-elements.json +95 -0
  386. package/lib/pill/index.d.ts +97 -0
  387. package/lib/pill/index.js +162 -0
  388. package/lib/pill/themes/halo/dark/index.js +3 -0
  389. package/lib/pill/themes/halo/light/index.js +3 -0
  390. package/lib/pill/themes/solar/charcoal/index.js +3 -0
  391. package/lib/pill/themes/solar/pearl/index.js +3 -0
  392. package/lib/progress-bar/custom-elements.json +58 -0
  393. package/lib/progress-bar/index.d.ts +82 -0
  394. package/lib/progress-bar/index.js +159 -0
  395. package/lib/progress-bar/themes/halo/dark/index.js +2 -0
  396. package/lib/progress-bar/themes/halo/light/index.js +2 -0
  397. package/lib/progress-bar/themes/solar/charcoal/index.js +2 -0
  398. package/lib/progress-bar/themes/solar/pearl/index.js +2 -0
  399. package/lib/radio-button/custom-elements.json +84 -0
  400. package/lib/radio-button/index.d.ts +106 -0
  401. package/lib/radio-button/index.js +195 -0
  402. package/lib/radio-button/radio-button-registry.d.ts +21 -0
  403. package/lib/radio-button/radio-button-registry.js +40 -0
  404. package/lib/radio-button/themes/halo/dark/index.js +3 -0
  405. package/lib/radio-button/themes/halo/light/index.js +3 -0
  406. package/lib/radio-button/themes/solar/charcoal/index.js +3 -0
  407. package/lib/radio-button/themes/solar/pearl/index.js +3 -0
  408. package/lib/rating/custom-elements.json +58 -0
  409. package/lib/rating/index.d.ts +91 -0
  410. package/lib/rating/index.js +158 -0
  411. package/lib/rating/themes/halo/dark/index.js +2 -0
  412. package/lib/rating/themes/halo/light/index.js +2 -0
  413. package/lib/rating/themes/solar/charcoal/index.js +2 -0
  414. package/lib/rating/themes/solar/pearl/index.js +2 -0
  415. package/lib/search-field/custom-elements.json +173 -0
  416. package/lib/search-field/index.d.ts +134 -0
  417. package/lib/search-field/index.js +254 -0
  418. package/lib/search-field/themes/halo/dark/index.js +3 -0
  419. package/lib/search-field/themes/halo/light/index.js +3 -0
  420. package/lib/search-field/themes/solar/charcoal/index.js +3 -0
  421. package/lib/search-field/themes/solar/pearl/index.js +3 -0
  422. package/lib/select/custom-elements.json +103 -0
  423. package/lib/select/helpers/types.d.ts +3 -0
  424. package/lib/select/helpers/types.js +1 -0
  425. package/lib/select/index.d.ts +388 -0
  426. package/lib/select/index.js +942 -0
  427. package/lib/select/themes/halo/dark/index.js +5 -0
  428. package/lib/select/themes/halo/light/index.js +5 -0
  429. package/lib/select/themes/solar/charcoal/index.js +5 -0
  430. package/lib/select/themes/solar/pearl/index.js +5 -0
  431. package/lib/sidebar-layout/custom-elements.json +72 -0
  432. package/lib/sidebar-layout/index.d.ts +69 -0
  433. package/lib/sidebar-layout/index.js +135 -0
  434. package/lib/sidebar-layout/themes/halo/dark/index.js +3 -0
  435. package/lib/sidebar-layout/themes/halo/light/index.js +3 -0
  436. package/lib/sidebar-layout/themes/solar/charcoal/index.js +3 -0
  437. package/lib/sidebar-layout/themes/solar/pearl/index.js +3 -0
  438. package/lib/slider/custom-elements.json +181 -0
  439. package/lib/slider/index.d.ts +409 -0
  440. package/lib/slider/index.js +1188 -0
  441. package/lib/slider/themes/halo/dark/index.js +3 -0
  442. package/lib/slider/themes/halo/light/index.js +3 -0
  443. package/lib/slider/themes/solar/charcoal/index.js +3 -0
  444. package/lib/slider/themes/solar/pearl/index.js +3 -0
  445. package/lib/sparkline/custom-elements.json +59 -0
  446. package/lib/sparkline/index.d.ts +107 -0
  447. package/lib/sparkline/index.js +188 -0
  448. package/lib/sparkline/themes/halo/dark/index.js +2 -0
  449. package/lib/sparkline/themes/halo/light/index.js +2 -0
  450. package/lib/sparkline/themes/solar/charcoal/index.js +2 -0
  451. package/lib/sparkline/themes/solar/pearl/index.js +2 -0
  452. package/lib/swing-gauge/const.d.ts +22 -0
  453. package/lib/swing-gauge/const.js +26 -0
  454. package/lib/swing-gauge/custom-elements.json +109 -0
  455. package/lib/swing-gauge/helpers.d.ts +8 -0
  456. package/lib/swing-gauge/helpers.js +105 -0
  457. package/lib/swing-gauge/index.d.ts +294 -0
  458. package/lib/swing-gauge/index.js +762 -0
  459. package/lib/swing-gauge/themes/halo/dark/index.js +3 -0
  460. package/lib/swing-gauge/themes/halo/light/index.js +3 -0
  461. package/lib/swing-gauge/themes/solar/charcoal/index.js +3 -0
  462. package/lib/swing-gauge/themes/solar/pearl/index.js +3 -0
  463. package/lib/swing-gauge/types.d.ts +34 -0
  464. package/lib/swing-gauge/types.js +1 -0
  465. package/lib/tab/custom-elements.json +123 -0
  466. package/lib/tab/index.d.ts +118 -0
  467. package/lib/tab/index.js +211 -0
  468. package/lib/tab/themes/halo/dark/index.js +4 -0
  469. package/lib/tab/themes/halo/light/index.js +4 -0
  470. package/lib/tab/themes/solar/charcoal/index.js +4 -0
  471. package/lib/tab/themes/solar/pearl/index.js +4 -0
  472. package/lib/tab-bar/custom-elements.json +52 -0
  473. package/lib/tab-bar/helpers/animate.d.ts +16 -0
  474. package/lib/tab-bar/helpers/animate.js +53 -0
  475. package/lib/tab-bar/index.d.ts +108 -0
  476. package/lib/tab-bar/index.js +220 -0
  477. package/lib/tab-bar/themes/halo/dark/index.js +4 -0
  478. package/lib/tab-bar/themes/halo/light/index.js +4 -0
  479. package/lib/tab-bar/themes/solar/charcoal/index.js +4 -0
  480. package/lib/tab-bar/themes/solar/pearl/index.js +4 -0
  481. package/lib/text-field/custom-elements.json +210 -0
  482. package/lib/text-field/index.d.ts +171 -0
  483. package/lib/text-field/index.js +319 -0
  484. package/lib/text-field/themes/halo/dark/index.js +3 -0
  485. package/lib/text-field/themes/halo/light/index.js +3 -0
  486. package/lib/text-field/themes/solar/charcoal/index.js +3 -0
  487. package/lib/text-field/themes/solar/pearl/index.js +3 -0
  488. package/lib/time-picker/custom-elements.json +124 -0
  489. package/lib/time-picker/index.d.ts +379 -0
  490. package/lib/time-picker/index.js +777 -0
  491. package/lib/time-picker/themes/halo/dark/index.js +4 -0
  492. package/lib/time-picker/themes/halo/light/index.js +4 -0
  493. package/lib/time-picker/themes/solar/charcoal/index.js +4 -0
  494. package/lib/time-picker/themes/solar/pearl/index.js +4 -0
  495. package/lib/toggle/custom-elements.json +84 -0
  496. package/lib/toggle/index.d.ts +77 -0
  497. package/lib/toggle/index.js +134 -0
  498. package/lib/toggle/themes/halo/dark/index.js +2 -0
  499. package/lib/toggle/themes/halo/light/index.js +2 -0
  500. package/lib/toggle/themes/solar/charcoal/index.js +2 -0
  501. package/lib/toggle/themes/solar/pearl/index.js +2 -0
  502. package/lib/tooltip/custom-elements.json +62 -0
  503. package/lib/tooltip/elements/title-tooltip.d.ts +1 -0
  504. package/lib/tooltip/elements/title-tooltip.js +18 -0
  505. package/lib/tooltip/elements/tooltip-element.d.ts +21 -0
  506. package/lib/tooltip/elements/tooltip-element.js +54 -0
  507. package/lib/tooltip/helpers/overflow-tooltip.d.ts +9 -0
  508. package/lib/tooltip/helpers/overflow-tooltip.js +19 -0
  509. package/lib/tooltip/helpers/renderer.d.ts +8 -0
  510. package/lib/tooltip/helpers/renderer.js +11 -0
  511. package/lib/tooltip/helpers/types.d.ts +23 -0
  512. package/lib/tooltip/helpers/types.js +1 -0
  513. package/lib/tooltip/index.d.ts +232 -0
  514. package/lib/tooltip/index.js +479 -0
  515. package/lib/tooltip/managers/tooltip-manager.d.ts +15 -0
  516. package/lib/tooltip/managers/tooltip-manager.js +144 -0
  517. package/lib/tooltip/themes/halo/dark/index.js +3 -0
  518. package/lib/tooltip/themes/halo/light/index.js +3 -0
  519. package/lib/tooltip/themes/solar/charcoal/index.js +3 -0
  520. package/lib/tooltip/themes/solar/pearl/index.js +3 -0
  521. package/lib/tornado-chart/custom-elements.json +45 -0
  522. package/lib/tornado-chart/elements/tornado-chart.d.ts +78 -0
  523. package/lib/tornado-chart/elements/tornado-chart.js +125 -0
  524. package/lib/tornado-chart/elements/tornado-item.d.ts +110 -0
  525. package/lib/tornado-chart/elements/tornado-item.js +209 -0
  526. package/lib/tornado-chart/index.d.ts +2 -0
  527. package/lib/tornado-chart/index.js +2 -0
  528. package/lib/tornado-chart/themes/halo/dark/index.js +6 -0
  529. package/lib/tornado-chart/themes/halo/light/index.js +6 -0
  530. package/lib/tornado-chart/themes/solar/charcoal/index.js +6 -0
  531. package/lib/tornado-chart/themes/solar/pearl/index.js +6 -0
  532. package/lib/tree/custom-elements.json +100 -0
  533. package/lib/tree/elements/tree-item.d.ts +96 -0
  534. package/lib/tree/elements/tree-item.js +182 -0
  535. package/lib/tree/elements/tree.d.ts +156 -0
  536. package/lib/tree/elements/tree.js +286 -0
  537. package/lib/tree/helpers/renderer.d.ts +5 -0
  538. package/lib/tree/helpers/renderer.js +33 -0
  539. package/lib/tree/helpers/types.d.ts +17 -0
  540. package/lib/tree/helpers/types.js +1 -0
  541. package/lib/tree/index.d.ts +4 -0
  542. package/lib/tree/index.js +3 -0
  543. package/lib/tree/managers/tree-manager.d.ts +236 -0
  544. package/lib/tree/managers/tree-manager.js +379 -0
  545. package/lib/tree/themes/halo/dark/index.js +7 -0
  546. package/lib/tree/themes/halo/light/index.js +7 -0
  547. package/lib/tree/themes/solar/charcoal/index.js +7 -0
  548. package/lib/tree/themes/solar/pearl/index.js +7 -0
  549. package/lib/tree-select/custom-elements.json +107 -0
  550. package/lib/tree-select/helpers/types.d.ts +4 -0
  551. package/lib/tree-select/helpers/types.js +1 -0
  552. package/lib/tree-select/index.d.ts +400 -0
  553. package/lib/tree-select/index.js +881 -0
  554. package/lib/tree-select/themes/halo/dark/index.js +12 -0
  555. package/lib/tree-select/themes/halo/light/index.js +12 -0
  556. package/lib/tree-select/themes/solar/charcoal/index.js +12 -0
  557. package/lib/tree-select/themes/solar/pearl/index.js +12 -0
  558. package/package.json +9 -9
@@ -0,0 +1,232 @@
1
+ import { JSXInterface } from '../jsx';
2
+ import { BasicElement, TemplateResult, CSSResult, PropertyValues } from '@refinitiv-ui/core';
3
+ import '../overlay';
4
+ import { OverlayTransitionStyle as TooltipTransitionStyle } from '../overlay';
5
+ import './elements/title-tooltip';
6
+ import { TooltipCondition, TooltipRenderer, TooltipPosition } from './helpers/types';
7
+ import { register as registerOverflowTooltip } from './helpers/overflow-tooltip';
8
+ /**
9
+ * Tooltip displays extra information when the
10
+ * user hovers the pointer over an item.
11
+ */
12
+ declare class Tooltip extends BasicElement {
13
+ /**
14
+ * Element version number
15
+ * @returns version number
16
+ */
17
+ static get version(): string;
18
+ private matchTarget;
19
+ private matchTargetRect;
20
+ private showDelay;
21
+ private hideDelay;
22
+ private clicked;
23
+ private timerTimeout?;
24
+ private contentNodes?;
25
+ /**
26
+ * A `CSSResult` that will be used
27
+ * to style the host, slotted children
28
+ * and the internal template of the element.
29
+ * @return CSS template
30
+ */
31
+ static get styles(): CSSResult | CSSResult[];
32
+ /**
33
+ * True if an element is an iframe
34
+ * @param relatedTarget Element to check
35
+ * @returns isIframe
36
+ */
37
+ private static isIframe;
38
+ /**
39
+ * Check if the match target has moved position
40
+ * @param matchTargetRect Match target rect
41
+ * @param lastMatchTarget Previous match target
42
+ * @returns matches
43
+ */
44
+ private static elementHasMoved;
45
+ /**
46
+ * CSS selector to match the tooltip
47
+ */
48
+ selector: string;
49
+ /**
50
+ * Provide a function to test against the target.
51
+ * Return `true` if the target matches
52
+ * @type {TooltipCondition}
53
+ */
54
+ condition: TooltipCondition | undefined;
55
+ /**
56
+ * A renderer to define tooltip internal content.
57
+ * Return undefined, `String`, `HTMLElement` or `DocumentFragment`.
58
+ * If the content is not present, tooltip will not be displayed
59
+ * @type {TooltipRenderer}
60
+ */
61
+ renderer: TooltipRenderer | undefined;
62
+ /**
63
+ * The position of the tooltip. Use the following values:
64
+ * `auto` (default) - display based on mouse enter coordinates
65
+ * `above` - display above the element
66
+ * `right` - display to the right of the element
67
+ * `below` - display beneath the element
68
+ * `left` - display to the left of the element
69
+ */
70
+ position: 'auto' | 'above' | 'right' | 'below' | 'left';
71
+ /**
72
+ * Set the transition style.
73
+ * Value can be `fade`, `zoom`, `slide-down`, `slide-up`, `slide-right`,
74
+ * `slide-left`, `slide-right-down`, `slide-right-up`, `slide-left-down`, `slide-left-up`, or null in case of no transition
75
+ * @type {TooltipTransitionStyle}
76
+ */
77
+ transitionStyle: TooltipTransitionStyle | null;
78
+ /**
79
+ * Get tooltip popup window
80
+ * Used for testing and legacy
81
+ */
82
+ private tooltip;
83
+ /**
84
+ * Get position adjuster element.
85
+ * Used to adjust offsets if transforms are used
86
+ */
87
+ private positionAdjusterEl;
88
+ private contentSlot;
89
+ private _x;
90
+ /**
91
+ * Set tooltip y coordinate
92
+ * @param x X coordinate
93
+ */
94
+ private set x(value);
95
+ private _y;
96
+ /**
97
+ * Set tooltip y coordinate
98
+ * @param y Y coordinate
99
+ */
100
+ private set y(value);
101
+ private _positionTarget;
102
+ /**
103
+ * Set tooltip position target
104
+ * @param positionTarget Position target
105
+ */
106
+ private set positionTarget(value);
107
+ private _opened;
108
+ /**
109
+ * Run when opened attribute has changed. Map to popup window
110
+ * @param opened True if popup should be opened
111
+ * @returns {void}
112
+ */
113
+ private setOpened;
114
+ connectedCallback(): void;
115
+ disconnectedCallback(): void;
116
+ protected firstUpdated(changedProperties: PropertyValues): void;
117
+ /**
118
+ * Clear all timers
119
+ * @returns {void}
120
+ */
121
+ private reset;
122
+ /**
123
+ * Check whether an element matches by condition
124
+ * If condition is not defined, checks by CSS selector
125
+ * @param element Element to check
126
+ * @param paths Event paths
127
+ * @returns true if element matches
128
+ */
129
+ private isMatchElement;
130
+ /**
131
+ * Return true if the target matches condition. False otherwise
132
+ * @param paths Target to match against
133
+ * @returns matched element or null
134
+ */
135
+ private getMatchedElement;
136
+ /**
137
+ * Check if the autosuggest has content
138
+ * @returns {Boolean} content exists
139
+ * @private
140
+ */
141
+ private hasSlotContent;
142
+ /**
143
+ * Get content off the target element
144
+ * @param target Target to check against
145
+ * @returns contentNode or null
146
+ */
147
+ private getContentNode;
148
+ /**
149
+ * Render content based on render to tooltip
150
+ * @param contentNode Content node to set
151
+ * @returns {void}
152
+ */
153
+ private renderContentNode;
154
+ /**
155
+ * Hide tooltip
156
+ * @returns {void}
157
+ */
158
+ private hideTooltip;
159
+ /**
160
+ * Reset tooltip
161
+ * @returns {void}
162
+ */
163
+ private resetTooltip;
164
+ /**
165
+ * Run when mouse is moving over the document
166
+ * @param event Mouse move event
167
+ * @param paths Event paths
168
+ * @returns {void}
169
+ */
170
+ private onMouseMove;
171
+ /**
172
+ * Try to show the tooltip if it matches the target
173
+ * @param paths The paths leading to target
174
+ * @param x X mouse coordinate
175
+ * @param y Y mouse coordinate
176
+ * @returns {void}
177
+ */
178
+ private showTooltip;
179
+ /**
180
+ * Get the delay to show tooltip
181
+ */
182
+ private get getTooltipShowDelay();
183
+ /**
184
+ * Show the tooltip corresponding to the correct position
185
+ * @param matchTarget Target to show the tooltip against
186
+ * @param x X coordinate
187
+ * @param y Y coordinate
188
+ * @returns {void}
189
+ */
190
+ private showTooltipAtPosition;
191
+ /**
192
+ * Run when document click or contextmenu event happens
193
+ * @returns {void}
194
+ */
195
+ private onClick;
196
+ /**
197
+ * Run when document mouse out event happens
198
+ * @returns {void}
199
+ */
200
+ private onMouseOut;
201
+ /**
202
+ * Get popup position based on tooltip position
203
+ */
204
+ private get tipPosition();
205
+ /**
206
+ * A `TemplateResult` that will be used
207
+ * to render the updated internal template.
208
+ * @returns Render template
209
+ */
210
+ protected render(): TemplateResult;
211
+ /**
212
+ * true if tooltip is opened, false otherwise
213
+ * @returns opened
214
+ */
215
+ private get opened();
216
+ }
217
+ export * from './elements/tooltip-element';
218
+ export { registerOverflowTooltip, Tooltip, TooltipCondition, TooltipRenderer, TooltipPosition, TooltipTransitionStyle };
219
+
220
+ declare global {
221
+ interface HTMLElementTagNameMap {
222
+ 'ef-tooltip': Tooltip;
223
+ }
224
+
225
+ namespace JSX {
226
+ interface IntrinsicElements {
227
+ 'ef-tooltip': Partial<Tooltip> | JSXInterface.HTMLAttributes<Tooltip>;
228
+ }
229
+ }
230
+ }
231
+
232
+ export {};
@@ -0,0 +1,479 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var Tooltip_1;
8
+ import { BasicElement, html, css, customElement, property, query, matches } from '@refinitiv-ui/core';
9
+ import { isSlotEmpty } from '@refinitiv-ui/utils';
10
+ import '../overlay';
11
+ import './elements/title-tooltip';
12
+ import { register, deregister } from './managers/tooltip-manager';
13
+ import { tooltipRenderer } from './helpers/renderer';
14
+ import { register as registerOverflowTooltip } from './helpers/overflow-tooltip';
15
+ import { VERSION } from '../';
16
+ const TooltipPositionMap = {
17
+ 'auto': ['bottom-start', 'top-start'],
18
+ 'above': ['top-middle'],
19
+ 'right': ['right-middle'],
20
+ 'below': ['bottom-middle'],
21
+ 'left': ['left-middle']
22
+ };
23
+ /**
24
+ * Tooltip displays extra information when the
25
+ * user hovers the pointer over an item.
26
+ */
27
+ let Tooltip = Tooltip_1 = class Tooltip extends BasicElement {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.matchTarget = null;
31
+ this.matchTargetRect = null;
32
+ this.showDelay = 300;
33
+ this.hideDelay = 150;
34
+ this.clicked = false;
35
+ /**
36
+ * CSS selector to match the tooltip
37
+ */
38
+ this.selector = '';
39
+ /**
40
+ * The position of the tooltip. Use the following values:
41
+ * `auto` (default) - display based on mouse enter coordinates
42
+ * `above` - display above the element
43
+ * `right` - display to the right of the element
44
+ * `below` - display beneath the element
45
+ * `left` - display to the left of the element
46
+ */
47
+ this.position = 'auto';
48
+ /**
49
+ * Set the transition style.
50
+ * Value can be `fade`, `zoom`, `slide-down`, `slide-up`, `slide-right`,
51
+ * `slide-left`, `slide-right-down`, `slide-right-up`, `slide-left-down`, `slide-left-up`, or null in case of no transition
52
+ * @type {TooltipTransitionStyle}
53
+ */
54
+ this.transitionStyle = 'fade';
55
+ this._x = 0;
56
+ this._y = 0;
57
+ this._positionTarget = null;
58
+ this._opened = false;
59
+ /**
60
+ * Clear all timers
61
+ * @returns {void}
62
+ */
63
+ this.reset = () => {
64
+ window.clearTimeout(this.timerTimeout);
65
+ };
66
+ /**
67
+ * Reset tooltip
68
+ * @returns {void}
69
+ */
70
+ this.resetTooltip = () => {
71
+ this.hideTooltip();
72
+ };
73
+ /**
74
+ * Run when mouse is moving over the document
75
+ * @param event Mouse move event
76
+ * @param paths Event paths
77
+ * @returns {void}
78
+ */
79
+ this.onMouseMove = (event, paths) => {
80
+ this.showTooltip(paths, event.clientX, event.clientY);
81
+ };
82
+ /**
83
+ * Run when document click or contextmenu event happens
84
+ * @returns {void}
85
+ */
86
+ this.onClick = () => {
87
+ this.clicked = true;
88
+ this.hideTooltip();
89
+ };
90
+ /**
91
+ * Run when document mouse out event happens
92
+ * @returns {void}
93
+ */
94
+ this.onMouseOut = ({ relatedTarget }) => {
95
+ // document mouesemove, mouseleave and blur are not fired over iframe
96
+ // therefore create a special case for iframe to hide the tooltip
97
+ /* istanbul ignore next */
98
+ if (Tooltip_1.isIframe(relatedTarget)) {
99
+ this.resetTooltip();
100
+ }
101
+ };
102
+ }
103
+ /**
104
+ * Element version number
105
+ * @returns version number
106
+ */
107
+ static get version() {
108
+ return VERSION;
109
+ }
110
+ /**
111
+ * A `CSSResult` that will be used
112
+ * to style the host, slotted children
113
+ * and the internal template of the element.
114
+ * @return CSS template
115
+ */
116
+ static get styles() {
117
+ return css `
118
+ :host {
119
+ display: contents;
120
+ position: absolute;
121
+ max-width: 0;
122
+ max-height: 0;
123
+ min-width: 0;
124
+ min-height: 0;
125
+ flex: none;
126
+ visibility: hidden;
127
+ }
128
+ [part=tooltip] {
129
+ visibility: visible;
130
+ overflow: visible;
131
+ }
132
+ [part=position-adjuster] {
133
+ position: fixed;
134
+ z-index: -1;
135
+ top: 0;
136
+ left: 0;
137
+ visibility: hidden;
138
+ }
139
+ `;
140
+ }
141
+ /**
142
+ * True if an element is an iframe
143
+ * @param relatedTarget Element to check
144
+ * @returns isIframe
145
+ */
146
+ static isIframe(relatedTarget) {
147
+ return relatedTarget !== null && relatedTarget.localName === 'iframe';
148
+ }
149
+ /**
150
+ * Check if the match target has moved position
151
+ * @param matchTargetRect Match target rect
152
+ * @param lastMatchTarget Previous match target
153
+ * @returns matches
154
+ */
155
+ static elementHasMoved(matchTargetRect, lastMatchTarget) {
156
+ if (lastMatchTarget === null) {
157
+ return true;
158
+ }
159
+ return lastMatchTarget.top !== matchTargetRect.top || lastMatchTarget.left !== matchTargetRect.left;
160
+ }
161
+ /**
162
+ * Set tooltip y coordinate
163
+ * @param x X coordinate
164
+ */
165
+ set x(x) {
166
+ const oldX = this._x;
167
+ if (oldX !== x) {
168
+ this._x = x;
169
+ void this.requestUpdate('x', oldX);
170
+ }
171
+ }
172
+ /**
173
+ * Set tooltip y coordinate
174
+ * @param y Y coordinate
175
+ */
176
+ set y(y) {
177
+ const oldY = this._y;
178
+ if (oldY !== y) {
179
+ this._y = y;
180
+ void this.requestUpdate('y', oldY);
181
+ }
182
+ }
183
+ /**
184
+ * Set tooltip position target
185
+ * @param positionTarget Position target
186
+ */
187
+ set positionTarget(positionTarget) {
188
+ const oldPositionTarget = this._positionTarget;
189
+ if (positionTarget !== oldPositionTarget) {
190
+ this._positionTarget = positionTarget;
191
+ void this.requestUpdate('positionTarget', oldPositionTarget);
192
+ }
193
+ }
194
+ /**
195
+ * Run when opened attribute has changed. Map to popup window
196
+ * @param opened True if popup should be opened
197
+ * @returns {void}
198
+ */
199
+ setOpened(opened) {
200
+ const oldOpened = this._opened;
201
+ if (oldOpened !== opened) {
202
+ this._opened = opened;
203
+ void this.requestUpdate('opened', oldOpened);
204
+ }
205
+ }
206
+ connectedCallback() {
207
+ super.connectedCallback();
208
+ register(this, {
209
+ mousemove: this.reset,
210
+ mousemoveThrottled: this.onMouseMove,
211
+ click: this.onClick,
212
+ mouseout: this.onMouseOut,
213
+ mouseleave: this.resetTooltip,
214
+ wheel: this.resetTooltip,
215
+ keydown: this.resetTooltip,
216
+ blur: this.resetTooltip
217
+ });
218
+ }
219
+ disconnectedCallback() {
220
+ deregister(this);
221
+ this.setOpened(false);
222
+ this.reset();
223
+ this.matchTarget = null;
224
+ this.matchTargetRect = null;
225
+ this.positionTarget = null;
226
+ super.disconnectedCallback();
227
+ }
228
+ firstUpdated(changedProperties) {
229
+ super.firstUpdated(changedProperties);
230
+ this.showDelay = parseInt(this.getComputedVariable('--show-delay', '300'), 10);
231
+ this.hideDelay = parseInt(this.getComputedVariable('--hide-delay', '150'), 10);
232
+ }
233
+ /**
234
+ * Check whether an element matches by condition
235
+ * If condition is not defined, checks by CSS selector
236
+ * @param element Element to check
237
+ * @param paths Event paths
238
+ * @returns true if element matches
239
+ */
240
+ isMatchElement(element, paths) {
241
+ if (this.condition) {
242
+ return this.condition(element, paths);
243
+ }
244
+ if (this.selector) {
245
+ return matches(element, this.selector);
246
+ }
247
+ return false;
248
+ }
249
+ /**
250
+ * Return true if the target matches condition. False otherwise
251
+ * @param paths Target to match against
252
+ * @returns matched element or null
253
+ */
254
+ getMatchedElement(paths) {
255
+ if (!this.condition && !this.selector) {
256
+ return null;
257
+ }
258
+ const l = paths.length;
259
+ for (let i = 0; i < l; i += 1) {
260
+ const node = paths[i];
261
+ if (node.nodeType !== Node.ELEMENT_NODE) {
262
+ continue;
263
+ }
264
+ if (node === document.body || node === document.documentElement) {
265
+ return null;
266
+ }
267
+ const element = node;
268
+ if (this.isMatchElement(element, paths)) {
269
+ return element;
270
+ }
271
+ }
272
+ return null;
273
+ }
274
+ /**
275
+ * Check if the autosuggest has content
276
+ * @returns {Boolean} content exists
277
+ * @private
278
+ */
279
+ hasSlotContent() {
280
+ if (this.contentNodes) {
281
+ /* show the slot. Default slotted content cannot work with tooltip or renderer */
282
+ return false;
283
+ }
284
+ return isSlotEmpty(this.contentSlot);
285
+ }
286
+ /**
287
+ * Get content off the target element
288
+ * @param target Target to check against
289
+ * @returns contentNode or null
290
+ */
291
+ getContentNode(target) {
292
+ let content;
293
+ if (typeof this.renderer === 'function') {
294
+ content = this.renderer(target);
295
+ }
296
+ else {
297
+ content = tooltipRenderer(target);
298
+ }
299
+ if (typeof content === 'string' && content) {
300
+ return document.createTextNode(content);
301
+ }
302
+ if (content instanceof HTMLElement) {
303
+ return content.cloneNode(true);
304
+ }
305
+ if (content instanceof DocumentFragment) {
306
+ return content.cloneNode(true);
307
+ }
308
+ return null;
309
+ }
310
+ /**
311
+ * Render content based on render to tooltip
312
+ * @param contentNode Content node to set
313
+ * @returns {void}
314
+ */
315
+ renderContentNode(contentNode) {
316
+ var _a;
317
+ if (contentNode instanceof Text && this.textContent === contentNode.textContent) {
318
+ return; /* Do not re-render the same text. Due to IE11 limitation we have to operate with text nodes */
319
+ }
320
+ if ((_a = this.contentNodes) === null || _a === void 0 ? void 0 : _a.length) {
321
+ this.contentNodes.forEach((node) => {
322
+ var _a;
323
+ (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(node);
324
+ });
325
+ }
326
+ if (contentNode instanceof DocumentFragment) {
327
+ this.contentNodes = [...contentNode.childNodes];
328
+ }
329
+ else {
330
+ this.contentNodes = [contentNode];
331
+ }
332
+ this.appendChild(contentNode);
333
+ }
334
+ /**
335
+ * Hide tooltip
336
+ * @returns {void}
337
+ */
338
+ hideTooltip() {
339
+ this.reset();
340
+ this.matchTarget = null;
341
+ this.matchTargetRect = null;
342
+ this.positionTarget = null;
343
+ this.setOpened(false);
344
+ }
345
+ /**
346
+ * Try to show the tooltip if it matches the target
347
+ * @param paths The paths leading to target
348
+ * @param x X mouse coordinate
349
+ * @param y Y mouse coordinate
350
+ * @returns {void}
351
+ */
352
+ showTooltip(paths, x, y) {
353
+ // composedPath is only available on the direct event
354
+ this.timerTimeout = window.setTimeout(() => {
355
+ const lastMatchTarget = this.matchTarget;
356
+ const matchTarget = this.getMatchedElement(paths);
357
+ this.matchTarget = matchTarget;
358
+ if (!matchTarget) {
359
+ this.setOpened(false);
360
+ return;
361
+ }
362
+ const matchTargetRect = matchTarget.getBoundingClientRect();
363
+ if (lastMatchTarget === matchTarget && !Tooltip_1.elementHasMoved(matchTargetRect, this.matchTargetRect)) {
364
+ return;
365
+ }
366
+ this.matchTargetRect = matchTargetRect;
367
+ this.clicked = false;
368
+ // adjust tooltip x & y vs clientX and clientY
369
+ const adjusterRect = this.positionAdjusterEl.getBoundingClientRect();
370
+ x = adjusterRect.left >= 0 ? x - adjusterRect.left : x;
371
+ y = adjusterRect.top >= 0 ? y - adjusterRect.top : y;
372
+ if (this.hasSlotContent()) {
373
+ this.showTooltipAtPosition(matchTarget, x, y);
374
+ return;
375
+ }
376
+ const contentNode = this.getContentNode(matchTarget);
377
+ if (contentNode) {
378
+ this.renderContentNode(contentNode);
379
+ this.showTooltipAtPosition(matchTarget, x, y);
380
+ return;
381
+ }
382
+ this.setOpened(false);
383
+ }, this.getTooltipShowDelay);
384
+ }
385
+ /**
386
+ * Get the delay to show tooltip
387
+ */
388
+ get getTooltipShowDelay() {
389
+ return this.clicked ? Math.round(this.hideDelay / 2) : this.opened ? this.hideDelay : this.showDelay;
390
+ }
391
+ /**
392
+ * Show the tooltip corresponding to the correct position
393
+ * @param matchTarget Target to show the tooltip against
394
+ * @param x X coordinate
395
+ * @param y Y coordinate
396
+ * @returns {void}
397
+ */
398
+ showTooltipAtPosition(matchTarget, x, y) {
399
+ switch (this.position) {
400
+ case 'above':
401
+ case 'right':
402
+ case 'below':
403
+ case 'left':
404
+ this.x = 0;
405
+ this.y = 0;
406
+ this.positionTarget = matchTarget;
407
+ break;
408
+ default:
409
+ this.positionTarget = null;
410
+ this.x = x;
411
+ this.y = y;
412
+ }
413
+ this.setOpened(true);
414
+ }
415
+ /**
416
+ * Get popup position based on tooltip position
417
+ */
418
+ get tipPosition() {
419
+ return TooltipPositionMap[this.position];
420
+ }
421
+ /**
422
+ * A `TemplateResult` that will be used
423
+ * to render the updated internal template.
424
+ * @returns Render template
425
+ */
426
+ render() {
427
+ return html `<ef-overlay
428
+ part="tooltip"
429
+ .noCancelOnEscKey=${true}
430
+ .noCancelOnOutsideClick=${true}
431
+ .withShadow=${true}
432
+ .noInteractionLock=${true}
433
+ .noFocusManagement=${true}
434
+ ?opened=${this._opened}
435
+ .position=${this.tipPosition}
436
+ .transitionStyle=${this.transitionStyle}
437
+ .positionTarget=${this._positionTarget}
438
+ .x=${this._x}
439
+ .y=${this._y}><slot id="contentSlot"></slot></ef-overlay><div part="position-adjuster"></div>`;
440
+ }
441
+ /**
442
+ * true if tooltip is opened, false otherwise
443
+ * @returns opened
444
+ */
445
+ get opened() {
446
+ return this._opened;
447
+ }
448
+ };
449
+ __decorate([
450
+ property({ type: String })
451
+ ], Tooltip.prototype, "selector", void 0);
452
+ __decorate([
453
+ property({ type: Function, attribute: false })
454
+ ], Tooltip.prototype, "condition", void 0);
455
+ __decorate([
456
+ property({ type: Function, attribute: false })
457
+ ], Tooltip.prototype, "renderer", void 0);
458
+ __decorate([
459
+ property({ type: String })
460
+ ], Tooltip.prototype, "position", void 0);
461
+ __decorate([
462
+ property({ type: String, attribute: 'transition-style' })
463
+ ], Tooltip.prototype, "transitionStyle", void 0);
464
+ __decorate([
465
+ query('[part=tooltip]')
466
+ ], Tooltip.prototype, "tooltip", void 0);
467
+ __decorate([
468
+ query('[part=position-adjuster]')
469
+ ], Tooltip.prototype, "positionAdjusterEl", void 0);
470
+ __decorate([
471
+ query('#contentSlot')
472
+ ], Tooltip.prototype, "contentSlot", void 0);
473
+ Tooltip = Tooltip_1 = __decorate([
474
+ customElement('ef-tooltip', {
475
+ alias: 'coral-tooltip'
476
+ })
477
+ ], Tooltip);
478
+ export * from './elements/tooltip-element';
479
+ export { registerOverflowTooltip, Tooltip };