@ckeditor/ckeditor5-ui 47.6.1 → 48.0.0-alpha.1
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.
- package/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +3 -3
- package/{src → dist}/colorselector/documentcolorcollection.d.ts +4 -4
- package/{src → dist}/dialog/dialog.d.ts +1 -1
- package/dist/index-editor.css +2728 -587
- package/dist/index.css +2673 -850
- package/dist/index.css.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/{src → dist}/menubar/menubarmenuview.d.ts +4 -0
- package/{src → dist}/view.d.ts +1 -1
- package/package.json +25 -47
- package/lang/contexts.json +0 -51
- package/lang/translations/af.po +0 -208
- package/lang/translations/ar.po +0 -208
- package/lang/translations/ast.po +0 -208
- package/lang/translations/az.po +0 -208
- package/lang/translations/be.po +0 -208
- package/lang/translations/bg.po +0 -208
- package/lang/translations/bn.po +0 -208
- package/lang/translations/bs.po +0 -208
- package/lang/translations/ca.po +0 -208
- package/lang/translations/cs.po +0 -208
- package/lang/translations/da.po +0 -208
- package/lang/translations/de-ch.po +0 -208
- package/lang/translations/de.po +0 -208
- package/lang/translations/el.po +0 -208
- package/lang/translations/en-au.po +0 -208
- package/lang/translations/en-gb.po +0 -208
- package/lang/translations/en.po +0 -208
- package/lang/translations/eo.po +0 -208
- package/lang/translations/es-co.po +0 -208
- package/lang/translations/es.po +0 -208
- package/lang/translations/et.po +0 -208
- package/lang/translations/eu.po +0 -208
- package/lang/translations/fa.po +0 -208
- package/lang/translations/fi.po +0 -208
- package/lang/translations/fr.po +0 -208
- package/lang/translations/gl.po +0 -208
- package/lang/translations/gu.po +0 -208
- package/lang/translations/he.po +0 -208
- package/lang/translations/hi.po +0 -208
- package/lang/translations/hr.po +0 -208
- package/lang/translations/hu.po +0 -208
- package/lang/translations/hy.po +0 -208
- package/lang/translations/id.po +0 -208
- package/lang/translations/it.po +0 -208
- package/lang/translations/ja.po +0 -208
- package/lang/translations/jv.po +0 -208
- package/lang/translations/kk.po +0 -208
- package/lang/translations/km.po +0 -208
- package/lang/translations/kn.po +0 -208
- package/lang/translations/ko.po +0 -208
- package/lang/translations/ku.po +0 -208
- package/lang/translations/lt.po +0 -208
- package/lang/translations/lv.po +0 -208
- package/lang/translations/ms.po +0 -208
- package/lang/translations/nb.po +0 -208
- package/lang/translations/ne.po +0 -208
- package/lang/translations/nl.po +0 -208
- package/lang/translations/no.po +0 -208
- package/lang/translations/oc.po +0 -208
- package/lang/translations/pl.po +0 -208
- package/lang/translations/pt-br.po +0 -208
- package/lang/translations/pt.po +0 -208
- package/lang/translations/ro.po +0 -208
- package/lang/translations/ru.po +0 -208
- package/lang/translations/si.po +0 -208
- package/lang/translations/sk.po +0 -208
- package/lang/translations/sl.po +0 -208
- package/lang/translations/sq.po +0 -208
- package/lang/translations/sr-latn.po +0 -208
- package/lang/translations/sr.po +0 -208
- package/lang/translations/sv.po +0 -208
- package/lang/translations/th.po +0 -208
- package/lang/translations/ti.po +0 -208
- package/lang/translations/tk.po +0 -208
- package/lang/translations/tr.po +0 -208
- package/lang/translations/tt.po +0 -208
- package/lang/translations/ug.po +0 -208
- package/lang/translations/uk.po +0 -208
- package/lang/translations/ur.po +0 -208
- package/lang/translations/uz.po +0 -208
- package/lang/translations/vi.po +0 -208
- package/lang/translations/zh-cn.po +0 -208
- package/lang/translations/zh.po +0 -208
- package/src/arialiveannouncer.js +0 -189
- package/src/augmentation.js +0 -5
- package/src/autocomplete/autocompleteview.js +0 -157
- package/src/badge/badge.js +0 -226
- package/src/bindings/addkeyboardhandlingforgrid.js +0 -107
- package/src/bindings/clickoutsidehandler.js +0 -36
- package/src/bindings/csstransitiondisablermixin.js +0 -58
- package/src/bindings/draggableviewmixin.js +0 -144
- package/src/bindings/preventdefault.js +0 -35
- package/src/bindings/submithandler.js +0 -47
- package/src/button/button.js +0 -5
- package/src/button/buttonlabel.js +0 -5
- package/src/button/buttonlabelview.js +0 -42
- package/src/button/buttonview.js +0 -278
- package/src/button/filedialogbuttonview.js +0 -147
- package/src/button/listitembuttonview.js +0 -136
- package/src/button/switchbuttonview.js +0 -79
- package/src/collapsible/collapsibleview.js +0 -106
- package/src/colorgrid/colorgridview.js +0 -140
- package/src/colorgrid/colortileview.js +0 -42
- package/src/colorgrid/utils.js +0 -84
- package/src/colorpicker/colorpickerview.js +0 -356
- package/src/colorpicker/utils.js +0 -108
- package/src/colorselector/colorgridsfragmentview.js +0 -368
- package/src/colorselector/colorpickerfragmentview.js +0 -254
- package/src/colorselector/colorselectorview.js +0 -294
- package/src/colorselector/documentcolorcollection.js +0 -42
- package/src/componentfactory.js +0 -108
- package/src/dialog/dialog.js +0 -325
- package/src/dialog/dialogactionsview.js +0 -118
- package/src/dialog/dialogcontentview.js +0 -39
- package/src/dialog/dialogview.js +0 -507
- package/src/dropdown/button/dropdownbutton.js +0 -5
- package/src/dropdown/button/dropdownbuttonview.js +0 -70
- package/src/dropdown/button/splitbuttonview.js +0 -178
- package/src/dropdown/dropdownpanelfocusable.js +0 -5
- package/src/dropdown/dropdownpanelview.js +0 -106
- package/src/dropdown/dropdownview.js +0 -438
- package/src/dropdown/menu/dropdownmenubehaviors.js +0 -125
- package/src/dropdown/menu/dropdownmenubuttonview.js +0 -69
- package/src/dropdown/menu/dropdownmenulistitembuttonview.js +0 -30
- package/src/dropdown/menu/dropdownmenulistitemview.js +0 -38
- package/src/dropdown/menu/dropdownmenulistview.js +0 -29
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +0 -63
- package/src/dropdown/menu/dropdownmenunestedmenuview.js +0 -214
- package/src/dropdown/menu/dropdownmenurootlistview.js +0 -168
- package/src/dropdown/menu/utils.js +0 -61
- package/src/dropdown/utils.js +0 -654
- package/src/editableui/editableuiview.js +0 -130
- package/src/editableui/inline/inlineeditableuiview.js +0 -75
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +0 -142
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js +0 -112
- package/src/editorui/bodycollection.js +0 -128
- package/src/editorui/boxed/boxededitoruiview.js +0 -95
- package/src/editorui/editorui.js +0 -586
- package/src/editorui/editoruiview.js +0 -60
- package/src/editorui/evaluationbadge.js +0 -99
- package/src/editorui/poweredby.js +0 -120
- package/src/focuscycler.js +0 -383
- package/src/formheader/formheaderview.js +0 -77
- package/src/formrow/formrowview.js +0 -56
- package/src/highlightedtext/buttonlabelwithhighlightview.js +0 -31
- package/src/highlightedtext/highlightedtextview.js +0 -102
- package/src/highlightedtext/labelwithhighlightview.js +0 -37
- package/src/icon/iconview.js +0 -123
- package/src/iframe/iframeview.js +0 -63
- package/src/index.js +0 -132
- package/src/input/inputbase.js +0 -119
- package/src/input/inputview.js +0 -24
- package/src/inputnumber/inputnumberview.js +0 -40
- package/src/inputtext/inputtextview.js +0 -27
- package/src/label/labelview.js +0 -46
- package/src/labeledfield/labeledfieldview.js +0 -177
- package/src/labeledfield/utils.js +0 -176
- package/src/labeledinput/labeledinputview.js +0 -138
- package/src/legacyerrors.js +0 -20
- package/src/list/listitemgroupview.js +0 -82
- package/src/list/listitemview.js +0 -46
- package/src/list/listseparatorview.js +0 -28
- package/src/list/listview.js +0 -210
- package/src/menubar/menubarmenubuttonview.js +0 -68
- package/src/menubar/menubarmenulistitembuttonview.js +0 -30
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +0 -32
- package/src/menubar/menubarmenulistitemview.js +0 -34
- package/src/menubar/menubarmenulistview.js +0 -72
- package/src/menubar/menubarmenupanelview.js +0 -64
- package/src/menubar/menubarmenuview.js +0 -198
- package/src/menubar/menubarview.js +0 -281
- package/src/menubar/utils.js +0 -1432
- package/src/model.js +0 -31
- package/src/notification/notification.js +0 -192
- package/src/panel/balloon/balloonpanelview.js +0 -1077
- package/src/panel/balloon/contextualballoon.js +0 -616
- package/src/panel/sticky/stickypanelview.js +0 -246
- package/src/search/filteredview.js +0 -5
- package/src/search/filtergroupanditemnames.js +0 -38
- package/src/search/searchinfoview.js +0 -59
- package/src/search/searchresultsview.js +0 -83
- package/src/search/text/searchtextqueryview.js +0 -87
- package/src/search/text/searchtextview.js +0 -242
- package/src/spinner/spinnerview.js +0 -38
- package/src/template.js +0 -1396
- package/src/textarea/textareaview.js +0 -189
- package/src/toolbar/balloon/balloontoolbar.js +0 -358
- package/src/toolbar/block/blockbuttonview.js +0 -41
- package/src/toolbar/block/blocktoolbar.js +0 -507
- package/src/toolbar/normalizetoolbarconfig.js +0 -52
- package/src/toolbar/toolbarlinebreakview.js +0 -28
- package/src/toolbar/toolbarseparatorview.js +0 -28
- package/src/toolbar/toolbarview.js +0 -873
- package/src/tooltipmanager.js +0 -454
- package/src/view.js +0 -471
- package/src/viewcollection.js +0 -210
- package/theme/components/arialiveannouncer/arialiveannouncer.css +0 -14
- package/theme/components/autocomplete/autocomplete.css +0 -22
- package/theme/components/button/button.css +0 -39
- package/theme/components/button/listitembutton.css +0 -48
- package/theme/components/button/switchbutton.css +0 -14
- package/theme/components/collapsible/collapsible.css +0 -10
- package/theme/components/colorgrid/colorgrid.css +0 -8
- package/theme/components/colorpicker/colorpicker.css +0 -34
- package/theme/components/colorselector/colorselector.css +0 -35
- package/theme/components/dialog/dialog.css +0 -42
- package/theme/components/dialog/dialogactions.css +0 -11
- package/theme/components/dropdown/dropdown.css +0 -95
- package/theme/components/dropdown/listdropdown.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenu.css +0 -8
- package/theme/components/dropdown/menu/dropdownmenubutton.css +0 -9
- package/theme/components/dropdown/menu/dropdownmenulistitem.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +0 -10
- package/theme/components/dropdown/menu/dropdownmenupanel.css +0 -11
- package/theme/components/dropdown/splitbutton.css +0 -14
- package/theme/components/dropdown/toolbardropdown.css +0 -20
- package/theme/components/editorui/accessibilityhelp.css +0 -10
- package/theme/components/editorui/editorui.css +0 -10
- package/theme/components/form/form.css +0 -87
- package/theme/components/formheader/formheader.css +0 -18
- package/theme/components/formrow/formrow.css +0 -32
- package/theme/components/highlightedtext/highlightedtext.css +0 -12
- package/theme/components/icon/icon.css +0 -8
- package/theme/components/input/input.css +0 -10
- package/theme/components/label/label.css +0 -12
- package/theme/components/labeledfield/labeledfieldview.css +0 -16
- package/theme/components/labeledinput/labeledinput.css +0 -10
- package/theme/components/list/list.css +0 -26
- package/theme/components/menubar/menubar.css +0 -10
- package/theme/components/menubar/menubarmenu.css +0 -9
- package/theme/components/menubar/menubarmenubutton.css +0 -11
- package/theme/components/menubar/menubarmenulistitem.css +0 -10
- package/theme/components/menubar/menubarmenulistitembutton.css +0 -10
- package/theme/components/menubar/menubarmenupanel.css +0 -62
- package/theme/components/panel/balloonpanel.css +0 -56
- package/theme/components/panel/balloonrotator.css +0 -17
- package/theme/components/panel/fakepanel.css +0 -23
- package/theme/components/panel/stickypanel.css +0 -17
- package/theme/components/responsive-form/responsiveform.css +0 -42
- package/theme/components/search/search.css +0 -43
- package/theme/components/spinner/spinner.css +0 -23
- package/theme/components/textarea/textarea.css +0 -10
- package/theme/components/toolbar/blocktoolbar.css +0 -9
- package/theme/components/toolbar/toolbar.css +0 -58
- package/theme/components/tooltip/tooltip.css +0 -12
- package/theme/globals/_evaluationbadge.css +0 -54
- package/theme/globals/_hidden.css +0 -13
- package/theme/globals/_poweredby.css +0 -84
- package/theme/globals/_transition.css +0 -12
- package/theme/globals/_zindex.css +0 -10
- package/theme/globals/globals.css +0 -10
- package/theme/mixins/_dir.css +0 -10
- package/theme/mixins/_mediacolors.css +0 -20
- package/theme/mixins/_rwd.css +0 -10
- package/theme/mixins/_unselectable.css +0 -14
- /package/{src → dist}/arialiveannouncer.d.ts +0 -0
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/autocomplete/autocompleteview.d.ts +0 -0
- /package/{src → dist}/badge/badge.d.ts +0 -0
- /package/{src → dist}/bindings/addkeyboardhandlingforgrid.d.ts +0 -0
- /package/{src → dist}/bindings/clickoutsidehandler.d.ts +0 -0
- /package/{src → dist}/bindings/csstransitiondisablermixin.d.ts +0 -0
- /package/{src → dist}/bindings/draggableviewmixin.d.ts +0 -0
- /package/{src → dist}/bindings/preventdefault.d.ts +0 -0
- /package/{src → dist}/bindings/submithandler.d.ts +0 -0
- /package/{src → dist}/button/button.d.ts +0 -0
- /package/{src → dist}/button/buttonlabel.d.ts +0 -0
- /package/{src → dist}/button/buttonlabelview.d.ts +0 -0
- /package/{src → dist}/button/buttonview.d.ts +0 -0
- /package/{src → dist}/button/filedialogbuttonview.d.ts +0 -0
- /package/{src → dist}/button/listitembuttonview.d.ts +0 -0
- /package/{src → dist}/button/switchbuttonview.d.ts +0 -0
- /package/{src → dist}/collapsible/collapsibleview.d.ts +0 -0
- /package/{src → dist}/colorgrid/colorgridview.d.ts +0 -0
- /package/{src → dist}/colorgrid/colortileview.d.ts +0 -0
- /package/{src → dist}/colorgrid/utils.d.ts +0 -0
- /package/{src → dist}/colorpicker/colorpickerview.d.ts +0 -0
- /package/{src → dist}/colorpicker/utils.d.ts +0 -0
- /package/{src → dist}/colorselector/colorgridsfragmentview.d.ts +0 -0
- /package/{src → dist}/colorselector/colorpickerfragmentview.d.ts +0 -0
- /package/{src → dist}/colorselector/colorselectorview.d.ts +0 -0
- /package/{src → dist}/componentfactory.d.ts +0 -0
- /package/{src → dist}/dialog/dialogactionsview.d.ts +0 -0
- /package/{src → dist}/dialog/dialogcontentview.d.ts +0 -0
- /package/{src → dist}/dialog/dialogview.d.ts +0 -0
- /package/{src → dist}/dropdown/button/dropdownbutton.d.ts +0 -0
- /package/{src → dist}/dropdown/button/dropdownbuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/button/splitbuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownpanelfocusable.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownpanelview.d.ts +0 -0
- /package/{src → dist}/dropdown/dropdownview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenubehaviors.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenubuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistitembuttonview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistitemview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenulistview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenunestedmenuview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/dropdownmenurootlistview.d.ts +0 -0
- /package/{src → dist}/dropdown/menu/utils.d.ts +0 -0
- /package/{src → dist}/dropdown/utils.d.ts +0 -0
- /package/{src → dist}/editableui/editableuiview.d.ts +0 -0
- /package/{src → dist}/editableui/inline/inlineeditableuiview.d.ts +0 -0
- /package/{src → dist}/editorui/accessibilityhelp/accessibilityhelp.d.ts +0 -0
- /package/{src → dist}/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +0 -0
- /package/{src → dist}/editorui/bodycollection.d.ts +0 -0
- /package/{src → dist}/editorui/boxed/boxededitoruiview.d.ts +0 -0
- /package/{src → dist}/editorui/editorui.d.ts +0 -0
- /package/{src → dist}/editorui/editoruiview.d.ts +0 -0
- /package/{src → dist}/editorui/evaluationbadge.d.ts +0 -0
- /package/{src → dist}/editorui/poweredby.d.ts +0 -0
- /package/{src → dist}/focuscycler.d.ts +0 -0
- /package/{src → dist}/formheader/formheaderview.d.ts +0 -0
- /package/{src → dist}/formrow/formrowview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/buttonlabelwithhighlightview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/highlightedtextview.d.ts +0 -0
- /package/{src → dist}/highlightedtext/labelwithhighlightview.d.ts +0 -0
- /package/{src → dist}/icon/iconview.d.ts +0 -0
- /package/{src → dist}/iframe/iframeview.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/input/inputbase.d.ts +0 -0
- /package/{src → dist}/input/inputview.d.ts +0 -0
- /package/{src → dist}/inputnumber/inputnumberview.d.ts +0 -0
- /package/{src → dist}/inputtext/inputtextview.d.ts +0 -0
- /package/{src → dist}/label/labelview.d.ts +0 -0
- /package/{src → dist}/labeledfield/labeledfieldview.d.ts +0 -0
- /package/{src → dist}/labeledfield/utils.d.ts +0 -0
- /package/{src → dist}/labeledinput/labeledinputview.d.ts +0 -0
- /package/{src → dist}/legacyerrors.d.ts +0 -0
- /package/{src → dist}/list/listitemgroupview.d.ts +0 -0
- /package/{src → dist}/list/listitemview.d.ts +0 -0
- /package/{src → dist}/list/listseparatorview.d.ts +0 -0
- /package/{src → dist}/list/listview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenubuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitembuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistitemview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenulistview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarmenupanelview.d.ts +0 -0
- /package/{src → dist}/menubar/menubarview.d.ts +0 -0
- /package/{src → dist}/menubar/utils.d.ts +0 -0
- /package/{src → dist}/model.d.ts +0 -0
- /package/{src → dist}/notification/notification.d.ts +0 -0
- /package/{src → dist}/panel/balloon/balloonpanelview.d.ts +0 -0
- /package/{src → dist}/panel/balloon/contextualballoon.d.ts +0 -0
- /package/{src → dist}/panel/sticky/stickypanelview.d.ts +0 -0
- /package/{src → dist}/search/filteredview.d.ts +0 -0
- /package/{src → dist}/search/filtergroupanditemnames.d.ts +0 -0
- /package/{src → dist}/search/searchinfoview.d.ts +0 -0
- /package/{src → dist}/search/searchresultsview.d.ts +0 -0
- /package/{src → dist}/search/text/searchtextqueryview.d.ts +0 -0
- /package/{src → dist}/search/text/searchtextview.d.ts +0 -0
- /package/{src → dist}/spinner/spinnerview.d.ts +0 -0
- /package/{src → dist}/template.d.ts +0 -0
- /package/{src → dist}/textarea/textareaview.d.ts +0 -0
- /package/{src → dist}/toolbar/balloon/balloontoolbar.d.ts +0 -0
- /package/{src → dist}/toolbar/block/blockbuttonview.d.ts +0 -0
- /package/{src → dist}/toolbar/block/blocktoolbar.d.ts +0 -0
- /package/{src → dist}/toolbar/normalizetoolbarconfig.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarlinebreakview.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarseparatorview.d.ts +0 -0
- /package/{src → dist}/toolbar/toolbarview.d.ts +0 -0
- /package/{src → dist}/tooltipmanager.d.ts +0 -0
- /package/{src → dist}/viewcollection.d.ts +0 -0
package/src/input/inputview.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
import { InputBase } from './inputbase.js';
|
|
6
|
-
import '../../theme/components/input/input.css';
|
|
7
|
-
/**
|
|
8
|
-
* The input view class.
|
|
9
|
-
*/
|
|
10
|
-
export class InputView extends InputBase {
|
|
11
|
-
/**
|
|
12
|
-
* @inheritDoc
|
|
13
|
-
*/
|
|
14
|
-
constructor(locale) {
|
|
15
|
-
super(locale);
|
|
16
|
-
this.set('inputMode', 'text');
|
|
17
|
-
const bind = this.bindTemplate;
|
|
18
|
-
this.extendTemplate({
|
|
19
|
-
attributes: {
|
|
20
|
-
inputmode: bind.to('inputMode')
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/inputnumber/inputnumberview
|
|
7
|
-
*/
|
|
8
|
-
import { InputView } from '../input/inputview.js';
|
|
9
|
-
/**
|
|
10
|
-
* The number input view class.
|
|
11
|
-
*/
|
|
12
|
-
export class InputNumberView extends InputView {
|
|
13
|
-
/**
|
|
14
|
-
* Creates an instance of the input number view.
|
|
15
|
-
*
|
|
16
|
-
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
17
|
-
* @param options The options of the input.
|
|
18
|
-
* @param options.min The value of the `min` DOM attribute (the lowest accepted value).
|
|
19
|
-
* @param options.max The value of the `max` DOM attribute (the highest accepted value).
|
|
20
|
-
* @param options.step The value of the `step` DOM attribute.
|
|
21
|
-
*/
|
|
22
|
-
constructor(locale, { min, max, step } = {}) {
|
|
23
|
-
super(locale);
|
|
24
|
-
const bind = this.bindTemplate;
|
|
25
|
-
this.set('min', min);
|
|
26
|
-
this.set('max', max);
|
|
27
|
-
this.set('step', step);
|
|
28
|
-
this.extendTemplate({
|
|
29
|
-
attributes: {
|
|
30
|
-
type: 'number',
|
|
31
|
-
class: [
|
|
32
|
-
'ck-input-number'
|
|
33
|
-
],
|
|
34
|
-
min: bind.to('min'),
|
|
35
|
-
max: bind.to('max'),
|
|
36
|
-
step: bind.to('step')
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/inputtext/inputtextview
|
|
7
|
-
*/
|
|
8
|
-
import { InputView } from '../input/inputview.js';
|
|
9
|
-
/**
|
|
10
|
-
* The text input view class.
|
|
11
|
-
*/
|
|
12
|
-
export class InputTextView extends InputView {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
constructor(locale) {
|
|
17
|
-
super(locale);
|
|
18
|
-
this.extendTemplate({
|
|
19
|
-
attributes: {
|
|
20
|
-
type: 'text',
|
|
21
|
-
class: [
|
|
22
|
-
'ck-input-text'
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
package/src/label/labelview.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/label/labelview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { uid } from '@ckeditor/ckeditor5-utils';
|
|
10
|
-
import '../../theme/components/label/label.css';
|
|
11
|
-
/**
|
|
12
|
-
* The label view class.
|
|
13
|
-
*/
|
|
14
|
-
export class LabelView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* An unique id of the label. It can be used by other UI components to reference
|
|
17
|
-
* the label, for instance, using the `aria-describedby` DOM attribute.
|
|
18
|
-
*/
|
|
19
|
-
id;
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
constructor(locale) {
|
|
24
|
-
super(locale);
|
|
25
|
-
this.set('text', undefined);
|
|
26
|
-
this.set('for', undefined);
|
|
27
|
-
this.id = `ck-editor__label_${uid()}`;
|
|
28
|
-
const bind = this.bindTemplate;
|
|
29
|
-
this.setTemplate({
|
|
30
|
-
tag: 'label',
|
|
31
|
-
attributes: {
|
|
32
|
-
class: [
|
|
33
|
-
'ck',
|
|
34
|
-
'ck-label'
|
|
35
|
-
],
|
|
36
|
-
id: this.id,
|
|
37
|
-
for: bind.to('for')
|
|
38
|
-
},
|
|
39
|
-
children: [
|
|
40
|
-
{
|
|
41
|
-
text: bind.to('text')
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/labeledfield/labeledfieldview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { LabelView } from '../label/labelview.js';
|
|
10
|
-
import { uid } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
import '../../theme/components/labeledfield/labeledfieldview.css';
|
|
12
|
-
/**
|
|
13
|
-
* The labeled field view class. It can be used to enhance any view with the following features:
|
|
14
|
-
*
|
|
15
|
-
* * a label,
|
|
16
|
-
* * (optional) an error message,
|
|
17
|
-
* * (optional) an info (status) text,
|
|
18
|
-
*
|
|
19
|
-
* all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface
|
|
20
|
-
* (e.g. observable properties) that allows controlling those additional features.
|
|
21
|
-
*
|
|
22
|
-
* The constructor of this class requires a callback that returns a view to be labeled. The callback
|
|
23
|
-
* is called with unique ids that allow binding of DOM properties:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {
|
|
27
|
-
* const inputView = new InputTextView( labeledFieldView.locale );
|
|
28
|
-
*
|
|
29
|
-
* inputView.set( {
|
|
30
|
-
* id: viewUid,
|
|
31
|
-
* ariaDescribedById: statusUid
|
|
32
|
-
* } );
|
|
33
|
-
*
|
|
34
|
-
* inputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );
|
|
35
|
-
* inputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );
|
|
36
|
-
*
|
|
37
|
-
* return inputView;
|
|
38
|
-
* } );
|
|
39
|
-
*
|
|
40
|
-
* labeledInputView.label = 'User name';
|
|
41
|
-
* labeledInputView.infoText = 'Full name like for instance, John Doe.';
|
|
42
|
-
* labeledInputView.render();
|
|
43
|
-
*
|
|
44
|
-
* document.body.append( labeledInputView.element );
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* See {@link module:ui/labeledfield/utils} to discover ready–to–use labeled input helpers for common
|
|
48
|
-
* UI components.
|
|
49
|
-
*/
|
|
50
|
-
export class LabeledFieldView extends View {
|
|
51
|
-
/**
|
|
52
|
-
* The field view that gets labeled.
|
|
53
|
-
*/
|
|
54
|
-
fieldView;
|
|
55
|
-
/**
|
|
56
|
-
* The label view instance that describes the entire view.
|
|
57
|
-
*/
|
|
58
|
-
labelView;
|
|
59
|
-
/**
|
|
60
|
-
* The status view for the {@link #fieldView}. It displays {@link #errorText} and
|
|
61
|
-
* {@link #infoText}.
|
|
62
|
-
*/
|
|
63
|
-
statusView;
|
|
64
|
-
/**
|
|
65
|
-
* A collection of children of the internal wrapper element. Allows inserting additional DOM elements (views) next to
|
|
66
|
-
* the {@link #fieldView} for easy styling (e.g. positioning).
|
|
67
|
-
*
|
|
68
|
-
* By default, the collection contains {@link #fieldView} and {@link #labelView}.
|
|
69
|
-
*/
|
|
70
|
-
fieldWrapperChildren;
|
|
71
|
-
/**
|
|
72
|
-
* Creates an instance of the labeled field view class using a provided creator function
|
|
73
|
-
* that provides the view to be labeled.
|
|
74
|
-
*
|
|
75
|
-
* @param locale The locale instance.
|
|
76
|
-
* @param viewCreator A function that returns a {@link module:ui/view~View}
|
|
77
|
-
* that will be labeled. The following arguments are passed to the creator function:
|
|
78
|
-
*
|
|
79
|
-
* * an instance of the `LabeledFieldView` to allow binding observable properties,
|
|
80
|
-
* * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,
|
|
81
|
-
* * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.
|
|
82
|
-
*/
|
|
83
|
-
constructor(locale, viewCreator) {
|
|
84
|
-
super(locale);
|
|
85
|
-
const viewUid = `ck-labeled-field-view-${uid()}`;
|
|
86
|
-
const statusUid = `ck-labeled-field-view-status-${uid()}`;
|
|
87
|
-
this.fieldView = viewCreator(this, viewUid, statusUid);
|
|
88
|
-
this.set('label', undefined);
|
|
89
|
-
this.set('isEnabled', true);
|
|
90
|
-
this.set('isEmpty', true);
|
|
91
|
-
this.set('isFocused', false);
|
|
92
|
-
this.set('errorText', null);
|
|
93
|
-
this.set('infoText', null);
|
|
94
|
-
this.set('class', undefined);
|
|
95
|
-
this.set('placeholder', undefined);
|
|
96
|
-
this.labelView = this._createLabelView(viewUid);
|
|
97
|
-
this.statusView = this._createStatusView(statusUid);
|
|
98
|
-
this.fieldWrapperChildren = this.createCollection([this.fieldView, this.labelView]);
|
|
99
|
-
this.bind('_statusText').to(this, 'errorText', this, 'infoText', (errorText, infoText) => errorText || infoText);
|
|
100
|
-
const bind = this.bindTemplate;
|
|
101
|
-
this.setTemplate({
|
|
102
|
-
tag: 'div',
|
|
103
|
-
attributes: {
|
|
104
|
-
class: [
|
|
105
|
-
'ck',
|
|
106
|
-
'ck-labeled-field-view',
|
|
107
|
-
bind.to('class'),
|
|
108
|
-
bind.if('isEnabled', 'ck-disabled', value => !value),
|
|
109
|
-
bind.if('isEmpty', 'ck-labeled-field-view_empty'),
|
|
110
|
-
bind.if('isFocused', 'ck-labeled-field-view_focused'),
|
|
111
|
-
bind.if('placeholder', 'ck-labeled-field-view_placeholder'),
|
|
112
|
-
bind.if('errorText', 'ck-error')
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
children: [
|
|
116
|
-
{
|
|
117
|
-
tag: 'div',
|
|
118
|
-
attributes: {
|
|
119
|
-
class: [
|
|
120
|
-
'ck',
|
|
121
|
-
'ck-labeled-field-view__input-wrapper'
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
children: this.fieldWrapperChildren
|
|
125
|
-
},
|
|
126
|
-
this.statusView
|
|
127
|
-
]
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Creates label view class instance and bind with view.
|
|
132
|
-
*
|
|
133
|
-
* @param id Unique id to set as labelView#for attribute.
|
|
134
|
-
*/
|
|
135
|
-
_createLabelView(id) {
|
|
136
|
-
const labelView = new LabelView(this.locale);
|
|
137
|
-
labelView.for = id;
|
|
138
|
-
labelView.bind('text').to(this, 'label');
|
|
139
|
-
return labelView;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
|
|
143
|
-
* next to the {@link #fieldView}. See {@link #_statusText}.
|
|
144
|
-
*
|
|
145
|
-
* @param statusUid Unique id of the status, shared with the {@link #fieldView view's}
|
|
146
|
-
* `aria-describedby` attribute.
|
|
147
|
-
*/
|
|
148
|
-
_createStatusView(statusUid) {
|
|
149
|
-
const statusView = new View(this.locale);
|
|
150
|
-
const bind = this.bindTemplate;
|
|
151
|
-
statusView.setTemplate({
|
|
152
|
-
tag: 'div',
|
|
153
|
-
attributes: {
|
|
154
|
-
class: [
|
|
155
|
-
'ck',
|
|
156
|
-
'ck-labeled-field-view__status',
|
|
157
|
-
bind.if('errorText', 'ck-labeled-field-view__status_error'),
|
|
158
|
-
bind.if('_statusText', 'ck-hidden', value => !value)
|
|
159
|
-
],
|
|
160
|
-
id: statusUid,
|
|
161
|
-
role: bind.if('errorText', 'alert')
|
|
162
|
-
},
|
|
163
|
-
children: [
|
|
164
|
-
{
|
|
165
|
-
text: bind.to('_statusText')
|
|
166
|
-
}
|
|
167
|
-
]
|
|
168
|
-
});
|
|
169
|
-
return statusView;
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Focuses the {@link #fieldView}.
|
|
173
|
-
*/
|
|
174
|
-
focus(direction) {
|
|
175
|
-
this.fieldView.focus(direction);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/labeledfield/utils
|
|
7
|
-
*/
|
|
8
|
-
import { InputTextView } from '../inputtext/inputtextview.js';
|
|
9
|
-
import { InputNumberView } from '../inputnumber/inputnumberview.js';
|
|
10
|
-
import { TextareaView } from '../textarea/textareaview.js';
|
|
11
|
-
import { createDropdown } from '../dropdown/utils.js';
|
|
12
|
-
/**
|
|
13
|
-
* A helper for creating labeled inputs.
|
|
14
|
-
*
|
|
15
|
-
* It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is
|
|
16
|
-
* logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
|
|
17
|
-
*
|
|
18
|
-
* The helper does the following:
|
|
19
|
-
*
|
|
20
|
-
* * It sets input's `id` and `ariaDescribedById` attributes.
|
|
21
|
-
* * It binds input's `isReadOnly` to the labeled view.
|
|
22
|
-
* * It binds input's `hasError` to the labeled view.
|
|
23
|
-
* * It enables a logic that cleans up the error when user starts typing in the input.
|
|
24
|
-
*
|
|
25
|
-
* Usage:
|
|
26
|
-
*
|
|
27
|
-
* ```ts
|
|
28
|
-
* const labeledInputView = new LabeledFieldView( locale, createLabeledInputText );
|
|
29
|
-
* console.log( labeledInputView.fieldView ); // A text input instance.
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @param labeledFieldView The instance of the labeled field view.
|
|
33
|
-
* @param viewUid A UID string that allows DOM logical connection between the
|
|
34
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
|
|
35
|
-
* @param statusUid A UID string that allows DOM logical connection between the
|
|
36
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
|
|
37
|
-
* @returns The input text view instance.
|
|
38
|
-
*/
|
|
39
|
-
const createLabeledInputText = (labeledFieldView, viewUid, statusUid) => {
|
|
40
|
-
const inputView = new InputTextView(labeledFieldView.locale);
|
|
41
|
-
inputView.set({
|
|
42
|
-
id: viewUid,
|
|
43
|
-
ariaDescribedById: statusUid
|
|
44
|
-
});
|
|
45
|
-
inputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);
|
|
46
|
-
inputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);
|
|
47
|
-
inputView.on('input', () => {
|
|
48
|
-
// UX: Make the error text disappear and disable the error indicator as the user
|
|
49
|
-
// starts fixing the errors.
|
|
50
|
-
labeledFieldView.errorText = null;
|
|
51
|
-
});
|
|
52
|
-
labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(inputView);
|
|
53
|
-
return inputView;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* A helper for creating labeled number inputs.
|
|
57
|
-
*
|
|
58
|
-
* It creates an instance of a {@link module:ui/inputnumber/inputnumberview~InputNumberView input number} that is
|
|
59
|
-
* logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
|
|
60
|
-
*
|
|
61
|
-
* The helper does the following:
|
|
62
|
-
*
|
|
63
|
-
* * It sets input's `id` and `ariaDescribedById` attributes.
|
|
64
|
-
* * It binds input's `isReadOnly` to the labeled view.
|
|
65
|
-
* * It binds input's `hasError` to the labeled view.
|
|
66
|
-
* * It enables a logic that cleans up the error when user starts typing in the input.
|
|
67
|
-
*
|
|
68
|
-
* Usage:
|
|
69
|
-
*
|
|
70
|
-
* ```ts
|
|
71
|
-
* const labeledInputView = new LabeledFieldView( locale, createLabeledInputNumber );
|
|
72
|
-
* console.log( labeledInputView.fieldView ); // A number input instance.
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @param labeledFieldView The instance of the labeled field view.
|
|
76
|
-
* @param viewUid A UID string that allows DOM logical connection between the
|
|
77
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.
|
|
78
|
-
* @param statusUid A UID string that allows DOM logical connection between the
|
|
79
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.
|
|
80
|
-
* @returns The input number view instance.
|
|
81
|
-
*/
|
|
82
|
-
const createLabeledInputNumber = (labeledFieldView, viewUid, statusUid) => {
|
|
83
|
-
const inputView = new InputNumberView(labeledFieldView.locale);
|
|
84
|
-
inputView.set({
|
|
85
|
-
id: viewUid,
|
|
86
|
-
ariaDescribedById: statusUid,
|
|
87
|
-
inputMode: 'numeric'
|
|
88
|
-
});
|
|
89
|
-
inputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);
|
|
90
|
-
inputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);
|
|
91
|
-
inputView.on('input', () => {
|
|
92
|
-
// UX: Make the error text disappear and disable the error indicator as the user
|
|
93
|
-
// starts fixing the errors.
|
|
94
|
-
labeledFieldView.errorText = null;
|
|
95
|
-
});
|
|
96
|
-
labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(inputView);
|
|
97
|
-
return inputView;
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* A helper for creating labeled textarea.
|
|
101
|
-
*
|
|
102
|
-
* It creates an instance of a {@link module:ui/textarea/textareaview~TextareaView textarea} that is
|
|
103
|
-
* logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.
|
|
104
|
-
*
|
|
105
|
-
* The helper does the following:
|
|
106
|
-
*
|
|
107
|
-
* * It sets textarea's `id` and `ariaDescribedById` attributes.
|
|
108
|
-
* * It binds textarea's `isReadOnly` to the labeled view.
|
|
109
|
-
* * It binds textarea's `hasError` to the labeled view.
|
|
110
|
-
* * It enables a logic that cleans up the error when user starts typing in the textarea.
|
|
111
|
-
*
|
|
112
|
-
* Usage:
|
|
113
|
-
*
|
|
114
|
-
* ```ts
|
|
115
|
-
* const labeledTextarea = new LabeledFieldView( locale, createLabeledTextarea );
|
|
116
|
-
* console.log( labeledTextarea.fieldView ); // A textarea 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's label} and the textarea.
|
|
122
|
-
* @param statusUid A UID string that allows DOM logical connection between the
|
|
123
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the textarea.
|
|
124
|
-
* @returns The textarea view instance.
|
|
125
|
-
*/
|
|
126
|
-
const createLabeledTextarea = (labeledFieldView, viewUid, statusUid) => {
|
|
127
|
-
const textareaView = new TextareaView(labeledFieldView.locale);
|
|
128
|
-
textareaView.set({
|
|
129
|
-
id: viewUid,
|
|
130
|
-
ariaDescribedById: statusUid
|
|
131
|
-
});
|
|
132
|
-
textareaView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);
|
|
133
|
-
textareaView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);
|
|
134
|
-
textareaView.on('input', () => {
|
|
135
|
-
// UX: Make the error text disappear and disable the error indicator as the user
|
|
136
|
-
// starts fixing the errors.
|
|
137
|
-
labeledFieldView.errorText = null;
|
|
138
|
-
});
|
|
139
|
-
labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(textareaView);
|
|
140
|
-
return textareaView;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* A helper for creating labeled dropdowns.
|
|
144
|
-
*
|
|
145
|
-
* It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is
|
|
146
|
-
* logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.
|
|
147
|
-
*
|
|
148
|
-
* The helper does the following:
|
|
149
|
-
*
|
|
150
|
-
* * It sets dropdown's `id` and `ariaDescribedById` attributes.
|
|
151
|
-
* * It binds input's `isEnabled` to the labeled view.
|
|
152
|
-
*
|
|
153
|
-
* Usage:
|
|
154
|
-
*
|
|
155
|
-
* ```ts
|
|
156
|
-
* const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );
|
|
157
|
-
* console.log( labeledInputView.fieldView ); // A dropdown instance.
|
|
158
|
-
* ```
|
|
159
|
-
*
|
|
160
|
-
* @param labeledFieldView The instance of the labeled field view.
|
|
161
|
-
* @param viewUid A UID string that allows DOM logical connection between the
|
|
162
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.
|
|
163
|
-
* @param statusUid A UID string that allows DOM logical connection between the
|
|
164
|
-
* {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.
|
|
165
|
-
* @returns The dropdown view instance.
|
|
166
|
-
*/
|
|
167
|
-
const createLabeledDropdown = (labeledFieldView, viewUid, statusUid) => {
|
|
168
|
-
const dropdownView = createDropdown(labeledFieldView.locale);
|
|
169
|
-
dropdownView.set({
|
|
170
|
-
id: viewUid,
|
|
171
|
-
ariaDescribedById: statusUid
|
|
172
|
-
});
|
|
173
|
-
dropdownView.bind('isEnabled').to(labeledFieldView);
|
|
174
|
-
return dropdownView;
|
|
175
|
-
};
|
|
176
|
-
export { createLabeledInputNumber, createLabeledInputText, createLabeledTextarea, createLabeledDropdown };
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/labeledinput/labeledinputview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { LabelView } from '../label/labelview.js';
|
|
10
|
-
import { uid } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
import '../../theme/components/labeledinput/labeledinput.css';
|
|
12
|
-
/**
|
|
13
|
-
* The labeled input view class.
|
|
14
|
-
*/
|
|
15
|
-
export class LabeledInputView extends View {
|
|
16
|
-
/**
|
|
17
|
-
* The label view.
|
|
18
|
-
*/
|
|
19
|
-
labelView;
|
|
20
|
-
/**
|
|
21
|
-
* The input view.
|
|
22
|
-
*/
|
|
23
|
-
inputView;
|
|
24
|
-
/**
|
|
25
|
-
* The status view for the {@link #inputView}. It displays {@link #errorText} and
|
|
26
|
-
* {@link #infoText}.
|
|
27
|
-
*/
|
|
28
|
-
statusView;
|
|
29
|
-
/**
|
|
30
|
-
* Creates an instance of the labeled input view class.
|
|
31
|
-
*
|
|
32
|
-
* @param locale The locale instance.
|
|
33
|
-
* @param InputView Constructor of the input view.
|
|
34
|
-
*/
|
|
35
|
-
constructor(locale, InputView) {
|
|
36
|
-
super(locale);
|
|
37
|
-
const inputUid = `ck-input-${uid()}`;
|
|
38
|
-
const statusUid = `ck-status-${uid()}`;
|
|
39
|
-
this.set('label', undefined);
|
|
40
|
-
this.set('value', undefined);
|
|
41
|
-
this.set('isReadOnly', false);
|
|
42
|
-
this.set('errorText', null);
|
|
43
|
-
this.set('infoText', null);
|
|
44
|
-
this.labelView = this._createLabelView(inputUid);
|
|
45
|
-
this.inputView = this._createInputView(InputView, inputUid, statusUid);
|
|
46
|
-
this.statusView = this._createStatusView(statusUid);
|
|
47
|
-
this.bind('_statusText').to(this, 'errorText', this, 'infoText', (errorText, infoText) => errorText || infoText);
|
|
48
|
-
const bind = this.bindTemplate;
|
|
49
|
-
this.setTemplate({
|
|
50
|
-
tag: 'div',
|
|
51
|
-
attributes: {
|
|
52
|
-
class: [
|
|
53
|
-
'ck',
|
|
54
|
-
'ck-labeled-input',
|
|
55
|
-
bind.if('isReadOnly', 'ck-disabled')
|
|
56
|
-
]
|
|
57
|
-
},
|
|
58
|
-
children: [
|
|
59
|
-
this.labelView,
|
|
60
|
-
this.inputView,
|
|
61
|
-
this.statusView
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Creates label view class instance and bind with view.
|
|
67
|
-
*
|
|
68
|
-
* @param id Unique id to set as labelView#for attribute.
|
|
69
|
-
*/
|
|
70
|
-
_createLabelView(id) {
|
|
71
|
-
const labelView = new LabelView(this.locale);
|
|
72
|
-
labelView.for = id;
|
|
73
|
-
labelView.bind('text').to(this, 'label');
|
|
74
|
-
return labelView;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Creates input view class instance and bind with view.
|
|
78
|
-
*
|
|
79
|
-
* @param InputView Input view constructor.
|
|
80
|
-
* @param inputUid Unique id to set as inputView#id attribute.
|
|
81
|
-
* @param statusUid Unique id of the status for the input's `aria-describedby` attribute.
|
|
82
|
-
*/
|
|
83
|
-
_createInputView(InputView, inputUid, statusUid) {
|
|
84
|
-
const inputView = new InputView(this.locale, statusUid);
|
|
85
|
-
inputView.id = inputUid;
|
|
86
|
-
inputView.ariaDescribedById = statusUid;
|
|
87
|
-
inputView.bind('value').to(this);
|
|
88
|
-
inputView.bind('isReadOnly').to(this);
|
|
89
|
-
inputView.bind('hasError').to(this, 'errorText', value => !!value);
|
|
90
|
-
inputView.on('input', () => {
|
|
91
|
-
// UX: Make the error text disappear and disable the error indicator as the user
|
|
92
|
-
// starts fixing the errors.
|
|
93
|
-
this.errorText = null;
|
|
94
|
-
});
|
|
95
|
-
return inputView;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Creates the status view instance. It displays {@link #errorText} and {@link #infoText}
|
|
99
|
-
* next to the {@link #inputView}. See {@link #_statusText}.
|
|
100
|
-
*
|
|
101
|
-
* @param statusUid Unique id of the status, shared with the input's `aria-describedby` attribute.
|
|
102
|
-
*/
|
|
103
|
-
_createStatusView(statusUid) {
|
|
104
|
-
const statusView = new View(this.locale);
|
|
105
|
-
const bind = this.bindTemplate;
|
|
106
|
-
statusView.setTemplate({
|
|
107
|
-
tag: 'div',
|
|
108
|
-
attributes: {
|
|
109
|
-
class: [
|
|
110
|
-
'ck',
|
|
111
|
-
'ck-labeled-input__status',
|
|
112
|
-
bind.if('errorText', 'ck-labeled-input__status_error'),
|
|
113
|
-
bind.if('_statusText', 'ck-hidden', value => !value)
|
|
114
|
-
],
|
|
115
|
-
id: statusUid,
|
|
116
|
-
role: bind.if('errorText', 'alert')
|
|
117
|
-
},
|
|
118
|
-
children: [
|
|
119
|
-
{
|
|
120
|
-
text: bind.to('_statusText')
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
});
|
|
124
|
-
return statusView;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Moves the focus to the input and selects the value.
|
|
128
|
-
*/
|
|
129
|
-
select() {
|
|
130
|
-
this.inputView.select();
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Focuses the input.
|
|
134
|
-
*/
|
|
135
|
-
focus() {
|
|
136
|
-
this.inputView.focus();
|
|
137
|
-
}
|
|
138
|
-
}
|
package/src/legacyerrors.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module ui/legacyerrors
|
|
7
|
-
*/
|
|
8
|
-
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
if (false) {
|
|
10
|
-
/**
|
|
11
|
-
* The `EditorUI#_editableElements` property has been
|
|
12
|
-
* deprecated and will be removed in the near future. Please use
|
|
13
|
-
* {@link module:ui/editorui/editorui~EditorUI#setEditableElement `setEditableElement()`} and
|
|
14
|
-
* {@link module:ui/editorui/editorui~EditorUI#getEditableElement `getEditableElement()`} methods instead.
|
|
15
|
-
*
|
|
16
|
-
* @error editor-ui-deprecated-editable-elements
|
|
17
|
-
* @param {module:ui/editorui/editorui~EditorUI} editorUI Editor UI instance the deprecated property belongs to.
|
|
18
|
-
*/
|
|
19
|
-
throw new CKEditorError('editor-ui-deprecated-editable-elements', null);
|
|
20
|
-
}
|