@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,18 +1,16 @@
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, query, customElement, property } from '@refinitiv-ui/core';
8
- import { color as parseColor } from '@refinitiv-ui/utils';
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 { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
+ import { VERSION } from '../version.js';
7
+ import { color as parseColor } from '@refinitiv-ui/utils/lib/color.js';
9
8
  import 'chart.js/dist/Chart.bundle.min.js';
10
- import '../header';
11
- import '../layout';
12
- import { legendHelper, merge } from './helpers';
9
+ import { legendHelper, merge } from './helpers/index.js';
10
+ import '../header/index.js';
11
+ import '../layout/index.js';
13
12
  // Register plugins
14
- import doughnutCenterPlugin from './plugins/doughnut-center-label';
15
- import { VERSION } from '../';
13
+ import doughnutCenterPlugin from './plugins/doughnut-center-label.js';
16
14
  window.Chart.pluginService.register(doughnutCenterPlugin);
17
15
  const CSS_COLOR_PREFIX = '--chart-color-';
18
16
  const CHART_TYPE_OPAQUE = ['line', 'bubble', 'radar', 'polarArea'];
@@ -415,7 +413,7 @@ let Chart = class Chart extends BasicElement {
415
413
  this.renderChart(config);
416
414
  }
417
415
  /**
418
- * A `CSSResult` that will be used
416
+ * A `CSSResultGroup` that will be used
419
417
  * to style the host, slotted children
420
418
  * and the internal template of the element.
421
419
  * @return CSS template
@@ -21,13 +21,13 @@
21
21
  "name": "readonly",
22
22
  "description": "Set readonly state",
23
23
  "type": "boolean",
24
- "default": "\"false\""
24
+ "default": "false"
25
25
  },
26
26
  {
27
27
  "name": "disabled",
28
28
  "description": "Set disabled state",
29
29
  "type": "boolean",
30
- "default": "\"false\""
30
+ "default": "false"
31
31
  }
32
32
  ],
33
33
  "properties": [
@@ -50,14 +50,14 @@
50
50
  "attribute": "readonly",
51
51
  "description": "Set readonly state",
52
52
  "type": "boolean",
53
- "default": "\"false\""
53
+ "default": "false"
54
54
  },
55
55
  {
56
56
  "name": "disabled",
57
57
  "attribute": "disabled",
58
58
  "description": "Set disabled state",
59
59
  "type": "boolean",
60
- "default": "\"false\""
60
+ "default": "false"
61
61
  }
62
62
  ],
63
63
  "events": [
@@ -0,0 +1,18 @@
1
+ # ef-checkbox
2
+
3
+ Form control for selecting one or several options
4
+
5
+ ## Properties
6
+
7
+ | Property | Attribute | Type | Default | Description |
8
+ |-----------------|-----------------|-----------|---------|----------------------------|
9
+ | `checked` | `checked` | `boolean` | false | Value of checkbox |
10
+ | `disabled` | `disabled` | `boolean` | false | Set disabled state |
11
+ | `indeterminate` | `indeterminate` | `boolean` | false | Set state to indeterminate |
12
+ | `readonly` | `readonly` | `boolean` | false | Set readonly state |
13
+
14
+ ## Events
15
+
16
+ | Event | Description |
17
+ |-------------------|--------------------------------------------|
18
+ | `checked-changed` | Fired when the `checked` property changes. |
@@ -1,6 +1,6 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { ControlElement, TemplateResult, CSSResult, PropertyValues } from '@refinitiv-ui/core';
3
- import '../icon';
2
+ import { ControlElement, TemplateResult, CSSResultGroup, PropertyValues } from '@refinitiv-ui/core';
3
+ import '../icon/index.js';
4
4
  /**
5
5
  * Form control for selecting one or several options
6
6
  * @fires checked-changed - Fired when the `checked` property changes.
@@ -17,31 +17,39 @@ export declare class Checkbox extends ControlElement {
17
17
  * @returns version number
18
18
  */
19
19
  static get version(): string;
20
+ protected readonly defaultRole: string | null;
20
21
  /**
21
- * A `CSSResult` that will be used
22
+ * A `CSSResultGroup` that will be used
22
23
  * to style the host, slotted children
23
24
  * and the internal template of the element.
24
- * @return {CSSResult | CSSResult[]} CSS template
25
+ * @return CSS template
25
26
  */
26
- static get styles(): CSSResult | CSSResult[];
27
+ static get styles(): CSSResultGroup;
28
+ private _checked;
27
29
  /**
28
30
  * Value of checkbox
31
+ * @param value new checked value
32
+ * @default false
29
33
  */
30
- checked: boolean;
34
+ set checked(value: boolean);
35
+ get checked(): boolean;
36
+ private _indeterminate;
31
37
  /**
32
38
  * Set state to indeterminate
39
+ * @param value new indeterminate value
40
+ * @default false
33
41
  */
34
- indeterminate: boolean;
42
+ set indeterminate(value: boolean);
43
+ get indeterminate(): boolean;
35
44
  /**
36
- * Getter for label
45
+ * Indicates current state of checkbox
46
+ * @ignore
37
47
  */
38
- private labelEl;
48
+ ariaChecked: string;
39
49
  /**
40
- * Updates the element
41
- * @param changedProperties Properties that has changed
42
- * @returns {void}
50
+ * Getter for label
43
51
  */
44
- protected update(changedProperties: PropertyValues): void;
52
+ private labelEl;
45
53
  /**
46
54
  * Called once after the component is first rendered
47
55
  * @param changedProperties map of changed properties with old values
@@ -1,13 +1,11 @@
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 { ControlElement, html, css, customElement, property, query } from '@refinitiv-ui/core';
8
- import { VERSION } from '../';
9
- import '../icon';
10
- import { registerOverflowTooltip } from '../tooltip';
1
+ import { __decorate } from "tslib";
2
+ import { ControlElement, 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 { query } from '@refinitiv-ui/core/lib/decorators/query.js';
6
+ import { VERSION } from '../version.js';
7
+ import { registerOverflowTooltip } from '../tooltip/index.js';
8
+ import '../icon/index.js';
11
9
  /**
12
10
  * Form control for selecting one or several options
13
11
  * @fires checked-changed - Fired when the `checked` property changes.
@@ -21,14 +19,14 @@ import { registerOverflowTooltip } from '../tooltip';
21
19
  let Checkbox = class Checkbox extends ControlElement {
22
20
  constructor() {
23
21
  super(...arguments);
22
+ this.defaultRole = 'checkbox';
23
+ this._checked = false;
24
+ this._indeterminate = false;
24
25
  /**
25
- * Value of checkbox
26
- */
27
- this.checked = false;
28
- /**
29
- * Set state to indeterminate
26
+ * Indicates current state of checkbox
27
+ * @ignore
30
28
  */
31
- this.indeterminate = false;
29
+ this.ariaChecked = String(this.checked);
32
30
  }
33
31
  /**
34
32
  * Element version number
@@ -38,10 +36,10 @@ let Checkbox = class Checkbox extends ControlElement {
38
36
  return VERSION;
39
37
  }
40
38
  /**
41
- * A `CSSResult` that will be used
39
+ * A `CSSResultGroup` that will be used
42
40
  * to style the host, slotted children
43
41
  * and the internal template of the element.
44
- * @return {CSSResult | CSSResult[]} CSS template
42
+ * @return CSS template
45
43
  */
46
44
  static get styles() {
47
45
  return css `
@@ -71,20 +69,44 @@ let Checkbox = class Checkbox extends ControlElement {
71
69
  `;
72
70
  }
73
71
  /**
74
- * Updates the element
75
- * @param changedProperties Properties that has changed
76
- * @returns {void}
72
+ * Value of checkbox
73
+ * @param value new checked value
74
+ * @default false
77
75
  */
78
- update(changedProperties) {
79
- // remove indeterminate if change state to checked
80
- if (changedProperties.get('checked') === false && this.checked && this.indeterminate) {
81
- this.indeterminate = false;
76
+ set checked(value) {
77
+ const oldValue = this._checked;
78
+ if (oldValue !== value) {
79
+ this._checked = value;
80
+ // remove indeterminate if change state to checked
81
+ if (this._checked) {
82
+ this.indeterminate = false;
83
+ }
84
+ this.ariaChecked = String(value);
85
+ void this.requestUpdate('checked', oldValue);
82
86
  }
83
- // remove checked if change state to indeterminate
84
- if (changedProperties.get('indeterminate') === false && this.indeterminate && this.checked) {
85
- this.checked = false;
87
+ }
88
+ get checked() {
89
+ return this._checked;
90
+ }
91
+ /**
92
+ * Set state to indeterminate
93
+ * @param value new indeterminate value
94
+ * @default false
95
+ */
96
+ set indeterminate(value) {
97
+ const oldValue = this._indeterminate;
98
+ if (oldValue !== value) {
99
+ this._indeterminate = value;
100
+ // remove checked if change state to indeterminate
101
+ if (value) {
102
+ this.checked = false;
103
+ }
104
+ this.ariaChecked = value ? 'mixed' : String(this.checked);
105
+ void this.requestUpdate('indeterminate', oldValue);
86
106
  }
87
- super.update(changedProperties);
107
+ }
108
+ get indeterminate() {
109
+ return this._indeterminate;
88
110
  }
89
111
  /**
90
112
  * Called once after the component is first rendered
@@ -155,10 +177,13 @@ let Checkbox = class Checkbox extends ControlElement {
155
177
  };
156
178
  __decorate([
157
179
  property({ type: Boolean, reflect: true })
158
- ], Checkbox.prototype, "checked", void 0);
180
+ ], Checkbox.prototype, "checked", null);
159
181
  __decorate([
160
182
  property({ type: Boolean, reflect: true })
161
- ], Checkbox.prototype, "indeterminate", void 0);
183
+ ], Checkbox.prototype, "indeterminate", null);
184
+ __decorate([
185
+ property({ type: String, reflect: true, attribute: 'aria-checked' })
186
+ ], Checkbox.prototype, "ariaChecked", void 0);
162
187
  __decorate([
163
188
  query('[part=label]', true)
164
189
  ], Checkbox.prototype, "labelEl", void 0);
@@ -8,7 +8,8 @@
8
8
  {
9
9
  "name": "value",
10
10
  "description": "Get time value in format `hh:mm:ss`",
11
- "type": "string"
11
+ "type": "string",
12
+ "default": "\"00:00:00\""
12
13
  },
13
14
  {
14
15
  "name": "offset",
@@ -18,7 +19,8 @@
18
19
  {
19
20
  "name": "tick",
20
21
  "description": "Toggles clock ticking function.",
21
- "type": "boolean"
22
+ "type": "boolean",
23
+ "default": "false"
22
24
  },
23
25
  {
24
26
  "name": "am-pm",
@@ -50,7 +52,8 @@
50
52
  "name": "value",
51
53
  "attribute": "value",
52
54
  "description": "Get time value in format `hh:mm:ss`",
53
- "type": "string"
55
+ "type": "string",
56
+ "default": "\"00:00:00\""
54
57
  },
55
58
  {
56
59
  "name": "offset",
@@ -62,7 +65,8 @@
62
65
  "name": "tick",
63
66
  "attribute": "tick",
64
67
  "description": "Toggles clock ticking function.",
65
- "type": "boolean"
68
+ "type": "boolean",
69
+ "default": "false"
66
70
  },
67
71
  {
68
72
  "name": "amPm",
@@ -102,6 +106,19 @@
102
106
  "name": "offset-changed",
103
107
  "description": "Fired when the the user offsets the clock in `interactive` mode."
104
108
  }
109
+ ],
110
+ "methods": [
111
+ {
112
+ "name": "resizedCallback",
113
+ "description": "Called when the element's dimension have changed",
114
+ "params": [
115
+ {
116
+ "name": "size",
117
+ "description": "Element size",
118
+ "type": "ElementSize"
119
+ }
120
+ ]
121
+ }
105
122
  ]
106
123
  }
107
124
  ]
@@ -0,0 +1,28 @@
1
+ # ef-clock
2
+
3
+ Display hours, minutes and seconds as clock interface
4
+
5
+ ## Properties
6
+
7
+ | Property | Attribute | Type | Default | Description |
8
+ |---------------|----------------|-----------|------------|--------------------------------------------------|
9
+ | `amPm` | `am-pm` | `boolean` | false | Display the digital clock in 12hr format. |
10
+ | `analogue` | `analogue` | `boolean` | false | Display clock in analogue style. |
11
+ | `interactive` | `interactive` | `boolean` | false | Enabled interactive mode. Allowing the user to offset the value. |
12
+ | `offset` | `offset` | `number` | | Get offset value |
13
+ | `showSeconds` | `show-seconds` | `boolean` | false | Display the seconds segment. |
14
+ | `tick` | `tick` | `boolean` | false | Toggles clock ticking function. |
15
+ | `value` | `value` | `string` | "00:00:00" | Get time value in format `hh:mm:ss` |
16
+
17
+ ## Methods
18
+
19
+ | Method | Type | Description |
20
+ |-------------------|---------------------|--------------------------------------------------|
21
+ | `resizedCallback` | `(size: any): void` | Called when the element's dimension have changed<br /><br />**size**: Element size |
22
+
23
+ ## Events
24
+
25
+ | Event | Description |
26
+ |------------------|--------------------------------------------------|
27
+ | `offset-changed` | Fired when the the user offsets the clock in `interactive` mode. |
28
+ | `value-changed` | Fired when the value property changes while ticking. |
@@ -1,23 +1,23 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { TemplateResult, CSSResult, PropertyValues, BasicElement } from '@refinitiv-ui/core';
2
+ import { TemplateResult, CSSResultGroup, PropertyValues, ResponsiveElement, ElementSize } from '@refinitiv-ui/core';
3
3
  /**
4
4
  * Display hours, minutes and seconds as clock interface
5
5
  * @fires value-changed - Fired when the value property changes while ticking.
6
6
  * @fires offset-changed - Fired when the the user offsets the clock in `interactive` mode.
7
7
  */
8
- export declare class Clock extends BasicElement {
8
+ export declare class Clock extends ResponsiveElement {
9
9
  /**
10
10
  * Element version number
11
11
  * @returns version number
12
12
  */
13
13
  static get version(): string;
14
14
  /**
15
- * A `CSSResult` that will be used
15
+ * A `CSSResultGroup` that will be used
16
16
  * to style the host, slotted children
17
17
  * and the internal template of the element.
18
- * @return {CSSResult | CSSResult[]} CSS template
18
+ * @return CSS template
19
19
  */
20
- static get styles(): CSSResult | CSSResult[];
20
+ static get styles(): CSSResultGroup;
21
21
  /**
22
22
  * Shared internal function,
23
23
  * used for handling notifications from tick manager.
@@ -44,6 +44,7 @@ export declare class Clock extends BasicElement {
44
44
  private tickTimestamp;
45
45
  /**
46
46
  * Get time value in format `hh:mm:ss`
47
+ * @default 00:00:00
47
48
  * @returns value
48
49
  */
49
50
  get value(): string;
@@ -68,6 +69,7 @@ export declare class Clock extends BasicElement {
68
69
  private _tick;
69
70
  /**
70
71
  * Toggles clock ticking function.
72
+ * @default false
71
73
  */
72
74
  get tick(): boolean;
73
75
  set tick(value: boolean);
@@ -99,6 +101,10 @@ export declare class Clock extends BasicElement {
99
101
  * Getter for seconds part.
100
102
  */
101
103
  private secondsPart;
104
+ /**
105
+ * Size of the clock.
106
+ */
107
+ private size;
102
108
  /**
103
109
  * Get the display time in seconds.
104
110
  * This value includes any offsets applied.
@@ -260,6 +266,12 @@ export declare class Clock extends BasicElement {
260
266
  * @returns {TemplateResult} template
261
267
  */
262
268
  private get secondsSegmentTemplate();
269
+ /**
270
+ * Called when the element's dimension have changed
271
+ * @param size Element size
272
+ * @returns {void}
273
+ */
274
+ resizedCallback(size: ElementSize): void;
263
275
  /**
264
276
  * Called when the element has been appended to the DOM
265
277
  * @returns {void}
@@ -1,22 +1,23 @@
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, BasicElement, ifDefined, WarningNotice, query, state } from '@refinitiv-ui/core';
8
- import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils';
9
- import { HOURS_IN_DAY, MINUTES_IN_HOUR, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_MINUTE } from './utils/timestamps';
10
- import { register, deRegister } from './utils/TickManager';
11
- import { VERSION } from '../';
1
+ import { __decorate } from "tslib";
2
+ import { html, css, WarningNotice, ResponsiveElement } 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 { state } from '@refinitiv-ui/core/lib/decorators/state.js';
7
+ import { ifDefined } from '@refinitiv-ui/core/lib/directives/if-defined.js';
8
+ import { VERSION } from '../version.js';
9
+ import { MILLISECONDS_IN_SECOND, HOURS_OF_NOON, isValidTime, toTimeSegment, TimeFormat, format, padNumber } from '@refinitiv-ui/utils/lib/date.js';
10
+ import { HOURS_IN_DAY, MINUTES_IN_HOUR, SECONDS_IN_DAY, SECONDS_IN_HOUR, SECONDS_IN_MINUTE } from './utils/timestamps.js';
11
+ import { register, deRegister } from './utils/TickManager.js';
12
12
  const UP = 'Up';
13
13
  const DOWN = 'Down';
14
+ const SMALL_SIZE = 130; // Break point for small size clock face.
14
15
  /**
15
16
  * Display hours, minutes and seconds as clock interface
16
17
  * @fires value-changed - Fired when the value property changes while ticking.
17
18
  * @fires offset-changed - Fired when the the user offsets the clock in `interactive` mode.
18
19
  */
19
- let Clock = class Clock extends BasicElement {
20
+ let Clock = class Clock extends ResponsiveElement {
20
21
  constructor() {
21
22
  super(...arguments);
22
23
  /**
@@ -60,6 +61,10 @@ let Clock = class Clock extends BasicElement {
60
61
  * Display clock in analogue style.
61
62
  */
62
63
  this.analogue = false;
64
+ /**
65
+ * Size of the clock.
66
+ */
67
+ this.size = null;
63
68
  }
64
69
  /**
65
70
  * Element version number
@@ -69,10 +74,10 @@ let Clock = class Clock extends BasicElement {
69
74
  return VERSION;
70
75
  }
71
76
  /**
72
- * A `CSSResult` that will be used
77
+ * A `CSSResultGroup` that will be used
73
78
  * to style the host, slotted children
74
79
  * and the internal template of the element.
75
- * @return {CSSResult | CSSResult[]} CSS template
80
+ * @return CSS template
76
81
  */
77
82
  static get styles() {
78
83
  return css `
@@ -105,6 +110,7 @@ let Clock = class Clock extends BasicElement {
105
110
  }
106
111
  /**
107
112
  * Get time value in format `hh:mm:ss`
113
+ * @default 00:00:00
108
114
  * @returns value
109
115
  */
110
116
  get value() {
@@ -130,7 +136,7 @@ let Clock = class Clock extends BasicElement {
130
136
  this.synchronise(); // Required to reset any tick session
131
137
  const { hours, minutes, seconds } = toTimeSegment(value);
132
138
  this.baseTime = hours * SECONDS_IN_HOUR + minutes * SECONDS_IN_MINUTE + seconds;
133
- void this.requestUpdate('value', oldValue);
139
+ this.requestUpdate('value', oldValue);
134
140
  }
135
141
  }
136
142
  /**
@@ -154,11 +160,12 @@ let Clock = class Clock extends BasicElement {
154
160
  const newOffset = Math.round(offset % SECONDS_IN_DAY) || 0;
155
161
  if (oldOffset !== newOffset) {
156
162
  this._offset = newOffset;
157
- void this.requestUpdate('offset', oldOffset);
163
+ this.requestUpdate('offset', oldOffset);
158
164
  }
159
165
  }
160
166
  /**
161
167
  * Toggles clock ticking function.
168
+ * @default false
162
169
  */
163
170
  get tick() {
164
171
  return this._tick;
@@ -170,7 +177,7 @@ let Clock = class Clock extends BasicElement {
170
177
  this._tick = newValue;
171
178
  this.synchronise();
172
179
  this.configureTickManager();
173
- void this.requestUpdate('tick', oldValue);
180
+ this.requestUpdate('tick', oldValue);
174
181
  }
175
182
  }
176
183
  /**
@@ -446,6 +453,15 @@ let Clock = class Clock extends BasicElement {
446
453
  get secondsSegmentTemplate() {
447
454
  return this.generateSegmentTemplate('seconds', this.displaySeconds);
448
455
  }
456
+ /**
457
+ * Called when the element's dimension have changed
458
+ * @param size Element size
459
+ * @returns {void}
460
+ */
461
+ resizedCallback(size) {
462
+ // size should be set to small only if it's analog clock and it's smaller than defined break point
463
+ this.size = this.analogue && Math.min(size.width, size.height) < SMALL_SIZE ? 'small' : null;
464
+ }
449
465
  /**
450
466
  * Called when the element has been appended to the DOM
451
467
  * @returns {void}
@@ -498,7 +514,7 @@ let Clock = class Clock extends BasicElement {
498
514
  const hourAngle = Number((30 * (this.displayHours24 + (1 / 60) * this.displayMinutes)).toFixed(2));
499
515
  return html `
500
516
  <div part="hands">
501
- <div part="digital">${this.digitalClockTemplate}</div>
517
+ ${this.size === 'small' ? html `${this.amPm ? this.amPmTemplate : undefined}` : html `<div part="digital">${this.digitalClockTemplate}</div>`}
502
518
  <div part="hand hour" style="transform: rotate(${hourAngle}deg)"></div>
503
519
  <div part="hand minute" style="transform: rotate(${minAngle}deg)"></div>
504
520
  ${this.showSeconds ? html `<div part="hand second" style="transform: rotate(${secAngle}deg)"></div>` : undefined}
@@ -556,6 +572,9 @@ __decorate([
556
572
  __decorate([
557
573
  query('[part~=seconds]', true)
558
574
  ], Clock.prototype, "secondsPart", void 0);
575
+ __decorate([
576
+ property({ type: String, attribute: 'size', reflect: true })
577
+ ], Clock.prototype, "size", void 0);
559
578
  Clock = __decorate([
560
579
  customElement('ef-clock', {
561
580
  alias: 'sapphire-clock'