@refinitiv-ui/elements 5.11.0 → 5.12.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/README.md +4 -4
  2. package/package.json +21 -290
  3. package/lib/accordion/index.d.ts +0 -76
  4. package/lib/accordion/index.js +0 -136
  5. package/lib/accordion/themes/halo/dark/index.js +0 -3
  6. package/lib/accordion/themes/halo/light/index.js +0 -3
  7. package/lib/accordion/themes/solar/charcoal/index.js +0 -3
  8. package/lib/accordion/themes/solar/pearl/index.js +0 -3
  9. package/lib/appstate-bar/index.d.ts +0 -65
  10. package/lib/appstate-bar/index.js +0 -100
  11. package/lib/appstate-bar/themes/halo/dark/index.js +0 -3
  12. package/lib/appstate-bar/themes/halo/light/index.js +0 -3
  13. package/lib/appstate-bar/themes/solar/charcoal/index.js +0 -3
  14. package/lib/appstate-bar/themes/solar/pearl/index.js +0 -3
  15. package/lib/autosuggest/helpers/types.d.ts +0 -54
  16. package/lib/autosuggest/helpers/types.js +0 -1
  17. package/lib/autosuggest/helpers/utils.d.ts +0 -39
  18. package/lib/autosuggest/helpers/utils.js +0 -75
  19. package/lib/autosuggest/index.d.ts +0 -538
  20. package/lib/autosuggest/index.js +0 -1255
  21. package/lib/autosuggest/themes/halo/dark/index.js +0 -5
  22. package/lib/autosuggest/themes/halo/light/index.js +0 -5
  23. package/lib/autosuggest/themes/solar/charcoal/index.js +0 -5
  24. package/lib/autosuggest/themes/solar/pearl/index.js +0 -5
  25. package/lib/button/index.d.ts +0 -132
  26. package/lib/button/index.js +0 -223
  27. package/lib/button/themes/halo/dark/index.js +0 -3
  28. package/lib/button/themes/halo/light/index.js +0 -3
  29. package/lib/button/themes/solar/charcoal/index.js +0 -3
  30. package/lib/button/themes/solar/pearl/index.js +0 -3
  31. package/lib/button-bar/index.d.ts +0 -76
  32. package/lib/button-bar/index.js +0 -155
  33. package/lib/button-bar/themes/halo/dark/index.js +0 -3
  34. package/lib/button-bar/themes/halo/light/index.js +0 -3
  35. package/lib/button-bar/themes/solar/charcoal/index.js +0 -3
  36. package/lib/button-bar/themes/solar/pearl/index.js +0 -3
  37. package/lib/calendar/constants.d.ts +0 -26
  38. package/lib/calendar/constants.js +0 -28
  39. package/lib/calendar/index.d.ts +0 -412
  40. package/lib/calendar/index.js +0 -1274
  41. package/lib/calendar/locales.d.ts +0 -1
  42. package/lib/calendar/locales.js +0 -41
  43. package/lib/calendar/themes/halo/dark/index.js +0 -3
  44. package/lib/calendar/themes/halo/light/index.js +0 -3
  45. package/lib/calendar/themes/solar/charcoal/index.js +0 -3
  46. package/lib/calendar/themes/solar/pearl/index.js +0 -3
  47. package/lib/calendar/types.d.ts +0 -32
  48. package/lib/calendar/types.js +0 -1
  49. package/lib/calendar/utils.d.ts +0 -42
  50. package/lib/calendar/utils.js +0 -120
  51. package/lib/canvas/index.d.ts +0 -101
  52. package/lib/canvas/index.js +0 -173
  53. package/lib/canvas/themes/halo/dark/index.js +0 -2
  54. package/lib/canvas/themes/halo/light/index.js +0 -2
  55. package/lib/canvas/themes/solar/charcoal/index.js +0 -2
  56. package/lib/canvas/themes/solar/pearl/index.js +0 -2
  57. package/lib/card/helpers/types.d.ts +0 -12
  58. package/lib/card/helpers/types.js +0 -1
  59. package/lib/card/index.d.ts +0 -142
  60. package/lib/card/index.js +0 -248
  61. package/lib/card/themes/halo/dark/index.js +0 -5
  62. package/lib/card/themes/halo/light/index.js +0 -5
  63. package/lib/card/themes/solar/charcoal/index.js +0 -5
  64. package/lib/card/themes/solar/pearl/index.js +0 -5
  65. package/lib/chart/helpers/index.d.ts +0 -2
  66. package/lib/chart/helpers/index.js +0 -2
  67. package/lib/chart/helpers/legend.d.ts +0 -5
  68. package/lib/chart/helpers/legend.js +0 -78
  69. package/lib/chart/helpers/merge.d.ts +0 -15
  70. package/lib/chart/helpers/merge.js +0 -28
  71. package/lib/chart/helpers/types.d.ts +0 -69
  72. package/lib/chart/helpers/types.js +0 -1
  73. package/lib/chart/index.d.ts +0 -187
  74. package/lib/chart/index.js +0 -491
  75. package/lib/chart/plugins/doughnut-center-label.d.ts +0 -3
  76. package/lib/chart/plugins/doughnut-center-label.js +0 -196
  77. package/lib/chart/themes/halo/dark/index.js +0 -4
  78. package/lib/chart/themes/halo/light/index.js +0 -4
  79. package/lib/chart/themes/solar/charcoal/index.js +0 -4
  80. package/lib/chart/themes/solar/pearl/index.js +0 -4
  81. package/lib/checkbox/index.d.ts +0 -97
  82. package/lib/checkbox/index.js +0 -194
  83. package/lib/checkbox/themes/halo/dark/index.js +0 -4
  84. package/lib/checkbox/themes/halo/light/index.js +0 -4
  85. package/lib/checkbox/themes/solar/charcoal/index.js +0 -4
  86. package/lib/checkbox/themes/solar/pearl/index.js +0 -4
  87. package/lib/clock/index.d.ts +0 -321
  88. package/lib/clock/index.js +0 -583
  89. package/lib/clock/themes/halo/dark/index.js +0 -2
  90. package/lib/clock/themes/halo/light/index.js +0 -2
  91. package/lib/clock/themes/solar/charcoal/index.js +0 -2
  92. package/lib/clock/themes/solar/pearl/index.js +0 -2
  93. package/lib/clock/utils/TickManager.d.ts +0 -14
  94. package/lib/clock/utils/TickManager.js +0 -66
  95. package/lib/clock/utils/timestamps.d.ts +0 -6
  96. package/lib/clock/utils/timestamps.js +0 -6
  97. package/lib/collapse/index.d.ts +0 -119
  98. package/lib/collapse/index.js +0 -197
  99. package/lib/collapse/themes/halo/dark/index.js +0 -5
  100. package/lib/collapse/themes/halo/light/index.js +0 -5
  101. package/lib/collapse/themes/solar/charcoal/index.js +0 -5
  102. package/lib/collapse/themes/solar/pearl/index.js +0 -5
  103. package/lib/color-dialog/elements/color-palettes.d.ts +0 -52
  104. package/lib/color-dialog/elements/color-palettes.js +0 -101
  105. package/lib/color-dialog/elements/grayscale-palettes.d.ts +0 -67
  106. package/lib/color-dialog/elements/grayscale-palettes.js +0 -161
  107. package/lib/color-dialog/elements/palettes.d.ts +0 -65
  108. package/lib/color-dialog/elements/palettes.js +0 -132
  109. package/lib/color-dialog/helpers/color-helpers.d.ts +0 -16
  110. package/lib/color-dialog/helpers/color-helpers.js +0 -161
  111. package/lib/color-dialog/helpers/value-model.d.ts +0 -75
  112. package/lib/color-dialog/helpers/value-model.js +0 -141
  113. package/lib/color-dialog/index.d.ts +0 -232
  114. package/lib/color-dialog/index.js +0 -459
  115. package/lib/color-dialog/themes/halo/dark/index.js +0 -7
  116. package/lib/color-dialog/themes/halo/light/index.js +0 -7
  117. package/lib/color-dialog/themes/solar/charcoal/index.js +0 -7
  118. package/lib/color-dialog/themes/solar/pearl/index.js +0 -7
  119. package/lib/combo-box/helpers/filter.d.ts +0 -10
  120. package/lib/combo-box/helpers/filter.js +0 -29
  121. package/lib/combo-box/helpers/keyboard-event.d.ts +0 -17
  122. package/lib/combo-box/helpers/keyboard-event.js +0 -19
  123. package/lib/combo-box/helpers/renderer.d.ts +0 -8
  124. package/lib/combo-box/helpers/renderer.js +0 -24
  125. package/lib/combo-box/helpers/types.d.ts +0 -11
  126. package/lib/combo-box/helpers/types.js +0 -1
  127. package/lib/combo-box/index.d.ts +0 -551
  128. package/lib/combo-box/index.js +0 -1183
  129. package/lib/combo-box/themes/halo/dark/index.js +0 -7
  130. package/lib/combo-box/themes/halo/light/index.js +0 -7
  131. package/lib/combo-box/themes/solar/charcoal/index.js +0 -7
  132. package/lib/combo-box/themes/solar/pearl/index.js +0 -7
  133. package/lib/counter/index.d.ts +0 -91
  134. package/lib/counter/index.js +0 -154
  135. package/lib/counter/themes/halo/dark/index.js +0 -3
  136. package/lib/counter/themes/halo/light/index.js +0 -3
  137. package/lib/counter/themes/solar/charcoal/index.js +0 -3
  138. package/lib/counter/themes/solar/pearl/index.js +0 -3
  139. package/lib/counter/utils.d.ts +0 -13
  140. package/lib/counter/utils.js +0 -52
  141. package/lib/datetime-picker/index.d.ts +0 -509
  142. package/lib/datetime-picker/index.js +0 -1175
  143. package/lib/datetime-picker/locales.d.ts +0 -8
  144. package/lib/datetime-picker/locales.js +0 -57
  145. package/lib/datetime-picker/themes/halo/dark/index.js +0 -7
  146. package/lib/datetime-picker/themes/halo/light/index.js +0 -7
  147. package/lib/datetime-picker/themes/solar/charcoal/index.js +0 -7
  148. package/lib/datetime-picker/themes/solar/pearl/index.js +0 -7
  149. package/lib/datetime-picker/types.d.ts +0 -3
  150. package/lib/datetime-picker/types.js +0 -1
  151. package/lib/datetime-picker/utils.d.ts +0 -55
  152. package/lib/datetime-picker/utils.js +0 -92
  153. package/lib/dialog/draggable-element.d.ts +0 -14
  154. package/lib/dialog/draggable-element.js +0 -221
  155. package/lib/dialog/index.d.ts +0 -196
  156. package/lib/dialog/index.js +0 -328
  157. package/lib/dialog/themes/halo/dark/index.js +0 -7
  158. package/lib/dialog/themes/halo/light/index.js +0 -7
  159. package/lib/dialog/themes/solar/charcoal/index.js +0 -7
  160. package/lib/dialog/themes/solar/pearl/index.js +0 -7
  161. package/lib/email-field/index.d.ts +0 -80
  162. package/lib/email-field/index.js +0 -86
  163. package/lib/email-field/themes/halo/dark/index.js +0 -3
  164. package/lib/email-field/themes/halo/light/index.js +0 -3
  165. package/lib/email-field/themes/solar/charcoal/index.js +0 -3
  166. package/lib/email-field/themes/solar/pearl/index.js +0 -3
  167. package/lib/events.d.ts +0 -121
  168. package/lib/events.js +0 -1
  169. package/lib/flag/index.d.ts +0 -96
  170. package/lib/flag/index.js +0 -168
  171. package/lib/flag/themes/halo/dark/index.js +0 -2
  172. package/lib/flag/themes/halo/light/index.js +0 -2
  173. package/lib/flag/themes/solar/charcoal/index.js +0 -2
  174. package/lib/flag/themes/solar/pearl/index.js +0 -2
  175. package/lib/flag/utils/FlagLoader.d.ts +0 -47
  176. package/lib/flag/utils/FlagLoader.js +0 -86
  177. package/lib/header/index.d.ts +0 -46
  178. package/lib/header/index.js +0 -73
  179. package/lib/header/themes/halo/dark/index.js +0 -2
  180. package/lib/header/themes/halo/light/index.js +0 -2
  181. package/lib/header/themes/solar/charcoal/index.js +0 -2
  182. package/lib/header/themes/solar/pearl/index.js +0 -2
  183. package/lib/heatmap/helpers/color.d.ts +0 -30
  184. package/lib/heatmap/helpers/color.js +0 -68
  185. package/lib/heatmap/helpers/text.d.ts +0 -26
  186. package/lib/heatmap/helpers/text.js +0 -91
  187. package/lib/heatmap/helpers/track.d.ts +0 -102
  188. package/lib/heatmap/helpers/track.js +0 -160
  189. package/lib/heatmap/helpers/types.d.ts +0 -40
  190. package/lib/heatmap/helpers/types.js +0 -1
  191. package/lib/heatmap/index.d.ts +0 -453
  192. package/lib/heatmap/index.js +0 -1103
  193. package/lib/heatmap/themes/halo/dark/index.js +0 -4
  194. package/lib/heatmap/themes/halo/light/index.js +0 -4
  195. package/lib/heatmap/themes/solar/charcoal/index.js +0 -4
  196. package/lib/heatmap/themes/solar/pearl/index.js +0 -4
  197. package/lib/icon/index.d.ts +0 -90
  198. package/lib/icon/index.js +0 -171
  199. package/lib/icon/themes/halo/dark/index.js +0 -2
  200. package/lib/icon/themes/halo/light/index.js +0 -2
  201. package/lib/icon/themes/solar/charcoal/index.js +0 -2
  202. package/lib/icon/themes/solar/pearl/index.js +0 -2
  203. package/lib/icon/utils/IconLoader.d.ts +0 -52
  204. package/lib/icon/utils/IconLoader.js +0 -93
  205. package/lib/index.d.ts +0 -3
  206. package/lib/index.js +0 -3
  207. package/lib/interactive-chart/helpers/merge.d.ts +0 -15
  208. package/lib/interactive-chart/helpers/merge.js +0 -28
  209. package/lib/interactive-chart/helpers/types.d.ts +0 -45
  210. package/lib/interactive-chart/helpers/types.js +0 -6
  211. package/lib/interactive-chart/index.d.ts +0 -383
  212. package/lib/interactive-chart/index.js +0 -1093
  213. package/lib/interactive-chart/themes/halo/dark/index.js +0 -3
  214. package/lib/interactive-chart/themes/halo/light/index.js +0 -3
  215. package/lib/interactive-chart/themes/solar/charcoal/index.js +0 -3
  216. package/lib/interactive-chart/themes/solar/pearl/index.js +0 -3
  217. package/lib/item/helpers/types.d.ts +0 -57
  218. package/lib/item/helpers/types.js +0 -1
  219. package/lib/item/index.d.ts +0 -159
  220. package/lib/item/index.js +0 -272
  221. package/lib/item/themes/halo/dark/index.js +0 -4
  222. package/lib/item/themes/halo/light/index.js +0 -4
  223. package/lib/item/themes/solar/charcoal/index.js +0 -4
  224. package/lib/item/themes/solar/pearl/index.js +0 -4
  225. package/lib/label/index.d.ts +0 -102
  226. package/lib/label/index.js +0 -245
  227. package/lib/label/themes/halo/dark/index.js +0 -3
  228. package/lib/label/themes/halo/light/index.js +0 -3
  229. package/lib/label/themes/solar/charcoal/index.js +0 -3
  230. package/lib/label/themes/solar/pearl/index.js +0 -3
  231. package/lib/layout/index.d.ts +0 -107
  232. package/lib/layout/index.js +0 -212
  233. package/lib/layout/themes/halo/dark/index.js +0 -2
  234. package/lib/layout/themes/halo/light/index.js +0 -2
  235. package/lib/layout/themes/solar/charcoal/index.js +0 -2
  236. package/lib/layout/themes/solar/pearl/index.js +0 -2
  237. package/lib/led-gauge/index.d.ts +0 -144
  238. package/lib/led-gauge/index.js +0 -438
  239. package/lib/led-gauge/themes/halo/dark/index.js +0 -3
  240. package/lib/led-gauge/themes/halo/light/index.js +0 -3
  241. package/lib/led-gauge/themes/solar/charcoal/index.js +0 -3
  242. package/lib/led-gauge/themes/solar/pearl/index.js +0 -3
  243. package/lib/list/extensible-function.d.ts +0 -8
  244. package/lib/list/extensible-function.js +0 -13
  245. package/lib/list/helpers/list-renderer.d.ts +0 -9
  246. package/lib/list/helpers/list-renderer.js +0 -37
  247. package/lib/list/helpers/types.d.ts +0 -3
  248. package/lib/list/helpers/types.js +0 -1
  249. package/lib/list/index.d.ts +0 -313
  250. package/lib/list/index.js +0 -640
  251. package/lib/list/renderer.d.ts +0 -36
  252. package/lib/list/renderer.js +0 -9
  253. package/lib/list/themes/halo/dark/index.js +0 -3
  254. package/lib/list/themes/halo/light/index.js +0 -3
  255. package/lib/list/themes/solar/charcoal/index.js +0 -3
  256. package/lib/list/themes/solar/pearl/index.js +0 -3
  257. package/lib/loader/index.d.ts +0 -41
  258. package/lib/loader/index.js +0 -61
  259. package/lib/loader/themes/halo/dark/index.js +0 -2
  260. package/lib/loader/themes/halo/light/index.js +0 -2
  261. package/lib/loader/themes/solar/charcoal/index.js +0 -2
  262. package/lib/loader/themes/solar/pearl/index.js +0 -2
  263. package/lib/multi-input/helpers/types.d.ts +0 -11
  264. package/lib/multi-input/helpers/types.js +0 -1
  265. package/lib/multi-input/index.d.ts +0 -301
  266. package/lib/multi-input/index.js +0 -594
  267. package/lib/multi-input/themes/halo/dark/index.js +0 -4
  268. package/lib/multi-input/themes/halo/light/index.js +0 -4
  269. package/lib/multi-input/themes/solar/charcoal/index.js +0 -4
  270. package/lib/multi-input/themes/solar/pearl/index.js +0 -4
  271. package/lib/notification/elements/notification-tray.d.ts +0 -97
  272. package/lib/notification/elements/notification-tray.js +0 -167
  273. package/lib/notification/elements/notification.d.ts +0 -90
  274. package/lib/notification/elements/notification.js +0 -154
  275. package/lib/notification/helpers/status.d.ts +0 -30
  276. package/lib/notification/helpers/status.js +0 -130
  277. package/lib/notification/helpers/types.d.ts +0 -10
  278. package/lib/notification/helpers/types.js +0 -1
  279. package/lib/notification/index.d.ts +0 -2
  280. package/lib/notification/index.js +0 -2
  281. package/lib/notification/themes/halo/dark/index.js +0 -5
  282. package/lib/notification/themes/halo/light/index.js +0 -5
  283. package/lib/notification/themes/solar/charcoal/index.js +0 -5
  284. package/lib/notification/themes/solar/pearl/index.js +0 -5
  285. package/lib/number-field/index.d.ts +0 -339
  286. package/lib/number-field/index.js +0 -740
  287. package/lib/number-field/themes/halo/dark/index.js +0 -3
  288. package/lib/number-field/themes/halo/light/index.js +0 -3
  289. package/lib/number-field/themes/solar/charcoal/index.js +0 -3
  290. package/lib/number-field/themes/solar/pearl/index.js +0 -3
  291. package/lib/overlay/elements/overlay-backdrop.d.ts +0 -46
  292. package/lib/overlay/elements/overlay-backdrop.js +0 -64
  293. package/lib/overlay/elements/overlay-viewport.d.ts +0 -40
  294. package/lib/overlay/elements/overlay-viewport.js +0 -52
  295. package/lib/overlay/elements/overlay.d.ts +0 -408
  296. package/lib/overlay/elements/overlay.js +0 -1426
  297. package/lib/overlay/helpers/functions.d.ts +0 -13
  298. package/lib/overlay/helpers/functions.js +0 -16
  299. package/lib/overlay/helpers/types.d.ts +0 -97
  300. package/lib/overlay/helpers/types.js +0 -16
  301. package/lib/overlay/index.d.ts +0 -2
  302. package/lib/overlay/index.js +0 -1
  303. package/lib/overlay/managers/backdrop-manager.d.ts +0 -45
  304. package/lib/overlay/managers/backdrop-manager.js +0 -96
  305. package/lib/overlay/managers/close-manager.d.ts +0 -54
  306. package/lib/overlay/managers/close-manager.js +0 -138
  307. package/lib/overlay/managers/focus-manager.d.ts +0 -71
  308. package/lib/overlay/managers/focus-manager.js +0 -228
  309. package/lib/overlay/managers/interaction-lock-manager.d.ts +0 -138
  310. package/lib/overlay/managers/interaction-lock-manager.js +0 -375
  311. package/lib/overlay/managers/viewport-manager.d.ts +0 -93
  312. package/lib/overlay/managers/viewport-manager.js +0 -211
  313. package/lib/overlay/managers/zindex-manager.d.ts +0 -80
  314. package/lib/overlay/managers/zindex-manager.js +0 -195
  315. package/lib/overlay/themes/halo/dark/index.js +0 -4
  316. package/lib/overlay/themes/halo/light/index.js +0 -4
  317. package/lib/overlay/themes/solar/charcoal/index.js +0 -4
  318. package/lib/overlay/themes/solar/pearl/index.js +0 -4
  319. package/lib/overlay-menu/helpers/types.d.ts +0 -8
  320. package/lib/overlay-menu/helpers/types.js +0 -1
  321. package/lib/overlay-menu/index.d.ts +0 -387
  322. package/lib/overlay-menu/index.js +0 -935
  323. package/lib/overlay-menu/managers/menu-manager.d.ts +0 -98
  324. package/lib/overlay-menu/managers/menu-manager.js +0 -240
  325. package/lib/overlay-menu/themes/halo/dark/index.js +0 -5
  326. package/lib/overlay-menu/themes/halo/light/index.js +0 -5
  327. package/lib/overlay-menu/themes/solar/charcoal/index.js +0 -5
  328. package/lib/overlay-menu/themes/solar/pearl/index.js +0 -5
  329. package/lib/pagination/index.d.ts +0 -275
  330. package/lib/pagination/index.js +0 -552
  331. package/lib/pagination/themes/halo/dark/index.js +0 -6
  332. package/lib/pagination/themes/halo/light/index.js +0 -6
  333. package/lib/pagination/themes/solar/charcoal/index.js +0 -6
  334. package/lib/pagination/themes/solar/pearl/index.js +0 -6
  335. package/lib/panel/index.d.ts +0 -48
  336. package/lib/panel/index.js +0 -74
  337. package/lib/panel/themes/halo/dark/index.js +0 -2
  338. package/lib/panel/themes/halo/light/index.js +0 -2
  339. package/lib/panel/themes/solar/charcoal/index.js +0 -2
  340. package/lib/panel/themes/solar/pearl/index.js +0 -2
  341. package/lib/password-field/index.d.ts +0 -89
  342. package/lib/password-field/index.js +0 -112
  343. package/lib/password-field/themes/halo/dark/index.js +0 -3
  344. package/lib/password-field/themes/halo/light/index.js +0 -3
  345. package/lib/password-field/themes/solar/charcoal/index.js +0 -3
  346. package/lib/password-field/themes/solar/pearl/index.js +0 -3
  347. package/lib/pill/index.d.ts +0 -97
  348. package/lib/pill/index.js +0 -160
  349. package/lib/pill/themes/halo/dark/index.js +0 -3
  350. package/lib/pill/themes/halo/light/index.js +0 -3
  351. package/lib/pill/themes/solar/charcoal/index.js +0 -3
  352. package/lib/pill/themes/solar/pearl/index.js +0 -3
  353. package/lib/progress-bar/index.d.ts +0 -82
  354. package/lib/progress-bar/index.js +0 -157
  355. package/lib/progress-bar/themes/halo/dark/index.js +0 -2
  356. package/lib/progress-bar/themes/halo/light/index.js +0 -2
  357. package/lib/progress-bar/themes/solar/charcoal/index.js +0 -2
  358. package/lib/progress-bar/themes/solar/pearl/index.js +0 -2
  359. package/lib/radio-button/index.d.ts +0 -123
  360. package/lib/radio-button/index.js +0 -261
  361. package/lib/radio-button/radio-button-registry.d.ts +0 -22
  362. package/lib/radio-button/radio-button-registry.js +0 -93
  363. package/lib/radio-button/themes/halo/dark/index.js +0 -3
  364. package/lib/radio-button/themes/halo/light/index.js +0 -3
  365. package/lib/radio-button/themes/solar/charcoal/index.js +0 -3
  366. package/lib/radio-button/themes/solar/pearl/index.js +0 -3
  367. package/lib/rating/index.d.ts +0 -91
  368. package/lib/rating/index.js +0 -157
  369. package/lib/rating/themes/halo/dark/index.js +0 -2
  370. package/lib/rating/themes/halo/light/index.js +0 -2
  371. package/lib/rating/themes/solar/charcoal/index.js +0 -2
  372. package/lib/rating/themes/solar/pearl/index.js +0 -2
  373. package/lib/search-field/index.d.ts +0 -77
  374. package/lib/search-field/index.js +0 -84
  375. package/lib/search-field/themes/halo/dark/index.js +0 -3
  376. package/lib/search-field/themes/halo/light/index.js +0 -3
  377. package/lib/search-field/themes/solar/charcoal/index.js +0 -3
  378. package/lib/search-field/themes/solar/pearl/index.js +0 -3
  379. package/lib/select/helpers/types.d.ts +0 -3
  380. package/lib/select/helpers/types.js +0 -1
  381. package/lib/select/index.d.ts +0 -396
  382. package/lib/select/index.js +0 -981
  383. package/lib/select/themes/halo/dark/index.js +0 -5
  384. package/lib/select/themes/halo/light/index.js +0 -5
  385. package/lib/select/themes/solar/charcoal/index.js +0 -5
  386. package/lib/select/themes/solar/pearl/index.js +0 -5
  387. package/lib/sidebar-layout/index.d.ts +0 -70
  388. package/lib/sidebar-layout/index.js +0 -134
  389. package/lib/sidebar-layout/themes/halo/dark/index.js +0 -3
  390. package/lib/sidebar-layout/themes/halo/light/index.js +0 -3
  391. package/lib/sidebar-layout/themes/solar/charcoal/index.js +0 -3
  392. package/lib/sidebar-layout/themes/solar/pearl/index.js +0 -3
  393. package/lib/slider/index.d.ts +0 -409
  394. package/lib/slider/index.js +0 -1187
  395. package/lib/slider/themes/halo/dark/index.js +0 -3
  396. package/lib/slider/themes/halo/light/index.js +0 -3
  397. package/lib/slider/themes/solar/charcoal/index.js +0 -3
  398. package/lib/slider/themes/solar/pearl/index.js +0 -3
  399. package/lib/sparkline/index.d.ts +0 -109
  400. package/lib/sparkline/index.js +0 -188
  401. package/lib/sparkline/themes/halo/dark/index.js +0 -2
  402. package/lib/sparkline/themes/halo/light/index.js +0 -2
  403. package/lib/sparkline/themes/solar/charcoal/index.js +0 -2
  404. package/lib/sparkline/themes/solar/pearl/index.js +0 -2
  405. package/lib/swing-gauge/const.d.ts +0 -22
  406. package/lib/swing-gauge/const.js +0 -26
  407. package/lib/swing-gauge/helpers.d.ts +0 -8
  408. package/lib/swing-gauge/helpers.js +0 -105
  409. package/lib/swing-gauge/index.d.ts +0 -296
  410. package/lib/swing-gauge/index.js +0 -764
  411. package/lib/swing-gauge/themes/halo/dark/index.js +0 -3
  412. package/lib/swing-gauge/themes/halo/light/index.js +0 -3
  413. package/lib/swing-gauge/themes/solar/charcoal/index.js +0 -3
  414. package/lib/swing-gauge/themes/solar/pearl/index.js +0 -3
  415. package/lib/swing-gauge/types.d.ts +0 -34
  416. package/lib/swing-gauge/types.js +0 -1
  417. package/lib/tab/index.d.ts +0 -118
  418. package/lib/tab/index.js +0 -208
  419. package/lib/tab/themes/halo/dark/index.js +0 -4
  420. package/lib/tab/themes/halo/light/index.js +0 -4
  421. package/lib/tab/themes/solar/charcoal/index.js +0 -4
  422. package/lib/tab/themes/solar/pearl/index.js +0 -4
  423. package/lib/tab-bar/helpers/animate.d.ts +0 -16
  424. package/lib/tab-bar/helpers/animate.js +0 -53
  425. package/lib/tab-bar/index.d.ts +0 -108
  426. package/lib/tab-bar/index.js +0 -218
  427. package/lib/tab-bar/themes/halo/dark/index.js +0 -4
  428. package/lib/tab-bar/themes/halo/light/index.js +0 -4
  429. package/lib/tab-bar/themes/solar/charcoal/index.js +0 -4
  430. package/lib/tab-bar/themes/solar/pearl/index.js +0 -4
  431. package/lib/text-field/index.d.ts +0 -151
  432. package/lib/text-field/index.js +0 -260
  433. package/lib/text-field/themes/halo/dark/index.js +0 -3
  434. package/lib/text-field/themes/halo/light/index.js +0 -3
  435. package/lib/text-field/themes/solar/charcoal/index.js +0 -3
  436. package/lib/text-field/themes/solar/pearl/index.js +0 -3
  437. package/lib/time-picker/index.d.ts +0 -412
  438. package/lib/time-picker/index.js +0 -898
  439. package/lib/time-picker/themes/halo/dark/index.js +0 -4
  440. package/lib/time-picker/themes/halo/light/index.js +0 -4
  441. package/lib/time-picker/themes/solar/charcoal/index.js +0 -4
  442. package/lib/time-picker/themes/solar/pearl/index.js +0 -4
  443. package/lib/toggle/index.d.ts +0 -87
  444. package/lib/toggle/index.js +0 -153
  445. package/lib/toggle/themes/halo/dark/index.js +0 -2
  446. package/lib/toggle/themes/halo/light/index.js +0 -2
  447. package/lib/toggle/themes/solar/charcoal/index.js +0 -2
  448. package/lib/toggle/themes/solar/pearl/index.js +0 -2
  449. package/lib/tooltip/elements/title-tooltip.d.ts +0 -1
  450. package/lib/tooltip/elements/title-tooltip.js +0 -18
  451. package/lib/tooltip/elements/tooltip-element.d.ts +0 -21
  452. package/lib/tooltip/elements/tooltip-element.js +0 -54
  453. package/lib/tooltip/helpers/overflow-tooltip.d.ts +0 -9
  454. package/lib/tooltip/helpers/overflow-tooltip.js +0 -19
  455. package/lib/tooltip/helpers/renderer.d.ts +0 -8
  456. package/lib/tooltip/helpers/renderer.js +0 -11
  457. package/lib/tooltip/helpers/types.d.ts +0 -23
  458. package/lib/tooltip/helpers/types.js +0 -1
  459. package/lib/tooltip/index.d.ts +0 -232
  460. package/lib/tooltip/index.js +0 -477
  461. package/lib/tooltip/managers/tooltip-manager.d.ts +0 -15
  462. package/lib/tooltip/managers/tooltip-manager.js +0 -140
  463. package/lib/tooltip/themes/halo/dark/index.js +0 -3
  464. package/lib/tooltip/themes/halo/light/index.js +0 -3
  465. package/lib/tooltip/themes/solar/charcoal/index.js +0 -3
  466. package/lib/tooltip/themes/solar/pearl/index.js +0 -3
  467. package/lib/tornado-chart/elements/tornado-chart.d.ts +0 -78
  468. package/lib/tornado-chart/elements/tornado-chart.js +0 -122
  469. package/lib/tornado-chart/elements/tornado-item.d.ts +0 -110
  470. package/lib/tornado-chart/elements/tornado-item.js +0 -207
  471. package/lib/tornado-chart/index.d.ts +0 -2
  472. package/lib/tornado-chart/index.js +0 -2
  473. package/lib/tornado-chart/themes/halo/dark/index.js +0 -6
  474. package/lib/tornado-chart/themes/halo/light/index.js +0 -6
  475. package/lib/tornado-chart/themes/solar/charcoal/index.js +0 -6
  476. package/lib/tornado-chart/themes/solar/pearl/index.js +0 -6
  477. package/lib/tree/elements/tree-item.d.ts +0 -129
  478. package/lib/tree/elements/tree-item.js +0 -238
  479. package/lib/tree/elements/tree.d.ts +0 -203
  480. package/lib/tree/elements/tree.js +0 -414
  481. package/lib/tree/helpers/filter.d.ts +0 -8
  482. package/lib/tree/helpers/filter.js +0 -33
  483. package/lib/tree/helpers/renderer.d.ts +0 -5
  484. package/lib/tree/helpers/renderer.js +0 -33
  485. package/lib/tree/helpers/types.d.ts +0 -25
  486. package/lib/tree/helpers/types.js +0 -1
  487. package/lib/tree/index.d.ts +0 -4
  488. package/lib/tree/index.js +0 -3
  489. package/lib/tree/managers/tree-manager.d.ts +0 -248
  490. package/lib/tree/managers/tree-manager.js +0 -395
  491. package/lib/tree/themes/halo/dark/index.js +0 -7
  492. package/lib/tree/themes/halo/light/index.js +0 -7
  493. package/lib/tree/themes/solar/charcoal/index.js +0 -7
  494. package/lib/tree/themes/solar/pearl/index.js +0 -7
  495. package/lib/tree-select/helpers/types.d.ts +0 -4
  496. package/lib/tree-select/helpers/types.js +0 -1
  497. package/lib/tree-select/index.d.ts +0 -404
  498. package/lib/tree-select/index.js +0 -891
  499. package/lib/tree-select/themes/halo/dark/index.js +0 -11
  500. package/lib/tree-select/themes/halo/light/index.js +0 -11
  501. package/lib/tree-select/themes/solar/charcoal/index.js +0 -11
  502. package/lib/tree-select/themes/solar/pearl/index.js +0 -11
  503. package/lib/version.d.ts +0 -1
  504. package/lib/version.js +0 -1
@@ -1,1183 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { FormFieldElement, css, html, WarningNotice, FocusedPropertyKey } from '@refinitiv-ui/core';
3
- import { customElement } from '@refinitiv-ui/core/lib/decorators/custom-element.js';
4
- import { property } from '@refinitiv-ui/core/lib/decorators/property.js';
5
- import { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
- import { eventOptions } from '@refinitiv-ui/core/lib/decorators/event-options.js';
7
- import { styleMap } from '@refinitiv-ui/core/lib/directives/style-map.js';
8
- import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
9
- import { VERSION } from '../version.js';
10
- import { CollectionComposer } from '@refinitiv-ui/utils/lib/collection.js';
11
- import { AnimationTaskRunner, TimeoutTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
12
- import { ComboBoxRenderer } from './helpers/renderer.js';
13
- import { defaultFilter } from './helpers/filter.js';
14
- import { CustomKeyboardEvent } from './helpers/keyboard-event.js';
15
- import '../icon/index.js';
16
- import '../overlay/index.js';
17
- import '../list/index.js';
18
- import '../counter/index.js';
19
- import { translate } from '@refinitiv-ui/translate';
20
- import '@refinitiv-ui/phrasebook/lib/locale/en/combo-box.js';
21
- export { ComboBoxRenderer };
22
- const QUERY_DEBOUNCE_RATE = 0;
23
- // Maximum number of characters to display in multiple mode
24
- const MULTIPLE_LABEL_MAX_SIZE = 250;
25
- // Separator for labels in multiple mode
26
- // Double space is expected
27
- const MULTIPLE_LABEL_SEPARATOR = '; ';
28
- const POPUP_POSITION = ['bottom-start', 'top-start'];
29
- const valueFormatWarning = new WarningNotice('The specified \'values\' format does not conform to the required format.');
30
- const freeTextMultipleWarning = new WarningNotice('"free-text" mode is not compatible with "multiple" mode');
31
- /**
32
- * Combines a popup with a filterable selection list
33
- *
34
- * @attr {boolean} readonly - Set readonly state
35
- * @prop {boolean} [readonly=false] - Set readonly state
36
- *
37
- * @attr {boolean} disabled - Set disabled state
38
- * @prop {boolean} [disabled=false] - Set disabled state
39
- *
40
- * @attr {string} name - Set name of the element
41
- * @prop {string} [name=''] - Set name of the element
42
- *
43
- * @fires value-changed - Dispatched when value changes
44
- * @fires query-changed - Dispatched when query changes
45
- * @fires opened-changed - Dispatched when opened state changes
46
- */
47
- let ComboBox = class ComboBox extends FormFieldElement {
48
- constructor() {
49
- super(...arguments);
50
- /**
51
- * Custom filter for static data
52
- * Set this to null when data is filtered externally, eg XHR
53
- * @type {ComboBoxFilter<T> | null}
54
- */
55
- this.filter = defaultFilter(this);
56
- /**
57
- * Renderer used to render list item elements
58
- * @type {ComboBoxRenderer}
59
- */
60
- this.renderer = new ComboBoxRenderer(this);
61
- this._multiple = false;
62
- /**
63
- * Track opened state of popup
64
- */
65
- this.opened = false;
66
- /**
67
- * Placeholder for input field
68
- */
69
- this.placeholder = '';
70
- /**
71
- * Show clears button
72
- */
73
- this.clears = false;
74
- this._freeText = false;
75
- /**
76
- * Set state to error
77
- */
78
- this.error = false;
79
- /**
80
- * Set state to warning
81
- */
82
- this.warning = false;
83
- // Internal reference to debounce rate
84
- this._queryDebounceRate = QUERY_DEBOUNCE_RATE;
85
- // Debounces the query using queryDebounceRate
86
- this.queryDebouncer = new TimeoutTaskRunner(this._queryDebounceRate);
87
- this._data = []; // Local data object set through data setter
88
- /**
89
- * `value` always initialised before `data`, so it cannot query and select items when using attribute.
90
- * This variable is to store value for selecting a data item after data has been initialised.
91
- */
92
- this.cachedValue = '';
93
- this._query = null; // Internally set and store query value
94
- /**
95
- * Composer used to query and modify item state.
96
- */
97
- this.composer = new CollectionComposer([]);
98
- /**
99
- * Initiate one time popup rendering
100
- */
101
- this.lazyRendered = false;
102
- /**
103
- * Throttle popup resizing
104
- */
105
- this.resizeThrottler = new AnimationTaskRunner();
106
- /**
107
- * Input text to display in text field while typing
108
- * Use because of query debouncer to avoid input to be not in sync with query
109
- */
110
- this.inputText = '';
111
- /**
112
- * Used to store free text value
113
- * If freeText mode is defined
114
- */
115
- this.freeTextValue = '';
116
- /**
117
- * Hold popup styling applied on open
118
- */
119
- this.popupDynamicStyles = {};
120
- /**
121
- * Use to call request update when CC changes its value
122
- * @returns {void}
123
- */
124
- this.modificationHandler = () => this.modificationUpdate();
125
- this._resolvedData = [];
126
- this.dataPromiseCounter = 0; // A counter to detect that the promise resolved is the last promise set
127
- /**
128
- * Mark combobox with loading flag
129
- * Used in conjunction with data promise
130
- */
131
- this.loading = false;
132
- this.shouldOpenOnFocus = false;
133
- }
134
- /**
135
- * Element version number
136
- * @returns version number
137
- */
138
- static get version() {
139
- return VERSION;
140
- }
141
- /**
142
- * A `CSSResultGroup` that will be used
143
- * to style the host, slotted children
144
- * and the internal template of the element.
145
- * @return CSS template
146
- */
147
- static get styles() {
148
- return css `
149
- :host {
150
- display: inline-flex;
151
- flex-flow: row nowrap;
152
- user-select: none;
153
- outline: none;
154
- }
155
- [part~=input-wrapper] {
156
- cursor: pointer;
157
- }
158
- [part~=input] {
159
- cursor: text;
160
- }
161
- [part~=input]::-ms-clear {
162
- display: none;
163
- }
164
- [hidden] {
165
- display: none !important;
166
- }
167
- `;
168
- }
169
- /**
170
- * Multiple selection mode
171
- * @param multiple true to set multiple mode
172
- * @default false
173
- */
174
- set multiple(multiple) {
175
- if (multiple && this.freeText) {
176
- freeTextMultipleWarning.show();
177
- multiple = false;
178
- }
179
- const oldMultiple = this._multiple;
180
- this._multiple = multiple;
181
- this.requestUpdate('multiple', oldMultiple);
182
- }
183
- get multiple() {
184
- return this._multiple;
185
- }
186
- /**
187
- * Allow to enter any value
188
- * @param freeText true to set freeText mode
189
- * @default false
190
- */
191
- set freeText(freeText) {
192
- if (this.multiple && freeText) {
193
- freeTextMultipleWarning.show();
194
- freeText = false;
195
- }
196
- if (!freeText) {
197
- this.freeTextValue = '';
198
- }
199
- const oldFreeText = this._freeText;
200
- this._freeText = freeText;
201
- this.requestUpdate('freeText', oldFreeText);
202
- }
203
- get freeText() {
204
- return this._freeText;
205
- }
206
- /**
207
- * Control query rate, defaults to 0
208
- */
209
- get queryDebounceRate() {
210
- return this._queryDebounceRate;
211
- }
212
- set queryDebounceRate(value) {
213
- const oldValue = this._queryDebounceRate;
214
- if (value !== oldValue) {
215
- this._queryDebounceRate = value;
216
- this.queryDebouncer = new TimeoutTaskRunner(this._queryDebounceRate);
217
- // no need to update as this is called for input changes
218
- }
219
- }
220
- /**
221
- * Data array to be displayed
222
- * @type {ComboBoxData<T>}
223
- * @default []
224
- */
225
- get data() {
226
- return this._data;
227
- }
228
- set data(value) {
229
- this._data = value;
230
- void this.resolveDataPromise(value);
231
- }
232
- /**
233
- * Returns the first selected item value.
234
- * Use `values` when multiple selection mode is enabled.
235
- * @default -
236
- */
237
- get value() {
238
- return this.values[0] || '';
239
- }
240
- set value(value) {
241
- /**
242
- * Set the value if the data is ready,
243
- * otherwise cache it for later.
244
- */
245
- if (this.composer.size) {
246
- this.values = [value];
247
- }
248
- else {
249
- this.cachedValue = value;
250
- }
251
- }
252
- /**
253
- * Returns a values collection of the currently
254
- * selected item values
255
- * @type {string[]}
256
- * @default []
257
- */
258
- get values() {
259
- // In free text mode, compare selected to values
260
- return this.freeTextValue ? [this.freeTextValue] : this.composerValues;
261
- }
262
- set values(values) {
263
- if (!Array.isArray(values)) {
264
- valueFormatWarning.show();
265
- this.values = [];
266
- }
267
- else {
268
- // Clone value arrays
269
- const newValues = values.slice(0, this.multiple ? values.length : 1);
270
- const oldValues = this.composerValues.slice();
271
- // Create comparison strings to check for differences
272
- const newComparison = newValues.sort().toString();
273
- const oldComparison = oldValues.sort().toString();
274
- // Should we update the selection state?
275
- if (newComparison !== oldComparison) {
276
- this.updateComposerValues(newValues);
277
- this.requestUpdate('values', oldValues);
278
- }
279
- }
280
- }
281
- /**
282
- * Update composer values.
283
- * @param newValues new values
284
- * @returns {void}
285
- */
286
- updateComposerValues(newValues) {
287
- this.queryItems((item, composer) => {
288
- if (newValues.includes(composer.getItemPropertyValue(item, 'value'))) {
289
- composer.setItemPropertyValue(item, 'selected', true);
290
- return true;
291
- }
292
- composer.setItemPropertyValue(item, 'selected', false);
293
- return false;
294
- });
295
- }
296
- /**
297
- * Query string applied to combo-box
298
- * Set via internal input
299
- * @readonly
300
- * @default null
301
- */
302
- get query() {
303
- return this._query;
304
- }
305
- set query(query) {
306
- const oldVal = this._query;
307
- this._query = query;
308
- this.queryDebouncer.cancel();
309
- if (oldVal !== this._query) {
310
- this.clearHighlighted();
311
- this.filterItems();
312
- this.requestUpdate('query', oldVal);
313
- }
314
- }
315
- /**
316
- * Label of selected value
317
- * @returns Label to use, defaults to empty string
318
- * @default -
319
- * @readonly
320
- */
321
- get label() {
322
- const labels = this.selectedLabels;
323
- if (labels.length <= 1) {
324
- return labels[0] || '';
325
- }
326
- // multiple mode, do according to UX specs
327
- const output = labels.join(MULTIPLE_LABEL_SEPARATOR);
328
- return output.length > MULTIPLE_LABEL_MAX_SIZE ? `${output.slice(0, MULTIPLE_LABEL_MAX_SIZE - 3)}...` : output;
329
- }
330
- /**
331
- * Get resolved data (if possible)
332
- */
333
- get resolvedData() {
334
- return this._resolvedData;
335
- }
336
- /**
337
- * Set resolved data
338
- * @param value resolved data
339
- */
340
- set resolvedData(value) {
341
- const oldValue = this._resolvedData;
342
- if (value !== oldValue) {
343
- if (Array.isArray(value)) {
344
- this.composer = new CollectionComposer(value);
345
- }
346
- else {
347
- this.composer = new CollectionComposer([]);
348
- }
349
- this.listenToComposer();
350
- this._resolvedData = value;
351
- /**
352
- * Select using initialised the value once from attribute/property,
353
- * only when there is no existing selections.
354
- */
355
- if (this.cachedValue && this.selection.length === 0) {
356
- this.value = this.cachedValue;
357
- this.cachedValue = ''; // Reset as it's only needed for initialisation
358
- }
359
- this.requestUpdate('data', oldValue);
360
- }
361
- }
362
- /**
363
- * Used to resolve data when set as a promise
364
- * @param data Data promise
365
- * @returns Promise<void>
366
- */
367
- async resolveDataPromise(data) {
368
- const dataPromiseCounter = this.dataPromiseCounter += 1;
369
- let resolvedData;
370
- if (data instanceof Promise) {
371
- this.loading = true;
372
- try {
373
- resolvedData = await data;
374
- }
375
- catch (error) {
376
- resolvedData = [];
377
- }
378
- }
379
- else {
380
- resolvedData = data;
381
- }
382
- if (dataPromiseCounter === this.dataPromiseCounter) {
383
- this.resolvedData = resolvedData;
384
- this.loading = false;
385
- }
386
- }
387
- /**
388
- * The the values from composer ignoring freeTextValue
389
- */
390
- get composerValues() {
391
- return this.queryItemsByPropertyValue('selected', true)
392
- .map(item => this.getItemPropertyValue(item, 'value'));
393
- }
394
- /**
395
- * Get the first value of highlighted item
396
- */
397
- get highlightedItemValue() {
398
- if (!this.opened) {
399
- return null;
400
- }
401
- return this.highlightedItems.map(item => this.getItemPropertyValue(item, 'value'))[0] || '';
402
- }
403
- /**
404
- * Return currently selected items
405
- * This is distinct from values as for controls with persistence features
406
- * it can be used to show current selection count and get the selection labels
407
- * @returns List of selected items
408
- */
409
- get selection() {
410
- return this.queryItemsByPropertyValue('selected', true).slice();
411
- }
412
- /**
413
- * Count of selected items
414
- * @returns Has selection
415
- */
416
- get selectionCount() {
417
- return this.selection.length;
418
- }
419
- /**
420
- * Determine if list has visible items
421
- * @returns List has visible items or not
422
- */
423
- get listHasVisibleItems() {
424
- return this.resolvedData.some(item => !this.getItemPropertyValue(item, 'hidden'));
425
- }
426
- /**
427
- * Selected item
428
- * @returns Has selection
429
- */
430
- get selectedItem() {
431
- return this.queryItemsByPropertyValue('selected', true)[0];
432
- }
433
- /**
434
- * Get a list of selected item labels
435
- * @returns Has selection
436
- */
437
- get selectedLabels() {
438
- return this.selection.map(selected => this.getItemPropertyValue(selected, 'label') || '');
439
- }
440
- /**
441
- * Utility method - ensures correct composer is being listened to
442
- * @returns {void}
443
- */
444
- listenToComposer() {
445
- this.composer.on('modification', // Listen for modifications
446
- this.modificationHandler // Update the template
447
- );
448
- }
449
- /**
450
- * Updates the element
451
- * @param changedProperties Properties that has changed
452
- * @returns {void}
453
- */
454
- update(changedProperties) {
455
- const focusedChanged = changedProperties.has(FocusedPropertyKey);
456
- // the opened logic is bound to focus state
457
- if (focusedChanged) {
458
- // When focus changes the popup can open only on tapstart
459
- if (this.focused && this.shouldOpenOnFocus) {
460
- this.setOpened(true);
461
- }
462
- else if (!this.focused) {
463
- this.setOpened(false);
464
- }
465
- this.shouldOpenOnFocus = false;
466
- }
467
- /*
468
- * data can be visible and opened changed = open
469
- * or, opened is true and data; and contains visible data = open
470
- * queries local properties first to short circuit querying map iteration
471
- */
472
- if (changedProperties.has('opened')) {
473
- if (this.opened) {
474
- // fulfil any queries if opened is changed
475
- // this is the case if keyboard navigation is used
476
- this.queryDebouncer.fulfil();
477
- this.opening();
478
- }
479
- else {
480
- this.clearHighlighted();
481
- }
482
- }
483
- // combo-box may be opened programmatically (via opened attribute)
484
- // make sure that the element correctly reacts on this change
485
- if ((changedProperties.has('data') && this.opened && !this.focused) || focusedChanged) {
486
- this.resetInput();
487
- }
488
- // If label is defined it means that there is an actual value
489
- // Select input text to simplify clearing the value
490
- if (focusedChanged && this.focused && this.label && this.inputElement) {
491
- this.inputElement.focus();
492
- this.inputElement.select();
493
- }
494
- // Make sure that the first item is always highlighted
495
- if (this.opened && (changedProperties.has('opened') || changedProperties.has('data') || changedProperties.has('query'))) {
496
- this.highlightFirstItem();
497
- }
498
- // If data is set asynchronously while popup is opened
499
- // list might not trigger popup update
500
- if (changedProperties.has('data') && this.opened) {
501
- this.forcePopupLayout();
502
- }
503
- super.update(changedProperties);
504
- }
505
- /**
506
- * Called once after the component is first rendered
507
- * @param changedProperties map of changed properties with old values
508
- * @returns {void}
509
- */
510
- firstUpdated(changedProperties) {
511
- super.firstUpdated(changedProperties);
512
- this.addEventListener('keydown', this.onKeyDown);
513
- this.addEventListener('tapstart', this.onTapStart);
514
- }
515
- /**
516
- * Sets opened state and fires event
517
- * Use this to set opened state when user interacts to the component
518
- * @param opened True if opened
519
- * @returns {void}
520
- */
521
- setOpened(opened) {
522
- if (this.opened !== opened && this.notifyPropertyChange('opened', opened, true)) {
523
- this.opened = opened;
524
- }
525
- }
526
- /**
527
- * Requests an update after a composer modification.
528
- * @returns {void}
529
- */
530
- modificationUpdate() {
531
- this.requestUpdate();
532
- }
533
- /**
534
- * Queries the composer for data items
535
- * @param engine Composer query engine
536
- * @returns Collection of matched items
537
- */
538
- queryItems(engine) {
539
- return this.composer.queryItems(engine);
540
- }
541
- /**
542
- * Queries the composer for data items,
543
- * matching by property value.
544
- * @param property Property name to query
545
- * @param value Property value to match against
546
- * @returns Collection of matched items
547
- */
548
- queryItemsByPropertyValue(property, value) {
549
- return this.composer.queryItemsByPropertyValue(property, value, 0);
550
- }
551
- /**
552
- * Gets the property value of an item
553
- * @param item Original data item
554
- * @param property Property name to get the value of
555
- * @returns Value of the property
556
- */
557
- getItemPropertyValue(item, property) {
558
- return this.composer.getItemPropertyValue(item, property);
559
- }
560
- /**
561
- * Sets the property value of an item
562
- * @param item Original data item
563
- * @param property Property name to set the value of
564
- * @param value New value of the property
565
- * @returns {void}
566
- */
567
- setItemPropertyValue(item, property, value) {
568
- this.composer.setItemPropertyValue(item, property, value);
569
- }
570
- /**
571
- * Set width on popup using parent and --list-max-width if set
572
- * @returns {void}
573
- */
574
- opening() {
575
- this.lazyRendered = true;
576
- this.restrictPopupWidth();
577
- }
578
- /**
579
- * Scrolls to the currently selected item
580
- * @returns {void}
581
- */
582
- scrollToSelected() {
583
- var _a;
584
- const item = this.selectedItem;
585
- if (item) {
586
- (_a = this.listEl) === null || _a === void 0 ? void 0 : _a.scrollToItem(item);
587
- }
588
- }
589
- /**
590
- * Get a list of highlighted items
591
- */
592
- get highlightedItems() {
593
- return this.queryItemsByPropertyValue('highlighted', true);
594
- }
595
- /**
596
- * Highlights the item
597
- * @param item data item to highlight
598
- * @returns {void}
599
- */
600
- highlightItem(item) {
601
- this.clearHighlighted();
602
- this.setItemPropertyValue(item, 'highlighted', true);
603
- }
604
- /**
605
- * Clears any highlighted items
606
- * @returns {void}
607
- */
608
- clearHighlighted() {
609
- this.highlightedItems.forEach(item => this.setItemPropertyValue(item, 'highlighted', false));
610
- }
611
- /**
612
- * Popup has to use max width if --list-max-width specified
613
- * otherwise, popup should have same width as control or wider
614
- * @returns {void}
615
- */
616
- restrictPopupWidth() {
617
- /* istanbul ignore next */
618
- if (this.offsetWidth === 0) {
619
- // this code might happen only when opened has been set during initialisation
620
- // or when display is set to none
621
- this.resizeThrottler.schedule(() => {
622
- if (this.offsetWidth) { /* must be here to avoid infinitive loop */
623
- this.restrictPopupWidth();
624
- this.requestUpdate();
625
- }
626
- });
627
- return;
628
- }
629
- const maxWidth = parseFloat(this.getComputedVariable('--list-max-width', 'none'));
630
- let minWidth = this.offsetWidth;
631
- // reset min-width if max-width less than min-width, otherwise browser won't apply max-width
632
- if (maxWidth < minWidth) {
633
- minWidth = 0;
634
- }
635
- this.popupDynamicStyles.minWidth = `${minWidth}px`;
636
- }
637
- /**
638
- * Set the query string and run `query-change` event
639
- * @param query query
640
- * @returns void
641
- */
642
- setQuery(query) {
643
- const oldQuery = this.query;
644
- this.query = query; // reset debouncer here
645
- if (oldQuery !== query) {
646
- this.notifyPropertyChange('query', this.query);
647
- }
648
- }
649
- /**
650
- * Reset the input text to match label
651
- * @returns {void}
652
- */
653
- resetInput() {
654
- this.setQuery('');
655
- this.inputText = this.multiple ? '' : (this.freeTextValue || this.label);
656
- }
657
- /**
658
- * Filter the internal items by query
659
- * Changes items' hidden state
660
- * @returns {void}
661
- */
662
- filterItems() {
663
- // if filter is null, it is off and external app is responsible
664
- if (this.filter) {
665
- // we do not produce a new list as it will loose all association with this composer
666
- // unless we spent time re-applying this composer to a new list/composer
667
- // instead we change the hidden state
668
- // by list applying a queryItems itself and does not render hidden items
669
- // filter declared here to avoid the possibility of being null if used directly in the callback
670
- const filter = this.filter;
671
- let groupHeaderItem = null;
672
- this.queryItems((item, composer) => {
673
- // do not filter hidden items
674
- if (item.hidden) {
675
- return false;
676
- }
677
- let result = false;
678
- // support groups
679
- if (composer.getItemPropertyValue(item, 'type') === 'header') {
680
- groupHeaderItem = item;
681
- }
682
- else {
683
- result = filter(item);
684
- }
685
- composer.setItemPropertyValue(item, 'hidden', !result);
686
- composer.updateItemTimestamp(item);
687
- if (result && groupHeaderItem && composer.getItemParent(groupHeaderItem) === composer.getItemParent(item)) {
688
- composer.setItemPropertyValue(groupHeaderItem, 'hidden', false);
689
- composer.updateItemTimestamp(groupHeaderItem);
690
- groupHeaderItem = null;
691
- }
692
- return result;
693
- });
694
- }
695
- this.forcePopupLayout();
696
- }
697
- /**
698
- * Highlight the selected item or the first available item
699
- * @returns {void}
700
- */
701
- highlightFirstItem() {
702
- let selectedItem = null;
703
- const highlightItem = this.queryItems((item, composer) => {
704
- if (selectedItem || !this.canHighlightItem(item, composer)) {
705
- return false;
706
- }
707
- if (composer.getItemPropertyValue(item, 'selected') === true) {
708
- selectedItem = item;
709
- }
710
- return true;
711
- })[0];
712
- (selectedItem || highlightItem) && this.highlightItem(selectedItem || highlightItem);
713
- }
714
- /**
715
- * Check if an item can be highlighted
716
- * @param item Collection composer item
717
- * @param composer Collection composer
718
- * @returns can highlight
719
- */
720
- canHighlightItem(item, composer) {
721
- let canHighlight = !(composer.getItemPropertyValue(item, 'hidden') === true
722
- || (composer.getItemPropertyValue(item, 'type') || 'text') !== 'text'
723
- || composer.getItemPropertyValue(item, 'disabled') === true
724
- || composer.isItemLocked(item) === true);
725
- // check ancestors
726
- if (canHighlight) {
727
- const parent = composer.getItemParent(item);
728
- canHighlight = !parent || this.canHighlightItem(parent, composer);
729
- }
730
- return canHighlight;
731
- }
732
- /**
733
- * https://github.com/juggle/resize-observer/issues/42
734
- *
735
- * This event ensures that ResizeObserver picks up resize events
736
- * when popup is deeply nested inside shadow root.
737
- * TODO: remove this workaround once ResizeObserver handles shadow root scenario
738
- * @returns {void}
739
- */
740
- forcePopupLayout() {
741
- window.dispatchEvent(new Event('animationiteration'));
742
- }
743
- /**
744
- * Shift focus back to input.
745
- * This method is required to prevent popup from focusing
746
- * @returns {void}
747
- */
748
- shiftFocus() {
749
- this.focus({
750
- preventScroll: true
751
- });
752
- }
753
- /**
754
- * Runs on input element `input` event
755
- * @param event `input` event
756
- * @returns {void}
757
- */
758
- onInputInput(event) {
759
- this.onInputValueChanged(event);
760
- }
761
- /**
762
- * Runs on input element `change` event
763
- * @param event `change` event
764
- * @returns {void}
765
- */
766
- onInputChange(event) {
767
- this.onInputValueChanged(event);
768
- }
769
- /**
770
- * Handle text value change from input field
771
- * @param event Custom Event fired from input field
772
- * @returns {void}
773
- */
774
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
775
- onInputValueChanged(event) {
776
- const inputText = this.inputValue;
777
- /**
778
- * Query is used to track if there is a query
779
- * We always use it so the absence of it can be used to reapply the
780
- * selected item's label, if applicable
781
- */
782
- this.queryDebouncer.schedule(() => {
783
- this.setQuery(inputText);
784
- });
785
- // Reset text when clearing the value
786
- if (!this.multiple && !inputText) {
787
- this.setValueAndNotify('');
788
- }
789
- // always ensure that internal val matches input val
790
- this.inputText = inputText;
791
- // Used for free input. Never set it unless in free text mode
792
- if (this.freeText) {
793
- this.value = ''; // make sure that composer does not have selected
794
- this.freeTextValue = inputText;
795
- this.notifyPropertyChange('value', inputText);
796
- }
797
- this.setOpened(true);
798
- }
799
- /**
800
- * Handle list value changed
801
- * @returns {void}
802
- */
803
- onListValueChanged() {
804
- // cascade value changed event
805
- this.notifyPropertyChange('value', this.value);
806
- this.onListInteraction();
807
- }
808
- /**
809
- * Handle popup opened event
810
- *
811
- * Scrolls the current selection into view
812
- * @returns {void}
813
- */
814
- onPopupOpened() {
815
- this.scrollToSelected();
816
- }
817
- /**
818
- * Handle popup closed event
819
- *
820
- * Ensures that popup state equals combo box opened prop
821
- * @returns {void}
822
- */
823
- onPopupClosed() {
824
- this.setOpened(false);
825
- }
826
- /**
827
- * Run when input-wrapper is tapped
828
- * @param event Tap event
829
- * @returns {void}
830
- */
831
- onTapStart(event) {
832
- // do nothing if disabled or readonly
833
- if (this.readonly || this.disabled) {
834
- return;
835
- }
836
- const path = event.composedPath();
837
- if (this.clearsButtonEl && path.includes(this.clearsButtonEl)) {
838
- this.onClearsButtonTap();
839
- return;
840
- }
841
- if (path.includes(this.toggleButtonEl)) {
842
- this.onToggleButtonTap();
843
- return;
844
- }
845
- this.onInputWrapperTap();
846
- }
847
- /**
848
- * Run when tap event happens on toggle button
849
- * @returns {void}
850
- */
851
- onToggleButtonTap() {
852
- if (this.opened) {
853
- this.setOpened(false);
854
- }
855
- else {
856
- this.openOnFocus();
857
- }
858
- }
859
- /**
860
- * Run when tap event happens on clears button
861
- * @returns {void}
862
- */
863
- onClearsButtonTap() {
864
- this.freeTextValue = '';
865
- this.inputText = '';
866
- this.setQuery('');
867
- this.setValueAndNotify('');
868
- this.openOnFocus();
869
- }
870
- /**
871
- * Run when tap event happens on input wrapper
872
- * excluding clears and toggles buttons
873
- * @returns {void}
874
- */
875
- onInputWrapperTap() {
876
- this.openOnFocus();
877
- }
878
- /**
879
- * This flag is required to remove the frame gap
880
- * between tap start and opening the popup
881
- * @returns {void}
882
- */
883
- openOnFocus() {
884
- if (this.opened) {
885
- return;
886
- }
887
- if (this.focused) {
888
- this.setOpened(true);
889
- return;
890
- }
891
- this.shouldOpenOnFocus = true;
892
- }
893
- /**
894
- * Handles key input
895
- * @param event Key down event object
896
- * @returns {void}
897
- */
898
- onKeyDown(event) {
899
- // Check if the event is already handle by list or it set to 'readonly'
900
- if (event.defaultPrevented || this.readonly) {
901
- return;
902
- }
903
- switch (event.key) {
904
- case 'Enter':
905
- this.enter(event);
906
- break;
907
- case 'Up':
908
- case 'ArrowUp':
909
- this.up(event);
910
- break;
911
- case 'Down':
912
- case 'ArrowDown':
913
- this.down(event);
914
- break;
915
- default:
916
- return;
917
- }
918
- event.preventDefault();
919
- }
920
- /**
921
- * Run when tap event or enter
922
- * happened on the list
923
- * @returns {void}
924
- */
925
- onListInteraction() {
926
- this.freeTextValue = ''; // when the item has been selected, reset the freeText
927
- if (!this.multiple) {
928
- this.resetInput();
929
- const label = this.label;
930
- this.setOpened(false);
931
- // make sure that focus is kept withing an element
932
- // and the cursor is positioned at the end of input
933
- // Wait before the update cycle completes
934
- void this.updateComplete.then(() => {
935
- if (this.inputElement) {
936
- this.inputElement.focus();
937
- this.inputElement.setSelectionRange(label.length, label.length);
938
- }
939
- });
940
- }
941
- }
942
- /**
943
- * Handles action keys, either opening the list,
944
- * or, selecting a highlighted item.
945
- * @param event keyboard event
946
- * @returns {void}
947
- */
948
- enter(event) {
949
- if (this.opened && this.listEl) {
950
- this.reTargetEvent(event, this.listEl);
951
- this.onListInteraction();
952
- }
953
- else {
954
- this.setOpened(true);
955
- }
956
- }
957
- /**
958
- * Navigates up the list.
959
- * Opens the list if closed.
960
- * @param event keyboard event
961
- * @returns {void}
962
- */
963
- up(event) {
964
- if (this.opened && this.listEl) {
965
- this.reTargetEvent(event, this.listEl);
966
- }
967
- else {
968
- this.setOpened(true);
969
- }
970
- }
971
- /**
972
- * Navigates down the list.
973
- * Opens the list if closed.
974
- * @param event keyboard event
975
- * @returns {void}
976
- */
977
- down(event) {
978
- if (this.opened && this.listEl) {
979
- this.reTargetEvent(event, this.listEl);
980
- }
981
- else {
982
- this.setOpened(true);
983
- }
984
- }
985
- /**
986
- * Retarget event to target element
987
- * @param event keyboard event
988
- * @param target new target element
989
- * @returns re-targeted event or the passed event if target is invalid
990
- */
991
- reTargetEvent(event, target) {
992
- const path = event.composedPath();
993
- /* istanbul ignore next */
994
- if (path[0] === target) {
995
- // this must not happen, but keep it here to avoid infinitive loop
996
- return event;
997
- }
998
- const keyboardEvent = new CustomKeyboardEvent(event.type, event);
999
- target.dispatchEvent(keyboardEvent);
1000
- if (keyboardEvent.defaultPrevented) {
1001
- event.preventDefault();
1002
- }
1003
- return keyboardEvent;
1004
- }
1005
- /**
1006
- * Template for clear button
1007
- * Rendered when `clears` attribute is set
1008
- * @returns Popup template or undefined
1009
- */
1010
- get clearButtonTemplate() {
1011
- if (this.clears) {
1012
- return html `
1013
- <div
1014
- id="clears-button"
1015
- part="button button-clear"
1016
- ?hidden=${!this.label && !this.query && !this.freeTextValue && !this.inputText}><ef-icon part="icon icon-clear" icon="cross"></ef-icon>
1017
- </div>
1018
- `;
1019
- }
1020
- }
1021
- /**
1022
- * Template for selection badge in multiple mode
1023
- * @returns Selection badge template or undefined
1024
- */
1025
- get selectionBadgeTemplate() {
1026
- if (this.multiple) {
1027
- const selectionLength = this.selectionCount;
1028
- // TODO Make this a short format number using i18n which has specific support for this +
1029
- // benefit of being localised too
1030
- if (this.focused || selectionLength > 1) {
1031
- return html `
1032
- <ef-counter part="selection-badge" tabindex="-1" .value=${selectionLength} title=${ifDefined(selectionLength > 999 ? selectionLength.toLocaleString() : undefined)} max="999"></ef-counter>
1033
- `;
1034
- }
1035
- }
1036
- }
1037
- /**
1038
- * Returns a list template
1039
- */
1040
- get listTemplate() {
1041
- return html `
1042
- <ef-list
1043
- id="internal-list"
1044
- @value-changed="${this.onListValueChanged}"
1045
- .data="${this.composer}"
1046
- .multiple="${this.multiple}"
1047
- .renderer="${this.renderer}"
1048
- ></ef-list>
1049
- `;
1050
- }
1051
- /**
1052
- * Returns a template showing no options text
1053
- * Called when freeText mode is off and all items are filtered out
1054
- */
1055
- get noItemsTemplate() {
1056
- if (!this.freeText) {
1057
- return html `<ef-item disabled>${this.t('NO_OPTIONS')}</ef-item>`;
1058
- }
1059
- }
1060
- /**
1061
- * Returns template for popup
1062
- * Lazy loads the popup
1063
- * @returns Popup template or undefined
1064
- */
1065
- get popupTemplate() {
1066
- if (this.lazyRendered) {
1067
- const hasVisibleItems = this.listHasVisibleItems;
1068
- return html `<ef-overlay
1069
- part="list"
1070
- style="${styleMap(this.popupDynamicStyles)}"
1071
- @opened="${this.onPopupOpened}"
1072
- @closed="${this.onPopupClosed}"
1073
- .focusBoundary="${this}"
1074
- .opened="${this.opened && (hasVisibleItems || !this.freeText)}"
1075
- .positionTarget="${this}"
1076
- .position="${POPUP_POSITION}"
1077
- with-shadow
1078
- no-overlap
1079
- no-focus-management
1080
- no-autofocus
1081
- @focusin="${this.shiftFocus}"
1082
- >${hasVisibleItems ? this.listTemplate : this.noItemsTemplate}</ef-overlay>`;
1083
- }
1084
- }
1085
- /**
1086
- * Decorate `<input>` element with common properties extended from combobox input
1087
- * @returns template map
1088
- */
1089
- get decorateInputMap() {
1090
- return Object.assign(Object.assign({}, super.decorateInputMap), { 'part': 'input', 'type': 'text', 'role': 'combobox', '.value': this.focused ? this.inputText : this.freeTextValue || this.label, 'aria-expanded': this.opened ? 'true' : 'false', 'aria-haspopup': 'listbox', 'aria-autocomplete': 'list', 'aria-owns': 'internal-list', 'aria-activedescendant': this.highlightedItemValue });
1091
- }
1092
- /**
1093
- * Returns a template for input field
1094
- * @returns Input template
1095
- */
1096
- get inputTemplate() {
1097
- return html `<div part="input-wrapper">
1098
- ${this.renderInput()}
1099
- ${this.selectionBadgeTemplate}
1100
- ${this.clearButtonTemplate}
1101
- <div id="toggle-button" part="button button-toggle">
1102
- <ef-icon part="icon icon-toggle" icon="down"></ef-icon>
1103
- </div>
1104
- </div>`;
1105
- }
1106
- /**
1107
- * A `TemplateResult` that will be used
1108
- * to render the updated internal template.
1109
- * @returns Render template
1110
- */
1111
- render() {
1112
- return html `
1113
- ${this.inputTemplate}
1114
- ${this.popupTemplate}
1115
- `;
1116
- }
1117
- };
1118
- __decorate([
1119
- property({ type: Function, attribute: false })
1120
- ], ComboBox.prototype, "filter", void 0);
1121
- __decorate([
1122
- property({ type: Function, attribute: false })
1123
- ], ComboBox.prototype, "renderer", void 0);
1124
- __decorate([
1125
- property({ type: Boolean })
1126
- ], ComboBox.prototype, "multiple", null);
1127
- __decorate([
1128
- property({ type: Boolean, reflect: true })
1129
- ], ComboBox.prototype, "opened", void 0);
1130
- __decorate([
1131
- property({ type: String })
1132
- ], ComboBox.prototype, "placeholder", void 0);
1133
- __decorate([
1134
- property({ type: Boolean })
1135
- ], ComboBox.prototype, "clears", void 0);
1136
- __decorate([
1137
- property({ type: Boolean, attribute: 'free-text' })
1138
- ], ComboBox.prototype, "freeText", null);
1139
- __decorate([
1140
- property({ type: Boolean, reflect: true })
1141
- ], ComboBox.prototype, "error", void 0);
1142
- __decorate([
1143
- property({ type: Boolean, reflect: true })
1144
- ], ComboBox.prototype, "warning", void 0);
1145
- __decorate([
1146
- property({ type: Number, attribute: 'query-debounce-rate' })
1147
- ], ComboBox.prototype, "queryDebounceRate", null);
1148
- __decorate([
1149
- property({ attribute: false })
1150
- ], ComboBox.prototype, "data", null);
1151
- __decorate([
1152
- property({ type: String })
1153
- ], ComboBox.prototype, "value", null);
1154
- __decorate([
1155
- property({ type: Array, attribute: false })
1156
- ], ComboBox.prototype, "values", null);
1157
- __decorate([
1158
- property({ type: String, attribute: false })
1159
- ], ComboBox.prototype, "query", null);
1160
- __decorate([
1161
- query('#internal-list')
1162
- ], ComboBox.prototype, "listEl", void 0);
1163
- __decorate([
1164
- query('#toggle-button')
1165
- ], ComboBox.prototype, "toggleButtonEl", void 0);
1166
- __decorate([
1167
- query('#clears-button')
1168
- ], ComboBox.prototype, "clearsButtonEl", void 0);
1169
- __decorate([
1170
- property({ type: String, reflect: true })
1171
- ], ComboBox.prototype, "loading", void 0);
1172
- __decorate([
1173
- translate({ scope: 'ef-combo-box' })
1174
- ], ComboBox.prototype, "t", void 0);
1175
- __decorate([
1176
- eventOptions({ capture: true })
1177
- ], ComboBox.prototype, "shiftFocus", null);
1178
- ComboBox = __decorate([
1179
- customElement('ef-combo-box', {
1180
- alias: 'coral-combo-box'
1181
- })
1182
- ], ComboBox);
1183
- export { ComboBox };