@ckeditor/ckeditor5-ui 47.6.1-alpha.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,246 +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/panel/sticky/stickypanelview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../../view.js';
|
|
9
|
-
import { Template } from '../../template.js';
|
|
10
|
-
import { Rect, toUnit, getVisualViewportOffset, global } from '@ckeditor/ckeditor5-utils';
|
|
11
|
-
// @if CK_DEBUG_STICKYPANEL // const {
|
|
12
|
-
// @if CK_DEBUG_STICKYPANEL // default: RectDrawer,
|
|
13
|
-
// @if CK_DEBUG_STICKYPANEL // diagonalStylesBlack
|
|
14
|
-
// @if CK_DEBUG_STICKYPANEL // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );
|
|
15
|
-
import '../../../theme/components/panel/stickypanel.css';
|
|
16
|
-
const toPx = /* #__PURE__ */ toUnit('px');
|
|
17
|
-
/**
|
|
18
|
-
* The sticky panel view class.
|
|
19
|
-
*/
|
|
20
|
-
export class StickyPanelView extends View {
|
|
21
|
-
/**
|
|
22
|
-
* Collection of the child views which creates balloon panel contents.
|
|
23
|
-
*/
|
|
24
|
-
content;
|
|
25
|
-
/**
|
|
26
|
-
* The panel which accepts children into {@link #content} collection.
|
|
27
|
-
* Also an element which is positioned when {@link #isSticky}.
|
|
28
|
-
*/
|
|
29
|
-
contentPanelElement;
|
|
30
|
-
/**
|
|
31
|
-
* A dummy element which visually fills the space as long as the
|
|
32
|
-
* actual panel is sticky. It prevents flickering of the UI.
|
|
33
|
-
*/
|
|
34
|
-
_contentPanelPlaceholder;
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
constructor(locale) {
|
|
39
|
-
super(locale);
|
|
40
|
-
const bind = this.bindTemplate;
|
|
41
|
-
this.set('isActive', false);
|
|
42
|
-
this.set('isSticky', false);
|
|
43
|
-
this.set('limiterElement', null);
|
|
44
|
-
this.set('limiterBottomOffset', 50);
|
|
45
|
-
this.set('viewportTopOffset', 0);
|
|
46
|
-
this.set('_marginLeft', null);
|
|
47
|
-
this.set('_isStickyToTheBottomOfLimiter', false);
|
|
48
|
-
this.set('_stickyTopOffset', null);
|
|
49
|
-
this.set('_stickyBottomOffset', null);
|
|
50
|
-
this.content = this.createCollection();
|
|
51
|
-
this._contentPanelPlaceholder = new Template({
|
|
52
|
-
tag: 'div',
|
|
53
|
-
attributes: {
|
|
54
|
-
class: [
|
|
55
|
-
'ck',
|
|
56
|
-
'ck-sticky-panel__placeholder'
|
|
57
|
-
],
|
|
58
|
-
style: {
|
|
59
|
-
display: bind.to('isSticky', isSticky => isSticky ? 'block' : 'none'),
|
|
60
|
-
height: bind.to('isSticky', isSticky => {
|
|
61
|
-
return isSticky ? toPx(this._contentPanelRect.height) : null;
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}).render();
|
|
66
|
-
this.contentPanelElement = new Template({
|
|
67
|
-
tag: 'div',
|
|
68
|
-
attributes: {
|
|
69
|
-
class: [
|
|
70
|
-
'ck',
|
|
71
|
-
'ck-sticky-panel__content',
|
|
72
|
-
// Toggle class of the panel when "sticky" state changes in the view.
|
|
73
|
-
bind.if('isSticky', 'ck-sticky-panel__content_sticky'),
|
|
74
|
-
bind.if('_isStickyToTheBottomOfLimiter', 'ck-sticky-panel__content_sticky_bottom-limit')
|
|
75
|
-
],
|
|
76
|
-
style: {
|
|
77
|
-
width: bind.to('isSticky', isSticky => {
|
|
78
|
-
return isSticky ? toPx(this._contentPanelPlaceholder.getBoundingClientRect().width) : null;
|
|
79
|
-
}),
|
|
80
|
-
top: bind.to('_stickyTopOffset', value => value ? toPx(value) : value),
|
|
81
|
-
bottom: bind.to('_stickyBottomOffset', value => value ? toPx(value) : value),
|
|
82
|
-
marginLeft: bind.to('_marginLeft')
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
children: this.content
|
|
86
|
-
}).render();
|
|
87
|
-
this.setTemplate({
|
|
88
|
-
tag: 'div',
|
|
89
|
-
attributes: {
|
|
90
|
-
class: [
|
|
91
|
-
'ck',
|
|
92
|
-
'ck-sticky-panel'
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
children: [
|
|
96
|
-
this._contentPanelPlaceholder,
|
|
97
|
-
this.contentPanelElement
|
|
98
|
-
]
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* @inheritDoc
|
|
103
|
-
*/
|
|
104
|
-
render() {
|
|
105
|
-
super.render();
|
|
106
|
-
// Check if the panel should go into the sticky state immediately.
|
|
107
|
-
this.checkIfShouldBeSticky();
|
|
108
|
-
// Update sticky state of the panel as the window and ancestors are being scrolled.
|
|
109
|
-
this.listenTo(global.document, 'scroll', () => {
|
|
110
|
-
this.checkIfShouldBeSticky();
|
|
111
|
-
}, { useCapture: true });
|
|
112
|
-
// Synchronize with `model.isActive` because sticking an inactive panel is pointless.
|
|
113
|
-
this.listenTo(this, 'change:isActive', () => {
|
|
114
|
-
this.checkIfShouldBeSticky();
|
|
115
|
-
});
|
|
116
|
-
if (global.window.visualViewport) {
|
|
117
|
-
this.listenTo(global.window.visualViewport, 'scroll', () => {
|
|
118
|
-
this.checkIfShouldBeSticky();
|
|
119
|
-
});
|
|
120
|
-
this.listenTo(global.window.visualViewport, 'resize', () => {
|
|
121
|
-
this.checkIfShouldBeSticky();
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Analyzes the environment to decide whether the panel should be sticky or not.
|
|
127
|
-
* Then handles the positioning of the panel.
|
|
128
|
-
*/
|
|
129
|
-
checkIfShouldBeSticky() {
|
|
130
|
-
// @if CK_DEBUG_STICKYPANEL // RectDrawer.clear();
|
|
131
|
-
if (!this.limiterElement || !this.isActive) {
|
|
132
|
-
this._unstick();
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const limiterRect = new Rect(this.limiterElement);
|
|
136
|
-
let visibleLimiterRect = limiterRect.getVisible();
|
|
137
|
-
if (visibleLimiterRect) {
|
|
138
|
-
const windowRect = new Rect(global.window);
|
|
139
|
-
windowRect.top += this.viewportTopOffset;
|
|
140
|
-
windowRect.height -= this.viewportTopOffset;
|
|
141
|
-
visibleLimiterRect = visibleLimiterRect.getIntersection(windowRect);
|
|
142
|
-
}
|
|
143
|
-
const { left: visualViewportOffsetLeft, top: visualViewportOffsetTop } = getVisualViewportOffset();
|
|
144
|
-
limiterRect.moveBy(visualViewportOffsetLeft, visualViewportOffsetTop);
|
|
145
|
-
if (visibleLimiterRect) {
|
|
146
|
-
visibleLimiterRect.moveBy(visualViewportOffsetLeft, visualViewportOffsetTop);
|
|
147
|
-
}
|
|
148
|
-
// Stick the panel only if
|
|
149
|
-
// * the limiter's ancestors are intersecting with each other so that some of their rects are visible,
|
|
150
|
-
// * and the limiter's top edge is above the visible ancestors' top edge.
|
|
151
|
-
if (visibleLimiterRect && limiterRect.top < visibleLimiterRect.top) {
|
|
152
|
-
// Check if there's a change the panel can be sticky to the bottom of the limiter.
|
|
153
|
-
if (this._contentPanelRect.height + this.limiterBottomOffset > visibleLimiterRect.height) {
|
|
154
|
-
const stickyBottomOffset = Math.max(limiterRect.bottom - visibleLimiterRect.bottom, 0) + this.limiterBottomOffset;
|
|
155
|
-
// @if CK_DEBUG_STICKYPANEL // const stickyBottomOffsetRect = new Rect( {
|
|
156
|
-
// @if CK_DEBUG_STICKYPANEL // top: limiterRect.bottom - stickyBottomOffset, left: 0, right: 2000,
|
|
157
|
-
// @if CK_DEBUG_STICKYPANEL // bottom: limiterRect.bottom - stickyBottomOffset, width: 2000, height: 1
|
|
158
|
-
// @if CK_DEBUG_STICKYPANEL // } );
|
|
159
|
-
// @if CK_DEBUG_STICKYPANEL // RectDrawer.draw( stickyBottomOffsetRect,
|
|
160
|
-
// @if CK_DEBUG_STICKYPANEL // { outlineWidth: '1px', opacity: '.8', outlineColor: 'black' },
|
|
161
|
-
// @if CK_DEBUG_STICKYPANEL // 'Sticky bottom offset',
|
|
162
|
-
// @if CK_DEBUG_STICKYPANEL // { visualViewportOrigin: true }
|
|
163
|
-
// @if CK_DEBUG_STICKYPANEL // );
|
|
164
|
-
// Check if sticking the panel to the bottom of the limiter does not cause it to suddenly
|
|
165
|
-
// move upwards if there's not enough space for it.
|
|
166
|
-
// To avoid toolbar flickering we are adding 1 for potential style change (sticky has all borders set,
|
|
167
|
-
// non-sticky lacks bottom border).
|
|
168
|
-
if (this._contentPanelRect.height + stickyBottomOffset + 1 < limiterRect.height) {
|
|
169
|
-
this._stickToBottomOfLimiter(stickyBottomOffset);
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
this._unstick();
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
else if (this._contentPanelRect.height + this.limiterBottomOffset < limiterRect.height) {
|
|
176
|
-
this._stickToTopOfAncestors(visibleLimiterRect.top);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
this._unstick();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
this._unstick();
|
|
184
|
-
}
|
|
185
|
-
// @if CK_DEBUG_STICKYPANEL // console.clear();
|
|
186
|
-
// @if CK_DEBUG_STICKYPANEL // console.log( 'isSticky', this.isSticky );
|
|
187
|
-
// @if CK_DEBUG_STICKYPANEL // console.log( '_isStickyToTheBottomOfLimiter', this._isStickyToTheBottomOfLimiter );
|
|
188
|
-
// @if CK_DEBUG_STICKYPANEL // console.log( '_stickyTopOffset', this._stickyTopOffset );
|
|
189
|
-
// @if CK_DEBUG_STICKYPANEL // console.log( '_stickyBottomOffset', this._stickyBottomOffset );
|
|
190
|
-
// @if CK_DEBUG_STICKYPANEL // if ( visibleLimiterRect ) {
|
|
191
|
-
// @if CK_DEBUG_STICKYPANEL // RectDrawer.draw( visibleLimiterRect,
|
|
192
|
-
// @if CK_DEBUG_STICKYPANEL // { ...diagonalStylesBlack,
|
|
193
|
-
// @if CK_DEBUG_STICKYPANEL // outlineWidth: '3px', opacity: '.8', outlineColor: 'orange', outlineOffset: '-3px',
|
|
194
|
-
// @if CK_DEBUG_STICKYPANEL // backgroundColor: 'rgba(0, 0, 255, .2)', zIndex: 2000 },
|
|
195
|
-
// @if CK_DEBUG_STICKYPANEL // 'visibleLimiterRect',
|
|
196
|
-
// @if CK_DEBUG_STICKYPANEL // { visualViewportOrigin: true }
|
|
197
|
-
// @if CK_DEBUG_STICKYPANEL // );
|
|
198
|
-
// @if CK_DEBUG_STICKYPANEL // }
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Sticks the panel at the given CSS `top` offset.
|
|
202
|
-
*
|
|
203
|
-
* @private
|
|
204
|
-
* @param topOffset
|
|
205
|
-
*/
|
|
206
|
-
_stickToTopOfAncestors(topOffset) {
|
|
207
|
-
this.isSticky = true;
|
|
208
|
-
this._isStickyToTheBottomOfLimiter = false;
|
|
209
|
-
this._stickyTopOffset = topOffset;
|
|
210
|
-
this._stickyBottomOffset = null;
|
|
211
|
-
this._marginLeft = toPx(-global.window.scrollX + getVisualViewportOffset().left);
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Sticks the panel at the bottom of the limiter with a given CSS `bottom` offset.
|
|
215
|
-
*
|
|
216
|
-
* @private
|
|
217
|
-
* @param stickyBottomOffset
|
|
218
|
-
*/
|
|
219
|
-
_stickToBottomOfLimiter(stickyBottomOffset) {
|
|
220
|
-
this.isSticky = true;
|
|
221
|
-
this._isStickyToTheBottomOfLimiter = true;
|
|
222
|
-
this._stickyTopOffset = null;
|
|
223
|
-
this._stickyBottomOffset = stickyBottomOffset;
|
|
224
|
-
this._marginLeft = toPx(-global.window.scrollX + getVisualViewportOffset().left);
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Unsticks the panel putting it back to its original position.
|
|
228
|
-
*
|
|
229
|
-
* @private
|
|
230
|
-
*/
|
|
231
|
-
_unstick() {
|
|
232
|
-
this.isSticky = false;
|
|
233
|
-
this._isStickyToTheBottomOfLimiter = false;
|
|
234
|
-
this._stickyTopOffset = null;
|
|
235
|
-
this._stickyBottomOffset = null;
|
|
236
|
-
this._marginLeft = null;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Returns the bounding rect of the {@link #contentPanelElement}.
|
|
240
|
-
*
|
|
241
|
-
* @private
|
|
242
|
-
*/
|
|
243
|
-
get _contentPanelRect() {
|
|
244
|
-
return new Rect(this.contentPanelElement);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
@@ -1,38 +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
|
-
* A filter function that returns matching item and group names in the list view.
|
|
7
|
-
*/
|
|
8
|
-
export function filterGroupAndItemNames(regExp, items) {
|
|
9
|
-
let totalItemsCount = 0;
|
|
10
|
-
let resultsCount = 0;
|
|
11
|
-
for (const groupView of items) {
|
|
12
|
-
const group = groupView;
|
|
13
|
-
const groupItems = group.items;
|
|
14
|
-
const isGroupLabelMatching = regExp && !!group.label.match(regExp);
|
|
15
|
-
group.labelView.highlightText(isGroupLabelMatching ? regExp : null);
|
|
16
|
-
for (const listItemView of groupItems) {
|
|
17
|
-
const buttonView = listItemView.children.first;
|
|
18
|
-
const labelView = buttonView.labelView;
|
|
19
|
-
if (!regExp) {
|
|
20
|
-
listItemView.isVisible = true;
|
|
21
|
-
labelView.highlightText(null);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const isItemLabelMatching = !!buttonView.label.match(regExp);
|
|
25
|
-
labelView.highlightText(isItemLabelMatching ? regExp : null);
|
|
26
|
-
listItemView.isVisible = isGroupLabelMatching || isItemLabelMatching;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const visibleInGroupCount = groupItems.filter(listItemView => listItemView.isVisible).length;
|
|
30
|
-
totalItemsCount += group.items.length;
|
|
31
|
-
resultsCount += isGroupLabelMatching ? group.items.length : visibleInGroupCount;
|
|
32
|
-
group.isVisible = isGroupLabelMatching || !!visibleInGroupCount;
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
resultsCount,
|
|
36
|
-
totalItemsCount
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,59 +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
|
-
/**
|
|
7
|
-
* A view displaying an information text related to different states of {@link module:ui/search/text/searchtextview~SearchTextView}.
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export class SearchInfoView extends View {
|
|
12
|
-
/**
|
|
13
|
-
* @inheritDoc
|
|
14
|
-
*/
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
const bind = this.bindTemplate;
|
|
18
|
-
this.set({
|
|
19
|
-
isVisible: false,
|
|
20
|
-
primaryText: '',
|
|
21
|
-
secondaryText: ''
|
|
22
|
-
});
|
|
23
|
-
this.setTemplate({
|
|
24
|
-
tag: 'div',
|
|
25
|
-
attributes: {
|
|
26
|
-
class: [
|
|
27
|
-
'ck',
|
|
28
|
-
'ck-search__info',
|
|
29
|
-
bind.if('isVisible', 'ck-hidden', value => !value)
|
|
30
|
-
],
|
|
31
|
-
tabindex: -1
|
|
32
|
-
},
|
|
33
|
-
children: [
|
|
34
|
-
{
|
|
35
|
-
tag: 'span',
|
|
36
|
-
children: [
|
|
37
|
-
{
|
|
38
|
-
text: [bind.to('primaryText')]
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
tag: 'span',
|
|
44
|
-
children: [
|
|
45
|
-
{
|
|
46
|
-
text: [bind.to('secondaryText')]
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Focuses the view
|
|
55
|
-
*/
|
|
56
|
-
focus() {
|
|
57
|
-
this.element.focus();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,83 +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/search/searchresultsview
|
|
7
|
-
*/
|
|
8
|
-
import { View } from '../view.js';
|
|
9
|
-
import { FocusTracker } from '@ckeditor/ckeditor5-utils';
|
|
10
|
-
import { FocusCycler } from '../focuscycler.js';
|
|
11
|
-
/**
|
|
12
|
-
* A sub-component of {@link module:ui/search/text/searchtextview~SearchTextView}. It hosts the filtered and the information views.
|
|
13
|
-
*/
|
|
14
|
-
export class SearchResultsView extends View {
|
|
15
|
-
/**
|
|
16
|
-
* Tracks information about the DOM focus in the view.
|
|
17
|
-
*
|
|
18
|
-
* @readonly
|
|
19
|
-
*/
|
|
20
|
-
focusTracker;
|
|
21
|
-
/**
|
|
22
|
-
* The collection of the child views inside of the list item {@link #element}.
|
|
23
|
-
*
|
|
24
|
-
* @readonly
|
|
25
|
-
*/
|
|
26
|
-
children;
|
|
27
|
-
/**
|
|
28
|
-
* Provides the focus management (keyboard navigation) in the view.
|
|
29
|
-
*
|
|
30
|
-
* @readonly
|
|
31
|
-
*/
|
|
32
|
-
_focusCycler;
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
constructor(locale) {
|
|
37
|
-
super(locale);
|
|
38
|
-
this.children = this.createCollection();
|
|
39
|
-
this.focusTracker = new FocusTracker();
|
|
40
|
-
this.setTemplate({
|
|
41
|
-
tag: 'div',
|
|
42
|
-
attributes: {
|
|
43
|
-
class: [
|
|
44
|
-
'ck',
|
|
45
|
-
'ck-search__results'
|
|
46
|
-
],
|
|
47
|
-
tabindex: -1
|
|
48
|
-
},
|
|
49
|
-
children: this.children
|
|
50
|
-
});
|
|
51
|
-
this._focusCycler = new FocusCycler({
|
|
52
|
-
focusables: this.children,
|
|
53
|
-
focusTracker: this.focusTracker
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @inheritDoc
|
|
58
|
-
*/
|
|
59
|
-
render() {
|
|
60
|
-
super.render();
|
|
61
|
-
for (const child of this.children) {
|
|
62
|
-
this.focusTracker.add(child.element);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Focuses the view.
|
|
67
|
-
*/
|
|
68
|
-
focus() {
|
|
69
|
-
this._focusCycler.focusFirst();
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Focuses the first child view.
|
|
73
|
-
*/
|
|
74
|
-
focusFirst() {
|
|
75
|
-
this._focusCycler.focusFirst();
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Focuses the last child view.
|
|
79
|
-
*/
|
|
80
|
-
focusLast() {
|
|
81
|
-
this._focusCycler.focusLast();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,87 +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/search/text/searchtextqueryview
|
|
7
|
-
*/
|
|
8
|
-
import { IconCancel, IconLoupe } from '@ckeditor/ckeditor5-icons';
|
|
9
|
-
import { ButtonView } from '../../button/buttonview.js';
|
|
10
|
-
import { IconView } from '../../icon/iconview.js';
|
|
11
|
-
import { LabeledFieldView } from '../../labeledfield/labeledfieldview.js';
|
|
12
|
-
import { createLabeledInputText } from '../../labeledfield/utils.js';
|
|
13
|
-
/**
|
|
14
|
-
* A search input field for the {@link module:ui/search/text/searchtextview~SearchTextView} component.
|
|
15
|
-
*
|
|
16
|
-
* @internal
|
|
17
|
-
* @extends module:ui/labeledfield/labeledfieldview~LabeledFieldView
|
|
18
|
-
*/
|
|
19
|
-
export class SearchTextQueryView extends LabeledFieldView {
|
|
20
|
-
/**
|
|
21
|
-
* The loupe icon displayed next to the {@link #fieldView}.
|
|
22
|
-
*/
|
|
23
|
-
iconView;
|
|
24
|
-
/**
|
|
25
|
-
* The button that clears and focuses the {@link #fieldView}.
|
|
26
|
-
*/
|
|
27
|
-
resetButtonView;
|
|
28
|
-
/**
|
|
29
|
-
* A reference to the view configuration.
|
|
30
|
-
*/
|
|
31
|
-
_viewConfig;
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
constructor(locale, config) {
|
|
36
|
-
const t = locale.t;
|
|
37
|
-
const viewConfig = Object.assign({}, {
|
|
38
|
-
showResetButton: true,
|
|
39
|
-
showIcon: true,
|
|
40
|
-
creator: createLabeledInputText
|
|
41
|
-
}, config);
|
|
42
|
-
super(locale, viewConfig.creator);
|
|
43
|
-
this.label = config.label;
|
|
44
|
-
this._viewConfig = viewConfig;
|
|
45
|
-
if (this._viewConfig.showIcon) {
|
|
46
|
-
this.iconView = new IconView();
|
|
47
|
-
this.iconView.content = IconLoupe;
|
|
48
|
-
this.fieldWrapperChildren.add(this.iconView, 0);
|
|
49
|
-
this.extendTemplate({
|
|
50
|
-
attributes: {
|
|
51
|
-
class: 'ck-search__query_with-icon'
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (this._viewConfig.showResetButton) {
|
|
56
|
-
this.resetButtonView = new ButtonView(locale);
|
|
57
|
-
this.resetButtonView.set({
|
|
58
|
-
label: t('Clear'),
|
|
59
|
-
icon: IconCancel,
|
|
60
|
-
class: 'ck-search__reset',
|
|
61
|
-
isVisible: false,
|
|
62
|
-
tooltip: true
|
|
63
|
-
});
|
|
64
|
-
this.resetButtonView.on('execute', () => {
|
|
65
|
-
this.reset();
|
|
66
|
-
this.focus();
|
|
67
|
-
this.fire('reset');
|
|
68
|
-
});
|
|
69
|
-
this.resetButtonView.bind('isVisible').to(this.fieldView, 'isEmpty', isEmpty => !isEmpty);
|
|
70
|
-
this.fieldWrapperChildren.add(this.resetButtonView);
|
|
71
|
-
this.extendTemplate({
|
|
72
|
-
attributes: {
|
|
73
|
-
class: 'ck-search__query_with-reset'
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Resets the search field to its default state.
|
|
80
|
-
*/
|
|
81
|
-
reset() {
|
|
82
|
-
this.fieldView.reset();
|
|
83
|
-
if (this._viewConfig.showResetButton) {
|
|
84
|
-
this.resetButtonView.isVisible = false;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|