@ckeditor/ckeditor5-ui 0.0.0-internal-20241017.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/CHANGELOG.md +4 -0
- package/LICENSE.md +21 -0
- package/README.md +26 -0
- package/ckeditor5-metadata.json +25 -0
- package/dist/arialiveannouncer.d.ts +113 -0
- package/dist/augmentation.d.ts +92 -0
- package/dist/autocomplete/autocompleteview.d.ts +85 -0
- package/dist/badge/badge.d.ts +133 -0
- package/dist/bindings/addkeyboardhandlingforgrid.d.ts +31 -0
- package/dist/bindings/clickoutsidehandler.d.ts +34 -0
- package/dist/bindings/csstransitiondisablermixin.d.ts +44 -0
- package/dist/bindings/draggableviewmixin.d.ts +50 -0
- package/dist/bindings/injectcsstransitiondisabler.d.ts +63 -0
- package/dist/bindings/preventdefault.d.ts +37 -0
- package/dist/bindings/submithandler.d.ts +61 -0
- package/dist/button/button.d.ts +179 -0
- package/dist/button/buttonlabel.d.ts +38 -0
- package/dist/button/buttonlabelview.d.ts +35 -0
- package/dist/button/buttonview.d.ts +201 -0
- package/dist/button/filedialogbuttonview.d.ts +111 -0
- package/dist/button/listitembuttonview.d.ts +82 -0
- package/dist/button/switchbuttonview.d.ts +49 -0
- package/dist/collapsible/collapsibleview.d.ts +74 -0
- package/dist/colorgrid/colorgridview.d.ts +136 -0
- package/dist/colorgrid/colortileview.d.ts +32 -0
- package/dist/colorgrid/utils.d.ts +51 -0
- package/dist/colorpicker/colorpickerview.d.ts +177 -0
- package/dist/colorpicker/utils.d.ts +52 -0
- package/dist/colorselector/colorgridsfragmentview.d.ts +199 -0
- package/dist/colorselector/colorpickerfragmentview.d.ts +137 -0
- package/dist/colorselector/colorselectorview.d.ts +246 -0
- package/dist/colorselector/documentcolorcollection.d.ts +74 -0
- package/dist/componentfactory.d.ts +85 -0
- package/dist/dialog/dialog.d.ts +281 -0
- package/dist/dialog/dialogactionsview.d.ts +73 -0
- package/dist/dialog/dialogcontentview.d.ts +31 -0
- package/dist/dialog/dialogview.d.ts +260 -0
- package/dist/dropdown/button/dropdownbutton.d.ts +29 -0
- package/dist/dropdown/button/dropdownbuttonview.d.ts +52 -0
- package/dist/dropdown/button/splitbuttonview.d.ts +166 -0
- package/dist/dropdown/dropdownpanelfocusable.d.ts +25 -0
- package/dist/dropdown/dropdownpanelview.d.ts +66 -0
- package/dist/dropdown/dropdownview.d.ts +332 -0
- package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +48 -0
- package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +40 -0
- package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +21 -0
- package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +26 -0
- package/dist/dropdown/menu/dropdownmenulistview.d.ts +28 -0
- package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +38 -0
- package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +135 -0
- package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +144 -0
- package/dist/dropdown/menu/utils.d.ts +128 -0
- package/dist/dropdown/utils.d.ts +297 -0
- package/dist/editableui/editableuiview.d.ts +76 -0
- package/dist/editableui/inline/inlineeditableuiview.d.ts +48 -0
- package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +59 -0
- package/dist/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +39 -0
- package/dist/editorui/bodycollection.d.ts +59 -0
- package/dist/editorui/boxed/boxededitoruiview.d.ts +44 -0
- package/dist/editorui/editorui.d.ts +358 -0
- package/dist/editorui/editoruiview.d.ts +48 -0
- package/dist/editorui/evaluationbadge.d.ts +37 -0
- package/dist/editorui/poweredby.d.ts +38 -0
- package/dist/focuscycler.d.ts +295 -0
- package/dist/formheader/formheaderview.d.ts +62 -0
- package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +34 -0
- package/dist/highlightedtext/highlightedtextview.d.ts +42 -0
- package/dist/highlightedtext/labelwithhighlightview.d.ts +30 -0
- package/dist/icon/iconview.d.ts +92 -0
- package/dist/iframe/iframeview.d.ts +54 -0
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +754 -0
- package/dist/index.css +1063 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +17688 -0
- package/dist/index.js.map +1 -0
- package/dist/input/inputbase.d.ts +123 -0
- package/dist/input/inputview.d.ts +40 -0
- package/dist/inputnumber/inputnumberview.d.ts +53 -0
- package/dist/inputtext/inputtextview.d.ts +22 -0
- package/dist/label/labelview.d.ts +40 -0
- package/dist/labeledfield/labeledfieldview.d.ts +191 -0
- package/dist/labeledfield/utils.d.ts +127 -0
- package/dist/labeledinput/labeledinputview.d.ts +129 -0
- package/dist/list/listitemgroupview.d.ts +63 -0
- package/dist/list/listitemview.d.ts +40 -0
- package/dist/list/listseparatorview.d.ts +22 -0
- package/dist/list/listview.d.ts +128 -0
- package/dist/menubar/menubarmenubuttonview.d.ts +39 -0
- package/dist/menubar/menubarmenulistitembuttonview.d.ts +25 -0
- package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +27 -0
- package/dist/menubar/menubarmenulistitemview.d.ts +29 -0
- package/dist/menubar/menubarmenulistview.d.ts +33 -0
- package/dist/menubar/menubarmenupanelview.d.ts +57 -0
- package/dist/menubar/menubarmenuview.d.ts +113 -0
- package/dist/menubar/menubarview.d.ts +177 -0
- package/dist/menubar/utils.d.ts +451 -0
- package/dist/model.d.ts +26 -0
- package/dist/notification/notification.d.ts +219 -0
- package/dist/panel/balloon/balloonpanelview.d.ts +701 -0
- package/dist/panel/balloon/contextualballoon.d.ts +313 -0
- package/dist/panel/sticky/stickypanelview.d.ts +160 -0
- package/dist/search/filteredview.d.ts +35 -0
- package/dist/search/filtergroupanditemnames.d.ts +19 -0
- package/dist/search/searchinfoview.d.ts +49 -0
- package/dist/search/searchresultsview.d.ts +58 -0
- package/dist/search/text/searchtextqueryview.d.ts +80 -0
- package/dist/search/text/searchtextview.d.ts +223 -0
- package/dist/spinner/spinnerview.d.ts +29 -0
- package/dist/template.d.ts +946 -0
- package/dist/textarea/textareaview.d.ts +108 -0
- package/dist/toolbar/balloon/balloontoolbar.d.ts +130 -0
- package/dist/toolbar/block/blockbuttonview.d.ts +39 -0
- package/dist/toolbar/block/blocktoolbar.d.ts +175 -0
- package/dist/toolbar/normalizetoolbarconfig.d.ts +44 -0
- package/dist/toolbar/toolbarlinebreakview.d.ts +22 -0
- package/dist/toolbar/toolbarseparatorview.d.ts +22 -0
- package/dist/toolbar/toolbarview.d.ts +271 -0
- package/dist/tooltipmanager.d.ts +192 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +5 -0
- package/dist/translations/af.umd.js +11 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/ast.d.ts +8 -0
- package/dist/translations/ast.js +5 -0
- package/dist/translations/ast.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/bs.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +5 -0
- package/dist/translations/eo.umd.js +11 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es-co.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +5 -0
- package/dist/translations/eu.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/jv.umd.js +11 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +5 -0
- package/dist/translations/km.umd.js +11 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +5 -0
- package/dist/translations/kn.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/nb.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sl.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +5 -0
- package/dist/translations/ti.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/view.d.ts +426 -0
- package/dist/viewcollection.d.ts +143 -0
- package/lang/contexts.json +51 -0
- package/lang/translations/af.po +214 -0
- package/lang/translations/ar.po +214 -0
- package/lang/translations/ast.po +214 -0
- package/lang/translations/az.po +214 -0
- package/lang/translations/bg.po +214 -0
- package/lang/translations/bn.po +214 -0
- package/lang/translations/bs.po +214 -0
- package/lang/translations/ca.po +214 -0
- package/lang/translations/cs.po +214 -0
- package/lang/translations/da.po +214 -0
- package/lang/translations/de-ch.po +214 -0
- package/lang/translations/de.po +214 -0
- package/lang/translations/el.po +214 -0
- package/lang/translations/en-au.po +214 -0
- package/lang/translations/en-gb.po +214 -0
- package/lang/translations/en.po +214 -0
- package/lang/translations/eo.po +214 -0
- package/lang/translations/es-co.po +214 -0
- package/lang/translations/es.po +214 -0
- package/lang/translations/et.po +214 -0
- package/lang/translations/eu.po +214 -0
- package/lang/translations/fa.po +214 -0
- package/lang/translations/fi.po +214 -0
- package/lang/translations/fr.po +214 -0
- package/lang/translations/gl.po +214 -0
- package/lang/translations/he.po +214 -0
- package/lang/translations/hi.po +214 -0
- package/lang/translations/hr.po +214 -0
- package/lang/translations/hu.po +214 -0
- package/lang/translations/id.po +214 -0
- package/lang/translations/it.po +214 -0
- package/lang/translations/ja.po +214 -0
- package/lang/translations/jv.po +214 -0
- package/lang/translations/km.po +214 -0
- package/lang/translations/kn.po +214 -0
- package/lang/translations/ko.po +214 -0
- package/lang/translations/ku.po +214 -0
- package/lang/translations/lt.po +214 -0
- package/lang/translations/lv.po +214 -0
- package/lang/translations/ms.po +214 -0
- package/lang/translations/nb.po +214 -0
- package/lang/translations/ne.po +214 -0
- package/lang/translations/nl.po +214 -0
- package/lang/translations/no.po +214 -0
- package/lang/translations/pl.po +214 -0
- package/lang/translations/pt-br.po +214 -0
- package/lang/translations/pt.po +214 -0
- package/lang/translations/ro.po +214 -0
- package/lang/translations/ru.po +214 -0
- package/lang/translations/sk.po +214 -0
- package/lang/translations/sl.po +214 -0
- package/lang/translations/sq.po +214 -0
- package/lang/translations/sr-latn.po +214 -0
- package/lang/translations/sr.po +214 -0
- package/lang/translations/sv.po +214 -0
- package/lang/translations/th.po +214 -0
- package/lang/translations/ti.po +214 -0
- package/lang/translations/tk.po +214 -0
- package/lang/translations/tr.po +214 -0
- package/lang/translations/tt.po +214 -0
- package/lang/translations/ug.po +214 -0
- package/lang/translations/uk.po +214 -0
- package/lang/translations/ur.po +214 -0
- package/lang/translations/uz.po +214 -0
- package/lang/translations/vi.po +214 -0
- package/lang/translations/zh-cn.po +214 -0
- package/lang/translations/zh.po +214 -0
- package/package.json +42 -0
- package/src/arialiveannouncer.d.ts +109 -0
- package/src/arialiveannouncer.js +165 -0
- package/src/augmentation.d.ts +88 -0
- package/src/augmentation.js +5 -0
- package/src/autocomplete/autocompleteview.d.ts +81 -0
- package/src/autocomplete/autocompleteview.js +154 -0
- package/src/badge/badge.d.ts +129 -0
- package/src/badge/badge.js +218 -0
- package/src/bindings/addkeyboardhandlingforgrid.d.ts +27 -0
- package/src/bindings/addkeyboardhandlingforgrid.js +107 -0
- package/src/bindings/clickoutsidehandler.d.ts +30 -0
- package/src/bindings/clickoutsidehandler.js +37 -0
- package/src/bindings/csstransitiondisablermixin.d.ts +40 -0
- package/src/bindings/csstransitiondisablermixin.js +55 -0
- package/src/bindings/draggableviewmixin.d.ts +46 -0
- package/src/bindings/draggableviewmixin.js +144 -0
- package/src/bindings/injectcsstransitiondisabler.d.ts +59 -0
- package/src/bindings/injectcsstransitiondisabler.js +71 -0
- package/src/bindings/preventdefault.d.ts +33 -0
- package/src/bindings/preventdefault.js +34 -0
- package/src/bindings/submithandler.d.ts +57 -0
- package/src/bindings/submithandler.js +47 -0
- package/src/button/button.d.ts +175 -0
- package/src/button/button.js +5 -0
- package/src/button/buttonlabel.d.ts +34 -0
- package/src/button/buttonlabel.js +5 -0
- package/src/button/buttonlabelview.d.ts +31 -0
- package/src/button/buttonlabelview.js +42 -0
- package/src/button/buttonview.d.ts +197 -0
- package/src/button/buttonview.js +248 -0
- package/src/button/filedialogbuttonview.d.ts +107 -0
- package/src/button/filedialogbuttonview.js +145 -0
- package/src/button/listitembuttonview.d.ts +78 -0
- package/src/button/listitembuttonview.js +129 -0
- package/src/button/switchbuttonview.d.ts +45 -0
- package/src/button/switchbuttonview.js +75 -0
- package/src/collapsible/collapsibleview.d.ts +70 -0
- package/src/collapsible/collapsibleview.js +95 -0
- package/src/colorgrid/colorgridview.d.ts +132 -0
- package/src/colorgrid/colorgridview.js +124 -0
- package/src/colorgrid/colortileview.d.ts +28 -0
- package/src/colorgrid/colortileview.js +42 -0
- package/src/colorgrid/utils.d.ts +47 -0
- package/src/colorgrid/utils.js +84 -0
- package/src/colorpicker/colorpickerview.d.ts +173 -0
- package/src/colorpicker/colorpickerview.js +326 -0
- package/src/colorpicker/utils.d.ts +48 -0
- package/src/colorpicker/utils.js +108 -0
- package/src/colorselector/colorgridsfragmentview.d.ts +195 -0
- package/src/colorselector/colorgridsfragmentview.js +291 -0
- package/src/colorselector/colorpickerfragmentview.d.ts +133 -0
- package/src/colorselector/colorpickerfragmentview.js +212 -0
- package/src/colorselector/colorselectorview.d.ts +242 -0
- package/src/colorselector/colorselectorview.js +257 -0
- package/src/colorselector/documentcolorcollection.d.ts +70 -0
- package/src/colorselector/documentcolorcollection.js +42 -0
- package/src/componentfactory.d.ts +81 -0
- package/src/componentfactory.js +104 -0
- package/src/dialog/dialog.d.ts +277 -0
- package/src/dialog/dialog.js +279 -0
- package/src/dialog/dialogactionsview.d.ts +69 -0
- package/src/dialog/dialogactionsview.js +98 -0
- package/src/dialog/dialogcontentview.d.ts +27 -0
- package/src/dialog/dialogcontentview.js +35 -0
- package/src/dialog/dialogview.d.ts +256 -0
- package/src/dialog/dialogview.js +453 -0
- package/src/dropdown/button/dropdownbutton.d.ts +25 -0
- package/src/dropdown/button/dropdownbutton.js +5 -0
- package/src/dropdown/button/dropdownbuttonview.d.ts +48 -0
- package/src/dropdown/button/dropdownbuttonview.js +66 -0
- package/src/dropdown/button/splitbuttonview.d.ts +162 -0
- package/src/dropdown/button/splitbuttonview.js +154 -0
- package/src/dropdown/dropdownpanelfocusable.d.ts +21 -0
- package/src/dropdown/dropdownpanelfocusable.js +5 -0
- package/src/dropdown/dropdownpanelview.d.ts +62 -0
- package/src/dropdown/dropdownpanelview.js +97 -0
- package/src/dropdown/dropdownview.d.ts +328 -0
- package/src/dropdown/dropdownview.js +380 -0
- package/src/dropdown/menu/dropdownmenubehaviors.d.ts +44 -0
- package/src/dropdown/menu/dropdownmenubehaviors.js +119 -0
- package/src/dropdown/menu/dropdownmenubuttonview.d.ts +36 -0
- package/src/dropdown/menu/dropdownmenubuttonview.js +65 -0
- package/src/dropdown/menu/dropdownmenulistitembuttonview.d.ts +17 -0
- package/src/dropdown/menu/dropdownmenulistitembuttonview.js +29 -0
- package/src/dropdown/menu/dropdownmenulistitemview.d.ts +22 -0
- package/src/dropdown/menu/dropdownmenulistitemview.js +34 -0
- package/src/dropdown/menu/dropdownmenulistview.d.ts +24 -0
- package/src/dropdown/menu/dropdownmenulistview.js +29 -0
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +34 -0
- package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +63 -0
- package/src/dropdown/menu/dropdownmenunestedmenuview.d.ts +131 -0
- package/src/dropdown/menu/dropdownmenunestedmenuview.js +191 -0
- package/src/dropdown/menu/dropdownmenurootlistview.d.ts +140 -0
- package/src/dropdown/menu/dropdownmenurootlistview.js +160 -0
- package/src/dropdown/menu/utils.d.ts +124 -0
- package/src/dropdown/menu/utils.js +61 -0
- package/src/dropdown/utils.d.ts +293 -0
- package/src/dropdown/utils.js +562 -0
- package/src/editableui/editableuiview.d.ts +72 -0
- package/src/editableui/editableuiview.js +112 -0
- package/src/editableui/inline/inlineeditableuiview.d.ts +44 -0
- package/src/editableui/inline/inlineeditableuiview.js +71 -0
- package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +55 -0
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +145 -0
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +35 -0
- package/src/editorui/accessibilityhelp/accessibilityhelpcontentview.js +112 -0
- package/src/editorui/bodycollection.d.ts +55 -0
- package/src/editorui/bodycollection.js +85 -0
- package/src/editorui/boxed/boxededitoruiview.d.ts +40 -0
- package/src/editorui/boxed/boxededitoruiview.js +81 -0
- package/src/editorui/editorui.d.ts +354 -0
- package/src/editorui/editorui.js +522 -0
- package/src/editorui/editoruiview.d.ts +44 -0
- package/src/editorui/editoruiview.js +38 -0
- package/src/editorui/evaluationbadge.d.ts +33 -0
- package/src/editorui/evaluationbadge.js +99 -0
- package/src/editorui/poweredby.d.ts +34 -0
- package/src/editorui/poweredby.js +127 -0
- package/src/focuscycler.d.ts +291 -0
- package/src/focuscycler.js +352 -0
- package/src/formheader/formheaderview.d.ts +58 -0
- package/src/formheader/formheaderview.js +69 -0
- package/src/highlightedtext/buttonlabelwithhighlightview.d.ts +30 -0
- package/src/highlightedtext/buttonlabelwithhighlightview.js +31 -0
- package/src/highlightedtext/highlightedtextview.d.ts +38 -0
- package/src/highlightedtext/highlightedtextview.js +102 -0
- package/src/highlightedtext/labelwithhighlightview.d.ts +26 -0
- package/src/highlightedtext/labelwithhighlightview.js +33 -0
- package/src/icon/iconview.d.ts +88 -0
- package/src/icon/iconview.js +115 -0
- package/src/iframe/iframeview.d.ts +50 -0
- package/src/iframe/iframeview.js +63 -0
- package/src/index.d.ts +93 -0
- package/src/index.js +90 -0
- package/src/input/inputbase.d.ts +119 -0
- package/src/input/inputbase.js +114 -0
- package/src/input/inputview.d.ts +36 -0
- package/src/input/inputview.js +24 -0
- package/src/inputnumber/inputnumberview.d.ts +49 -0
- package/src/inputnumber/inputnumberview.js +40 -0
- package/src/inputtext/inputtextview.d.ts +18 -0
- package/src/inputtext/inputtextview.js +27 -0
- package/src/label/labelview.d.ts +36 -0
- package/src/label/labelview.js +41 -0
- package/src/labeledfield/labeledfieldview.d.ts +187 -0
- package/src/labeledfield/labeledfieldview.js +157 -0
- package/src/labeledfield/utils.d.ts +123 -0
- package/src/labeledfield/utils.js +176 -0
- package/src/labeledinput/labeledinputview.d.ts +125 -0
- package/src/labeledinput/labeledinputview.js +125 -0
- package/src/list/listitemgroupview.d.ts +59 -0
- package/src/list/listitemgroupview.js +67 -0
- package/src/list/listitemview.d.ts +36 -0
- package/src/list/listitemview.js +42 -0
- package/src/list/listseparatorview.d.ts +18 -0
- package/src/list/listseparatorview.js +28 -0
- package/src/list/listview.d.ts +124 -0
- package/src/list/listview.js +188 -0
- package/src/menubar/menubarmenubuttonview.d.ts +35 -0
- package/src/menubar/menubarmenubuttonview.js +64 -0
- package/src/menubar/menubarmenulistitembuttonview.d.ts +21 -0
- package/src/menubar/menubarmenulistitembuttonview.js +30 -0
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +23 -0
- package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +32 -0
- package/src/menubar/menubarmenulistitemview.d.ts +25 -0
- package/src/menubar/menubarmenulistitemview.js +34 -0
- package/src/menubar/menubarmenulistview.d.ts +29 -0
- package/src/menubar/menubarmenulistview.js +72 -0
- package/src/menubar/menubarmenupanelview.d.ts +53 -0
- package/src/menubar/menubarmenupanelview.js +60 -0
- package/src/menubar/menubarmenuview.d.ts +109 -0
- package/src/menubar/menubarmenuview.js +160 -0
- package/src/menubar/menubarview.d.ts +173 -0
- package/src/menubar/menubarview.js +261 -0
- package/src/menubar/utils.d.ts +447 -0
- package/src/menubar/utils.js +1388 -0
- package/src/model.d.ts +22 -0
- package/src/model.js +31 -0
- package/src/notification/notification.d.ts +215 -0
- package/src/notification/notification.js +193 -0
- package/src/panel/balloon/balloonpanelview.d.ts +697 -0
- package/src/panel/balloon/balloonpanelview.js +1055 -0
- package/src/panel/balloon/contextualballoon.d.ts +309 -0
- package/src/panel/balloon/contextualballoon.js +576 -0
- package/src/panel/sticky/stickypanelview.d.ts +156 -0
- package/src/panel/sticky/stickypanelview.js +234 -0
- package/src/search/filteredview.d.ts +31 -0
- package/src/search/filteredview.js +5 -0
- package/src/search/filtergroupanditemnames.d.ts +15 -0
- package/src/search/filtergroupanditemnames.js +38 -0
- package/src/search/searchinfoview.d.ts +45 -0
- package/src/search/searchinfoview.js +59 -0
- package/src/search/searchresultsview.d.ts +54 -0
- package/src/search/searchresultsview.js +65 -0
- package/src/search/text/searchtextqueryview.d.ts +76 -0
- package/src/search/text/searchtextqueryview.js +75 -0
- package/src/search/text/searchtextview.d.ts +219 -0
- package/src/search/text/searchtextview.js +202 -0
- package/src/spinner/spinnerview.d.ts +25 -0
- package/src/spinner/spinnerview.js +38 -0
- package/src/template.d.ts +942 -0
- package/src/template.js +1294 -0
- package/src/textarea/textareaview.d.ts +104 -0
- package/src/textarea/textareaview.js +182 -0
- package/src/toolbar/balloon/balloontoolbar.d.ts +126 -0
- package/src/toolbar/balloon/balloontoolbar.js +324 -0
- package/src/toolbar/block/blockbuttonview.d.ts +35 -0
- package/src/toolbar/block/blockbuttonview.js +41 -0
- package/src/toolbar/block/blocktoolbar.d.ts +171 -0
- package/src/toolbar/block/blocktoolbar.js +492 -0
- package/src/toolbar/normalizetoolbarconfig.d.ts +40 -0
- package/src/toolbar/normalizetoolbarconfig.js +52 -0
- package/src/toolbar/toolbarlinebreakview.d.ts +18 -0
- package/src/toolbar/toolbarlinebreakview.js +28 -0
- package/src/toolbar/toolbarseparatorview.d.ts +18 -0
- package/src/toolbar/toolbarseparatorview.js +28 -0
- package/src/toolbar/toolbarview.d.ts +267 -0
- package/src/toolbar/toolbarview.js +721 -0
- package/src/tooltipmanager.d.ts +188 -0
- package/src/tooltipmanager.js +413 -0
- package/src/view.d.ts +422 -0
- package/src/view.js +396 -0
- package/src/viewcollection.d.ts +139 -0
- package/src/viewcollection.js +206 -0
- package/theme/components/arialiveannouncer/arialiveannouncer.css +14 -0
- package/theme/components/autocomplete/autocomplete.css +22 -0
- package/theme/components/button/button.css +39 -0
- package/theme/components/button/listitembutton.css +48 -0
- package/theme/components/button/switchbutton.css +14 -0
- package/theme/components/collapsible/collapsible.css +10 -0
- package/theme/components/colorgrid/colorgrid.css +8 -0
- package/theme/components/colorpicker/colorpicker.css +34 -0
- package/theme/components/colorselector/colorselector.css +35 -0
- package/theme/components/dialog/dialog.css +39 -0
- package/theme/components/dialog/dialogactions.css +11 -0
- package/theme/components/dropdown/dropdown.css +95 -0
- package/theme/components/dropdown/listdropdown.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenu.css +8 -0
- package/theme/components/dropdown/menu/dropdownmenubutton.css +9 -0
- package/theme/components/dropdown/menu/dropdownmenulistitem.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +10 -0
- package/theme/components/dropdown/menu/dropdownmenupanel.css +11 -0
- package/theme/components/dropdown/splitbutton.css +14 -0
- package/theme/components/dropdown/toolbardropdown.css +20 -0
- package/theme/components/editorui/accessibilityhelp.css +10 -0
- package/theme/components/editorui/editorui.css +10 -0
- package/theme/components/formheader/formheader.css +16 -0
- package/theme/components/highlightedtext/highlightedtext.css +12 -0
- package/theme/components/icon/icon.css +8 -0
- package/theme/components/input/input.css +10 -0
- package/theme/components/label/label.css +12 -0
- package/theme/components/labeledfield/labeledfieldview.css +16 -0
- package/theme/components/labeledinput/labeledinput.css +10 -0
- package/theme/components/list/list.css +26 -0
- package/theme/components/menubar/menubar.css +10 -0
- package/theme/components/menubar/menubarmenu.css +9 -0
- package/theme/components/menubar/menubarmenubutton.css +11 -0
- package/theme/components/menubar/menubarmenulistitem.css +10 -0
- package/theme/components/menubar/menubarmenulistitembutton.css +10 -0
- package/theme/components/menubar/menubarmenupanel.css +62 -0
- package/theme/components/panel/balloonpanel.css +56 -0
- package/theme/components/panel/balloonrotator.css +17 -0
- package/theme/components/panel/fakepanel.css +23 -0
- package/theme/components/panel/stickypanel.css +17 -0
- package/theme/components/responsive-form/responsiveform.css +42 -0
- package/theme/components/search/search.css +43 -0
- package/theme/components/spinner/spinner.css +23 -0
- package/theme/components/textarea/textarea.css +10 -0
- package/theme/components/toolbar/blocktoolbar.css +9 -0
- package/theme/components/toolbar/toolbar.css +58 -0
- package/theme/components/tooltip/tooltip.css +12 -0
- package/theme/globals/_evaluationbadge.css +50 -0
- package/theme/globals/_hidden.css +13 -0
- package/theme/globals/_poweredby.css +72 -0
- package/theme/globals/_transition.css +12 -0
- package/theme/globals/_zindex.css +10 -0
- package/theme/globals/globals.css +10 -0
- package/theme/icons/accessibility.svg +1 -0
- package/theme/icons/color-tile-check.svg +1 -0
- package/theme/icons/dropdown-arrow.svg +1 -0
- package/theme/icons/project-logo.svg +1 -0
- package/theme/mixins/_dir.css +10 -0
- package/theme/mixins/_mediacolors.css +20 -0
- package/theme/mixins/_rwd.css +10 -0
- package/theme/mixins/_unselectable.css +14 -0
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/dropdown/dropdownview
|
|
7
|
+
*/
|
|
8
|
+
import View from '../view.js';
|
|
9
|
+
import type { default as DropdownButton } from './button/dropdownbutton.js';
|
|
10
|
+
import type { default as DropdownPanelView, PanelPosition } from './dropdownpanelview.js';
|
|
11
|
+
import type { FocusableView } from '../focuscycler.js';
|
|
12
|
+
import type ListView from '../list/listview.js';
|
|
13
|
+
import type ToolbarView from '../toolbar/toolbarview.js';
|
|
14
|
+
import type DropdownMenuRootListView from './menu/dropdownmenurootlistview.js';
|
|
15
|
+
import { KeystrokeHandler, FocusTracker, type Locale, type PositioningFunction } from '@ckeditor/ckeditor5-utils';
|
|
16
|
+
import '../../theme/components/dropdown/dropdown.css';
|
|
17
|
+
/**
|
|
18
|
+
* The dropdown view class. It manages the dropdown button and dropdown panel.
|
|
19
|
+
*
|
|
20
|
+
* In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}
|
|
21
|
+
* util:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* const dropdown = createDropdown( locale );
|
|
25
|
+
*
|
|
26
|
+
* // Configure dropdown's button properties:
|
|
27
|
+
* dropdown.buttonView.set( {
|
|
28
|
+
* label: 'A dropdown',
|
|
29
|
+
* withText: true
|
|
30
|
+
* } );
|
|
31
|
+
*
|
|
32
|
+
* dropdown.render();
|
|
33
|
+
*
|
|
34
|
+
* dropdown.panelView.element.textContent = 'Content of the panel';
|
|
35
|
+
*
|
|
36
|
+
* // Will render a dropdown with a panel containing a "Content of the panel" text.
|
|
37
|
+
* document.body.appendChild( dropdown.element );
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}
|
|
41
|
+
* and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in
|
|
42
|
+
* {@link module:ui/dropdown/utils~createDropdown} documentation.
|
|
43
|
+
*
|
|
44
|
+
* If you want to create a completely custom dropdown, then you can compose it manually:
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* const button = new DropdownButtonView( locale );
|
|
48
|
+
* const panel = new DropdownPanelView( locale );
|
|
49
|
+
* const dropdown = new DropdownView( locale, button, panel );
|
|
50
|
+
*
|
|
51
|
+
* button.set( {
|
|
52
|
+
* label: 'A dropdown',
|
|
53
|
+
* withText: true
|
|
54
|
+
* } );
|
|
55
|
+
*
|
|
56
|
+
* dropdown.render();
|
|
57
|
+
*
|
|
58
|
+
* panel.element.textContent = 'Content of the panel';
|
|
59
|
+
*
|
|
60
|
+
* // Will render a dropdown with a panel containing a "Content of the panel" text.
|
|
61
|
+
* document.body.appendChild( dropdown.element );
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* However, dropdown created this way will contain little behavior. You will need to implement handlers for actions
|
|
65
|
+
* such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}
|
|
66
|
+
* (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what
|
|
67
|
+
* you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.
|
|
68
|
+
*/
|
|
69
|
+
export default class DropdownView extends View<HTMLDivElement> {
|
|
70
|
+
/**
|
|
71
|
+
* Button of the dropdown view. Clicking the button opens the {@link #panelView}.
|
|
72
|
+
*/
|
|
73
|
+
readonly buttonView: DropdownButton & FocusableView;
|
|
74
|
+
/**
|
|
75
|
+
* Panel of the dropdown. It opens when the {@link #buttonView} is
|
|
76
|
+
* {@link module:ui/button/button~Button#event:execute executed} (i.e. clicked).
|
|
77
|
+
*
|
|
78
|
+
* Child views can be added to the panel's `children` collection:
|
|
79
|
+
*
|
|
80
|
+
* ```ts
|
|
81
|
+
* dropdown.panelView.children.add( childView );
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* See {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children} and
|
|
85
|
+
* {@link module:ui/viewcollection~ViewCollection#add}.
|
|
86
|
+
*/
|
|
87
|
+
readonly panelView: DropdownPanelView;
|
|
88
|
+
/**
|
|
89
|
+
* Tracks information about the DOM focus in the dropdown.
|
|
90
|
+
*/
|
|
91
|
+
readonly focusTracker: FocusTracker;
|
|
92
|
+
/**
|
|
93
|
+
* Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}. It manages
|
|
94
|
+
* keystrokes of the dropdown:
|
|
95
|
+
*
|
|
96
|
+
* * <kbd>▼</kbd> opens the dropdown,
|
|
97
|
+
* * <kbd>◀</kbd> and <kbd>Esc</kbd> closes the dropdown.
|
|
98
|
+
*/
|
|
99
|
+
readonly keystrokes: KeystrokeHandler;
|
|
100
|
+
/**
|
|
101
|
+
* A child {@link module:ui/list/listview~ListView list view} of the dropdown located
|
|
102
|
+
* in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
|
|
103
|
+
*
|
|
104
|
+
* **Note**: Only supported when dropdown has list view added using {@link module:ui/dropdown/utils~addListToDropdown}.
|
|
105
|
+
*/
|
|
106
|
+
listView?: ListView;
|
|
107
|
+
/**
|
|
108
|
+
* A child toolbar of the dropdown located in the
|
|
109
|
+
* {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
|
|
110
|
+
*
|
|
111
|
+
* **Note**: Only supported when dropdown has a toolbar added using {@link module:ui/dropdown/utils~addToolbarToDropdown}.
|
|
112
|
+
*/
|
|
113
|
+
toolbarView?: ToolbarView;
|
|
114
|
+
/**
|
|
115
|
+
* A child menu component of the dropdown located
|
|
116
|
+
* in its {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel}.
|
|
117
|
+
*
|
|
118
|
+
* **Note**: Only supported when dropdown has a menu added using {@link module:ui/dropdown/utils~addMenuToDropdown}.
|
|
119
|
+
*/
|
|
120
|
+
menuView?: DropdownMenuRootListView;
|
|
121
|
+
/**
|
|
122
|
+
* Controls whether the dropdown view is open, i.e. shows or hides the {@link #panelView panel}.
|
|
123
|
+
*
|
|
124
|
+
* **Note**: When the dropdown gets open, it will attempt to call `focus()` on the first child of its {@link #panelView}.
|
|
125
|
+
* See {@link module:ui/dropdown/utils~addToolbarToDropdown}, {@link module:ui/dropdown/utils~addListToDropdown}, and
|
|
126
|
+
* {@link module:ui/dropdown/utils~focusChildOnDropdownOpen} to learn more about focus management in dropdowns.
|
|
127
|
+
*
|
|
128
|
+
* @observable
|
|
129
|
+
*/
|
|
130
|
+
isOpen: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Controls whether the dropdown is enabled, i.e. it can be clicked and execute an action.
|
|
133
|
+
*
|
|
134
|
+
* See {@link module:ui/button/buttonview~ButtonView#isEnabled}.
|
|
135
|
+
*
|
|
136
|
+
* @observable
|
|
137
|
+
*/
|
|
138
|
+
isEnabled: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* (Optional) The additional CSS class set on the dropdown {@link #element}.
|
|
141
|
+
*
|
|
142
|
+
* @observable
|
|
143
|
+
*/
|
|
144
|
+
class: string | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* (Optional) The `id` attribute of the dropdown (i.e. to pair with a `<label>` element).
|
|
147
|
+
*
|
|
148
|
+
* @observable
|
|
149
|
+
*/
|
|
150
|
+
id: string | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* The position of the panel, relative to the dropdown.
|
|
153
|
+
*
|
|
154
|
+
* **Note**: When `'auto'`, the panel will use one of the remaining positions to stay
|
|
155
|
+
* in the viewport, visible to the user. The positions correspond directly to
|
|
156
|
+
* {@link module:ui/dropdown/dropdownview~DropdownView.defaultPanelPositions default panel positions}.
|
|
157
|
+
*
|
|
158
|
+
* **Note**: This value has an impact on the
|
|
159
|
+
* {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#position} property
|
|
160
|
+
* each time the panel becomes {@link #isOpen open}.
|
|
161
|
+
*
|
|
162
|
+
* @observable
|
|
163
|
+
* @default 'auto'
|
|
164
|
+
*/
|
|
165
|
+
panelPosition: PanelPosition | 'auto';
|
|
166
|
+
/**
|
|
167
|
+
* @observable
|
|
168
|
+
*/
|
|
169
|
+
ariaDescribedById: string | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Creates an instance of the dropdown.
|
|
172
|
+
*
|
|
173
|
+
* Also see {@link #render}.
|
|
174
|
+
*
|
|
175
|
+
* @param locale The localization services instance.
|
|
176
|
+
*/
|
|
177
|
+
constructor(locale: Locale | undefined, buttonView: DropdownButton & FocusableView, panelView: DropdownPanelView);
|
|
178
|
+
/**
|
|
179
|
+
* @inheritDoc
|
|
180
|
+
*/
|
|
181
|
+
render(): void;
|
|
182
|
+
/**
|
|
183
|
+
* Focuses the {@link #buttonView}.
|
|
184
|
+
*/
|
|
185
|
+
focus(): void;
|
|
186
|
+
/**
|
|
187
|
+
* Returns {@link #panelView panel} positions to be used by the
|
|
188
|
+
* {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}
|
|
189
|
+
* utility considering the direction of the language the UI of the editor is displayed in.
|
|
190
|
+
*/
|
|
191
|
+
private get _panelPositions();
|
|
192
|
+
/**
|
|
193
|
+
* A set of positioning functions used by the dropdown view to determine
|
|
194
|
+
* the optimal position (i.e. fitting into the browser viewport) of its
|
|
195
|
+
* {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when
|
|
196
|
+
* {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.
|
|
197
|
+
*
|
|
198
|
+
* The available positioning functions are as follow:
|
|
199
|
+
*
|
|
200
|
+
* **South**
|
|
201
|
+
*
|
|
202
|
+
* * `south`
|
|
203
|
+
*
|
|
204
|
+
* ```
|
|
205
|
+
* [ Button ]
|
|
206
|
+
* +-----------------+
|
|
207
|
+
* | Panel |
|
|
208
|
+
* +-----------------+
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* * `southEast`
|
|
212
|
+
*
|
|
213
|
+
* ```
|
|
214
|
+
* [ Button ]
|
|
215
|
+
* +-----------------+
|
|
216
|
+
* | Panel |
|
|
217
|
+
* +-----------------+
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* * `southWest`
|
|
221
|
+
*
|
|
222
|
+
* ```
|
|
223
|
+
* [ Button ]
|
|
224
|
+
* +-----------------+
|
|
225
|
+
* | Panel |
|
|
226
|
+
* +-----------------+
|
|
227
|
+
* ```
|
|
228
|
+
*
|
|
229
|
+
* * `southMiddleEast`
|
|
230
|
+
*
|
|
231
|
+
* ```
|
|
232
|
+
* [ Button ]
|
|
233
|
+
* +-----------------+
|
|
234
|
+
* | Panel |
|
|
235
|
+
* +-----------------+
|
|
236
|
+
* ```
|
|
237
|
+
*
|
|
238
|
+
* * `southMiddleWest`
|
|
239
|
+
*
|
|
240
|
+
* ```
|
|
241
|
+
* [ Button ]
|
|
242
|
+
* +-----------------+
|
|
243
|
+
* | Panel |
|
|
244
|
+
* +-----------------+
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* **North**
|
|
248
|
+
*
|
|
249
|
+
* * `north`
|
|
250
|
+
*
|
|
251
|
+
* ```
|
|
252
|
+
* +-----------------+
|
|
253
|
+
* | Panel |
|
|
254
|
+
* +-----------------+
|
|
255
|
+
* [ Button ]
|
|
256
|
+
* ```
|
|
257
|
+
*
|
|
258
|
+
* * `northEast`
|
|
259
|
+
*
|
|
260
|
+
* ```
|
|
261
|
+
* +-----------------+
|
|
262
|
+
* | Panel |
|
|
263
|
+
* +-----------------+
|
|
264
|
+
* [ Button ]
|
|
265
|
+
* ```
|
|
266
|
+
*
|
|
267
|
+
* * `northWest`
|
|
268
|
+
*
|
|
269
|
+
* ```
|
|
270
|
+
* +-----------------+
|
|
271
|
+
* | Panel |
|
|
272
|
+
* +-----------------+
|
|
273
|
+
* [ Button ]
|
|
274
|
+
* ```
|
|
275
|
+
*
|
|
276
|
+
* * `northMiddleEast`
|
|
277
|
+
*
|
|
278
|
+
* ```
|
|
279
|
+
* +-----------------+
|
|
280
|
+
* | Panel |
|
|
281
|
+
* +-----------------+
|
|
282
|
+
* [ Button ]
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* * `northMiddleWest`
|
|
286
|
+
*
|
|
287
|
+
* ```
|
|
288
|
+
* +-----------------+
|
|
289
|
+
* | Panel |
|
|
290
|
+
* +-----------------+
|
|
291
|
+
* [ Button ]
|
|
292
|
+
* ```
|
|
293
|
+
*
|
|
294
|
+
* Positioning functions are compatible with {@link module:utils/dom/position~DomPoint}.
|
|
295
|
+
*
|
|
296
|
+
* The name that position function returns will be reflected in dropdown panel's class that
|
|
297
|
+
* controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
|
|
298
|
+
* to learn more.
|
|
299
|
+
*/
|
|
300
|
+
static defaultPanelPositions: Record<string, PositioningFunction>;
|
|
301
|
+
/**
|
|
302
|
+
* A function used to calculate the optimal position for the dropdown panel.
|
|
303
|
+
*/
|
|
304
|
+
private static _getOptimalPosition;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Fired when an item inside the dropdown is executed.
|
|
308
|
+
*
|
|
309
|
+
* **Note**: Only supported when dropdown was integrated with its child view using one of the helper functions:
|
|
310
|
+
* {@link module:ui/dropdown/utils~addListToDropdown}, {@link module:ui/dropdown/utils~addToolbarToDropdown}, or
|
|
311
|
+
* {@link module:ui/dropdown/utils~addMenuToDropdown}.
|
|
312
|
+
*
|
|
313
|
+
* When integrated with a list, it fires when a child of one of {@link module:ui/list/listitemview~ListItemView}s
|
|
314
|
+
* fired `execute` event.
|
|
315
|
+
*
|
|
316
|
+
* When integrated with a toolbar, it fires when one of the buttons has been {@link module:ui/button/button~Button#event:execute executed}.
|
|
317
|
+
*
|
|
318
|
+
* When integrated with a nested menu, it fires when one of the menu buttons has been executed.
|
|
319
|
+
*
|
|
320
|
+
* In each case, the event is delegated from the component which fired it. It does not have additional parameters and `event.source` is the
|
|
321
|
+
* original component.
|
|
322
|
+
*
|
|
323
|
+
* @eventName ~DropdownView#execute
|
|
324
|
+
*/
|
|
325
|
+
export type DropdownViewEvent = {
|
|
326
|
+
name: 'execute';
|
|
327
|
+
args: [];
|
|
328
|
+
};
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module ui/dropdown/dropdownview
|
|
7
|
+
*/
|
|
8
|
+
import View from '../view.js';
|
|
9
|
+
import { KeystrokeHandler, FocusTracker, getOptimalPosition } from '@ckeditor/ckeditor5-utils';
|
|
10
|
+
import '../../theme/components/dropdown/dropdown.css';
|
|
11
|
+
/**
|
|
12
|
+
* The dropdown view class. It manages the dropdown button and dropdown panel.
|
|
13
|
+
*
|
|
14
|
+
* In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}
|
|
15
|
+
* util:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* const dropdown = createDropdown( locale );
|
|
19
|
+
*
|
|
20
|
+
* // Configure dropdown's button properties:
|
|
21
|
+
* dropdown.buttonView.set( {
|
|
22
|
+
* label: 'A dropdown',
|
|
23
|
+
* withText: true
|
|
24
|
+
* } );
|
|
25
|
+
*
|
|
26
|
+
* dropdown.render();
|
|
27
|
+
*
|
|
28
|
+
* dropdown.panelView.element.textContent = 'Content of the panel';
|
|
29
|
+
*
|
|
30
|
+
* // Will render a dropdown with a panel containing a "Content of the panel" text.
|
|
31
|
+
* document.body.appendChild( dropdown.element );
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}
|
|
35
|
+
* and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in
|
|
36
|
+
* {@link module:ui/dropdown/utils~createDropdown} documentation.
|
|
37
|
+
*
|
|
38
|
+
* If you want to create a completely custom dropdown, then you can compose it manually:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* const button = new DropdownButtonView( locale );
|
|
42
|
+
* const panel = new DropdownPanelView( locale );
|
|
43
|
+
* const dropdown = new DropdownView( locale, button, panel );
|
|
44
|
+
*
|
|
45
|
+
* button.set( {
|
|
46
|
+
* label: 'A dropdown',
|
|
47
|
+
* withText: true
|
|
48
|
+
* } );
|
|
49
|
+
*
|
|
50
|
+
* dropdown.render();
|
|
51
|
+
*
|
|
52
|
+
* panel.element.textContent = 'Content of the panel';
|
|
53
|
+
*
|
|
54
|
+
* // Will render a dropdown with a panel containing a "Content of the panel" text.
|
|
55
|
+
* document.body.appendChild( dropdown.element );
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* However, dropdown created this way will contain little behavior. You will need to implement handlers for actions
|
|
59
|
+
* such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}
|
|
60
|
+
* (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what
|
|
61
|
+
* you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.
|
|
62
|
+
*/
|
|
63
|
+
class DropdownView extends View {
|
|
64
|
+
/**
|
|
65
|
+
* Creates an instance of the dropdown.
|
|
66
|
+
*
|
|
67
|
+
* Also see {@link #render}.
|
|
68
|
+
*
|
|
69
|
+
* @param locale The localization services instance.
|
|
70
|
+
*/
|
|
71
|
+
constructor(locale, buttonView, panelView) {
|
|
72
|
+
super(locale);
|
|
73
|
+
const bind = this.bindTemplate;
|
|
74
|
+
this.buttonView = buttonView;
|
|
75
|
+
this.panelView = panelView;
|
|
76
|
+
this.set('isOpen', false);
|
|
77
|
+
this.set('isEnabled', true);
|
|
78
|
+
this.set('class', undefined);
|
|
79
|
+
this.set('id', undefined);
|
|
80
|
+
this.set('panelPosition', 'auto');
|
|
81
|
+
// Toggle the visibility of the panel when the dropdown becomes open.
|
|
82
|
+
this.panelView.bind('isVisible').to(this, 'isOpen');
|
|
83
|
+
this.keystrokes = new KeystrokeHandler();
|
|
84
|
+
this.focusTracker = new FocusTracker();
|
|
85
|
+
this.setTemplate({
|
|
86
|
+
tag: 'div',
|
|
87
|
+
attributes: {
|
|
88
|
+
class: [
|
|
89
|
+
'ck',
|
|
90
|
+
'ck-dropdown',
|
|
91
|
+
bind.to('class'),
|
|
92
|
+
bind.if('isEnabled', 'ck-disabled', value => !value)
|
|
93
|
+
],
|
|
94
|
+
id: bind.to('id'),
|
|
95
|
+
'aria-describedby': bind.to('ariaDescribedById')
|
|
96
|
+
},
|
|
97
|
+
children: [
|
|
98
|
+
buttonView,
|
|
99
|
+
panelView
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
buttonView.extendTemplate({
|
|
103
|
+
attributes: {
|
|
104
|
+
class: [
|
|
105
|
+
'ck-dropdown__button'
|
|
106
|
+
],
|
|
107
|
+
'data-cke-tooltip-disabled': bind.to('isOpen')
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @inheritDoc
|
|
113
|
+
*/
|
|
114
|
+
render() {
|
|
115
|
+
super.render();
|
|
116
|
+
this.focusTracker.add(this.buttonView.element);
|
|
117
|
+
this.focusTracker.add(this.panelView.element);
|
|
118
|
+
// Toggle the dropdown when its button has been clicked.
|
|
119
|
+
this.listenTo(this.buttonView, 'open', () => {
|
|
120
|
+
this.isOpen = !this.isOpen;
|
|
121
|
+
});
|
|
122
|
+
// Let the dropdown control the position of the panel. The position must
|
|
123
|
+
// be updated every time the dropdown is open.
|
|
124
|
+
this.on('change:isOpen', (evt, name, isOpen) => {
|
|
125
|
+
if (!isOpen) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// If "auto", find the best position of the panel to fit into the viewport.
|
|
129
|
+
// Otherwise, simply assign the static position.
|
|
130
|
+
if (this.panelPosition === 'auto') {
|
|
131
|
+
const optimalPanelPosition = DropdownView._getOptimalPosition({
|
|
132
|
+
element: this.panelView.element,
|
|
133
|
+
target: this.buttonView.element,
|
|
134
|
+
fitInViewport: true,
|
|
135
|
+
positions: this._panelPositions
|
|
136
|
+
});
|
|
137
|
+
this.panelView.position = (optimalPanelPosition ? optimalPanelPosition.name : this._panelPositions[0].name);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
this.panelView.position = this.panelPosition;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
// Listen for keystrokes coming from within #element.
|
|
144
|
+
this.keystrokes.listenTo(this.element);
|
|
145
|
+
const closeDropdown = (data, cancel) => {
|
|
146
|
+
if (this.isOpen) {
|
|
147
|
+
this.isOpen = false;
|
|
148
|
+
cancel();
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
// Open the dropdown panel using the arrow down key, just like with return or space.
|
|
152
|
+
this.keystrokes.set('arrowdown', (data, cancel) => {
|
|
153
|
+
// Don't open if the dropdown is disabled or already open.
|
|
154
|
+
if (this.buttonView.isEnabled && !this.isOpen) {
|
|
155
|
+
this.isOpen = true;
|
|
156
|
+
cancel();
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
// Block the right arrow key (until nested dropdowns are implemented).
|
|
160
|
+
this.keystrokes.set('arrowright', (data, cancel) => {
|
|
161
|
+
if (this.isOpen) {
|
|
162
|
+
cancel();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
// Close the dropdown using the arrow left/escape key.
|
|
166
|
+
this.keystrokes.set('arrowleft', closeDropdown);
|
|
167
|
+
this.keystrokes.set('esc', closeDropdown);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Focuses the {@link #buttonView}.
|
|
171
|
+
*/
|
|
172
|
+
focus() {
|
|
173
|
+
this.buttonView.focus();
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Returns {@link #panelView panel} positions to be used by the
|
|
177
|
+
* {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}
|
|
178
|
+
* utility considering the direction of the language the UI of the editor is displayed in.
|
|
179
|
+
*/
|
|
180
|
+
get _panelPositions() {
|
|
181
|
+
const { south, north, southEast, southWest, northEast, northWest, southMiddleEast, southMiddleWest, northMiddleEast, northMiddleWest } = DropdownView.defaultPanelPositions;
|
|
182
|
+
if (this.locale.uiLanguageDirection !== 'rtl') {
|
|
183
|
+
return [
|
|
184
|
+
southEast, southWest, southMiddleEast, southMiddleWest, south,
|
|
185
|
+
northEast, northWest, northMiddleEast, northMiddleWest, north
|
|
186
|
+
];
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
return [
|
|
190
|
+
southWest, southEast, southMiddleWest, southMiddleEast, south,
|
|
191
|
+
northWest, northEast, northMiddleWest, northMiddleEast, north
|
|
192
|
+
];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* A set of positioning functions used by the dropdown view to determine
|
|
198
|
+
* the optimal position (i.e. fitting into the browser viewport) of its
|
|
199
|
+
* {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when
|
|
200
|
+
* {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.
|
|
201
|
+
*
|
|
202
|
+
* The available positioning functions are as follow:
|
|
203
|
+
*
|
|
204
|
+
* **South**
|
|
205
|
+
*
|
|
206
|
+
* * `south`
|
|
207
|
+
*
|
|
208
|
+
* ```
|
|
209
|
+
* [ Button ]
|
|
210
|
+
* +-----------------+
|
|
211
|
+
* | Panel |
|
|
212
|
+
* +-----------------+
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* * `southEast`
|
|
216
|
+
*
|
|
217
|
+
* ```
|
|
218
|
+
* [ Button ]
|
|
219
|
+
* +-----------------+
|
|
220
|
+
* | Panel |
|
|
221
|
+
* +-----------------+
|
|
222
|
+
* ```
|
|
223
|
+
*
|
|
224
|
+
* * `southWest`
|
|
225
|
+
*
|
|
226
|
+
* ```
|
|
227
|
+
* [ Button ]
|
|
228
|
+
* +-----------------+
|
|
229
|
+
* | Panel |
|
|
230
|
+
* +-----------------+
|
|
231
|
+
* ```
|
|
232
|
+
*
|
|
233
|
+
* * `southMiddleEast`
|
|
234
|
+
*
|
|
235
|
+
* ```
|
|
236
|
+
* [ Button ]
|
|
237
|
+
* +-----------------+
|
|
238
|
+
* | Panel |
|
|
239
|
+
* +-----------------+
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* * `southMiddleWest`
|
|
243
|
+
*
|
|
244
|
+
* ```
|
|
245
|
+
* [ Button ]
|
|
246
|
+
* +-----------------+
|
|
247
|
+
* | Panel |
|
|
248
|
+
* +-----------------+
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* **North**
|
|
252
|
+
*
|
|
253
|
+
* * `north`
|
|
254
|
+
*
|
|
255
|
+
* ```
|
|
256
|
+
* +-----------------+
|
|
257
|
+
* | Panel |
|
|
258
|
+
* +-----------------+
|
|
259
|
+
* [ Button ]
|
|
260
|
+
* ```
|
|
261
|
+
*
|
|
262
|
+
* * `northEast`
|
|
263
|
+
*
|
|
264
|
+
* ```
|
|
265
|
+
* +-----------------+
|
|
266
|
+
* | Panel |
|
|
267
|
+
* +-----------------+
|
|
268
|
+
* [ Button ]
|
|
269
|
+
* ```
|
|
270
|
+
*
|
|
271
|
+
* * `northWest`
|
|
272
|
+
*
|
|
273
|
+
* ```
|
|
274
|
+
* +-----------------+
|
|
275
|
+
* | Panel |
|
|
276
|
+
* +-----------------+
|
|
277
|
+
* [ Button ]
|
|
278
|
+
* ```
|
|
279
|
+
*
|
|
280
|
+
* * `northMiddleEast`
|
|
281
|
+
*
|
|
282
|
+
* ```
|
|
283
|
+
* +-----------------+
|
|
284
|
+
* | Panel |
|
|
285
|
+
* +-----------------+
|
|
286
|
+
* [ Button ]
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* * `northMiddleWest`
|
|
290
|
+
*
|
|
291
|
+
* ```
|
|
292
|
+
* +-----------------+
|
|
293
|
+
* | Panel |
|
|
294
|
+
* +-----------------+
|
|
295
|
+
* [ Button ]
|
|
296
|
+
* ```
|
|
297
|
+
*
|
|
298
|
+
* Positioning functions are compatible with {@link module:utils/dom/position~DomPoint}.
|
|
299
|
+
*
|
|
300
|
+
* The name that position function returns will be reflected in dropdown panel's class that
|
|
301
|
+
* controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}
|
|
302
|
+
* to learn more.
|
|
303
|
+
*/
|
|
304
|
+
DropdownView.defaultPanelPositions = {
|
|
305
|
+
south: (buttonRect, panelRect) => {
|
|
306
|
+
return {
|
|
307
|
+
top: buttonRect.bottom,
|
|
308
|
+
left: buttonRect.left - (panelRect.width - buttonRect.width) / 2,
|
|
309
|
+
name: 's'
|
|
310
|
+
};
|
|
311
|
+
},
|
|
312
|
+
southEast: buttonRect => {
|
|
313
|
+
return {
|
|
314
|
+
top: buttonRect.bottom,
|
|
315
|
+
left: buttonRect.left,
|
|
316
|
+
name: 'se'
|
|
317
|
+
};
|
|
318
|
+
},
|
|
319
|
+
southWest: (buttonRect, panelRect) => {
|
|
320
|
+
return {
|
|
321
|
+
top: buttonRect.bottom,
|
|
322
|
+
left: buttonRect.left - panelRect.width + buttonRect.width,
|
|
323
|
+
name: 'sw'
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
southMiddleEast: (buttonRect, panelRect) => {
|
|
327
|
+
return {
|
|
328
|
+
top: buttonRect.bottom,
|
|
329
|
+
left: buttonRect.left - (panelRect.width - buttonRect.width) / 4,
|
|
330
|
+
name: 'sme'
|
|
331
|
+
};
|
|
332
|
+
},
|
|
333
|
+
southMiddleWest: (buttonRect, panelRect) => {
|
|
334
|
+
return {
|
|
335
|
+
top: buttonRect.bottom,
|
|
336
|
+
left: buttonRect.left - (panelRect.width - buttonRect.width) * 3 / 4,
|
|
337
|
+
name: 'smw'
|
|
338
|
+
};
|
|
339
|
+
},
|
|
340
|
+
north: (buttonRect, panelRect) => {
|
|
341
|
+
return {
|
|
342
|
+
top: buttonRect.top - panelRect.height,
|
|
343
|
+
left: buttonRect.left - (panelRect.width - buttonRect.width) / 2,
|
|
344
|
+
name: 'n'
|
|
345
|
+
};
|
|
346
|
+
},
|
|
347
|
+
northEast: (buttonRect, panelRect) => {
|
|
348
|
+
return {
|
|
349
|
+
top: buttonRect.top - panelRect.height,
|
|
350
|
+
left: buttonRect.left,
|
|
351
|
+
name: 'ne'
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
northWest: (buttonRect, panelRect) => {
|
|
355
|
+
return {
|
|
356
|
+
top: buttonRect.top - panelRect.height,
|
|
357
|
+
left: buttonRect.left - panelRect.width + buttonRect.width,
|
|
358
|
+
name: 'nw'
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
northMiddleEast: (buttonRect, panelRect) => {
|
|
362
|
+
return {
|
|
363
|
+
top: buttonRect.top - panelRect.height,
|
|
364
|
+
left: buttonRect.left - (panelRect.width - buttonRect.width) / 4,
|
|
365
|
+
name: 'nme'
|
|
366
|
+
};
|
|
367
|
+
},
|
|
368
|
+
northMiddleWest: (buttonRect, panelRect) => {
|
|
369
|
+
return {
|
|
370
|
+
top: buttonRect.top - panelRect.height,
|
|
371
|
+
left: buttonRect.left - (panelRect.width - buttonRect.width) * 3 / 4,
|
|
372
|
+
name: 'nmw'
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* A function used to calculate the optimal position for the dropdown panel.
|
|
378
|
+
*/
|
|
379
|
+
DropdownView._getOptimalPosition = getOptimalPosition;
|
|
380
|
+
export default DropdownView;
|