@ckeditor/ckeditor5-ui 41.3.1 → 41.4.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 (392) hide show
  1. package/dist/index-content.css +4 -0
  2. package/dist/index-editor.css +497 -0
  3. package/dist/index.css +942 -0
  4. package/dist/index.css.map +1 -0
  5. package/dist/index.js +14343 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/translations/af.d.ts +8 -0
  8. package/dist/translations/af.js +5 -0
  9. package/dist/translations/af.umd.js +11 -0
  10. package/dist/translations/ar.d.ts +8 -0
  11. package/dist/translations/ar.js +5 -0
  12. package/dist/translations/ar.umd.js +11 -0
  13. package/dist/translations/ast.d.ts +8 -0
  14. package/dist/translations/ast.js +5 -0
  15. package/dist/translations/ast.umd.js +11 -0
  16. package/dist/translations/az.d.ts +8 -0
  17. package/dist/translations/az.js +5 -0
  18. package/dist/translations/az.umd.js +11 -0
  19. package/dist/translations/bg.d.ts +8 -0
  20. package/dist/translations/bg.js +5 -0
  21. package/dist/translations/bg.umd.js +11 -0
  22. package/dist/translations/bn.d.ts +8 -0
  23. package/dist/translations/bn.js +5 -0
  24. package/dist/translations/bn.umd.js +11 -0
  25. package/dist/translations/bs.d.ts +8 -0
  26. package/dist/translations/bs.js +5 -0
  27. package/dist/translations/bs.umd.js +11 -0
  28. package/dist/translations/ca.d.ts +8 -0
  29. package/dist/translations/ca.js +5 -0
  30. package/dist/translations/ca.umd.js +11 -0
  31. package/dist/translations/cs.d.ts +8 -0
  32. package/dist/translations/cs.js +5 -0
  33. package/dist/translations/cs.umd.js +11 -0
  34. package/dist/translations/da.d.ts +8 -0
  35. package/dist/translations/da.js +5 -0
  36. package/dist/translations/da.umd.js +11 -0
  37. package/dist/translations/de-ch.d.ts +8 -0
  38. package/dist/translations/de-ch.js +5 -0
  39. package/dist/translations/de-ch.umd.js +11 -0
  40. package/dist/translations/de.d.ts +8 -0
  41. package/dist/translations/de.js +5 -0
  42. package/dist/translations/de.umd.js +11 -0
  43. package/dist/translations/el.d.ts +8 -0
  44. package/dist/translations/el.js +5 -0
  45. package/dist/translations/el.umd.js +11 -0
  46. package/dist/translations/en-au.d.ts +8 -0
  47. package/dist/translations/en-au.js +5 -0
  48. package/dist/translations/en-au.umd.js +11 -0
  49. package/dist/translations/en-gb.d.ts +8 -0
  50. package/dist/translations/en-gb.js +5 -0
  51. package/dist/translations/en-gb.umd.js +11 -0
  52. package/dist/translations/en.d.ts +8 -0
  53. package/dist/translations/en.js +5 -0
  54. package/dist/translations/en.umd.js +11 -0
  55. package/dist/translations/eo.d.ts +8 -0
  56. package/dist/translations/eo.js +5 -0
  57. package/dist/translations/eo.umd.js +11 -0
  58. package/dist/translations/es-co.d.ts +8 -0
  59. package/dist/translations/es-co.js +5 -0
  60. package/dist/translations/es-co.umd.js +11 -0
  61. package/dist/translations/es.d.ts +8 -0
  62. package/dist/translations/es.js +5 -0
  63. package/dist/translations/es.umd.js +11 -0
  64. package/dist/translations/et.d.ts +8 -0
  65. package/dist/translations/et.js +5 -0
  66. package/dist/translations/et.umd.js +11 -0
  67. package/dist/translations/eu.d.ts +8 -0
  68. package/dist/translations/eu.js +5 -0
  69. package/dist/translations/eu.umd.js +11 -0
  70. package/dist/translations/fa.d.ts +8 -0
  71. package/dist/translations/fa.js +5 -0
  72. package/dist/translations/fa.umd.js +11 -0
  73. package/dist/translations/fi.d.ts +8 -0
  74. package/dist/translations/fi.js +5 -0
  75. package/dist/translations/fi.umd.js +11 -0
  76. package/dist/translations/fr.d.ts +8 -0
  77. package/dist/translations/fr.js +5 -0
  78. package/dist/translations/fr.umd.js +11 -0
  79. package/dist/translations/gl.d.ts +8 -0
  80. package/dist/translations/gl.js +5 -0
  81. package/dist/translations/gl.umd.js +11 -0
  82. package/dist/translations/he.d.ts +8 -0
  83. package/dist/translations/he.js +5 -0
  84. package/dist/translations/he.umd.js +11 -0
  85. package/dist/translations/hi.d.ts +8 -0
  86. package/dist/translations/hi.js +5 -0
  87. package/dist/translations/hi.umd.js +11 -0
  88. package/dist/translations/hr.d.ts +8 -0
  89. package/dist/translations/hr.js +5 -0
  90. package/dist/translations/hr.umd.js +11 -0
  91. package/dist/translations/hu.d.ts +8 -0
  92. package/dist/translations/hu.js +5 -0
  93. package/dist/translations/hu.umd.js +11 -0
  94. package/dist/translations/id.d.ts +8 -0
  95. package/dist/translations/id.js +5 -0
  96. package/dist/translations/id.umd.js +11 -0
  97. package/dist/translations/it.d.ts +8 -0
  98. package/dist/translations/it.js +5 -0
  99. package/dist/translations/it.umd.js +11 -0
  100. package/dist/translations/ja.d.ts +8 -0
  101. package/dist/translations/ja.js +5 -0
  102. package/dist/translations/ja.umd.js +11 -0
  103. package/dist/translations/jv.d.ts +8 -0
  104. package/dist/translations/jv.js +5 -0
  105. package/dist/translations/jv.umd.js +11 -0
  106. package/dist/translations/km.d.ts +8 -0
  107. package/dist/translations/km.js +5 -0
  108. package/dist/translations/km.umd.js +11 -0
  109. package/dist/translations/kn.d.ts +8 -0
  110. package/dist/translations/kn.js +5 -0
  111. package/dist/translations/kn.umd.js +11 -0
  112. package/dist/translations/ko.d.ts +8 -0
  113. package/dist/translations/ko.js +5 -0
  114. package/dist/translations/ko.umd.js +11 -0
  115. package/dist/translations/ku.d.ts +8 -0
  116. package/dist/translations/ku.js +5 -0
  117. package/dist/translations/ku.umd.js +11 -0
  118. package/dist/translations/lt.d.ts +8 -0
  119. package/dist/translations/lt.js +5 -0
  120. package/dist/translations/lt.umd.js +11 -0
  121. package/dist/translations/lv.d.ts +8 -0
  122. package/dist/translations/lv.js +5 -0
  123. package/dist/translations/lv.umd.js +11 -0
  124. package/dist/translations/ms.d.ts +8 -0
  125. package/dist/translations/ms.js +5 -0
  126. package/dist/translations/ms.umd.js +11 -0
  127. package/dist/translations/nb.d.ts +8 -0
  128. package/dist/translations/nb.js +5 -0
  129. package/dist/translations/nb.umd.js +11 -0
  130. package/dist/translations/ne.d.ts +8 -0
  131. package/dist/translations/ne.js +5 -0
  132. package/dist/translations/ne.umd.js +11 -0
  133. package/dist/translations/nl.d.ts +8 -0
  134. package/dist/translations/nl.js +5 -0
  135. package/dist/translations/nl.umd.js +11 -0
  136. package/dist/translations/no.d.ts +8 -0
  137. package/dist/translations/no.js +5 -0
  138. package/dist/translations/no.umd.js +11 -0
  139. package/dist/translations/pl.d.ts +8 -0
  140. package/dist/translations/pl.js +5 -0
  141. package/dist/translations/pl.umd.js +11 -0
  142. package/dist/translations/pt-br.d.ts +8 -0
  143. package/dist/translations/pt-br.js +5 -0
  144. package/dist/translations/pt-br.umd.js +11 -0
  145. package/dist/translations/pt.d.ts +8 -0
  146. package/dist/translations/pt.js +5 -0
  147. package/dist/translations/pt.umd.js +11 -0
  148. package/dist/translations/ro.d.ts +8 -0
  149. package/dist/translations/ro.js +5 -0
  150. package/dist/translations/ro.umd.js +11 -0
  151. package/dist/translations/ru.d.ts +8 -0
  152. package/dist/translations/ru.js +5 -0
  153. package/dist/translations/ru.umd.js +11 -0
  154. package/dist/translations/sk.d.ts +8 -0
  155. package/dist/translations/sk.js +5 -0
  156. package/dist/translations/sk.umd.js +11 -0
  157. package/dist/translations/sl.d.ts +8 -0
  158. package/dist/translations/sl.js +5 -0
  159. package/dist/translations/sl.umd.js +11 -0
  160. package/dist/translations/sq.d.ts +8 -0
  161. package/dist/translations/sq.js +5 -0
  162. package/dist/translations/sq.umd.js +11 -0
  163. package/dist/translations/sr-latn.d.ts +8 -0
  164. package/dist/translations/sr-latn.js +5 -0
  165. package/dist/translations/sr-latn.umd.js +11 -0
  166. package/dist/translations/sr.d.ts +8 -0
  167. package/dist/translations/sr.js +5 -0
  168. package/dist/translations/sr.umd.js +11 -0
  169. package/dist/translations/sv.d.ts +8 -0
  170. package/dist/translations/sv.js +5 -0
  171. package/dist/translations/sv.umd.js +11 -0
  172. package/dist/translations/th.d.ts +8 -0
  173. package/dist/translations/th.js +5 -0
  174. package/dist/translations/th.umd.js +11 -0
  175. package/dist/translations/ti.d.ts +8 -0
  176. package/dist/translations/ti.js +5 -0
  177. package/dist/translations/ti.umd.js +11 -0
  178. package/dist/translations/tk.d.ts +8 -0
  179. package/dist/translations/tk.js +5 -0
  180. package/dist/translations/tk.umd.js +11 -0
  181. package/dist/translations/tr.d.ts +8 -0
  182. package/dist/translations/tr.js +5 -0
  183. package/dist/translations/tr.umd.js +11 -0
  184. package/dist/translations/tt.d.ts +8 -0
  185. package/dist/translations/tt.js +5 -0
  186. package/dist/translations/tt.umd.js +11 -0
  187. package/dist/translations/ug.d.ts +8 -0
  188. package/dist/translations/ug.js +5 -0
  189. package/dist/translations/ug.umd.js +11 -0
  190. package/dist/translations/uk.d.ts +8 -0
  191. package/dist/translations/uk.js +5 -0
  192. package/dist/translations/uk.umd.js +11 -0
  193. package/dist/translations/ur.d.ts +8 -0
  194. package/dist/translations/ur.js +5 -0
  195. package/dist/translations/ur.umd.js +11 -0
  196. package/dist/translations/uz.d.ts +8 -0
  197. package/dist/translations/uz.js +5 -0
  198. package/dist/translations/uz.umd.js +11 -0
  199. package/dist/translations/vi.d.ts +8 -0
  200. package/dist/translations/vi.js +5 -0
  201. package/dist/translations/vi.umd.js +11 -0
  202. package/dist/translations/zh-cn.d.ts +8 -0
  203. package/dist/translations/zh-cn.js +5 -0
  204. package/dist/translations/zh-cn.umd.js +11 -0
  205. package/dist/translations/zh.d.ts +8 -0
  206. package/dist/translations/zh.js +5 -0
  207. package/dist/translations/zh.umd.js +11 -0
  208. package/dist/types/arialiveannouncer.d.ts +113 -0
  209. package/dist/types/augmentation.d.ts +92 -0
  210. package/dist/types/autocomplete/autocompleteview.d.ts +85 -0
  211. package/dist/types/bindings/addkeyboardhandlingforgrid.d.ts +31 -0
  212. package/dist/types/bindings/clickoutsidehandler.d.ts +32 -0
  213. package/dist/types/bindings/csstransitiondisablermixin.d.ts +44 -0
  214. package/dist/types/bindings/draggableviewmixin.d.ts +50 -0
  215. package/dist/types/bindings/injectcsstransitiondisabler.d.ts +63 -0
  216. package/dist/types/bindings/preventdefault.d.ts +37 -0
  217. package/dist/types/bindings/submithandler.d.ts +61 -0
  218. package/dist/types/button/button.d.ts +185 -0
  219. package/dist/types/button/buttonlabel.d.ts +38 -0
  220. package/dist/types/button/buttonlabelview.d.ts +35 -0
  221. package/dist/types/button/buttonview.d.ts +189 -0
  222. package/dist/types/button/filedialogbuttonview.d.ts +84 -0
  223. package/dist/types/button/switchbuttonview.d.ts +49 -0
  224. package/dist/types/collapsible/collapsibleview.d.ts +74 -0
  225. package/dist/types/colorgrid/colorgridview.d.ts +136 -0
  226. package/dist/types/colorgrid/colortileview.d.ts +32 -0
  227. package/dist/types/colorgrid/utils.d.ts +51 -0
  228. package/dist/types/colorpicker/colorpickerview.d.ts +177 -0
  229. package/dist/types/colorpicker/utils.d.ts +52 -0
  230. package/dist/types/colorselector/colorgridsfragmentview.d.ts +199 -0
  231. package/dist/types/colorselector/colorpickerfragmentview.d.ts +137 -0
  232. package/dist/types/colorselector/colorselectorview.d.ts +246 -0
  233. package/dist/types/colorselector/documentcolorcollection.d.ts +74 -0
  234. package/dist/types/componentfactory.d.ts +85 -0
  235. package/dist/types/dialog/dialog.d.ts +277 -0
  236. package/dist/types/dialog/dialogactionsview.d.ts +73 -0
  237. package/dist/types/dialog/dialogcontentview.d.ts +31 -0
  238. package/dist/types/dialog/dialogview.d.ts +260 -0
  239. package/dist/types/dropdown/button/dropdownbutton.d.ts +29 -0
  240. package/dist/types/dropdown/button/dropdownbuttonview.d.ts +52 -0
  241. package/dist/types/dropdown/button/splitbuttonview.d.ts +166 -0
  242. package/dist/types/dropdown/dropdownpanelfocusable.d.ts +25 -0
  243. package/dist/types/dropdown/dropdownpanelview.d.ts +66 -0
  244. package/dist/types/dropdown/dropdownview.d.ts +319 -0
  245. package/dist/types/dropdown/utils.d.ts +239 -0
  246. package/dist/types/editableui/editableuiview.d.ts +76 -0
  247. package/dist/types/editableui/inline/inlineeditableuiview.d.ts +44 -0
  248. package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +55 -0
  249. package/dist/types/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +39 -0
  250. package/dist/types/editorui/bodycollection.d.ts +59 -0
  251. package/dist/types/editorui/boxed/boxededitoruiview.d.ts +44 -0
  252. package/dist/types/editorui/editorui.d.ts +292 -0
  253. package/dist/types/editorui/editoruiview.d.ts +43 -0
  254. package/dist/types/editorui/poweredby.d.ts +75 -0
  255. package/dist/types/focuscycler.d.ts +249 -0
  256. package/dist/types/formheader/formheaderview.d.ts +63 -0
  257. package/dist/types/highlightedtext/highlightedtextview.d.ts +42 -0
  258. package/dist/types/icon/iconview.d.ts +92 -0
  259. package/dist/types/iframe/iframeview.d.ts +54 -0
  260. package/dist/types/index.d.ts +87 -0
  261. package/dist/types/input/inputbase.d.ts +123 -0
  262. package/dist/types/input/inputview.d.ts +40 -0
  263. package/dist/types/inputnumber/inputnumberview.d.ts +53 -0
  264. package/dist/types/inputtext/inputtextview.d.ts +22 -0
  265. package/dist/types/label/labelview.d.ts +40 -0
  266. package/dist/types/labeledfield/labeledfieldview.d.ts +191 -0
  267. package/dist/types/labeledfield/utils.d.ts +127 -0
  268. package/dist/types/labeledinput/labeledinputview.d.ts +129 -0
  269. package/dist/types/list/listitemgroupview.d.ts +63 -0
  270. package/dist/types/list/listitemview.d.ts +40 -0
  271. package/dist/types/list/listseparatorview.d.ts +22 -0
  272. package/dist/types/list/listview.d.ts +128 -0
  273. package/dist/types/menubar/menubarmenubuttonview.d.ts +39 -0
  274. package/dist/types/menubar/menubarmenulistitembuttonview.d.ts +25 -0
  275. package/dist/types/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +27 -0
  276. package/dist/types/menubar/menubarmenulistitemview.d.ts +29 -0
  277. package/dist/types/menubar/menubarmenulistview.d.ts +28 -0
  278. package/dist/types/menubar/menubarmenupanelview.d.ts +57 -0
  279. package/dist/types/menubar/menubarmenuview.d.ts +113 -0
  280. package/dist/types/menubar/menubarview.d.ts +168 -0
  281. package/dist/types/menubar/utils.d.ts +443 -0
  282. package/dist/types/model.d.ts +26 -0
  283. package/dist/types/notification/notification.d.ts +215 -0
  284. package/dist/types/panel/balloon/balloonpanelview.d.ts +689 -0
  285. package/dist/types/panel/balloon/contextualballoon.d.ts +303 -0
  286. package/dist/types/panel/sticky/stickypanelview.d.ts +160 -0
  287. package/dist/types/search/filteredview.d.ts +35 -0
  288. package/dist/types/search/searchinfoview.d.ts +49 -0
  289. package/dist/types/search/searchresultsview.d.ts +58 -0
  290. package/dist/types/search/text/searchtextqueryview.d.ts +80 -0
  291. package/dist/types/search/text/searchtextview.d.ts +223 -0
  292. package/dist/types/spinner/spinnerview.d.ts +29 -0
  293. package/dist/types/template.d.ts +946 -0
  294. package/dist/types/textarea/textareaview.d.ts +108 -0
  295. package/dist/types/toolbar/balloon/balloontoolbar.d.ts +121 -0
  296. package/dist/types/toolbar/block/blockbuttonview.d.ts +39 -0
  297. package/dist/types/toolbar/block/blocktoolbar.d.ts +157 -0
  298. package/dist/types/toolbar/normalizetoolbarconfig.d.ts +44 -0
  299. package/dist/types/toolbar/toolbarlinebreakview.d.ts +22 -0
  300. package/dist/types/toolbar/toolbarseparatorview.d.ts +22 -0
  301. package/dist/types/toolbar/toolbarview.d.ts +271 -0
  302. package/dist/types/tooltipmanager.d.ts +199 -0
  303. package/dist/types/view.d.ts +426 -0
  304. package/dist/types/viewcollection.d.ts +143 -0
  305. package/lang/contexts.json +2 -1
  306. package/lang/translations/af.po +4 -0
  307. package/lang/translations/ar.po +4 -0
  308. package/lang/translations/ast.po +4 -0
  309. package/lang/translations/az.po +4 -0
  310. package/lang/translations/bg.po +4 -0
  311. package/lang/translations/bn.po +4 -0
  312. package/lang/translations/bs.po +4 -0
  313. package/lang/translations/ca.po +4 -0
  314. package/lang/translations/cs.po +4 -0
  315. package/lang/translations/da.po +4 -0
  316. package/lang/translations/de-ch.po +4 -0
  317. package/lang/translations/de.po +4 -0
  318. package/lang/translations/el.po +4 -0
  319. package/lang/translations/en-au.po +4 -0
  320. package/lang/translations/en-gb.po +4 -0
  321. package/lang/translations/en.po +4 -0
  322. package/lang/translations/eo.po +4 -0
  323. package/lang/translations/es-co.po +4 -0
  324. package/lang/translations/es.po +4 -0
  325. package/lang/translations/et.po +4 -0
  326. package/lang/translations/eu.po +4 -0
  327. package/lang/translations/fa.po +4 -0
  328. package/lang/translations/fi.po +4 -0
  329. package/lang/translations/fr.po +4 -0
  330. package/lang/translations/gl.po +4 -0
  331. package/lang/translations/he.po +4 -0
  332. package/lang/translations/hi.po +4 -0
  333. package/lang/translations/hr.po +4 -0
  334. package/lang/translations/hu.po +4 -0
  335. package/lang/translations/id.po +4 -0
  336. package/lang/translations/it.po +4 -0
  337. package/lang/translations/ja.po +4 -0
  338. package/lang/translations/jv.po +4 -0
  339. package/lang/translations/km.po +4 -0
  340. package/lang/translations/kn.po +4 -0
  341. package/lang/translations/ko.po +4 -0
  342. package/lang/translations/ku.po +4 -0
  343. package/lang/translations/lt.po +4 -0
  344. package/lang/translations/lv.po +4 -0
  345. package/lang/translations/ms.po +4 -0
  346. package/lang/translations/nb.po +4 -0
  347. package/lang/translations/ne.po +4 -0
  348. package/lang/translations/nl.po +4 -0
  349. package/lang/translations/no.po +4 -0
  350. package/lang/translations/pl.po +4 -0
  351. package/lang/translations/pt-br.po +4 -0
  352. package/lang/translations/pt.po +4 -0
  353. package/lang/translations/ro.po +4 -0
  354. package/lang/translations/ru.po +4 -0
  355. package/lang/translations/sk.po +4 -0
  356. package/lang/translations/sl.po +4 -0
  357. package/lang/translations/sq.po +4 -0
  358. package/lang/translations/sr-latn.po +4 -0
  359. package/lang/translations/sr.po +4 -0
  360. package/lang/translations/sv.po +4 -0
  361. package/lang/translations/th.po +4 -0
  362. package/lang/translations/ti.po +214 -0
  363. package/lang/translations/tk.po +4 -0
  364. package/lang/translations/tr.po +4 -0
  365. package/lang/translations/tt.po +4 -0
  366. package/lang/translations/ug.po +4 -0
  367. package/lang/translations/uk.po +4 -0
  368. package/lang/translations/ur.po +4 -0
  369. package/lang/translations/uz.po +4 -0
  370. package/lang/translations/vi.po +4 -0
  371. package/lang/translations/zh-cn.po +4 -0
  372. package/lang/translations/zh.po +4 -0
  373. package/package.json +4 -3
  374. package/src/arialiveannouncer.d.ts +34 -23
  375. package/src/arialiveannouncer.js +80 -30
  376. package/src/colorgrid/colortileview.d.ts +1 -1
  377. package/src/colorgrid/colortileview.js +3 -1
  378. package/src/colorpicker/colorpickerview.d.ts +32 -1
  379. package/src/colorpicker/colorpickerview.js +62 -13
  380. package/src/colorselector/colorpickerfragmentview.d.ts +4 -0
  381. package/src/colorselector/colorpickerfragmentview.js +13 -5
  382. package/src/colorselector/colorselectorview.js +1 -0
  383. package/src/index.d.ts +4 -4
  384. package/src/index.js +3 -2
  385. package/src/menubar/utils.d.ts +8 -1
  386. package/src/menubar/utils.js +26 -2
  387. package/src/toolbar/toolbarview.js +2 -3
  388. package/theme/components/arialiveannouncer/arialiveannouncer.css +4 -0
  389. package/theme/components/tooltip/tooltip.css +4 -0
  390. package/theme/globals/globals.css +0 -1
  391. package/theme/mixins/_mediacolors.css +20 -0
  392. package/theme/globals/_reset.css +0 -13
@@ -0,0 +1,123 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/input/inputbase
11
+ */
12
+ import View from '../view.js';
13
+ import { FocusTracker, type Locale } from '@ckeditor/ckeditor5-utils';
14
+ /**
15
+ * The base input view class.
16
+ */
17
+ export default abstract class InputBase<TElement extends HTMLInputElement | HTMLTextAreaElement = HTMLInputElement> extends View<TElement> {
18
+ /**
19
+ * Stores information about the editor UI focus and propagates it so various plugins and components
20
+ * are unified as a focus group.
21
+ */
22
+ readonly focusTracker: FocusTracker;
23
+ /**
24
+ * The value of the input.
25
+ *
26
+ * @observable
27
+ */
28
+ value: string | undefined;
29
+ /**
30
+ * The `id` attribute of the input (i.e. to pair with a `<label>` element).
31
+ *
32
+ * @observable
33
+ */
34
+ id: string | undefined;
35
+ /**
36
+ * The `placeholder` attribute of the input.
37
+ *
38
+ * @observable
39
+ */
40
+ placeholder: string | undefined;
41
+ /**
42
+ * The `tabindex` attribute of the input.
43
+ *
44
+ * @observable
45
+ */
46
+ tabIndex: number | undefined;
47
+ /**
48
+ * The `aria-label` attribute of the input.
49
+ *
50
+ * @observable
51
+ */
52
+ ariaLabel: string | undefined;
53
+ /**
54
+ * Controls whether the input view is in read-only mode.
55
+ *
56
+ * @observable
57
+ */
58
+ isReadOnly: boolean;
59
+ /**
60
+ * Set to `true` when the field has some error. Usually controlled via
61
+ * {@link module:ui/labeledinput/labeledinputview~LabeledInputView#errorText}.
62
+ *
63
+ * @observable
64
+ */
65
+ hasError: boolean;
66
+ /**
67
+ * The `id` of the element describing this field, e.g. when it has
68
+ * some error; it helps screen readers read the error text.
69
+ *
70
+ * @observable
71
+ */
72
+ ariaDescribedById: string | undefined;
73
+ /**
74
+ * An observable flag set to `true` when the input is currently focused by the user.
75
+ * Set to `false` otherwise.
76
+ *
77
+ * @readonly
78
+ * @observable
79
+ * @default false
80
+ */
81
+ isFocused: boolean;
82
+ /**
83
+ * An observable flag set to `true` when the input contains no text, i.e.
84
+ * when {@link #value} is `''`, `null`, or `false`.
85
+ *
86
+ * @readonly
87
+ * @observable
88
+ * @default true
89
+ */
90
+ isEmpty: boolean;
91
+ /**
92
+ * @inheritDoc
93
+ */
94
+ constructor(locale?: Locale);
95
+ /**
96
+ * @inheritDoc
97
+ */
98
+ render(): void;
99
+ /**
100
+ * @inheritDoc
101
+ */
102
+ destroy(): void;
103
+ /**
104
+ * Moves the focus to the input and selects the value.
105
+ */
106
+ select(): void;
107
+ /**
108
+ * Focuses the input.
109
+ */
110
+ focus(): void;
111
+ /**
112
+ * Resets the value of the input
113
+ */
114
+ reset(): void;
115
+ /**
116
+ * Updates the {@link #isEmpty} property value on demand.
117
+ */
118
+ protected _updateIsEmpty(): void;
119
+ /**
120
+ * Sets the `value` property of the {@link #element DOM element} on demand.
121
+ */
122
+ private _setDomElementValue;
123
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/input/inputview
11
+ */
12
+ import { type Locale } from '@ckeditor/ckeditor5-utils';
13
+ import InputBase from './inputbase.js';
14
+ import '../../theme/components/input/input.css';
15
+ /**
16
+ * The input view class.
17
+ */
18
+ export default class InputView extends InputBase {
19
+ /**
20
+ * Corresponds to the `inputmode` DOM attribute. Can be `text`, `numeric`, `decimal`, etc.
21
+ *
22
+ * @observable
23
+ * @default 'text'
24
+ */
25
+ inputMode: string;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor(locale?: Locale);
30
+ }
31
+ /**
32
+ * Fired when the user types in the input. Corresponds to the native
33
+ * DOM `input` event.
34
+ *
35
+ * @eventName ~InputView#input
36
+ */
37
+ export type InputViewInputEvent = {
38
+ name: 'input';
39
+ args: [InputEvent];
40
+ };
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/inputnumber/inputnumberview
11
+ */
12
+ import InputView from '../input/inputview.js';
13
+ import type { Locale } from '@ckeditor/ckeditor5-utils';
14
+ /**
15
+ * The number input view class.
16
+ */
17
+ export default class InputNumberView extends InputView {
18
+ /**
19
+ * The value of the `min` DOM attribute (the lowest accepted value) set on the {@link #element}.
20
+ *
21
+ * @observable
22
+ * @default undefined
23
+ */
24
+ min: number | undefined;
25
+ /**
26
+ * The value of the `max` DOM attribute (the highest accepted value) set on the {@link #element}.
27
+ *
28
+ * @observable
29
+ * @default undefined
30
+ */
31
+ max: number | undefined;
32
+ /**
33
+ * The value of the `step` DOM attribute set on the {@link #element}.
34
+ *
35
+ * @observable
36
+ * @default undefined
37
+ */
38
+ step: number | undefined;
39
+ /**
40
+ * Creates an instance of the input number view.
41
+ *
42
+ * @param locale The {@link module:core/editor/editor~Editor#locale} instance.
43
+ * @param options The options of the input.
44
+ * @param options.min The value of the `min` DOM attribute (the lowest accepted value).
45
+ * @param options.max The value of the `max` DOM attribute (the highest accepted value).
46
+ * @param options.step The value of the `step` DOM attribute.
47
+ */
48
+ constructor(locale?: Locale, { min, max, step }?: {
49
+ min?: number;
50
+ max?: number;
51
+ step?: number;
52
+ });
53
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/inputtext/inputtextview
11
+ */
12
+ import InputView from '../input/inputview.js';
13
+ import type { Locale } from '@ckeditor/ckeditor5-utils';
14
+ /**
15
+ * The text input view class.
16
+ */
17
+ export default class InputTextView extends InputView {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ constructor(locale?: Locale);
22
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/label/labelview
11
+ */
12
+ import View from '../view.js';
13
+ import { type Locale } from '@ckeditor/ckeditor5-utils';
14
+ import '../../theme/components/label/label.css';
15
+ /**
16
+ * The label view class.
17
+ */
18
+ export default class LabelView extends View {
19
+ /**
20
+ * An unique id of the label. It can be used by other UI components to reference
21
+ * the label, for instance, using the `aria-describedby` DOM attribute.
22
+ */
23
+ readonly id: string;
24
+ /**
25
+ * The text of the label.
26
+ *
27
+ * @observable
28
+ */
29
+ text: string | undefined;
30
+ /**
31
+ * The `for` attribute of the label (i.e. to pair with an `<input>` element).
32
+ *
33
+ * @observable
34
+ */
35
+ for: string | undefined;
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ constructor(locale?: Locale);
40
+ }
@@ -0,0 +1,191 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/labeledfield/labeledfieldview
11
+ */
12
+ import View from '../view.js';
13
+ import LabelView from '../label/labelview.js';
14
+ import type { FocusableView } from '../focuscycler.js';
15
+ import type ViewCollection from '../viewcollection.js';
16
+ import { type Locale } from '@ckeditor/ckeditor5-utils';
17
+ import '../../theme/components/labeledfield/labeledfieldview.css';
18
+ /**
19
+ * The labeled field view class. It can be used to enhance any view with the following features:
20
+ *
21
+ * * a label,
22
+ * * (optional) an error message,
23
+ * * (optional) an info (status) text,
24
+ *
25
+ * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface
26
+ * (e.g. observable properties) that allows controlling those additional features.
27
+ *
28
+ * The constructor of this class requires a callback that returns a view to be labeled. The callback
29
+ * is called with unique ids that allow binding of DOM properties:
30
+ *
31
+ * ```ts
32
+ * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {
33
+ * const inputView = new InputTextView( labeledFieldView.locale );
34
+ *
35
+ * inputView.set( {
36
+ * id: viewUid,
37
+ * ariaDescribedById: statusUid
38
+ * } );
39
+ *
40
+ * inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
41
+ * inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
42
+ *
43
+ * return inputView;
44
+ * } );
45
+ *
46
+ * labeledInputView.label = 'User name';
47
+ * labeledInputView.infoText = 'Full name like for instance, John Doe.';
48
+ * labeledInputView.render();
49
+ *
50
+ * document.body.append( labeledInputView.element );
51
+ * ```
52
+ *
53
+ * See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common
54
+ * UI components.
55
+ */
56
+ export default class LabeledFieldView<TFieldView extends FocusableView = FocusableView> extends View {
57
+ /**
58
+ * The field view that gets labeled.
59
+ */
60
+ readonly fieldView: TFieldView;
61
+ /**
62
+ * The label view instance that describes the entire view.
63
+ */
64
+ readonly labelView: LabelView;
65
+ /**
66
+ * The status view for the {@link #fieldView}. It displays {@link #errorText} and
67
+ * {@link #infoText}.
68
+ */
69
+ readonly statusView: View;
70
+ /**
71
+ * A collection of children of the internal wrapper element. Allows inserting additional DOM elements (views) next to
72
+ * the {@link #fieldView} for easy styling (e.g. positioning).
73
+ *
74
+ * By default, the collection contains {@link #fieldView} and {@link #labelView}.
75
+ */
76
+ readonly fieldWrapperChildren: ViewCollection;
77
+ /**
78
+ * The text of the label.
79
+ *
80
+ * @observable
81
+ */
82
+ label: string | undefined;
83
+ /**
84
+ * Controls whether the component is in read-only mode.
85
+ *
86
+ * @observable
87
+ */
88
+ isEnabled: boolean;
89
+ /**
90
+ * An observable flag set to `true` when {@link #fieldView} is empty (`false` otherwise).
91
+ *
92
+ * @readonly
93
+ * @observable
94
+ * @default true
95
+ */
96
+ isEmpty: boolean;
97
+ /**
98
+ * An observable flag set to `true` when {@link #fieldView} is currently focused by
99
+ * the user (`false` otherwise).
100
+ *
101
+ * @readonly
102
+ * @observable
103
+ * @default false
104
+ */
105
+ isFocused: boolean;
106
+ /**
107
+ * The validation error text. When set, it will be displayed
108
+ * next to the {@link #fieldView} as a typical validation error message.
109
+ * Set it to `null` to hide the message.
110
+ *
111
+ * **Note:** Setting this property to anything but `null` will automatically
112
+ * make the `hasError` of the {@link #fieldView} `true`.
113
+ *
114
+ * @observable
115
+ */
116
+ errorText: string | null;
117
+ /**
118
+ * The additional information text displayed next to the {@link #fieldView} which can
119
+ * be used to inform the user about its purpose, provide help or hints.
120
+ *
121
+ * Set it to `null` to hide the message.
122
+ *
123
+ * **Note:** This text will be displayed in the same place as {@link #errorText} but the
124
+ * latter always takes precedence: if the {@link #errorText} is set, it replaces
125
+ * {@link #infoText}.
126
+ *
127
+ * @observable
128
+ * @default null
129
+ */
130
+ infoText: string | null;
131
+ /**
132
+ * (Optional) The additional CSS class set on the dropdown {@link #element}.
133
+ *
134
+ * @observable
135
+ */
136
+ class: string | undefined;
137
+ /**
138
+ * The content of the `placeholder` attribute of the {@link #fieldView}.
139
+ *
140
+ * @observable
141
+ */
142
+ placeholder: string | undefined;
143
+ /**
144
+ * The combined status text made of {@link #errorText} and {@link #infoText}.
145
+ * Note that when present, {@link #errorText} always takes precedence in the
146
+ * status.
147
+ *
148
+ * @see #errorText
149
+ * @see #infoText
150
+ * @see #statusView
151
+ * @private
152
+ * @observable
153
+ */
154
+ _statusText: string | null;
155
+ /**
156
+ * Creates an instance of the labeled field view class using a provided creator function
157
+ * that provides the view to be labeled.
158
+ *
159
+ * @param locale The locale instance.
160
+ * @param viewCreator A function that returns a {@link module:ui/view~View}
161
+ * that will be labeled. The following arguments are passed to the creator function:
162
+ *
163
+ * * an instance of the `LabeledFieldView` to allow binding observable properties,
164
+ * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,
165
+ * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.
166
+ */
167
+ constructor(locale: Locale | undefined, viewCreator: LabeledFieldViewCreator<TFieldView>);
168
+ /**
169
+ * Creates label view class instance and bind with view.
170
+ *
171
+ * @param id Unique id to set as labelView#for attribute.
172
+ */
173
+ private _createLabelView;
174
+ /**
175
+ * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
176
+ * next to the {@link #fieldView}. See {@link #_statusText}.
177
+ *
178
+ * @param statusUid Unique id of the status, shared with the {@link #fieldView view's}
179
+ * `aria-describedby` attribute.
180
+ */
181
+ private _createStatusView;
182
+ /**
183
+ * Focuses the {@link #fieldView}.
184
+ */
185
+ focus(direction?: 1 | -1): void;
186
+ }
187
+ /**
188
+ * A creator function that returns a focusable view to be labeled by a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView}
189
+ * instance.
190
+ */
191
+ export type LabeledFieldViewCreator<TFieldView extends FocusableView> = (labeledFieldView: LabeledFieldView, viewUid: string, statusUid: string) => TFieldView;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/labeledfield/utils
11
+ */
12
+ import InputTextView from '../inputtext/inputtextview.js';
13
+ import InputNumberView from '../inputnumber/inputnumberview.js';
14
+ import TextareaView from '../textarea/textareaview.js';
15
+ import type DropdownView from '../dropdown/dropdownview.js';
16
+ import type { LabeledFieldViewCreator } from './labeledfieldview.js';
17
+ /**
18
+ * A helper for creating labeled inputs.
19
+ *
20
+ * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is
21
+ * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
22
+ *
23
+ * The helper does the following:
24
+ *
25
+ * * It sets input's `id` and `ariaDescribedById` attributes.
26
+ * * It binds input's `isReadOnly` to the labeled view.
27
+ * * It binds input's `hasError` to the labeled view.
28
+ * * It enables a logic that cleans up the error when user starts typing in the input.
29
+ *
30
+ * Usage:
31
+ *
32
+ * ```ts
33
+ * const labeledInputView = new LabeledFieldView( locale, createLabeledInputText );
34
+ * console.log( labeledInputView.fieldView ); // A text input instance.
35
+ * ```
36
+ *
37
+ * @param labeledFieldView The instance of the labeled field view.
38
+ * @param viewUid A UID string that allows DOM logical connection between the
39
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
40
+ * @param statusUid A UID string that allows DOM logical connection between the
41
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
42
+ * @returns The input text view instance.
43
+ */
44
+ declare const createLabeledInputText: LabeledFieldViewCreator<InputTextView>;
45
+ /**
46
+ * A helper for creating labeled number inputs.
47
+ *
48
+ * It creates an instance of a {@link module:ui/inputnumber/inputnumberview~InputNumberView input number} that is
49
+ * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
50
+ *
51
+ * The helper does the following:
52
+ *
53
+ * * It sets input's `id` and `ariaDescribedById` attributes.
54
+ * * It binds input's `isReadOnly` to the labeled view.
55
+ * * It binds input's `hasError` to the labeled view.
56
+ * * It enables a logic that cleans up the error when user starts typing in the input.
57
+ *
58
+ * Usage:
59
+ *
60
+ * ```ts
61
+ * const labeledInputView = new LabeledFieldView( locale, createLabeledInputNumber );
62
+ * console.log( labeledInputView.fieldView ); // A number input instance.
63
+ * ```
64
+ *
65
+ * @param labeledFieldView The instance of the labeled field view.
66
+ * @param viewUid A UID string that allows DOM logical connection between the
67
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
68
+ * @param statusUid A UID string that allows DOM logical connection between the
69
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
70
+ * @returns The input number view instance.
71
+ */
72
+ declare const createLabeledInputNumber: LabeledFieldViewCreator<InputNumberView>;
73
+ /**
74
+ * A helper for creating labeled textarea.
75
+ *
76
+ * It creates an instance of a {@link module:ui/textarea/textareaview~TextareaView textarea} that is
77
+ * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
78
+ *
79
+ * The helper does the following:
80
+ *
81
+ * * It sets textarea's `id` and `ariaDescribedById` attributes.
82
+ * * It binds textarea's `isReadOnly` to the labeled view.
83
+ * * It binds textarea's `hasError` to the labeled view.
84
+ * * It enables a logic that cleans up the error when user starts typing in the textarea.
85
+ *
86
+ * Usage:
87
+ *
88
+ * ```ts
89
+ * const labeledTextarea = new LabeledFieldView( locale, createLabeledTextarea );
90
+ * console.log( labeledTextarea.fieldView ); // A textarea instance.
91
+ * ```
92
+ *
93
+ * @param labeledFieldView The instance of the labeled field view.
94
+ * @param viewUid A UID string that allows DOM logical connection between the
95
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the textarea.
96
+ * @param statusUid A UID string that allows DOM logical connection between the
97
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the textarea.
98
+ * @returns The textarea view instance.
99
+ */
100
+ declare const createLabeledTextarea: LabeledFieldViewCreator<TextareaView>;
101
+ /**
102
+ * A helper for creating labeled dropdowns.
103
+ *
104
+ * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is
105
+ * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.
106
+ *
107
+ * The helper does the following:
108
+ *
109
+ * * It sets dropdown's `id` and `ariaDescribedById` attributes.
110
+ * * It binds input's `isEnabled` to the labeled view.
111
+ *
112
+ * Usage:
113
+ *
114
+ * ```ts
115
+ * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
116
+ * console.log( labeledInputView.fieldView ); // A dropdown instance.
117
+ * ```
118
+ *
119
+ * @param labeledFieldView The instance of the labeled field view.
120
+ * @param viewUid A UID string that allows DOM logical connection between the
121
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.
122
+ * @param statusUid A UID string that allows DOM logical connection between the
123
+ * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.
124
+ * @returns The dropdown view instance.
125
+ */
126
+ declare const createLabeledDropdown: LabeledFieldViewCreator<DropdownView>;
127
+ export { createLabeledInputNumber, createLabeledInputText, createLabeledTextarea, createLabeledDropdown };