@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
@@ -3,7 +3,7 @@
3
3
  "tags": [
4
4
  {
5
5
  "name": "ef-text-field",
6
- "description": "Form control element for text",
6
+ "description": "Form control element for text.",
7
7
  "attributes": [
8
8
  {
9
9
  "name": "pattern",
@@ -11,29 +11,10 @@
11
11
  "type": "string",
12
12
  "default": "\"\""
13
13
  },
14
- {
15
- "name": "placeholder",
16
- "description": "Set place holder text",
17
- "type": "string",
18
- "default": "\"\""
19
- },
20
- {
21
- "name": "error",
22
- "description": "Set state to error",
23
- "type": "boolean",
24
- "default": "false"
25
- },
26
- {
27
- "name": "warning",
28
- "description": "Set state to warning",
29
- "type": "boolean",
30
- "default": "false"
31
- },
32
14
  {
33
15
  "name": "icon",
34
16
  "description": "Specify icon to display in input. Value can be icon name",
35
- "type": "string",
36
- "default": "\"\""
17
+ "type": "string | null"
37
18
  },
38
19
  {
39
20
  "name": "icon-has-action",
@@ -41,12 +22,6 @@
41
22
  "type": "boolean",
42
23
  "default": "false"
43
24
  },
44
- {
45
- "name": "transparent",
46
- "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.",
47
- "type": "boolean",
48
- "default": "false"
49
- },
50
25
  {
51
26
  "name": "maxlength",
52
27
  "description": "Set character max limit",
@@ -58,8 +33,20 @@
58
33
  "type": "number | null"
59
34
  },
60
35
  {
61
- "name": "value",
62
- "description": "Input's value",
36
+ "name": "disabled",
37
+ "description": "Set disabled state",
38
+ "type": "boolean",
39
+ "default": "false"
40
+ },
41
+ {
42
+ "name": "error",
43
+ "description": "Set error state",
44
+ "type": "boolean",
45
+ "default": "false"
46
+ },
47
+ {
48
+ "name": "placeholder",
49
+ "description": "Set placeholder text",
63
50
  "type": "string",
64
51
  "default": "\"\""
65
52
  },
@@ -67,13 +54,25 @@
67
54
  "name": "readonly",
68
55
  "description": "Set readonly state",
69
56
  "type": "boolean",
70
- "default": "\"false\""
57
+ "default": "false"
71
58
  },
72
59
  {
73
- "name": "disabled",
74
- "description": "Set disabled state",
60
+ "name": "transparent",
61
+ "description": "Disables all other states and border/background styles.",
62
+ "type": "boolean",
63
+ "default": "false"
64
+ },
65
+ {
66
+ "name": "warning",
67
+ "description": "Set warning state",
75
68
  "type": "boolean",
76
- "default": "\"false\""
69
+ "default": "false"
70
+ },
71
+ {
72
+ "name": "value",
73
+ "description": "Input's value",
74
+ "type": "string",
75
+ "default": "\"\""
77
76
  }
78
77
  ],
79
78
  "properties": [
@@ -84,33 +83,11 @@
84
83
  "type": "string",
85
84
  "default": "\"\""
86
85
  },
87
- {
88
- "name": "placeholder",
89
- "attribute": "placeholder",
90
- "description": "Set place holder text",
91
- "type": "string",
92
- "default": "\"\""
93
- },
94
- {
95
- "name": "error",
96
- "attribute": "error",
97
- "description": "Set state to error",
98
- "type": "boolean",
99
- "default": "false"
100
- },
101
- {
102
- "name": "warning",
103
- "attribute": "warning",
104
- "description": "Set state to warning",
105
- "type": "boolean",
106
- "default": "false"
107
- },
108
86
  {
109
87
  "name": "icon",
110
88
  "attribute": "icon",
111
89
  "description": "Specify icon to display in input. Value can be icon name",
112
- "type": "string",
113
- "default": "\"\""
90
+ "type": "string | null"
114
91
  },
115
92
  {
116
93
  "name": "iconHasAction",
@@ -119,13 +96,6 @@
119
96
  "type": "boolean",
120
97
  "default": "false"
121
98
  },
122
- {
123
- "name": "transparent",
124
- "attribute": "transparent",
125
- "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.",
126
- "type": "boolean",
127
- "default": "false"
128
- },
129
99
  {
130
100
  "name": "maxLength",
131
101
  "attribute": "maxlength",
@@ -139,19 +109,23 @@
139
109
  "type": "number | null"
140
110
  },
141
111
  {
142
- "name": "selectionStart",
143
- "description": "Selection start index",
144
- "type": "number | null"
112
+ "name": "disabled",
113
+ "attribute": "disabled",
114
+ "description": "Set disabled state",
115
+ "type": "boolean",
116
+ "default": "false"
145
117
  },
146
118
  {
147
- "name": "selectionEnd",
148
- "description": "Selection end index",
149
- "type": "number | null"
119
+ "name": "error",
120
+ "attribute": "error",
121
+ "description": "Set error state",
122
+ "type": "boolean",
123
+ "default": "false"
150
124
  },
151
125
  {
152
- "name": "value",
153
- "attribute": "value",
154
- "description": "Input's value",
126
+ "name": "placeholder",
127
+ "attribute": "placeholder",
128
+ "description": "Set placeholder text",
155
129
  "type": "string",
156
130
  "default": "\"\""
157
131
  },
@@ -160,14 +134,28 @@
160
134
  "attribute": "readonly",
161
135
  "description": "Set readonly state",
162
136
  "type": "boolean",
163
- "default": "\"false\""
137
+ "default": "false"
164
138
  },
165
139
  {
166
- "name": "disabled",
167
- "attribute": "disabled",
168
- "description": "Set disabled state",
140
+ "name": "transparent",
141
+ "attribute": "transparent",
142
+ "description": "Disables all other states and border/background styles.",
169
143
  "type": "boolean",
170
- "default": "\"false\""
144
+ "default": "false"
145
+ },
146
+ {
147
+ "name": "warning",
148
+ "attribute": "warning",
149
+ "description": "Set warning state",
150
+ "type": "boolean",
151
+ "default": "false"
152
+ },
153
+ {
154
+ "name": "value",
155
+ "attribute": "value",
156
+ "description": "Input's value",
157
+ "type": "string",
158
+ "default": "\"\""
171
159
  }
172
160
  ],
173
161
  "events": [
@@ -181,26 +169,27 @@
181
169
  },
182
170
  {
183
171
  "name": "icon-click",
184
- "description": "Dispatched only when element has icon-has-action attribute and icon is clicked"
172
+ "description": "Dispatched when icon is clicked"
185
173
  }
186
174
  ],
187
175
  "methods": [
188
176
  {
189
- "name": "select",
190
- "description": "Select the contents of input",
191
- "params": []
177
+ "name": "onInputInput",
178
+ "description": "",
179
+ "params": [
180
+ {
181
+ "name": "event",
182
+ "type": "InputEvent"
183
+ }
184
+ ]
192
185
  },
193
186
  {
194
- "name": "setSelectionRange",
195
- "description": "Set the selection range",
187
+ "name": "onInputChange",
188
+ "description": "",
196
189
  "params": [
197
190
  {
198
- "name": "startSelection",
199
- "description": "Start of selection"
200
- },
201
- {
202
- "name": "endSelection",
203
- "description": "End of the selection"
191
+ "name": "event",
192
+ "type": "InputEvent"
204
193
  }
205
194
  ]
206
195
  }
@@ -0,0 +1,35 @@
1
+ # ef-text-field
2
+
3
+ Form control element for text.
4
+
5
+ ## Properties
6
+
7
+ | Property | Attribute | Type | Default | Description |
8
+ |-----------------|-------------------|------------------|---------|--------------------------------------------------|
9
+ | `disabled` | `disabled` | `boolean` | false | Set disabled state |
10
+ | `error` | `error` | `boolean` | false | Set error state |
11
+ | `icon` | `icon` | `string \| null` | null | Specify icon to display in input. Value can be icon name |
12
+ | `iconHasAction` | `icon-has-action` | `boolean` | false | Specify when icon need to be clickable |
13
+ | `maxLength` | `maxlength` | `number \| null` | null | Set character max limit |
14
+ | `minLength` | `minlength` | `number \| null` | null | Set character min limit |
15
+ | `pattern` | `pattern` | `string` | "" | Set regular expression for input validation |
16
+ | `placeholder` | `placeholder` | `string` | "" | Set placeholder text |
17
+ | `readonly` | `readonly` | `boolean` | false | Set readonly state |
18
+ | `transparent` | `transparent` | `boolean` | false | Disables all other states and border/background styles. |
19
+ | `value` | `value` | `string` | "" | Input's value |
20
+ | `warning` | `warning` | `boolean` | false | Set warning state |
21
+
22
+ ## Methods
23
+
24
+ | Method | Type |
25
+ |-----------------|----------------------|
26
+ | `onInputChange` | `(event: any): void` |
27
+ | `onInputInput` | `(event: any): void` |
28
+
29
+ ## Events
30
+
31
+ | Event | Description |
32
+ |-----------------|-------------------------------------|
33
+ | `error-changed` | Dispatched when error state changes |
34
+ | `icon-click` | Dispatched when icon is clicked |
35
+ | `value-changed` | Dispatched when value changes |
@@ -1,63 +1,59 @@
1
1
  import { JSXInterface } from '../jsx';
2
- import { ControlElement, CSSResult, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
3
- import '../icon';
4
- declare type SelectionIndex = number | null;
2
+ import { FormFieldElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core';
3
+ import { TemplateMap } from '@refinitiv-ui/core/lib/directives/template-map.js';
4
+ import '../icon/index.js';
5
5
  /**
6
- * Form control element for text
6
+ * Form control element for text.
7
7
  *
8
8
  * @fires value-changed - Dispatched when value changes
9
9
  * @fires error-changed - Dispatched when error state changes
10
+ * @fires icon-click - Dispatched when icon is clicked
10
11
  *
11
- * @attr {string} value - Input's value
12
- * @prop {string} [value=] - Input's value
12
+ * @attr {boolean} disabled - Set disabled state
13
+ * @prop {boolean} [disabled=false] - Set disabled state
14
+ *
15
+ * @attr {boolean} error - Set error state
16
+ * @prop {boolean} [error=false] - Set error state
17
+ *
18
+ * @attr {string} placeholder - Set placeholder text
19
+ * @prop {string} [placeholder=""] - Set placeholder text
13
20
  *
14
21
  * @attr {boolean} readonly - Set readonly state
15
22
  * @prop {boolean} [readonly=false] - Set readonly state
16
23
  *
17
- * @attr {boolean} disabled - Set disabled state
18
- * @prop {boolean} [disabled=false] - Set disabled state
24
+ * @attr {boolean} transparent - Disables all other states and border/background styles.
25
+ * @prop {boolean} [transparent=false] - Disables all other states and border/background styles.
26
+ *
27
+ * @attr {boolean} warning - Set warning state
28
+ * @prop {boolean} [warning=false] - Set warning state
29
+ *
30
+ * @attr {string} value - Input's value
31
+ * @prop {string} [value=""] - Input's value
19
32
  */
20
- export declare class TextField extends ControlElement {
33
+ export declare class TextField extends FormFieldElement {
21
34
  /**
22
35
  * Element version number
23
36
  * @returns version number
24
37
  */
25
38
  static get version(): string;
26
39
  /**
27
- * @returns A `CSSResult` that will be used to style the host,
40
+ * A `CSSResultGroup` that will be used to style the host,
28
41
  * slotted children and the internal template of the element.
42
+ * @returns CSS template
29
43
  */
30
- static get styles(): CSSResult | CSSResult[];
44
+ static get styles(): CSSResultGroup;
31
45
  /**
32
46
  * Set regular expression for input validation
33
47
  */
34
48
  pattern: string;
35
- /**
36
- * Set place holder text
37
- */
38
- placeholder: string;
39
- /**
40
- * Set state to error
41
- */
42
- error: boolean;
43
- /**
44
- * Set state to warning
45
- */
46
- warning: boolean;
47
49
  /**
48
50
  * Specify icon to display in input. Value can be icon name
49
51
  */
50
- icon: string;
52
+ icon: string | null;
51
53
  /**
52
54
  * Specify when icon need to be clickable
53
55
  */
54
56
  iconHasAction: boolean;
55
- /**
56
- * Disables all other states and border/background styles.
57
- * Use with advanced composite elements requiring e.g. multi selection in
58
- * combo-box when parent container handles element states.
59
- */
60
- transparent: boolean;
61
57
  /**
62
58
  * Set character max limit
63
59
  */
@@ -66,32 +62,6 @@ export declare class TextField extends ControlElement {
66
62
  * Set character min limit
67
63
  */
68
64
  minLength: number | null;
69
- /**
70
- * Get native input element from shadow roots
71
- */
72
- private inputElement;
73
- /**
74
- * Selection start index
75
- */
76
- get selectionStart(): number | null;
77
- set selectionStart(index: SelectionIndex);
78
- /**
79
- * Selection end index
80
- */
81
- get selectionEnd(): number | null;
82
- set selectionEnd(index: SelectionIndex);
83
- /**
84
- * Select the contents of input
85
- * @returns void
86
- */
87
- select(): void;
88
- /**
89
- * Set the selection range
90
- * @param startSelection Start of selection
91
- * @param endSelection End of the selection
92
- * @returns {void}
93
- */
94
- setSelectionRange(startSelection: number, endSelection: number): void;
95
65
  /**
96
66
  * Called after the component is first rendered
97
67
  * @param changedProperties Properties which have changed
@@ -109,52 +79,62 @@ export declare class TextField extends ControlElement {
109
79
  * @param changedProperties Properties that has changed
110
80
  * @returns True if input should be re-validated
111
81
  */
112
- private shouldValidateInput;
82
+ protected shouldValidateInput(changedProperties: PropertyValues): boolean;
113
83
  /**
114
- * renders icon element if property present
84
+ * Runs on input element `input` event
85
+ * @param event `input` event
115
86
  * @returns {void}
116
87
  */
117
- private renderIcon;
88
+ protected onInputInput(event: InputEvent): void;
118
89
  /**
119
- * A `TemplateResult` that will be used
120
- * to render the updated internal template.
121
- * @return Render template
90
+ * Runs on input element `change` event
91
+ * @param event `change` event
92
+ * @returns {void}
122
93
  */
123
- protected render(): TemplateResult;
94
+ protected onInputChange(event: InputEvent): void;
124
95
  /**
125
- * check if value is changed and fire event
96
+ * Check if value is changed and fire event
126
97
  * @returns {void}
127
98
  */
128
- private onPossibleValueChange;
99
+ protected onPossibleValueChange(event: InputEvent): void;
129
100
  /**
130
- * validate input according `pattern`, `minLength` and `maxLength` properties
101
+ * Validate input according `pattern`, `minLength` and `maxLength` properties
131
102
  * change state of `error` property according pattern validation
132
- * @returns void
103
+ * @returns {void}
133
104
  */
134
- private validateInput;
105
+ protected validateInput(): void;
135
106
  /**
136
107
  * @param error existing state of error
137
108
  * @returns true if there is no error and browser is IE11 and minLength more than 0 and value exists
138
109
  */
139
- private shouldValidateForMinLength;
110
+ protected shouldValidateForMinLength(error: boolean): boolean;
140
111
  /**
141
- * Detect `enter` and `space` keydown and fire
142
- * @param event keydown event
112
+ * Fires event on `icon` click
143
113
  * @returns {void}
144
114
  */
145
- private handleKeyDown;
115
+ protected iconClick(): void;
146
116
  /**
147
- * Process internal icon click and fire `icon-click` event
148
- * @returns void
117
+ * Decorate `<input>` element with common properties extended from form field element:
118
+ * type="text" - always `text`
119
+ * part="input" - always "input", used for styling
120
+ * maxlength - calculated from `this.maxLength`
121
+ * minlength - calculated from `this.minLength`
122
+ * pattern - calculated from `this.pattern`
123
+ * @returns template map
149
124
  */
150
- private iconClick;
125
+ protected get decorateInputMap(): TemplateMap;
151
126
  /**
152
- * Fire event on `icon` click
127
+ * Renders icon element if property present
153
128
  * @returns {void}
154
129
  */
155
- private notifyIcon;
130
+ protected renderIcon(): TemplateResult | null;
131
+ /**
132
+ * A `TemplateResult` that will be used
133
+ * to render the updated internal template.
134
+ * @return Render template
135
+ */
136
+ protected render(): TemplateResult;
156
137
  }
157
- export {};
158
138
 
159
139
  declare global {
160
140
  interface HTMLElementTagNameMap {
@@ -163,7 +143,7 @@ declare global {
163
143
 
164
144
  namespace JSX {
165
145
  interface IntrinsicElements {
166
- 'ef-text-field': Partial<TextField> | JSXInterface.ControlHTMLAttributes<TextField>;
146
+ 'ef-text-field': Partial<TextField> | JSXInterface.HTMLAttributes<TextField>;
167
147
  }
168
148
  }
169
149
  }