@refinitiv-ui/elements 5.3.4 → 5.8.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 (352) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/lib/accordion/custom-elements.md +18 -0
  3. package/lib/accordion/index.d.ts +5 -5
  4. package/lib/accordion/index.js +8 -11
  5. package/lib/appstate-bar/custom-elements.md +22 -0
  6. package/lib/appstate-bar/index.d.ts +5 -5
  7. package/lib/appstate-bar/index.js +8 -11
  8. package/lib/autosuggest/custom-elements.json +24 -4
  9. package/lib/autosuggest/custom-elements.md +54 -0
  10. package/lib/autosuggest/helpers/types.d.ts +1 -1
  11. package/lib/autosuggest/helpers/utils.d.ts +2 -2
  12. package/lib/autosuggest/helpers/utils.js +1 -2
  13. package/lib/autosuggest/index.d.ts +13 -8
  14. package/lib/autosuggest/index.js +38 -31
  15. package/lib/button/custom-elements.json +2 -2
  16. package/lib/button/custom-elements.md +23 -0
  17. package/lib/button/index.d.ts +13 -13
  18. package/lib/button/index.js +41 -31
  19. package/lib/button-bar/custom-elements.md +9 -0
  20. package/lib/button-bar/index.d.ts +3 -3
  21. package/lib/button-bar/index.js +8 -10
  22. package/lib/calendar/constants.d.ts +22 -0
  23. package/lib/calendar/constants.js +23 -0
  24. package/lib/calendar/custom-elements.json +8 -6
  25. package/lib/calendar/custom-elements.md +35 -0
  26. package/lib/calendar/index.d.ts +9 -7
  27. package/lib/calendar/index.js +20 -38
  28. package/lib/calendar/locales.d.ts +1 -31
  29. package/lib/calendar/locales.js +0 -104
  30. package/lib/calendar/types.d.ts +1 -5
  31. package/lib/calendar/types.js +1 -6
  32. package/lib/calendar/utils.d.ts +31 -1
  33. package/lib/calendar/utils.js +104 -2
  34. package/lib/canvas/custom-elements.json +7 -5
  35. package/lib/canvas/custom-elements.md +27 -0
  36. package/lib/canvas/index.d.ts +4 -3
  37. package/lib/canvas/index.js +8 -10
  38. package/lib/card/custom-elements.json +3 -1
  39. package/lib/card/custom-elements.md +24 -0
  40. package/lib/card/helpers/types.d.ts +1 -1
  41. package/lib/card/index.d.ts +10 -8
  42. package/lib/card/index.js +14 -13
  43. package/lib/chart/custom-elements.json +1 -1
  44. package/lib/chart/custom-elements.md +16 -0
  45. package/lib/chart/helpers/index.d.ts +2 -2
  46. package/lib/chart/helpers/index.js +2 -2
  47. package/lib/chart/index.d.ts +6 -6
  48. package/lib/chart/index.js +12 -14
  49. package/lib/checkbox/custom-elements.json +4 -4
  50. package/lib/checkbox/custom-elements.md +18 -0
  51. package/lib/checkbox/index.d.ts +21 -13
  52. package/lib/checkbox/index.js +56 -31
  53. package/lib/clock/custom-elements.json +21 -4
  54. package/lib/clock/custom-elements.md +28 -0
  55. package/lib/clock/index.d.ts +17 -5
  56. package/lib/clock/index.js +37 -18
  57. package/lib/clock/themes/halo/dark/index.js +1 -1
  58. package/lib/clock/themes/halo/light/index.js +1 -1
  59. package/lib/clock/themes/solar/charcoal/index.js +1 -1
  60. package/lib/clock/themes/solar/pearl/index.js +1 -1
  61. package/lib/clock/utils/TickManager.js +2 -2
  62. package/lib/collapse/custom-elements.md +27 -0
  63. package/lib/collapse/index.d.ts +7 -7
  64. package/lib/collapse/index.js +11 -13
  65. package/lib/color-dialog/custom-elements.json +29 -16
  66. package/lib/color-dialog/custom-elements.md +39 -0
  67. package/lib/color-dialog/elements/color-palettes.d.ts +5 -5
  68. package/lib/color-dialog/elements/color-palettes.js +9 -13
  69. package/lib/color-dialog/elements/grayscale-palettes.d.ts +5 -5
  70. package/lib/color-dialog/elements/grayscale-palettes.js +10 -13
  71. package/lib/color-dialog/elements/palettes.d.ts +10 -3
  72. package/lib/color-dialog/elements/palettes.js +58 -45
  73. package/lib/color-dialog/helpers/color-helpers.d.ts +7 -53
  74. package/lib/color-dialog/helpers/color-helpers.js +12 -109
  75. package/lib/color-dialog/helpers/value-model.d.ts +1 -1
  76. package/lib/color-dialog/helpers/value-model.js +18 -16
  77. package/lib/color-dialog/index.d.ts +19 -19
  78. package/lib/color-dialog/index.js +47 -45
  79. package/lib/combo-box/custom-elements.json +28 -16
  80. package/lib/combo-box/custom-elements.md +35 -0
  81. package/lib/combo-box/helpers/filter.d.ts +4 -4
  82. package/lib/combo-box/helpers/types.d.ts +2 -2
  83. package/lib/combo-box/index.d.ts +26 -18
  84. package/lib/combo-box/index.js +36 -27
  85. package/lib/combo-box/themes/halo/dark/index.js +1 -1
  86. package/lib/combo-box/themes/halo/light/index.js +1 -1
  87. package/lib/combo-box/themes/solar/charcoal/index.js +1 -1
  88. package/lib/combo-box/themes/solar/pearl/index.js +1 -1
  89. package/lib/counter/custom-elements.json +8 -4
  90. package/lib/counter/custom-elements.md +11 -0
  91. package/lib/counter/index.d.ts +5 -3
  92. package/lib/counter/index.js +11 -12
  93. package/lib/datetime-picker/custom-elements.json +52 -23
  94. package/lib/datetime-picker/custom-elements.md +57 -0
  95. package/lib/datetime-picker/index.d.ts +25 -14
  96. package/lib/datetime-picker/index.js +46 -35
  97. package/lib/datetime-picker/locales.d.ts +1 -1
  98. package/lib/datetime-picker/locales.js +12 -1
  99. package/lib/datetime-picker/themes/solar/charcoal/index.js +1 -1
  100. package/lib/datetime-picker/themes/solar/pearl/index.js +1 -1
  101. package/lib/datetime-picker/types.d.ts +1 -1
  102. package/lib/datetime-picker/utils.js +1 -1
  103. package/lib/dialog/custom-elements.json +34 -12
  104. package/lib/dialog/custom-elements.md +47 -0
  105. package/lib/dialog/index.d.ts +17 -20
  106. package/lib/dialog/index.js +28 -31
  107. package/lib/email-field/custom-elements.json +81 -94
  108. package/lib/email-field/custom-elements.md +37 -0
  109. package/lib/email-field/index.d.ts +44 -116
  110. package/lib/email-field/index.js +48 -249
  111. package/lib/email-field/themes/solar/charcoal/index.js +1 -1
  112. package/lib/email-field/themes/solar/pearl/index.js +1 -1
  113. package/lib/events.d.ts +2 -2
  114. package/lib/events.js +1 -2
  115. package/lib/flag/custom-elements.md +10 -0
  116. package/lib/flag/index.d.ts +6 -4
  117. package/lib/flag/index.js +12 -12
  118. package/lib/flag/utils/FlagLoader.d.ts +1 -1
  119. package/lib/flag/utils/FlagLoader.js +1 -1
  120. package/lib/header/custom-elements.md +18 -0
  121. package/lib/header/index.d.ts +2 -2
  122. package/lib/header/index.js +5 -8
  123. package/lib/heatmap/custom-elements.md +26 -0
  124. package/lib/heatmap/helpers/color.d.ts +1 -1
  125. package/lib/heatmap/helpers/color.js +1 -1
  126. package/lib/heatmap/helpers/text.d.ts +1 -1
  127. package/lib/heatmap/index.d.ts +7 -7
  128. package/lib/heatmap/index.js +15 -16
  129. package/lib/icon/custom-elements.json +6 -4
  130. package/lib/icon/custom-elements.md +8 -0
  131. package/lib/icon/index.d.ts +9 -6
  132. package/lib/icon/index.js +28 -18
  133. package/lib/icon/utils/IconLoader.d.ts +6 -1
  134. package/lib/icon/utils/IconLoader.js +24 -17
  135. package/lib/index.d.ts +2 -1
  136. package/lib/index.js +2 -1
  137. package/lib/interactive-chart/custom-elements.json +6 -10
  138. package/lib/interactive-chart/custom-elements.md +31 -0
  139. package/lib/interactive-chart/helpers/types.d.ts +2 -2
  140. package/lib/interactive-chart/index.d.ts +11 -8
  141. package/lib/interactive-chart/index.js +17 -17
  142. package/lib/item/custom-elements.json +4 -4
  143. package/lib/item/custom-elements.md +29 -0
  144. package/lib/item/helpers/types.d.ts +1 -1
  145. package/lib/item/index.d.ts +18 -8
  146. package/lib/item/index.js +36 -16
  147. package/lib/label/custom-elements.md +11 -0
  148. package/lib/label/index.d.ts +3 -3
  149. package/lib/label/index.js +12 -20
  150. package/lib/layout/custom-elements.md +26 -0
  151. package/lib/layout/index.d.ts +3 -3
  152. package/lib/layout/index.js +6 -9
  153. package/lib/led-gauge/custom-elements.json +4 -4
  154. package/lib/led-gauge/custom-elements.md +17 -0
  155. package/lib/led-gauge/index.d.ts +5 -4
  156. package/lib/led-gauge/index.js +9 -11
  157. package/lib/list/custom-elements.json +18 -5
  158. package/lib/list/custom-elements.md +32 -0
  159. package/lib/list/helpers/list-renderer.d.ts +2 -2
  160. package/lib/list/helpers/list-renderer.js +4 -2
  161. package/lib/list/helpers/types.d.ts +2 -2
  162. package/lib/list/index.d.ts +27 -10
  163. package/lib/list/index.js +54 -25
  164. package/lib/list/renderer.d.ts +2 -2
  165. package/lib/list/renderer.js +1 -1
  166. package/lib/loader/custom-elements.md +5 -0
  167. package/lib/loader/index.js +4 -8
  168. package/lib/multi-input/custom-elements.json +7 -6
  169. package/lib/multi-input/custom-elements.md +43 -0
  170. package/lib/multi-input/helpers/types.d.ts +1 -1
  171. package/lib/multi-input/index.d.ts +11 -7
  172. package/lib/multi-input/index.js +20 -17
  173. package/lib/multi-input/themes/solar/charcoal/index.js +1 -1
  174. package/lib/multi-input/themes/solar/pearl/index.js +1 -1
  175. package/lib/notification/custom-elements.md +26 -0
  176. package/lib/notification/elements/notification-tray.d.ts +2 -2
  177. package/lib/notification/elements/notification-tray.js +6 -9
  178. package/lib/notification/elements/notification.d.ts +5 -5
  179. package/lib/notification/elements/notification.js +8 -11
  180. package/lib/notification/helpers/status.d.ts +1 -1
  181. package/lib/notification/helpers/status.js +1 -1
  182. package/lib/notification/helpers/types.d.ts +1 -1
  183. package/lib/notification/index.d.ts +2 -2
  184. package/lib/notification/index.js +2 -2
  185. package/lib/number-field/custom-elements.json +99 -54
  186. package/lib/number-field/custom-elements.md +42 -0
  187. package/lib/number-field/index.d.ts +96 -51
  188. package/lib/number-field/index.js +121 -89
  189. package/lib/number-field/themes/solar/charcoal/index.js +1 -1
  190. package/lib/number-field/themes/solar/pearl/index.js +1 -1
  191. package/lib/overlay/custom-elements.json +26 -13
  192. package/lib/overlay/custom-elements.md +54 -0
  193. package/lib/overlay/elements/overlay-backdrop.d.ts +4 -4
  194. package/lib/overlay/elements/overlay-backdrop.js +6 -9
  195. package/lib/overlay/elements/overlay-viewport.d.ts +3 -3
  196. package/lib/overlay/elements/overlay-viewport.js +5 -9
  197. package/lib/overlay/elements/overlay.d.ts +10 -5
  198. package/lib/overlay/elements/overlay.js +27 -28
  199. package/lib/overlay/index.d.ts +2 -2
  200. package/lib/overlay/index.js +1 -1
  201. package/lib/overlay/managers/backdrop-manager.d.ts +1 -1
  202. package/lib/overlay/managers/backdrop-manager.js +2 -2
  203. package/lib/overlay/managers/close-manager.js +1 -1
  204. package/lib/overlay/managers/focus-manager.js +2 -2
  205. package/lib/overlay/managers/interaction-lock-manager.js +2 -2
  206. package/lib/overlay/managers/viewport-manager.d.ts +2 -2
  207. package/lib/overlay/managers/viewport-manager.js +6 -2
  208. package/lib/overlay/managers/zindex-manager.js +1 -1
  209. package/lib/overlay-menu/custom-elements.json +70 -20
  210. package/lib/overlay-menu/custom-elements.md +44 -0
  211. package/lib/overlay-menu/helpers/types.d.ts +3 -3
  212. package/lib/overlay-menu/index.d.ts +26 -19
  213. package/lib/overlay-menu/index.js +47 -33
  214. package/lib/overlay-menu/managers/menu-manager.d.ts +2 -2
  215. package/lib/overlay-menu/managers/menu-manager.js +3 -3
  216. package/lib/pagination/custom-elements.md +27 -0
  217. package/lib/pagination/index.d.ts +8 -8
  218. package/lib/pagination/index.js +13 -15
  219. package/lib/panel/custom-elements.md +11 -0
  220. package/lib/panel/index.d.ts +3 -3
  221. package/lib/panel/index.js +6 -9
  222. package/lib/password-field/custom-elements.json +62 -67
  223. package/lib/password-field/custom-elements.md +39 -0
  224. package/lib/password-field/index.d.ts +43 -94
  225. package/lib/password-field/index.js +52 -198
  226. package/lib/password-field/themes/solar/charcoal/index.js +1 -1
  227. package/lib/password-field/themes/solar/pearl/index.js +1 -1
  228. package/lib/pill/custom-elements.json +8 -6
  229. package/lib/pill/custom-elements.md +22 -0
  230. package/lib/pill/index.d.ts +5 -5
  231. package/lib/pill/index.js +9 -11
  232. package/lib/progress-bar/custom-elements.md +18 -0
  233. package/lib/progress-bar/index.d.ts +3 -3
  234. package/lib/progress-bar/index.js +7 -9
  235. package/lib/radio-button/custom-elements.json +4 -4
  236. package/lib/radio-button/custom-elements.md +19 -0
  237. package/lib/radio-button/index.d.ts +25 -8
  238. package/lib/radio-button/index.js +84 -21
  239. package/lib/radio-button/radio-button-registry.d.ts +3 -2
  240. package/lib/radio-button/radio-button-registry.js +57 -4
  241. package/lib/rating/custom-elements.md +17 -0
  242. package/lib/rating/index.d.ts +3 -3
  243. package/lib/rating/index.js +9 -10
  244. package/lib/search-field/custom-elements.json +70 -74
  245. package/lib/search-field/custom-elements.md +41 -0
  246. package/lib/search-field/index.d.ts +44 -101
  247. package/lib/search-field/index.js +50 -220
  248. package/lib/search-field/themes/solar/charcoal/index.js +1 -1
  249. package/lib/search-field/themes/solar/pearl/index.js +1 -1
  250. package/lib/select/custom-elements.json +5 -4
  251. package/lib/select/custom-elements.md +24 -0
  252. package/lib/select/helpers/types.d.ts +1 -1
  253. package/lib/select/index.d.ts +18 -10
  254. package/lib/select/index.js +84 -45
  255. package/lib/sidebar-layout/custom-elements.json +2 -6
  256. package/lib/sidebar-layout/custom-elements.md +21 -0
  257. package/lib/sidebar-layout/index.d.ts +7 -6
  258. package/lib/sidebar-layout/index.js +9 -10
  259. package/lib/slider/custom-elements.json +4 -4
  260. package/lib/slider/custom-elements.md +28 -0
  261. package/lib/slider/index.d.ts +4 -4
  262. package/lib/slider/index.js +9 -10
  263. package/lib/sparkline/custom-elements.json +4 -4
  264. package/lib/sparkline/custom-elements.md +16 -0
  265. package/lib/sparkline/index.d.ts +6 -4
  266. package/lib/sparkline/index.js +10 -10
  267. package/lib/swing-gauge/custom-elements.json +5 -3
  268. package/lib/swing-gauge/custom-elements.md +17 -0
  269. package/lib/swing-gauge/helpers.d.ts +1 -1
  270. package/lib/swing-gauge/helpers.js +1 -1
  271. package/lib/swing-gauge/index.d.ts +9 -7
  272. package/lib/swing-gauge/index.js +17 -15
  273. package/lib/tab/custom-elements.json +2 -2
  274. package/lib/tab/custom-elements.md +22 -0
  275. package/lib/tab/index.d.ts +5 -5
  276. package/lib/tab/index.js +9 -12
  277. package/lib/tab/themes/solar/charcoal/index.js +1 -1
  278. package/lib/tab/themes/solar/pearl/index.js +1 -1
  279. package/lib/tab-bar/custom-elements.md +11 -0
  280. package/lib/tab-bar/index.d.ts +4 -4
  281. package/lib/tab-bar/index.js +9 -11
  282. package/lib/tab-bar/themes/solar/charcoal/index.js +1 -1
  283. package/lib/tab-bar/themes/solar/pearl/index.js +1 -1
  284. package/lib/text-field/custom-elements.json +78 -89
  285. package/lib/text-field/custom-elements.md +35 -0
  286. package/lib/text-field/index.d.ts +59 -79
  287. package/lib/text-field/index.js +99 -158
  288. package/lib/text-field/themes/solar/charcoal/index.js +1 -1
  289. package/lib/text-field/themes/solar/pearl/index.js +1 -1
  290. package/lib/time-picker/custom-elements.json +4 -4
  291. package/lib/time-picker/custom-elements.md +28 -0
  292. package/lib/time-picker/index.d.ts +7 -4
  293. package/lib/time-picker/index.js +15 -14
  294. package/lib/time-picker/themes/solar/charcoal/index.js +1 -1
  295. package/lib/time-picker/themes/solar/pearl/index.js +1 -1
  296. package/lib/toggle/custom-elements.json +4 -4
  297. package/lib/toggle/custom-elements.md +19 -0
  298. package/lib/toggle/index.d.ts +14 -4
  299. package/lib/toggle/index.js +31 -12
  300. package/lib/tooltip/custom-elements.md +14 -0
  301. package/lib/tooltip/elements/title-tooltip.js +2 -2
  302. package/lib/tooltip/elements/tooltip-element.d.ts +1 -1
  303. package/lib/tooltip/helpers/overflow-tooltip.d.ts +1 -1
  304. package/lib/tooltip/helpers/overflow-tooltip.js +1 -1
  305. package/lib/tooltip/helpers/renderer.d.ts +1 -1
  306. package/lib/tooltip/helpers/types.d.ts +1 -1
  307. package/lib/tooltip/index.d.ts +9 -9
  308. package/lib/tooltip/index.js +18 -20
  309. package/lib/tooltip/managers/tooltip-manager.d.ts +2 -2
  310. package/lib/tooltip/managers/tooltip-manager.js +3 -7
  311. package/lib/tornado-chart/custom-elements.md +18 -0
  312. package/lib/tornado-chart/elements/tornado-chart.d.ts +4 -4
  313. package/lib/tornado-chart/elements/tornado-chart.js +8 -11
  314. package/lib/tornado-chart/elements/tornado-item.d.ts +5 -5
  315. package/lib/tornado-chart/elements/tornado-item.js +10 -12
  316. package/lib/tornado-chart/index.d.ts +2 -2
  317. package/lib/tornado-chart/index.js +2 -2
  318. package/lib/tree/custom-elements.json +17 -3
  319. package/lib/tree/custom-elements.md +32 -0
  320. package/lib/tree/elements/tree-item.d.ts +4 -4
  321. package/lib/tree/elements/tree-item.js +10 -13
  322. package/lib/tree/elements/tree.d.ts +51 -5
  323. package/lib/tree/elements/tree.js +138 -11
  324. package/lib/tree/helpers/filter.d.ts +8 -0
  325. package/lib/tree/helpers/filter.js +33 -0
  326. package/lib/tree/helpers/renderer.d.ts +2 -2
  327. package/lib/tree/helpers/renderer.js +3 -3
  328. package/lib/tree/helpers/types.d.ts +9 -1
  329. package/lib/tree/index.d.ts +4 -4
  330. package/lib/tree/index.js +3 -3
  331. package/lib/tree/managers/tree-manager.d.ts +22 -10
  332. package/lib/tree/managers/tree-manager.js +56 -40
  333. package/lib/tree/themes/halo/dark/index.js +1 -1
  334. package/lib/tree/themes/halo/light/index.js +1 -1
  335. package/lib/tree/themes/solar/charcoal/index.js +1 -1
  336. package/lib/tree/themes/solar/pearl/index.js +1 -1
  337. package/lib/tree-select/custom-elements.json +10 -6
  338. package/lib/tree-select/custom-elements.md +26 -0
  339. package/lib/tree-select/helpers/types.d.ts +2 -2
  340. package/lib/tree-select/index.d.ts +32 -28
  341. package/lib/tree-select/index.js +54 -44
  342. package/lib/tree-select/themes/halo/dark/index.js +1 -1
  343. package/lib/tree-select/themes/halo/light/index.js +1 -1
  344. package/lib/tree-select/themes/solar/charcoal/index.js +1 -1
  345. package/lib/tree-select/themes/solar/pearl/index.js +1 -1
  346. package/lib/version.d.ts +1 -0
  347. package/lib/version.js +1 -0
  348. package/package.json +298 -15
  349. package/lib/autosuggest/helpers/const.d.ts +0 -2
  350. package/lib/autosuggest/helpers/const.js +0 -3
  351. package/lib/overlay-menu/helpers/uuid.d.ts +0 -7
  352. package/lib/overlay-menu/helpers/uuid.js +0 -13
@@ -1,15 +1,15 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { CSSResult, ControlElement, TemplateResult, PropertyValues } from '@refinitiv-ui/core';
2
+ import { CSSResultGroup, ControlElement, TemplateResult, PropertyValues } from '@refinitiv-ui/core';
3
3
  /**
4
4
  * Basic radio button
5
5
  *
6
6
  * @fires checked-changed - Fired when the `checked` property changes.
7
7
  *
8
- * @attr {string} [value=] - Value of the radio button
9
- * @prop {string} [value=] - Value of the radio button
8
+ * @attr {string} value - Value of the radio button
9
+ * @prop {string} [value=""] - Value of the radio button
10
10
  *
11
- * @attr {string} [name=] - Group multiple radio buttons by assigning the same name
12
- * @prop {string} [name=] - Group multiple radio buttons by assigning the same name
11
+ * @attr {string} name - Group multiple radio buttons by assigning the same name
12
+ * @prop {string} [name=""] - Group multiple radio buttons by assigning the same name
13
13
  *
14
14
  * @attr {boolean} readonly - Set readonly state
15
15
  * @prop {boolean} [readonly=false] - Set readonly state
@@ -23,17 +23,28 @@ export declare class RadioButton extends ControlElement {
23
23
  * @returns version number
24
24
  */
25
25
  static get version(): string;
26
+ protected readonly defaultRole: string | null;
26
27
  /**
27
- * A `CSSResult` that will be used
28
+ * A `CSSResultGroup` that will be used
28
29
  * to style the host, slotted children
29
30
  * and the internal template of the element.
30
31
  * @return CSS template
31
32
  */
32
- static get styles(): CSSResult | CSSResult[];
33
+ static get styles(): CSSResultGroup;
34
+ private _checked;
33
35
  /**
34
36
  * Radio button checked state
37
+ * @param value checked state
38
+ * @default false
39
+ * @returns {void}
40
+ */
41
+ set checked(value: boolean);
42
+ get checked(): boolean;
43
+ /**
44
+ * Aria indicating checked state
45
+ * @ignore
35
46
  */
36
- checked: boolean;
47
+ ariaChecked: string;
37
48
  /**
38
49
  * Getter for label
39
50
  */
@@ -83,6 +94,12 @@ export declare class RadioButton extends ControlElement {
83
94
  * @return {void}
84
95
  */
85
96
  private handleChangeChecked;
97
+ /**
98
+ * Navigate to next or previous checkable sibling in the same group if present
99
+ * @param direction up/next; down/previous
100
+ * @returns {void}
101
+ */
102
+ private navigateToSibling;
86
103
  /**
87
104
  * A `TemplateResult` that will be used
88
105
  * to render the updated internal template.
@@ -1,23 +1,21 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { html, css, customElement, property, ControlElement, query } from '@refinitiv-ui/core';
8
- import { VERSION } from '../';
9
- import { registerOverflowTooltip } from '../tooltip';
10
- import { applyRegistry, removeFromRegistry, getRadioGroup } from './radio-button-registry';
1
+ import { __decorate } from "tslib";
2
+ import { html, css, ControlElement } 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 { VERSION } from '../version.js';
7
+ import { registerOverflowTooltip } from '../tooltip/index.js';
8
+ import { applyRegistry, removeFromRegistry, getRadioGroup } from './radio-button-registry.js';
11
9
  /**
12
10
  * Basic radio button
13
11
  *
14
12
  * @fires checked-changed - Fired when the `checked` property changes.
15
13
  *
16
- * @attr {string} [value=] - Value of the radio button
17
- * @prop {string} [value=] - Value of the radio button
14
+ * @attr {string} value - Value of the radio button
15
+ * @prop {string} [value=""] - Value of the radio button
18
16
  *
19
- * @attr {string} [name=] - Group multiple radio buttons by assigning the same name
20
- * @prop {string} [name=] - Group multiple radio buttons by assigning the same name
17
+ * @attr {string} name - Group multiple radio buttons by assigning the same name
18
+ * @prop {string} [name=""] - Group multiple radio buttons by assigning the same name
21
19
  *
22
20
  * @attr {boolean} readonly - Set readonly state
23
21
  * @prop {boolean} [readonly=false] - Set readonly state
@@ -28,10 +26,13 @@ import { applyRegistry, removeFromRegistry, getRadioGroup } from './radio-button
28
26
  let RadioButton = class RadioButton extends ControlElement {
29
27
  constructor() {
30
28
  super(...arguments);
29
+ this.defaultRole = 'radio';
30
+ this._checked = false;
31
31
  /**
32
- * Radio button checked state
32
+ * Aria indicating checked state
33
+ * @ignore
33
34
  */
34
- this.checked = false;
35
+ this.ariaChecked = String(this.checked);
35
36
  }
36
37
  /**
37
38
  * Element version number
@@ -41,7 +42,7 @@ let RadioButton = class RadioButton extends ControlElement {
41
42
  return VERSION;
42
43
  }
43
44
  /**
44
- * A `CSSResult` that will be used
45
+ * A `CSSResultGroup` that will be used
45
46
  * to style the host, slotted children
46
47
  * and the internal template of the element.
47
48
  * @return CSS template
@@ -70,6 +71,23 @@ let RadioButton = class RadioButton extends ControlElement {
70
71
  }
71
72
  `;
72
73
  }
74
+ /**
75
+ * Radio button checked state
76
+ * @param value checked state
77
+ * @default false
78
+ * @returns {void}
79
+ */
80
+ set checked(value) {
81
+ const oldValue = this._checked;
82
+ if (oldValue !== value) {
83
+ this._checked = value;
84
+ this.ariaChecked = String(value);
85
+ void this.requestUpdate('checked', oldValue);
86
+ }
87
+ }
88
+ get checked() {
89
+ return this._checked;
90
+ }
73
91
  /**
74
92
  * Called when connected to DOM
75
93
  * @returns {void}
@@ -94,7 +112,7 @@ let RadioButton = class RadioButton extends ControlElement {
94
112
  */
95
113
  update(changedProperties) {
96
114
  if (this.isConnected && this.hasUpdated && changedProperties.has('name')) {
97
- applyRegistry(this);
115
+ applyRegistry(this, changedProperties.get('name'));
98
116
  }
99
117
  // Ensure only one radio button is checked
100
118
  if (this.isConnected && this.hasUpdated && (changedProperties.has('checked') || (changedProperties.has('name')))) {
@@ -119,8 +137,12 @@ let RadioButton = class RadioButton extends ControlElement {
119
137
  */
120
138
  manageGroupState() {
121
139
  if (this.checked && this.name) {
140
+ // restore tab index when checked
141
+ this.tabIndex = 0;
122
142
  getRadioGroup(this).filter(radio => radio !== this).forEach(radio => {
123
- radio.checked = false; // unchecking the rest of the group members
143
+ // uncheck and hide the rest of the group members from focusability
144
+ radio.checked = false;
145
+ radio.tabIndex = -1;
124
146
  });
125
147
  }
126
148
  }
@@ -141,15 +163,26 @@ let RadioButton = class RadioButton extends ControlElement {
141
163
  * @returns {void}
142
164
  */
143
165
  onKeyDown(event) {
144
- if (this.disabled || this.readonly || event.defaultPrevented) {
166
+ if (this.disabled || event.defaultPrevented) {
145
167
  return;
146
168
  }
147
169
  switch (event.key) {
148
170
  case 'Enter':
149
171
  case ' ':
150
172
  case 'Spacebar':
173
+ if (this.readonly) {
174
+ return;
175
+ }
151
176
  this.handleChangeChecked();
152
177
  break;
178
+ case 'ArrowRight':
179
+ case 'ArrowDown':
180
+ this.navigateToSibling('next');
181
+ break;
182
+ case 'ArrowLeft':
183
+ case 'ArrowUp':
184
+ this.navigateToSibling('previous');
185
+ break;
153
186
  default:
154
187
  return;
155
188
  }
@@ -167,6 +200,33 @@ let RadioButton = class RadioButton extends ControlElement {
167
200
  this.notifyPropertyChange('checked', this.checked);
168
201
  }
169
202
  }
203
+ /**
204
+ * Navigate to next or previous checkable sibling in the same group if present
205
+ * @param direction up/next; down/previous
206
+ * @returns {void}
207
+ */
208
+ navigateToSibling(direction) {
209
+ if (!this.name) {
210
+ return;
211
+ }
212
+ const group = getRadioGroup(this).filter(radio => !radio.disabled);
213
+ const index = group.indexOf(this);
214
+ let element;
215
+ if (direction === 'next') {
216
+ element = index === -1 ? group[0] : group[index + 1];
217
+ }
218
+ else {
219
+ element = index === -1 ? group[group.length - 1] : group[index - 1];
220
+ }
221
+ if (!element) {
222
+ element = direction === 'next' ? group[0] : group[group.length - 1];
223
+ }
224
+ if (!element.readonly) {
225
+ this.checked = false;
226
+ element.checked = true;
227
+ }
228
+ element.focus();
229
+ }
170
230
  /**
171
231
  * A `TemplateResult` that will be used
172
232
  * to render the updated internal template.
@@ -183,7 +243,10 @@ let RadioButton = class RadioButton extends ControlElement {
183
243
  };
184
244
  __decorate([
185
245
  property({ type: Boolean, reflect: true })
186
- ], RadioButton.prototype, "checked", void 0);
246
+ ], RadioButton.prototype, "checked", null);
247
+ __decorate([
248
+ property({ type: String, reflect: true, attribute: 'aria-checked' })
249
+ ], RadioButton.prototype, "ariaChecked", void 0);
187
250
  __decorate([
188
251
  query('[part=label]', true)
189
252
  ], RadioButton.prototype, "labelEl", void 0);
@@ -1,4 +1,4 @@
1
- import { RadioButton } from './index';
1
+ import type { RadioButton } from './index';
2
2
  /**
3
3
  * Remove radio button from registry
4
4
  * @param radio Radio button to remove
@@ -9,9 +9,10 @@ declare const removeFromRegistry: (radio: RadioButton) => void;
9
9
  * Add radio button to registry group of radio has a name
10
10
  * If radio does not have the name, remove from the group
11
11
  * @param radio Radio button to add
12
+ * @param oldGroupName group name of radio button before changed
12
13
  * @returns {void}
13
14
  */
14
- declare const applyRegistry: (radio: RadioButton) => void;
15
+ declare const applyRegistry: (radio: RadioButton, oldGroupName?: string) => void;
15
16
  /**
16
17
  * Get the group of same name radio buttons
17
18
  * @param radio A radio to get a group for
@@ -14,16 +14,69 @@ const removeFromRegistry = (radio) => {
14
14
  * Add radio button to registry group of radio has a name
15
15
  * If radio does not have the name, remove from the group
16
16
  * @param radio Radio button to add
17
+ * @param oldGroupName group name of radio button before changed
17
18
  * @returns {void}
18
19
  */
19
- const applyRegistry = (radio) => {
20
- const idx = registry.indexOf(radio);
21
- if (radio.name && idx === -1) {
20
+ const applyRegistry = (radio, oldGroupName = '') => {
21
+ const isNewRadioButton = registry.indexOf(radio) === -1;
22
+ if (radio.name && isNewRadioButton) {
22
23
  registry.push(radio);
24
+ if (registry.length === 1) {
25
+ return;
26
+ }
27
+ // Set tabIndex to -1 if radio either uncheck or not the first radio button in the group.
28
+ const radioGroup = getRadioGroup(radio);
29
+ if (!radio.checked && radioGroup.length > 1) {
30
+ radio.tabIndex = -1;
31
+ }
23
32
  }
24
- else if (!radio.name && idx !== -1) {
33
+ // Removed from the group
34
+ else if (!radio.name && !isNewRadioButton) {
25
35
  removeFromRegistry(radio);
36
+ radio.tabIndex = 0; // Restores tabIndex and switch to single mode
37
+ // Re-compute tabIndex for old radio group
38
+ const oldRadioGroup = registry.filter(radio => radio.name === oldGroupName);
39
+ restoreTabIndex(oldRadioGroup);
40
+ }
41
+ // Changes group
42
+ else if (radio.name && !isNewRadioButton) {
43
+ // Re-compute tabIndex for new radio group when name attribute has changed
44
+ const newRadioGroup = getRadioGroup(radio);
45
+ if (radio.checked) {
46
+ radio.tabIndex = 0;
47
+ // uncheck and hide the rest of the group members from focusability
48
+ newRadioGroup.filter((newRadio) => newRadio !== radio).forEach(newRadio => {
49
+ newRadio.checked = false;
50
+ newRadio.tabIndex = -1;
51
+ });
52
+ }
53
+ else {
54
+ radio.tabIndex = -1;
55
+ restoreTabIndex(newRadioGroup);
56
+ }
57
+ // Re-compute tabIndex for old radio group when name attribute has changed.
58
+ const oldRadioGroup = registry.filter(radio => radio.name === oldGroupName);
59
+ restoreTabIndex(oldRadioGroup);
60
+ }
61
+ };
62
+ /**
63
+ * Re-compute tabIndex for the radio group
64
+ * Set tabIndex to 0 for first radio button in the group.
65
+ * Set tabIndex to -1 for the rest of button in group.
66
+ * @param radioGroup collection of radio buttons
67
+ * @returns {void}
68
+ */
69
+ const restoreTabIndex = (radioGroup) => {
70
+ if (!radioGroup.length) {
71
+ return;
72
+ }
73
+ const checkedRadio = radioGroup.filter(radio => radio.checked);
74
+ if (checkedRadio.length) {
75
+ return;
26
76
  }
77
+ radioGroup.forEach((radio, index) => {
78
+ radio.tabIndex = index === 0 ? 0 : -1;
79
+ });
27
80
  };
28
81
  /**
29
82
  * Get the group of same name radio buttons
@@ -0,0 +1,17 @@
1
+ # ef-rating
2
+
3
+ Star visualisation component that is generally used for ranking
4
+
5
+ ## Properties
6
+
7
+ | Property | Attribute | Type | Default | Description |
8
+ |---------------|---------------|-----------|---------|--------------------------------------------------|
9
+ | `interactive` | `interactive` | `boolean` | false | Make it possible to interact with rating control and change the value |
10
+ | `max` | `max` | `string` | "5" | Set number of total stars |
11
+ | `value` | `value` | `string` | "0" | Set number of selected stars. Value can be any number between 0 and `max`.<br />Decimal values are calculated to empty star (0 - .25); half-star (.25 - .75) and full star (.75 - 1) |
12
+
13
+ ## Events
14
+
15
+ | Event | Description |
16
+ |-----------------|---------------------------------|
17
+ | `value-changed` | Fired when the `value` changes. |
@@ -1,5 +1,5 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { BasicElement, TemplateResult, CSSResult, PropertyValues } from '@refinitiv-ui/core';
2
+ import { BasicElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
3
3
  /**
4
4
  * Star visualisation component that is generally used for ranking
5
5
  * @fires value-changed - Fired when the `value` changes.
@@ -62,12 +62,12 @@ export declare class Rating extends BasicElement {
62
62
  */
63
63
  protected updated(changedProperties: PropertyValues): void;
64
64
  /**
65
- * A `CSSResult` that will be used
65
+ * A `CSSResultGroup` that will be used
66
66
  * to style the host, slotted children
67
67
  * and the internal template of the element.
68
68
  * @returns CSS template
69
69
  */
70
- static get styles(): CSSResult | CSSResult[];
70
+ static get styles(): CSSResultGroup;
71
71
  /**
72
72
  * A `TemplateResult` that will be used
73
73
  * to render the updated internal template.
@@ -1,11 +1,10 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { BasicElement, html, css, customElement, property, queryAll, repeat } from '@refinitiv-ui/core';
8
- import { VERSION } from '../';
1
+ import { __decorate } from "tslib";
2
+ import { BasicElement, html, css } 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 { queryAll } from '@refinitiv-ui/core/lib/decorators/query-all.js';
6
+ import { repeat } from '@refinitiv-ui/core/lib/directives/repeat.js';
7
+ import { VERSION } from '../version.js';
9
8
  /**
10
9
  * Star visualisation component that is generally used for ranking
11
10
  * @fires value-changed - Fired when the `value` changes.
@@ -78,7 +77,7 @@ let Rating = class Rating extends BasicElement {
78
77
  this.items.push({ item: selected ? `icon icon-${selected}` : 'icon' });
79
78
  }
80
79
  this.valuePrevious = value;
81
- void this.requestUpdate();
80
+ this.requestUpdate();
82
81
  }
83
82
  /**
84
83
  * Process click event to set the new value
@@ -115,7 +114,7 @@ let Rating = class Rating extends BasicElement {
115
114
  });
116
115
  }
117
116
  /**
118
- * A `CSSResult` that will be used
117
+ * A `CSSResultGroup` that will be used
119
118
  * to style the host, slotted children
120
119
  * and the internal template of the element.
121
120
  * @returns CSS template
@@ -6,48 +6,44 @@
6
6
  "description": "Form control to get a search input from users.",
7
7
  "attributes": [
8
8
  {
9
- "name": "pattern",
10
- "description": "Set regular expression for input validation",
11
- "type": "string",
12
- "default": "\"\""
13
- },
14
- {
15
- "name": "placeholder",
16
- "description": "Set place holder text",
17
- "type": "string",
18
- "default": "\"\""
9
+ "name": "disabled",
10
+ "description": "Set disabled state",
11
+ "type": "boolean",
12
+ "default": "false"
19
13
  },
20
14
  {
21
15
  "name": "error",
22
- "description": "Set state to error",
16
+ "description": "Set error state",
23
17
  "type": "boolean",
24
18
  "default": "false"
25
19
  },
26
20
  {
27
- "name": "warning",
28
- "description": "Set state to warning",
21
+ "name": "icon-has-action",
22
+ "description": "Specify when icon need to be clickable",
29
23
  "type": "boolean",
30
24
  "default": "false"
31
25
  },
32
26
  {
33
- "name": "transparent",
34
- "description": "Disables all other states and border/background styles.\nUse with advanced composite elements requiring e.g. multi selection in\ncombo-box when parent container handles element states.",
35
- "type": "boolean",
36
- "default": "false"
27
+ "name": "placeholder",
28
+ "description": "Set placeholder text",
29
+ "type": "string",
30
+ "default": "\"\""
37
31
  },
38
32
  {
39
- "name": "maxlength",
40
- "description": "Set character max limit",
41
- "type": "number | null"
33
+ "name": "readonly",
34
+ "description": "Set readonly state",
35
+ "type": "boolean",
36
+ "default": "false"
42
37
  },
43
38
  {
44
- "name": "minlength",
45
- "description": "Set character min limit",
46
- "type": "number | null"
39
+ "name": "transparent",
40
+ "description": "Disables all other states and border/background styles.",
41
+ "type": "boolean",
42
+ "default": "false"
47
43
  },
48
44
  {
49
- "name": "icon-has-action",
50
- "description": "Specify when icon need to be clickable",
45
+ "name": "warning",
46
+ "description": "Set warning state",
51
47
  "type": "boolean",
52
48
  "default": "false"
53
49
  },
@@ -58,77 +54,63 @@
58
54
  "default": "\"\""
59
55
  },
60
56
  {
61
- "name": "readonly",
62
- "description": "Set readonly state",
63
- "type": "boolean",
64
- "default": "\"false\""
57
+ "name": "icon-has-action",
58
+ "description": "Specify when icon need to be clickable",
59
+ "type": "boolean"
65
60
  },
66
61
  {
67
- "name": "disabled",
68
- "description": "Set disabled state",
69
- "type": "boolean",
70
- "default": "\"false\""
62
+ "name": "maxlength",
63
+ "description": "Set character max limit",
64
+ "type": "number"
65
+ },
66
+ {
67
+ "name": "minlength",
68
+ "description": "Set character min limit",
69
+ "type": "number"
71
70
  }
72
71
  ],
73
72
  "properties": [
74
73
  {
75
- "name": "pattern",
76
- "attribute": "pattern",
77
- "description": "Set regular expression for input validation",
78
- "type": "string",
79
- "default": "\"\""
80
- },
81
- {
82
- "name": "placeholder",
83
- "attribute": "placeholder",
84
- "description": "Set place holder text",
85
- "type": "string",
86
- "default": "\"\""
87
- },
88
- {
89
- "name": "error",
90
- "attribute": "error",
91
- "description": "Set state to error",
74
+ "name": "disabled",
75
+ "attribute": "disabled",
76
+ "description": "Set disabled state",
92
77
  "type": "boolean",
93
78
  "default": "false"
94
79
  },
95
80
  {
96
- "name": "warning",
97
- "attribute": "warning",
98
- "description": "Set state to warning",
81
+ "name": "error",
82
+ "attribute": "error",
83
+ "description": "Set error state",
99
84
  "type": "boolean",
100
85
  "default": "false"
101
86
  },
102
87
  {
103
- "name": "transparent",
104
- "attribute": "transparent",
105
- "description": "Disables all other states and border/background styles.\nUse with advanced composite elements requiring e.g. multi selection in\ncombo-box when parent container handles element states.",
88
+ "name": "iconHasAction",
89
+ "attribute": "icon-has-action",
90
+ "description": "Specify when icon need to be clickable",
106
91
  "type": "boolean",
107
92
  "default": "false"
108
93
  },
109
94
  {
110
95
  "name": "maxLength",
111
- "attribute": "maxlength",
112
96
  "description": "Set character max limit",
113
97
  "type": "number | null"
114
98
  },
115
99
  {
116
100
  "name": "minLength",
117
- "attribute": "minlength",
118
101
  "description": "Set character min limit",
119
102
  "type": "number | null"
120
103
  },
121
104
  {
122
- "name": "iconHasAction",
123
- "attribute": "icon-has-action",
124
- "description": "Specify when icon need to be clickable",
125
- "type": "boolean",
126
- "default": "false"
105
+ "name": "pattern",
106
+ "description": "Set regular expression for input validation",
107
+ "type": "string",
108
+ "default": "\"\""
127
109
  },
128
110
  {
129
- "name": "value",
130
- "attribute": "value",
131
- "description": "Input's value",
111
+ "name": "placeholder",
112
+ "attribute": "placeholder",
113
+ "description": "Set placeholder text",
132
114
  "type": "string",
133
115
  "default": "\"\""
134
116
  },
@@ -137,14 +119,28 @@
137
119
  "attribute": "readonly",
138
120
  "description": "Set readonly state",
139
121
  "type": "boolean",
140
- "default": "\"false\""
122
+ "default": "false"
141
123
  },
142
124
  {
143
- "name": "disabled",
144
- "attribute": "disabled",
145
- "description": "Set disabled state",
125
+ "name": "transparent",
126
+ "attribute": "transparent",
127
+ "description": "Disables all other states and border/background styles.",
146
128
  "type": "boolean",
147
- "default": "\"false\""
129
+ "default": "false"
130
+ },
131
+ {
132
+ "name": "warning",
133
+ "attribute": "warning",
134
+ "description": "Set warning state",
135
+ "type": "boolean",
136
+ "default": "false"
137
+ },
138
+ {
139
+ "name": "value",
140
+ "attribute": "value",
141
+ "description": "Input's value",
142
+ "type": "string",
143
+ "default": "\"\""
148
144
  }
149
145
  ],
150
146
  "events": [
@@ -158,13 +154,13 @@
158
154
  },
159
155
  {
160
156
  "name": "icon-click",
161
- "description": "Dispatched only when element has icon-has-action attribute and icon is clicked"
157
+ "description": "Dispatched when icon is clicked"
162
158
  }
163
159
  ],
164
160
  "methods": [
165
161
  {
166
- "name": "select",
167
- "description": "Select the contents of input",
162
+ "name": "renderIcon",
163
+ "description": "",
168
164
  "params": []
169
165
  }
170
166
  ]