@ckeditor/ckeditor5-ui 47.6.1 → 48.0.0-alpha.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.
- 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
|
@@ -1,82 +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/list/listitemgroupview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { ListView } from './listview.js';
|
|
10
|
-
import { LabelView } from '../label/labelview.js';
|
|
11
|
-
import { ListSeparatorView } from './listseparatorview.js';
|
|
12
|
-
/**
|
|
13
|
-
* The list item group view class.
|
|
14
|
-
*/
|
|
15
|
-
export class ListItemGroupView extends View {
|
|
16
|
-
/**
|
|
17
|
-
* Label of the group view. Its text is configurable using the {@link #label label attribute}.
|
|
18
|
-
*
|
|
19
|
-
* If a custom label view is not passed in `ListItemGroupView` constructor, the label is an instance
|
|
20
|
-
* of {@link module:ui/label/labelview~LabelView}.
|
|
21
|
-
*/
|
|
22
|
-
labelView;
|
|
23
|
-
/**
|
|
24
|
-
* Collection of the child list items inside this group.
|
|
25
|
-
*/
|
|
26
|
-
items;
|
|
27
|
-
/**
|
|
28
|
-
* Collection of the child elements of the group.
|
|
29
|
-
*/
|
|
30
|
-
children;
|
|
31
|
-
/**
|
|
32
|
-
* Creates an instance of the list item group view class.
|
|
33
|
-
*
|
|
34
|
-
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
35
|
-
* @param labelView The instance of the group's label. If not provided, an instance of
|
|
36
|
-
* {@link module:ui/label/labelview~LabelView} is used.
|
|
37
|
-
*/
|
|
38
|
-
constructor(locale, labelView = new LabelView()) {
|
|
39
|
-
super(locale);
|
|
40
|
-
const bind = this.bindTemplate;
|
|
41
|
-
const nestedList = new ListView(locale);
|
|
42
|
-
this.set({
|
|
43
|
-
label: '',
|
|
44
|
-
isVisible: true
|
|
45
|
-
});
|
|
46
|
-
this.labelView = labelView;
|
|
47
|
-
this.labelView.bind('text').to(this, 'label');
|
|
48
|
-
this.children = this.createCollection();
|
|
49
|
-
this.children.addMany([this.labelView, nestedList]);
|
|
50
|
-
nestedList.set({
|
|
51
|
-
role: 'group',
|
|
52
|
-
ariaLabelledBy: labelView.id
|
|
53
|
-
});
|
|
54
|
-
// Disable focus tracking and accessible navigation in the child list.
|
|
55
|
-
nestedList.focusTracker.destroy();
|
|
56
|
-
nestedList.keystrokes.destroy();
|
|
57
|
-
this.items = nestedList.items;
|
|
58
|
-
this.setTemplate({
|
|
59
|
-
tag: 'li',
|
|
60
|
-
attributes: {
|
|
61
|
-
role: 'presentation',
|
|
62
|
-
class: [
|
|
63
|
-
'ck',
|
|
64
|
-
'ck-list__group',
|
|
65
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
children: this.children
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Focuses the list item (which is not a separator).
|
|
73
|
-
*/
|
|
74
|
-
focus() {
|
|
75
|
-
if (this.items) {
|
|
76
|
-
const firstListItem = this.items.find(item => !(item instanceof ListSeparatorView));
|
|
77
|
-
if (firstListItem) {
|
|
78
|
-
firstListItem.focus();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
package/src/list/listitemview.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/list/listitemview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
/**
|
|
10
|
-
* The list item view class.
|
|
11
|
-
*/
|
|
12
|
-
export class ListItemView extends View {
|
|
13
|
-
/**
|
|
14
|
-
* Collection of the child views inside of the list item {@link #element}.
|
|
15
|
-
*/
|
|
16
|
-
children;
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
constructor(locale) {
|
|
21
|
-
super(locale);
|
|
22
|
-
const bind = this.bindTemplate;
|
|
23
|
-
this.set('isVisible', true);
|
|
24
|
-
this.children = this.createCollection();
|
|
25
|
-
this.setTemplate({
|
|
26
|
-
tag: 'li',
|
|
27
|
-
attributes: {
|
|
28
|
-
class: [
|
|
29
|
-
'ck',
|
|
30
|
-
'ck-list__item',
|
|
31
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
32
|
-
],
|
|
33
|
-
role: 'presentation'
|
|
34
|
-
},
|
|
35
|
-
children: this.children
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Focuses the list item.
|
|
40
|
-
*/
|
|
41
|
-
focus() {
|
|
42
|
-
if (this.children.first) {
|
|
43
|
-
this.children.first.focus();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,28 +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/list/listseparatorview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
/**
|
|
10
|
-
* The list separator view class.
|
|
11
|
-
*/
|
|
12
|
-
export class ListSeparatorView extends View {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
constructor(locale) {
|
|
17
|
-
super(locale);
|
|
18
|
-
this.setTemplate({
|
|
19
|
-
tag: 'li',
|
|
20
|
-
attributes: {
|
|
21
|
-
class: [
|
|
22
|
-
'ck',
|
|
23
|
-
'ck-list__separator'
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
package/src/list/listview.js
DELETED
|
@@ -1,210 +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/list/listview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { FocusCycler } from '../focuscycler.js';
|
|
10
|
-
import { ListItemView } from './listitemview.js';
|
|
11
|
-
import { ListItemGroupView } from './listitemgroupview.js';
|
|
12
|
-
import { ViewCollection } from '../viewcollection.js';
|
|
13
|
-
import { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
14
|
-
import '../../theme/components/list/list.css';
|
|
15
|
-
/**
|
|
16
|
-
* The list view class.
|
|
17
|
-
*/
|
|
18
|
-
export class ListView extends View {
|
|
19
|
-
/**
|
|
20
|
-
* The collection of focusable views in the list. It is used to determine accessible navigation
|
|
21
|
-
* between the {@link module:ui/list/listitemview~ListItemView list items} and
|
|
22
|
-
* {@link module:ui/list/listitemgroupview~ListItemGroupView list groups}.
|
|
23
|
-
*/
|
|
24
|
-
focusables;
|
|
25
|
-
/**
|
|
26
|
-
* Collection of the child list views.
|
|
27
|
-
*/
|
|
28
|
-
items;
|
|
29
|
-
/**
|
|
30
|
-
* Tracks information about DOM focus in the list.
|
|
31
|
-
*/
|
|
32
|
-
focusTracker;
|
|
33
|
-
/**
|
|
34
|
-
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
35
|
-
*/
|
|
36
|
-
keystrokes;
|
|
37
|
-
/**
|
|
38
|
-
* Helps cycling over focusable {@link #items} in the list.
|
|
39
|
-
*/
|
|
40
|
-
_focusCycler;
|
|
41
|
-
/**
|
|
42
|
-
* A cached map of {@link module:ui/list/listitemgroupview~ListItemGroupView} to `change` event listeners for their `items`.
|
|
43
|
-
* Used for accessibility and keyboard navigation purposes.
|
|
44
|
-
*/
|
|
45
|
-
_listItemGroupToChangeListeners = new WeakMap();
|
|
46
|
-
/**
|
|
47
|
-
* @inheritDoc
|
|
48
|
-
*/
|
|
49
|
-
constructor(locale) {
|
|
50
|
-
super(locale);
|
|
51
|
-
const bind = this.bindTemplate;
|
|
52
|
-
this.focusables = new ViewCollection();
|
|
53
|
-
this.items = this.createCollection();
|
|
54
|
-
this.focusTracker = new FocusTracker();
|
|
55
|
-
this.keystrokes = new KeystrokeHandler();
|
|
56
|
-
this._focusCycler = new FocusCycler({
|
|
57
|
-
focusables: this.focusables,
|
|
58
|
-
focusTracker: this.focusTracker,
|
|
59
|
-
keystrokeHandler: this.keystrokes,
|
|
60
|
-
actions: {
|
|
61
|
-
// Navigate list items backwards using the arrowup key.
|
|
62
|
-
focusPrevious: 'arrowup',
|
|
63
|
-
// Navigate toolbar items forwards using the arrowdown key.
|
|
64
|
-
focusNext: 'arrowdown'
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
this.set('ariaLabel', undefined);
|
|
68
|
-
this.set('ariaLabelledBy', undefined);
|
|
69
|
-
this.set('role', undefined);
|
|
70
|
-
this.setTemplate({
|
|
71
|
-
tag: 'ul',
|
|
72
|
-
attributes: {
|
|
73
|
-
class: [
|
|
74
|
-
'ck',
|
|
75
|
-
'ck-reset',
|
|
76
|
-
'ck-list'
|
|
77
|
-
],
|
|
78
|
-
role: bind.to('role'),
|
|
79
|
-
'aria-label': bind.to('ariaLabel'),
|
|
80
|
-
'aria-labelledby': bind.to('ariaLabelledBy')
|
|
81
|
-
},
|
|
82
|
-
children: this.items
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* @inheritDoc
|
|
87
|
-
*/
|
|
88
|
-
render() {
|
|
89
|
-
super.render();
|
|
90
|
-
// Items added before rendering should be known to the #focusTracker.
|
|
91
|
-
for (const item of this.items) {
|
|
92
|
-
if (item instanceof ListItemGroupView) {
|
|
93
|
-
this._registerFocusableItemsGroup(item);
|
|
94
|
-
}
|
|
95
|
-
else if (item instanceof ListItemView) {
|
|
96
|
-
this._registerFocusableListItem(item);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
this.items.on('change', (evt, data) => {
|
|
100
|
-
for (const removed of data.removed) {
|
|
101
|
-
if (removed instanceof ListItemGroupView) {
|
|
102
|
-
this._deregisterFocusableItemsGroup(removed);
|
|
103
|
-
}
|
|
104
|
-
else if (removed instanceof ListItemView) {
|
|
105
|
-
this._deregisterFocusableListItem(removed);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
for (const added of Array.from(data.added).reverse()) {
|
|
109
|
-
if (added instanceof ListItemGroupView) {
|
|
110
|
-
this._registerFocusableItemsGroup(added, data.index);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
this._registerFocusableListItem(added, data.index);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
// Start listening for the keystrokes coming from #element.
|
|
118
|
-
this.keystrokes.listenTo(this.element);
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* @inheritDoc
|
|
122
|
-
*/
|
|
123
|
-
destroy() {
|
|
124
|
-
super.destroy();
|
|
125
|
-
this.focusTracker.destroy();
|
|
126
|
-
this.keystrokes.destroy();
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Focuses the first focusable in {@link #items}.
|
|
130
|
-
*/
|
|
131
|
-
focus() {
|
|
132
|
-
this._focusCycler.focusFirst();
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Focuses the first focusable in {@link #items}.
|
|
136
|
-
*/
|
|
137
|
-
focusFirst() {
|
|
138
|
-
this._focusCycler.focusFirst();
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Focuses the last focusable in {@link #items}.
|
|
142
|
-
*/
|
|
143
|
-
focusLast() {
|
|
144
|
-
this._focusCycler.focusLast();
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Registers a list item view in the focus tracker.
|
|
148
|
-
*
|
|
149
|
-
* @param item The list item view to be registered.
|
|
150
|
-
* @param index Index of the list item view in the {@link #items} collection. If not specified, the item will be added at the end.
|
|
151
|
-
*/
|
|
152
|
-
_registerFocusableListItem(item, index) {
|
|
153
|
-
this.focusTracker.add(item.element);
|
|
154
|
-
this.focusables.add(item, index);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Removes a list item view from the focus tracker.
|
|
158
|
-
*
|
|
159
|
-
* @param item The list item view to be removed.
|
|
160
|
-
*/
|
|
161
|
-
_deregisterFocusableListItem(item) {
|
|
162
|
-
this.focusTracker.remove(item.element);
|
|
163
|
-
this.focusables.remove(item);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Gets a callback that will be called when the `items` collection of a {@link module:ui/list/listitemgroupview~ListItemGroupView}
|
|
167
|
-
* change.
|
|
168
|
-
*
|
|
169
|
-
* @param groupView The group view for which the callback will be created.
|
|
170
|
-
* @returns The callback function to be used for the items `change` event listener in a group.
|
|
171
|
-
*/
|
|
172
|
-
_getOnGroupItemsChangeCallback(groupView) {
|
|
173
|
-
return (evt, data) => {
|
|
174
|
-
for (const removed of data.removed) {
|
|
175
|
-
this._deregisterFocusableListItem(removed);
|
|
176
|
-
}
|
|
177
|
-
for (const added of Array.from(data.added).reverse()) {
|
|
178
|
-
this._registerFocusableListItem(added, this.items.getIndex(groupView) + data.index);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Registers a list item group view (and its children) in the focus tracker.
|
|
184
|
-
*
|
|
185
|
-
* @param groupView A group view to be registered.
|
|
186
|
-
* @param groupIndex Index of the group view in the {@link #items} collection. If not specified, the group will be added at the end.
|
|
187
|
-
*/
|
|
188
|
-
_registerFocusableItemsGroup(groupView, groupIndex) {
|
|
189
|
-
Array.from(groupView.items).forEach((child, childIndex) => {
|
|
190
|
-
const registeredChildIndex = typeof groupIndex !== 'undefined' ? groupIndex + childIndex : undefined;
|
|
191
|
-
this._registerFocusableListItem(child, registeredChildIndex);
|
|
192
|
-
});
|
|
193
|
-
const groupItemsChangeCallback = this._getOnGroupItemsChangeCallback(groupView);
|
|
194
|
-
// Cache the reference to the callback in case the group is removed (see _deregisterFocusableItemsGroup()).
|
|
195
|
-
this._listItemGroupToChangeListeners.set(groupView, groupItemsChangeCallback);
|
|
196
|
-
groupView.items.on('change', groupItemsChangeCallback);
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Removes a list item group view (and its children) from the focus tracker.
|
|
200
|
-
*
|
|
201
|
-
* @param groupView The group view to be removed.
|
|
202
|
-
*/
|
|
203
|
-
_deregisterFocusableItemsGroup(groupView) {
|
|
204
|
-
for (const child of groupView.items) {
|
|
205
|
-
this._deregisterFocusableListItem(child);
|
|
206
|
-
}
|
|
207
|
-
groupView.items.off('change', this._listItemGroupToChangeListeners.get(groupView));
|
|
208
|
-
this._listItemGroupToChangeListeners.delete(groupView);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
@@ -1,68 +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/menubar/menubarmenubuttonview
|
|
7
|
-
*/
|
|
8
|
-
import { IconDropdownArrow } from '@ckeditor/ckeditor5-icons';
|
|
9
|
-
import { IconView } from '../icon/iconview.js';
|
|
10
|
-
import { ListItemButtonView } from '../button/listitembuttonview.js';
|
|
11
|
-
import '../../theme/components/menubar/menubarmenubutton.css';
|
|
12
|
-
/**
|
|
13
|
-
* A menu {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#buttonView} class. Buttons like this one
|
|
14
|
-
* open both top-level bar menus as well as sub-menus.
|
|
15
|
-
*/
|
|
16
|
-
export class MenuBarMenuButtonView extends ListItemButtonView {
|
|
17
|
-
/**
|
|
18
|
-
* An icon that displays an arrow to indicate a direction of the menu.
|
|
19
|
-
*/
|
|
20
|
-
arrowView;
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of the menu bar button view.
|
|
23
|
-
*
|
|
24
|
-
* @param locale The localization services instance.
|
|
25
|
-
*/
|
|
26
|
-
constructor(locale) {
|
|
27
|
-
super(locale);
|
|
28
|
-
const bind = this.bindTemplate;
|
|
29
|
-
this.set({
|
|
30
|
-
withText: true,
|
|
31
|
-
role: 'menuitem'
|
|
32
|
-
});
|
|
33
|
-
this.arrowView = this._createArrowView();
|
|
34
|
-
this.extendTemplate({
|
|
35
|
-
attributes: {
|
|
36
|
-
class: [
|
|
37
|
-
'ck-menu-bar__menu__button'
|
|
38
|
-
],
|
|
39
|
-
'aria-haspopup': true,
|
|
40
|
-
'aria-expanded': this.bindTemplate.to('isOn', value => String(value)),
|
|
41
|
-
'data-cke-tooltip-disabled': bind.to('isOn')
|
|
42
|
-
},
|
|
43
|
-
on: {
|
|
44
|
-
'mouseenter': bind.to('mouseenter')
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
render() {
|
|
52
|
-
super.render();
|
|
53
|
-
this.children.add(this.arrowView);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Creates the {@link #arrowView} instance.
|
|
57
|
-
*/
|
|
58
|
-
_createArrowView() {
|
|
59
|
-
const arrowView = new IconView();
|
|
60
|
-
arrowView.content = IconDropdownArrow;
|
|
61
|
-
arrowView.extendTemplate({
|
|
62
|
-
attributes: {
|
|
63
|
-
class: 'ck-menu-bar__menu__button__arrow'
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return arrowView;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,30 +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 { ListItemButtonView } from '../button/listitembuttonview.js';
|
|
6
|
-
import '../../theme/components/menubar/menubarmenulistitembutton.css';
|
|
7
|
-
/**
|
|
8
|
-
* A menu bar list button view. Buttons like this one execute user actions.
|
|
9
|
-
*/
|
|
10
|
-
export class MenuBarMenuListItemButtonView extends ListItemButtonView {
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of the menu bar list button view.
|
|
13
|
-
*
|
|
14
|
-
* @param locale The localization services instance.
|
|
15
|
-
*/
|
|
16
|
-
constructor(locale) {
|
|
17
|
-
super(locale);
|
|
18
|
-
this.set({
|
|
19
|
-
withText: true,
|
|
20
|
-
withKeystroke: true,
|
|
21
|
-
tooltip: false,
|
|
22
|
-
role: 'menuitem'
|
|
23
|
-
});
|
|
24
|
-
this.extendTemplate({
|
|
25
|
-
attributes: {
|
|
26
|
-
class: ['ck-menu-bar__menu__item__button']
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,32 +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 { FileDialogListItemButtonView } from '../button/filedialogbuttonview.js';
|
|
6
|
-
import '../../theme/components/menubar/menubarmenulistitembutton.css';
|
|
7
|
-
/**
|
|
8
|
-
* A menu bar list file dialog button view. Buttons like this one execute user actions.
|
|
9
|
-
*
|
|
10
|
-
* This component provides a button that opens the native file selection dialog.
|
|
11
|
-
*/
|
|
12
|
-
export class MenuBarMenuListItemFileDialogButtonView extends FileDialogListItemButtonView {
|
|
13
|
-
/**
|
|
14
|
-
* Creates an instance of the menu bar list button view.
|
|
15
|
-
*
|
|
16
|
-
* @param locale The localization services instance.
|
|
17
|
-
*/
|
|
18
|
-
constructor(locale) {
|
|
19
|
-
super(locale);
|
|
20
|
-
this.set({
|
|
21
|
-
withText: true,
|
|
22
|
-
withKeystroke: true,
|
|
23
|
-
tooltip: false,
|
|
24
|
-
role: 'menuitem'
|
|
25
|
-
});
|
|
26
|
-
this.extendTemplate({
|
|
27
|
-
attributes: {
|
|
28
|
-
class: ['ck-menu-bar__menu__item__button']
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,34 +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 { ListItemView } from '../list/listitemview.js';
|
|
6
|
-
import '../../theme/components/menubar/menubarmenulistitem.css';
|
|
7
|
-
/**
|
|
8
|
-
* A menu bar list item view, a child of {@link module:ui/menubar/menubarmenulistview~MenuBarMenuListView}.
|
|
9
|
-
*
|
|
10
|
-
* Populate this item with a {@link module:ui/menubar/menubarmenulistitembuttonview~MenuBarMenuListItemButtonView} instance
|
|
11
|
-
* or a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView} instance to create a sub-menu.
|
|
12
|
-
*/
|
|
13
|
-
export class MenuBarMenuListItemView extends ListItemView {
|
|
14
|
-
/**
|
|
15
|
-
* Creates an instance of the list item view.
|
|
16
|
-
*
|
|
17
|
-
* @param locale The localization services instance.
|
|
18
|
-
*/
|
|
19
|
-
constructor(locale, parentMenuView) {
|
|
20
|
-
super(locale);
|
|
21
|
-
const bind = this.bindTemplate;
|
|
22
|
-
this.extendTemplate({
|
|
23
|
-
attributes: {
|
|
24
|
-
class: [
|
|
25
|
-
'ck-menu-bar__menu__item'
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
on: {
|
|
29
|
-
'mouseenter': bind.to('mouseenter')
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
this.delegate('mouseenter').to(parentMenuView);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,72 +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 { ListItemView } from '../list/listitemview.js';
|
|
6
|
-
import { ListView } from '../list/listview.js';
|
|
7
|
-
import { ListItemButtonView } from '../button/listitembuttonview.js';
|
|
8
|
-
import { ButtonView } from '../button/buttonview.js';
|
|
9
|
-
/**
|
|
10
|
-
* A list of menu bar items, a child of {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView}.
|
|
11
|
-
*
|
|
12
|
-
* Use this class to create a list of items (options, buttons) to be displayed in a menu bar.
|
|
13
|
-
*
|
|
14
|
-
* To populate this list, use {@link module:ui/menubar/menubarmenulistitemview~MenuBarMenuListItemView} instances.
|
|
15
|
-
*/
|
|
16
|
-
export class MenuBarMenuListView extends ListView {
|
|
17
|
-
/**
|
|
18
|
-
* Creates an instance of the list view.
|
|
19
|
-
*
|
|
20
|
-
* @param locale The localization services instance.
|
|
21
|
-
*/
|
|
22
|
-
constructor(locale) {
|
|
23
|
-
super(locale);
|
|
24
|
-
this.role = 'menu';
|
|
25
|
-
this.items.on('change', this._setItemsCheckSpace.bind(this));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* This method adds empty space if there is any toggleable item in the list.
|
|
29
|
-
* It makes the list properly aligned.
|
|
30
|
-
*/
|
|
31
|
-
_setItemsCheckSpace() {
|
|
32
|
-
const hasAnyToggleableItem = (Array
|
|
33
|
-
.from(this.items)
|
|
34
|
-
.some(item => {
|
|
35
|
-
const listButtonView = pickListButtonMenuViewIfPresent(item);
|
|
36
|
-
return listButtonView && listButtonView.isToggleable;
|
|
37
|
-
}));
|
|
38
|
-
this.items.forEach(item => {
|
|
39
|
-
const listButtonView = pickListButtonMenuViewIfPresent(item);
|
|
40
|
-
if (listButtonView) {
|
|
41
|
-
listButtonView.hasCheckSpace = hasAnyToggleableItem;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Picks the first button menu view from the given item if present.
|
|
48
|
-
*
|
|
49
|
-
* @param item The item to check for a button menu view.
|
|
50
|
-
* @returns The first button menu view found in the item, or `null` if not found.
|
|
51
|
-
*/
|
|
52
|
-
function pickListButtonMenuViewIfPresent(item) {
|
|
53
|
-
if (!(item instanceof ListItemView)) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
return item
|
|
57
|
-
.children
|
|
58
|
-
.map(child => isNestedMenuLikeView(child) ? child.buttonView : child)
|
|
59
|
-
.find(item => item instanceof ListItemButtonView);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Checks if the given item is a nested menu-like view. `MenuBarMenuView` imports this file
|
|
63
|
-
* so to avoid circular dependencies, this function is defined in more generic way.
|
|
64
|
-
*
|
|
65
|
-
* @param item The item to check.
|
|
66
|
-
* @returns `true` if the item is a nested menu-like view, `false` otherwise.
|
|
67
|
-
*/
|
|
68
|
-
function isNestedMenuLikeView(item) {
|
|
69
|
-
return (typeof item === 'object' &&
|
|
70
|
-
'buttonView' in item &&
|
|
71
|
-
item.buttonView instanceof ButtonView);
|
|
72
|
-
}
|
|
@@ -1,64 +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 { View } from '../view.js';
|
|
6
|
-
import '../../theme/components/menubar/menubarmenupanel.css';
|
|
7
|
-
/**
|
|
8
|
-
* A view representing a {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#panelView} of a menu.
|
|
9
|
-
*/
|
|
10
|
-
export class MenuBarMenuPanelView extends View {
|
|
11
|
-
/**
|
|
12
|
-
* Collection of the child views in this panel.
|
|
13
|
-
*/
|
|
14
|
-
children;
|
|
15
|
-
/**
|
|
16
|
-
* Creates an instance of the menu panel view.
|
|
17
|
-
*
|
|
18
|
-
* @param locale The localization services instance.
|
|
19
|
-
*/
|
|
20
|
-
constructor(locale) {
|
|
21
|
-
super(locale);
|
|
22
|
-
const bind = this.bindTemplate;
|
|
23
|
-
this.set('isVisible', false);
|
|
24
|
-
this.set('position', 'se');
|
|
25
|
-
this.children = this.createCollection();
|
|
26
|
-
this.setTemplate({
|
|
27
|
-
tag: 'div',
|
|
28
|
-
attributes: {
|
|
29
|
-
class: [
|
|
30
|
-
'ck',
|
|
31
|
-
'ck-reset',
|
|
32
|
-
'ck-menu-bar__menu__panel',
|
|
33
|
-
bind.to('position', value => `ck-menu-bar__menu__panel_position_${value}`),
|
|
34
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
35
|
-
],
|
|
36
|
-
tabindex: '-1'
|
|
37
|
-
},
|
|
38
|
-
children: this.children,
|
|
39
|
-
on: {
|
|
40
|
-
// Drag and drop in the panel should not break the selection in the editor.
|
|
41
|
-
// https://github.com/ckeditor/ckeditor5-ui/issues/228
|
|
42
|
-
selectstart: bind.to(evt => {
|
|
43
|
-
if (evt.target.tagName.toLocaleLowerCase() === 'input') {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
evt.preventDefault();
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Focuses the first child of the panel (default) or the last one if the `direction` is `-1`.
|
|
53
|
-
*/
|
|
54
|
-
focus(direction = 1) {
|
|
55
|
-
if (this.children.length) {
|
|
56
|
-
if (direction === 1) {
|
|
57
|
-
this.children.first.focus();
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
this.children.last.focus();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|