@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,981 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import { ControlElement, html, css, 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 { styleMap } from '@refinitiv-ui/core/lib/directives/style-map.js';
7
- import { VERSION } from '../version.js';
8
- import '../overlay/index.js';
9
- import '../item/index.js';
10
- import '../icon/index.js';
11
- import { Item } from '../item/index.js';
12
- import { CollectionComposer } from '@refinitiv-ui/utils/lib/collection.js';
13
- import { TimeoutTaskRunner, AnimationTaskRunner } from '@refinitiv-ui/utils/lib/async.js';
14
- // Observer config for items
15
- const observerOptions = {
16
- subtree: true,
17
- childList: true,
18
- attributes: true,
19
- characterData: true,
20
- attributeFilter: [
21
- 'label',
22
- 'value',
23
- 'selected',
24
- 'disabled',
25
- 'readonly'
26
- ]
27
- };
28
- const LABEL_SEPARATOR = ', '; // TODO: for multiselect
29
- const POPUP_POSITION = ['bottom-start', 'top-start'];
30
- const KEY_SEARCH_DEBOUNCER = 300;
31
- var Navigation;
32
- (function (Navigation) {
33
- Navigation["FIRST"] = "First";
34
- Navigation["LAST"] = "Last";
35
- Navigation["NEXT"] = "Next";
36
- Navigation["PREVIOUS"] = "Previous";
37
- })(Navigation || (Navigation = {}));
38
- /**
39
- * Expands upon the native select element,
40
- * providing a fully themeable dropdown element.
41
- *
42
- * @attr {boolean} disabled - Set disabled state
43
- * @prop {boolean} [disabled=false] - Set disabled state
44
- *
45
- * @fires value-changed - Fired when the value property changes.
46
- * @fires opened-changed - Fired when the opened property changes.
47
- */
48
- let Select = class Select extends ControlElement {
49
- constructor() {
50
- super(...arguments);
51
- this.defaultRole = 'button';
52
- this.composer = new CollectionComposer([]);
53
- this._data = null;
54
- this.popupDynamicStyles = {}; /* set popup min-width based on select width or CSS vars */
55
- this.lazyRendered = false; /* speed up rendering by not populating popup window on first load */
56
- this.popupScrollTop = 0; /* remember scroll position on popup refit actions */
57
- this.observingMutations = false;
58
- this.keySearchTerm = ''; /* used for quick search */
59
- this.keySearchThrottler = new TimeoutTaskRunner(KEY_SEARCH_DEBOUNCER);
60
- this.resizeThrottler = new AnimationTaskRunner();
61
- /**
62
- * Placeholder to display when no value is set
63
- */
64
- this.placeholder = '';
65
- /**
66
- * Toggles the opened state of the list
67
- */
68
- this.opened = false;
69
- /**
70
- * Set state to error
71
- */
72
- this.error = false;
73
- /**
74
- * Set state to warning
75
- */
76
- this.warning = false;
77
- /**
78
- * This variable is here to ensure that the value and data are in sync when data is set after the value.
79
- * This is developer error to use both, selected and value to control the selections.
80
- * Therefore as soon as value has been set externally, selected state in data setter is ignored
81
- */
82
- this.cachedValue = '';
83
- /**
84
- * Handles all mutations and filters out
85
- * any Shadow DOM changes in polyfilled browsers
86
- * mutations collection of mutation records
87
- * @param mutations Observer mutations
88
- * @returns {void}
89
- */
90
- this.handleMutations = (mutations) => {
91
- const hasLightDomMutations = mutations
92
- .some(m => m.target.getRootNode() !== this.shadowRoot);
93
- if (hasLightDomMutations) {
94
- this.requestUpdate();
95
- }
96
- };
97
- this.shouldOpenOnFocus = false;
98
- /**
99
- * Used to store scroll position
100
- * @returns {void}
101
- */
102
- this.onPopupScroll = ({ target }) => {
103
- this.popupScrollTop = target.scrollTop;
104
- };
105
- }
106
- /**
107
- * Element version number
108
- * @returns version number
109
- */
110
- static get version() {
111
- return VERSION;
112
- }
113
- /**
114
- * A `CSSResultGroup` that will be used
115
- * to style the host, slotted children
116
- * and the internal template of the element.
117
- * @return CSS template
118
- */
119
- static get styles() {
120
- return css `
121
- :host {
122
- outline: none;
123
- position: relative;
124
- user-select: none;
125
- -webkit-user-select: none;
126
- display: inline-block;
127
- }
128
-
129
- [part=label],
130
- [part=placeholder] {
131
- white-space: nowrap;
132
- overflow: hidden;
133
- text-overflow: ellipsis;
134
- }
135
- [part=icon] {
136
- flex: none;
137
- }
138
- :host [part=list] {
139
- overflow-y: auto;
140
- }
141
- :host [part="list"] ::slotted(:not(ef-item)) {
142
- display: none;
143
- }
144
- #box {
145
- align-items: center;
146
- display: inline-flex;
147
- flex-flow: row nowrap;
148
- overflow: hidden;
149
- flex: 1 1 100%;
150
- }
151
- #text {
152
- position: relative;
153
- flex: 1 1 auto;
154
- height: 100%;
155
- display: flex;
156
- align-items: center;
157
- min-width: 0;
158
- }
159
- #trigger {
160
- position: absolute;
161
- top: 0;
162
- right: 0;
163
- bottom: 0;
164
- left: 0;
165
- }
166
- #select {
167
- position: absolute;
168
- top: 0;
169
- left: 0;
170
- right: 0;
171
- bottom: 0;
172
- width: 100%;
173
- height: 100%;
174
- opacity: 0;
175
- border: none;
176
- padding: 0;
177
- margin: 0;
178
- }
179
- `;
180
- }
181
- /**
182
- * Current text content of the selected value
183
- * @readonly
184
- */
185
- get label() {
186
- return this.labels[0];
187
- }
188
- /**
189
- * Current text content of the selected values
190
- * @ignore
191
- * @readonly
192
- */
193
- get labels() {
194
- if (this.hasDataItems()) {
195
- return this.selectedDataItems.map(item => this.composer.getItemPropertyValue(item, 'label'));
196
- }
197
- return this.selectedSlotItems.map(item => this.getItemLabel(item));
198
- }
199
- /**
200
- * Switch to multiple select input
201
- * @ignore
202
- * @param multiple True if element needs to support multi selection
203
- */
204
- set multiple(multiple) {
205
- // TODO: not implemented
206
- }
207
- /**
208
- * @ignore
209
- */
210
- get multiple() {
211
- return false;
212
- }
213
- /**
214
- * Construct the menu from data object. Cannot be used with slotted content
215
- * @type {SelectData | null}
216
- * @default null
217
- */
218
- get data() {
219
- return this._data;
220
- }
221
- set data(value) {
222
- const oldValue = this._data;
223
- if (oldValue === value) {
224
- return;
225
- }
226
- else if (Array.isArray(value)) {
227
- this.composer = new CollectionComposer(value);
228
- }
229
- else {
230
- this.composer = new CollectionComposer([]);
231
- }
232
- this._data = value;
233
- // check if new set of data contains selected, which becomes the new value
234
- // otherwise try to set current value
235
- if (!this.selectedDataItems.length) {
236
- this.value = this.cachedValue;
237
- }
238
- this.requestUpdate('data', oldValue);
239
- }
240
- /**
241
- * Value of the element
242
- * @param value Element value
243
- * @default -
244
- */
245
- set value(value) {
246
- value = this.castValue(value);
247
- this.cachedValue = value;
248
- const oldValue = this.value;
249
- if (value !== oldValue) {
250
- this.stopObserveMutations();
251
- // setting the value always overrides the selected attribute
252
- // either defined in data or by having selected as an attribute
253
- this.clearSelection();
254
- this.selectValue(value);
255
- this.requestUpdate('value', oldValue);
256
- }
257
- }
258
- get value() {
259
- return this.values[0] || '';
260
- }
261
- /**
262
- * Array of selected items` values
263
- * @ignore
264
- * @readonly
265
- */
266
- get values() {
267
- if (this.hasDataItems()) {
268
- return this.selectedDataItems.map(item => this.composer.getItemPropertyValue(item, 'value'));
269
- }
270
- return this.selectedSlotItems.map(item => this.getItemValue(item));
271
- }
272
- /**
273
- * Called when connected to DOM
274
- * @returns {void}
275
- */
276
- connectedCallback() {
277
- super.connectedCallback();
278
- // Indicating that this select has a popup of type listbox
279
- this.setAttribute('aria-haspopup', 'listbox');
280
- }
281
- /**
282
- * Updates the element
283
- * @param changedProperties Properties that has changed
284
- * @returns {void}
285
- */
286
- update(changedProperties) {
287
- this.cachedValue = ''; /* reset cached value as it is only valid when value and data are set the same time */
288
- const focusedChanged = changedProperties.has(FocusedPropertyKey);
289
- // the opened logic is bound to focus state
290
- if (focusedChanged) {
291
- // When focus changes the popup can open only on tapstart
292
- if (this.focused && this.shouldOpenOnFocus) {
293
- this.setOpened(true);
294
- }
295
- this.shouldOpenOnFocus = false;
296
- }
297
- if (changedProperties.has('opened')) {
298
- if (this.opened) {
299
- this.opening();
300
- }
301
- else {
302
- this.closing();
303
- }
304
- this.setAttribute('aria-expanded', this.opened ? 'true' : 'false');
305
- }
306
- if (changedProperties.has('error')) {
307
- this.setAttribute('aria-invalid', this.error ? 'true' : 'false');
308
- }
309
- super.update(changedProperties);
310
- }
311
- /**
312
- * Called after the component is first rendered
313
- * @param changedProperties Properties which have changed
314
- * @returns {void}
315
- */
316
- firstUpdated(changedProperties) {
317
- super.firstUpdated(changedProperties);
318
- this.addEventListener('keydown', this.onKeyDown); /* keydown when select is closed */
319
- }
320
- /**
321
- * Called when element finished updating
322
- * @param changedProperties Properties which have changed
323
- * @returns {void}
324
- */
325
- updated(changedProperties) {
326
- super.updated(changedProperties);
327
- // we must wait while all elements in the tree are updated before starting the mutation observer
328
- void this.updateComplete.then(() => {
329
- // Start watching for any child mutations
330
- this.observeMutations();
331
- });
332
- }
333
- /**
334
- * Run when popup is opening
335
- * Calculate CSS variables an computed width
336
- * @returns {void}
337
- */
338
- opening() {
339
- this.lazyRendered = true;
340
- this.restrictPopupWidth(); /* styles ary dynamically applied in rendering */
341
- }
342
- /**
343
- * Run when popup is closing
344
- * @returns {void}
345
- */
346
- closing() {
347
- // no content
348
- }
349
- /**
350
- * Observe any changes to Light DOM
351
- * This observer is self contained and should
352
- * be garbage collected when there are no element references.
353
- * @returns {void}
354
- */
355
- observeMutations() {
356
- // Start watching for any new mutations if slotted content is used
357
- if (!this.observingMutations && !this.hasDataItems()) {
358
- if (!this.mutationObserver) {
359
- this.mutationObserver = new MutationObserver(this.handleMutations);
360
- }
361
- this.mutationObserver.observe(this, observerOptions);
362
- this.observingMutations = true;
363
- }
364
- }
365
- /**
366
- * Stop observe any changes to Light DOM
367
- * There must not be any observation on any internal changes
368
- * as it may cause excessive re-rendering
369
- * @returns {void}
370
- */
371
- stopObserveMutations() {
372
- if (this.observingMutations && this.mutationObserver) {
373
- this.mutationObserver.disconnect();
374
- this.observingMutations = false;
375
- }
376
- }
377
- /**
378
- * Popup has to use max width if --list-max-width specified
379
- * otherwise, popup should have same width as control or wider
380
- * @returns {void}
381
- */
382
- restrictPopupWidth() {
383
- /* istanbul ignore next */
384
- if (this.offsetWidth === 0) {
385
- // this code might happen only when opened has been set during initialisation
386
- // or when display is set to none
387
- this.resizeThrottler.schedule(() => {
388
- if (this.offsetWidth) { /* must be here to avoid infinitive loop */
389
- this.restrictPopupWidth();
390
- this.requestUpdate();
391
- }
392
- });
393
- return;
394
- }
395
- const maxWidth = this.getComputedVariable('--list-max-width', 'none');
396
- let minWidth = this.offsetWidth;
397
- if (maxWidth !== 'none') {
398
- // reset min-width if max-width less than min-width, otherwise browser won't apply max-width
399
- if (parseInt(maxWidth, 10) < minWidth) {
400
- minWidth = 0;
401
- }
402
- }
403
- this.popupDynamicStyles.minWidth = `${minWidth}px`;
404
- }
405
- /**
406
- * Set opened state with event
407
- * @param opened True if opened
408
- * @returns {void}
409
- */
410
- setOpened(opened) {
411
- if (this.opened !== opened) {
412
- this.notifyPropertyChange('opened', opened);
413
- this.opened = opened;
414
- }
415
- }
416
- /**
417
- * This flag is required to remove the frame gap
418
- * between tap start and opening the popup
419
- * @returns {void}
420
- */
421
- openOnFocus() {
422
- if (this.opened) {
423
- return;
424
- }
425
- if (this.focused) {
426
- this.setOpened(true);
427
- return;
428
- }
429
- this.shouldOpenOnFocus = true;
430
- }
431
- /**
432
- * Toggles the opened state of the list
433
- * @returns {void}
434
- */
435
- toggleOpened() {
436
- if (this.opened) {
437
- this.setOpened(false);
438
- }
439
- else {
440
- this.openOnFocus();
441
- }
442
- }
443
- /**
444
- * Scroll to first selected item
445
- * @returns {void}
446
- */
447
- scrollToSelected() {
448
- const selected = this.getSelectedElements()[0];
449
- if (selected) {
450
- selected.scrollIntoView({
451
- block: 'nearest'
452
- });
453
- }
454
- }
455
- /**
456
- * Used to restore scroll position on each refit event
457
- * @returns {void}
458
- */
459
- onPopupRefit({ target }) {
460
- target.scrollTop = this.popupScrollTop;
461
- }
462
- /**
463
- * Run when popup closes externally via opened-changed event
464
- * Required to propagate the event
465
- * @param event opened-changed event
466
- * @returns {void}
467
- */
468
- onPopupOpenedChanged(event) {
469
- event.preventDefault();
470
- this.setOpened(event.detail.value);
471
- }
472
- /**
473
- * Run when popup gets opened
474
- * @returns {void}
475
- */
476
- onPopupOpened({ target }) {
477
- this.scrollToSelected();
478
- this.setItemHighlight(this.getSelectedElements()[0]);
479
- const eventOptions = {
480
- capture: true,
481
- passive: true
482
- };
483
- target === null || target === void 0 ? void 0 : target.addEventListener('scroll', this.onPopupScroll, eventOptions);
484
- }
485
- /**
486
- * Run when popup gets closed
487
- * @returns {void}
488
- */
489
- onPopupClosed({ target }) {
490
- const eventOptions = {
491
- capture: true,
492
- passive: true
493
- };
494
- target === null || target === void 0 ? void 0 : target.removeEventListener('scroll', this.onPopupScroll, eventOptions);
495
- this.setItemHighlight();
496
- this.popupScrollTop = 0;
497
- }
498
- /**
499
- * Run when tap event happens on render root
500
- * @param event tap event
501
- * @returns {void}
502
- */
503
- onPopupTap(event) {
504
- const item = this.findSelectableElement(event);
505
- if (item) {
506
- this.setValueAndNotify(this.getItemValue(item));
507
- this.setOpened(false);
508
- }
509
- }
510
- /**
511
- * Run mouse move event over the popup
512
- * @param event mouse move event
513
- * @returns {void}
514
- */
515
- onPopupMouseMove(event) {
516
- var _a;
517
- (_a = this.menuEl) === null || _a === void 0 ? void 0 : _a.focus();
518
- const item = this.findSelectableElement(event);
519
- if (item) {
520
- this.setItemHighlight(item);
521
- }
522
- }
523
- /**
524
- * Handles key input when popup is closed
525
- * @param event Key down event object
526
- * @returns {void}
527
- */
528
- onKeyDown(event) {
529
- switch (event.key) {
530
- case 'Up':
531
- case 'ArrowUp':
532
- case 'Down':
533
- case 'ArrowDown':
534
- case 'Enter':
535
- case 'Spacebar':
536
- case ' ':
537
- this.setOpened(true);
538
- break;
539
- default:
540
- return;
541
- }
542
- event.preventDefault();
543
- }
544
- /**
545
- * Handles popup key input when popup is opened
546
- * @param event Key down event object
547
- * @returns {void}
548
- */
549
- onPopupKeyDown(event) {
550
- var _a;
551
- switch (event.key) {
552
- case ' ':
553
- case 'Spacebar':
554
- case 'Enter':
555
- (_a = this.highlightedItem) === null || _a === void 0 ? void 0 : _a.click();
556
- break;
557
- case 'Up':
558
- case 'ArrowUp':
559
- this.focusElement(Navigation.PREVIOUS);
560
- break;
561
- case 'Down':
562
- case 'ArrowDown':
563
- this.focusElement(Navigation.NEXT);
564
- break;
565
- case 'Tab':
566
- this.focusElement(event.shiftKey ? Navigation.PREVIOUS : Navigation.NEXT);
567
- break;
568
- case 'Home':
569
- this.focusElement(Navigation.FIRST);
570
- break;
571
- case 'End':
572
- this.focusElement(Navigation.LAST);
573
- break;
574
- default:
575
- if (this.isValidFilterKey(event)) {
576
- this.onKeySearch(event.key);
577
- break;
578
- }
579
- return;
580
- // no default
581
- }
582
- event.preventDefault();
583
- event.stopPropagation(); /* must be her to not reach self key listener */
584
- }
585
- /**
586
- * Check if keyboard keydown can be used for data searching
587
- * @param event Keyboard event
588
- * @returns true if a valid key
589
- */
590
- isValidFilterKey(event) {
591
- // all printable keys have length of 1. This is better than regexp as we cover all non latin characters
592
- return event.key.length === 1
593
- && !event.ctrlKey
594
- && !event.altKey
595
- && !event.metaKey;
596
- }
597
- /**
598
- * Focus and highlight element according to specified direction
599
- * @param direction previous, next, first or last focusable element
600
- * @returns {void}
601
- */
602
- focusElement(direction) {
603
- const highlightedItem = this.highlightedItem || this.getSelectedElements()[0];
604
- const selectableElements = this.getSelectableElements();
605
- if (selectableElements.length === 0) {
606
- return;
607
- }
608
- const index = highlightedItem ? selectableElements.indexOf(highlightedItem) : -1;
609
- const firstElement = selectableElements[0];
610
- const lastElement = selectableElements[selectableElements.length - 1];
611
- let element;
612
- switch (direction) {
613
- case Navigation.PREVIOUS:
614
- element = index === -1 ? lastElement : selectableElements[index - 1];
615
- break;
616
- case Navigation.NEXT:
617
- element = index === -1 ? firstElement : selectableElements[index + 1];
618
- break;
619
- case Navigation.FIRST:
620
- element = firstElement;
621
- break;
622
- case Navigation.LAST:
623
- element = lastElement;
624
- break;
625
- default:
626
- break;
627
- }
628
- if (!element) {
629
- element = direction === Navigation.NEXT ? firstElement : lastElement;
630
- }
631
- if (element) {
632
- element.focus();
633
- this.setItemHighlight(element);
634
- }
635
- }
636
- /**
637
- * Highlight or remove highlight from an item
638
- * @param [item] An item to highlight
639
- * @returns {void}
640
- */
641
- setItemHighlight(item) {
642
- if (this.highlightedItem === item) {
643
- return;
644
- }
645
- if (this.highlightedItem) {
646
- this.highlightedItem.highlighted = false;
647
- }
648
- this.highlightedItem = item;
649
- if (item) {
650
- item.highlighted = true;
651
- }
652
- }
653
- /**
654
- * A simple search that highlight elements on key press
655
- * @param key A key pressed
656
- * @returns {void}
657
- */
658
- onKeySearch(key) {
659
- this.keySearchTerm += key.toLowerCase();
660
- this.keySearchThrottler.schedule(() => {
661
- this.keySearchTerm = '';
662
- });
663
- // start from highlighted and continue in circles
664
- let selectableElements = this.getSelectableElements();
665
- const highlightedIdx = this.highlightedItem ? selectableElements.indexOf(this.highlightedItem) : -1;
666
- selectableElements = selectableElements.concat(selectableElements.splice(0, highlightedIdx));
667
- const focusElement = selectableElements.find(item => {
668
- const label = this.getItemLabel(item).toLowerCase();
669
- return label.startsWith(this.keySearchTerm) && item !== this.highlightedItem;
670
- });
671
- if (focusElement) {
672
- focusElement.focus();
673
- this.setItemHighlight(focusElement);
674
- }
675
- }
676
- /**
677
- * Check if element can be selected
678
- * @param element Element to check
679
- * @returns true if element can be selected
680
- */
681
- isSelectableElement(element) {
682
- // TODO: remove disabled && readonly check once ControlElement tabIndex issue is fixed
683
- return element instanceof Item && element.tabIndex >= 0 && !element.disabled && !element.readonly;
684
- }
685
- /**
686
- * Get a list of selectable HTML Elements
687
- * *Can be used only when select is opened*
688
- * @returns A list of selectable HTML elements
689
- */
690
- getSelectableElements() {
691
- const root = this.hasDataItems() ? this.menuEl : this;
692
- /* istanbul ignore next */
693
- if (!root) {
694
- return [];
695
- }
696
- const items = [];
697
- const rootChildren = root.children;
698
- for (let i = 0; i < rootChildren.length; i += 1) {
699
- const item = rootChildren[i];
700
- if (this.isSelectableElement(item)) {
701
- items.push(item);
702
- }
703
- }
704
- return items;
705
- }
706
- /**
707
- * Find selectable element is the event composed path
708
- * @param event Event to check
709
- * @returns The first selectable element or undefined
710
- */
711
- findSelectableElement(event) {
712
- const path = event.composedPath();
713
- for (let i = 0; i < path.length; i += 1) {
714
- const element = path[i];
715
- if (element === this) {
716
- return;
717
- }
718
- if (this.isSelectableElement(element)) {
719
- return element;
720
- }
721
- }
722
- }
723
- /**
724
- * Get a list of selected HTML elements
725
- * *Can be used only when select is opened*
726
- * @returns A list of selected elements
727
- */
728
- getSelectedElements() {
729
- return this.getSelectableElements().filter(item => item.selected);
730
- }
731
- /**
732
- * Clears the current selected items
733
- * @returns {void}
734
- */
735
- clearSelection() {
736
- if (this.hasDataItems()) {
737
- this.selectedDataItems.forEach((item) => this.composer.setItemPropertyValue(item, 'selected', false));
738
- }
739
- else {
740
- this.selectedSlotItems.forEach(item => {
741
- item.selected = false;
742
- });
743
- }
744
- this.requestUpdate();
745
- }
746
- /**
747
- * Mark item as selected
748
- * @param value Value to select
749
- * @returns true if corresponding item is found and item selected
750
- */
751
- selectValue(value) {
752
- if (!this.values.includes(value)) {
753
- if (this.hasDataItems()) {
754
- return this.selectDataItem(value);
755
- }
756
- else {
757
- return this.selectSlotItem(value);
758
- }
759
- }
760
- return false;
761
- }
762
- /**
763
- * Mark data item as selected
764
- * @param value Item value
765
- * @returns true if corresponding item is found and item selected
766
- */
767
- selectDataItem(value) {
768
- const item = this.composer.queryItemsByPropertyValue('value', value)[0];
769
- if (item) {
770
- this.composer.setItemPropertyValue(item, 'selected', true);
771
- return true;
772
- }
773
- return false;
774
- }
775
- /**
776
- * Mark slotted item as selected
777
- * @param value Item value, item label or item text content
778
- * @returns true if corresponding item is found and item selected
779
- */
780
- selectSlotItem(value) {
781
- const items = this.getSelectableElements();
782
- for (let i = 0; i < items.length; i += 1) {
783
- const item = items[i];
784
- if (this.getItemValue(item) === value) {
785
- item.selected = true;
786
- return true;
787
- }
788
- }
789
- return false;
790
- }
791
- /**
792
- * Helper to return a value from an item
793
- * @param item select item
794
- * @returns value
795
- */
796
- getItemValue(item) {
797
- return item.value || (item.hasAttribute('value') ? '' : this.getItemLabel(item));
798
- }
799
- /**
800
- * Helper to return a label from an item
801
- * @param item select item
802
- * @returns value
803
- */
804
- getItemLabel(item) {
805
- return item.label || item.textContent || '';
806
- }
807
- /**
808
- * Check whether select is working with data or slotted content
809
- * @returns True if working with data
810
- */
811
- hasDataItems() {
812
- var _a;
813
- return !!((_a = this.data) === null || _a === void 0 ? void 0 : _a.length);
814
- }
815
- /**
816
- * Retrieve the selected data items
817
- * @returns Selected data item
818
- */
819
- get selectedDataItems() {
820
- return this.composer.queryItemsByPropertyValue('selected', true);
821
- }
822
- /**
823
- * Retrieve the selected items
824
- * @returns Selected data item
825
- */
826
- get selectedSlotItems() {
827
- return this.getSelectedElements();
828
- }
829
- /**
830
- * Calculating whether the placeholder should be hidden
831
- * @returns result
832
- */
833
- placeholderHidden() {
834
- return !!(this.labels.length > 0 || this.value);
835
- }
836
- /**
837
- * Create template for menu item
838
- * @param item JSON object to parse
839
- * @returns template result
840
- */
841
- toItem(item) {
842
- switch (item.type) {
843
- case 'divider':
844
- return html `<ef-item role="presentation" part="item" type="divider"></ef-item>`;
845
- case 'header':
846
- return html `<ef-item
847
- role="presentation"
848
- part="item"
849
- type="header"
850
- .label=${item.label}></ef-item>`;
851
- // no default
852
- }
853
- return html `<ef-item
854
- role="option"
855
- part="item"
856
- .value=${item.value}
857
- .label=${item.label}
858
- ?selected=${this.composer.getItemPropertyValue(item, 'selected')}
859
- ?disabled=${item.disabled}
860
- ></ef-item>`;
861
- }
862
- /**
863
- * Template for placeholder
864
- */
865
- get placeholderTemplate() {
866
- return html `<div part="placeholder">${this.placeholder}</div>`;
867
- }
868
- /**
869
- * Template for label
870
- */
871
- get labelTemplate() {
872
- return html `<div part="label">${this.multiple ? this.labels.join(LABEL_SEPARATOR) : this.label}</div>`;
873
- }
874
- /**
875
- * Edit template when select is not readonly or disabled
876
- */
877
- get editTemplate() {
878
- if (!this.readonly && !this.disabled) {
879
- return html `
880
- <div id="trigger" @tapstart="${this.toggleOpened}"></div>
881
- ${this.popupTemplate}
882
- `;
883
- }
884
- }
885
- /**
886
- * Get default slot template
887
- */
888
- get slottedContent() {
889
- return html `<slot></slot>`;
890
- }
891
- /**
892
- * Get data iterator template
893
- */
894
- get dataContent() {
895
- return html `${this.composer.queryItems(() => true).map(item => this.toItem(item))}`;
896
- }
897
- /**
898
- * Edit template when select is not readonly or disabled
899
- */
900
- get popupTemplate() {
901
- if (this.lazyRendered) {
902
- return html `<ef-overlay
903
- tabindex="-1"
904
- id="menu"
905
- part="list"
906
- role="listbox"
907
- style=${styleMap(this.popupDynamicStyles)}
908
- with-shadow
909
- lock-position-target
910
- .positionTarget=${this}
911
- .position=${POPUP_POSITION}
912
- ?opened=${this.opened}
913
- @tap=${this.onPopupTap}
914
- @mousemove=${this.onPopupMouseMove}
915
- @keydown=${this.onPopupKeyDown}
916
- @opened-changed="${this.onPopupOpenedChanged}"
917
- @opened="${this.onPopupOpened}"
918
- @refit=${this.onPopupRefit}
919
- @closed="${this.onPopupClosed}">${this.hasDataItems() ? this.dataContent : this.slottedContent}</ef-overlay>`;
920
- }
921
- else {
922
- // This code is required because IE11 polyfill need items to be within a slot
923
- // to make MutationObserver to observe items correctly
924
- return html `<div style="display: none !important;"><slot></slot></div>`;
925
- }
926
- }
927
- /**
928
- * A `TemplateResult` that will be used
929
- * to render the updated internal template.
930
- * @return Render template
931
- */
932
- render() {
933
- return html `
934
- <div id="box">
935
- <div id="text">
936
- ${this.placeholderHidden() ? this.labelTemplate : this.placeholderTemplate}
937
- </div>
938
- <ef-icon icon="down" part="icon"></ef-icon>
939
- </div>
940
- ${this.editTemplate}`;
941
- }
942
- };
943
- __decorate([
944
- property({ type: String, attribute: false })
945
- ], Select.prototype, "label", null);
946
- __decorate([
947
- property({ type: Array, attribute: false })
948
- ], Select.prototype, "labels", null);
949
- __decorate([
950
- property({ type: String })
951
- ], Select.prototype, "placeholder", void 0);
952
- __decorate([
953
- property({ type: Boolean, reflect: true })
954
- ], Select.prototype, "opened", void 0);
955
- __decorate([
956
- property({ type: Boolean, reflect: true })
957
- ], Select.prototype, "error", void 0);
958
- __decorate([
959
- property({ type: Boolean, reflect: true })
960
- ], Select.prototype, "warning", void 0);
961
- __decorate([
962
- property({ type: Boolean })
963
- ], Select.prototype, "multiple", null);
964
- __decorate([
965
- property({ attribute: false })
966
- ], Select.prototype, "data", null);
967
- __decorate([
968
- property({ type: String, attribute: false })
969
- ], Select.prototype, "value", null);
970
- __decorate([
971
- property({ attribute: false })
972
- ], Select.prototype, "values", null);
973
- __decorate([
974
- query('#menu')
975
- ], Select.prototype, "menuEl", void 0);
976
- Select = __decorate([
977
- customElement('ef-select', {
978
- alias: 'coral-select'
979
- })
980
- ], Select);
981
- export { Select };