@ckeditor/ckeditor5-ui 48.2.0-alpha.7 → 48.3.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.
Files changed (117) hide show
  1. package/dist/arialiveannouncer.d.ts +90 -90
  2. package/dist/augmentation.d.ts +86 -86
  3. package/dist/autocomplete/autocompleteview.d.ts +70 -70
  4. package/dist/badge/badge.d.ts +119 -121
  5. package/dist/bindings/addkeyboardhandlingforgrid.d.ts +22 -22
  6. package/dist/bindings/clickoutsidehandler.d.ts +25 -25
  7. package/dist/bindings/csstransitiondisablermixin.d.ts +47 -36
  8. package/dist/bindings/draggableviewmixin.d.ts +45 -37
  9. package/dist/bindings/preventdefault.d.ts +30 -30
  10. package/dist/bindings/submithandler.d.ts +49 -49
  11. package/dist/button/button.d.ts +167 -167
  12. package/dist/button/buttonlabel.d.ts +28 -28
  13. package/dist/button/buttonlabelview.d.ts +26 -26
  14. package/dist/button/buttonview.d.ts +192 -192
  15. package/dist/button/filedialogbuttonview.d.ts +107 -99
  16. package/dist/button/listitembuttonview.d.ts +73 -73
  17. package/dist/button/switchbuttonview.d.ts +40 -40
  18. package/dist/collapsible/collapsibleview.d.ts +63 -63
  19. package/dist/colorgrid/colorgridview.d.ts +117 -117
  20. package/dist/colorgrid/colortileview.d.ts +21 -21
  21. package/dist/colorgrid/utils.d.ts +35 -35
  22. package/dist/colorpicker/colorpickerview.d.ts +155 -157
  23. package/dist/colorpicker/utils.d.ts +37 -37
  24. package/dist/colorselector/colorgridsfragmentview.d.ts +191 -191
  25. package/dist/colorselector/colorpickerfragmentview.d.ts +129 -129
  26. package/dist/colorselector/colorselectorview.d.ts +227 -229
  27. package/dist/colorselector/documentcolorcollection.d.ts +52 -59
  28. package/dist/componentfactory.d.ts +76 -76
  29. package/dist/dialog/dialog.d.ts +311 -288
  30. package/dist/dialog/dialogactionsview.d.ts +62 -62
  31. package/dist/dialog/dialogcontentview.d.ts +22 -22
  32. package/dist/dialog/dialogview.d.ts +255 -251
  33. package/dist/dropdown/button/dropdownbutton.d.ts +17 -17
  34. package/dist/dropdown/button/dropdownbuttonview.d.ts +41 -41
  35. package/dist/dropdown/button/splitbuttonview.d.ts +155 -155
  36. package/dist/dropdown/dropdownpanelfocusable.d.ts +16 -16
  37. package/dist/dropdown/dropdownpanelview.d.ts +56 -56
  38. package/dist/dropdown/dropdownview.d.ts +326 -326
  39. package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +43 -43
  40. package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +29 -29
  41. package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +12 -12
  42. package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +17 -17
  43. package/dist/dropdown/menu/dropdownmenulistview.d.ts +19 -19
  44. package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +28 -28
  45. package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +126 -126
  46. package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +132 -132
  47. package/dist/dropdown/menu/utils.d.ts +112 -112
  48. package/dist/dropdown/utils.d.ts +272 -272
  49. package/dist/editableui/editableuiview.d.ts +78 -78
  50. package/dist/editableui/inline/inlineeditableuiview.d.ts +38 -38
  51. package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +50 -50
  52. package/dist/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +30 -30
  53. package/dist/editorui/bodycollection.d.ts +86 -86
  54. package/dist/editorui/boxed/boxededitoruiview.d.ts +35 -35
  55. package/dist/editorui/editorui.d.ts +348 -351
  56. package/dist/editorui/editoruiview.d.ts +53 -53
  57. package/dist/editorui/evaluationbadge.d.ts +28 -28
  58. package/dist/editorui/poweredby.d.ts +25 -25
  59. package/dist/focuscycler.d.ts +265 -270
  60. package/dist/formheader/formheaderview.d.ts +53 -53
  61. package/dist/formrow/formrowview.d.ts +52 -52
  62. package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +25 -25
  63. package/dist/highlightedtext/highlightedtextview.d.ts +33 -33
  64. package/dist/highlightedtext/labelwithhighlightview.d.ts +21 -21
  65. package/dist/icon/iconview.d.ts +83 -83
  66. package/dist/iframe/iframeview.d.ts +42 -42
  67. package/dist/index.css.map +1 -1
  68. package/dist/index.d.ts +136 -136
  69. package/dist/index.js +16467 -17751
  70. package/dist/index.js.map +1 -1
  71. package/dist/input/inputbase.d.ts +114 -114
  72. package/dist/input/inputview.d.ts +28 -28
  73. package/dist/inputnumber/inputnumberview.d.ts +44 -44
  74. package/dist/inputtext/inputtextview.d.ts +13 -13
  75. package/dist/label/labelview.d.ts +31 -31
  76. package/dist/labeledfield/labeledfieldview.d.ts +180 -180
  77. package/dist/labeledfield/utils.d.ts +112 -112
  78. package/dist/labeledinput/labeledinputview.d.ts +120 -120
  79. package/dist/legacyerrors.d.ts +0 -4
  80. package/dist/list/listitemgroupview.d.ts +54 -54
  81. package/dist/list/listitemview.d.ts +31 -31
  82. package/dist/list/listseparatorview.d.ts +13 -13
  83. package/dist/list/listview.d.ts +119 -119
  84. package/dist/menubar/menubarmenubuttonview.d.ts +28 -28
  85. package/dist/menubar/menubarmenulistitembuttonview.d.ts +16 -16
  86. package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +18 -18
  87. package/dist/menubar/menubarmenulistitemview.d.ts +20 -20
  88. package/dist/menubar/menubarmenulistview.d.ts +24 -24
  89. package/dist/menubar/menubarmenupanelview.d.ts +47 -47
  90. package/dist/menubar/menubarmenuview.d.ts +113 -113
  91. package/dist/menubar/menubarview.d.ts +145 -145
  92. package/dist/menubar/utils.d.ts +455 -455
  93. package/dist/model.d.ts +19 -18
  94. package/dist/notification/notification.d.ts +200 -200
  95. package/dist/panel/balloon/balloonpanelview.d.ts +692 -692
  96. package/dist/panel/balloon/contextualballoon.d.ts +298 -298
  97. package/dist/panel/sticky/stickypanelview.d.ts +151 -151
  98. package/dist/search/filteredview.d.ts +23 -23
  99. package/dist/search/filtergroupanditemnames.d.ts +11 -11
  100. package/dist/search/searchinfoview.d.ts +39 -39
  101. package/dist/search/searchresultsview.d.ts +49 -49
  102. package/dist/search/text/searchtextqueryview.d.ts +63 -63
  103. package/dist/search/text/searchtextview.d.ts +203 -203
  104. package/dist/spinner/spinnerview.d.ts +20 -20
  105. package/dist/template.d.ts +897 -902
  106. package/dist/textarea/textareaview.d.ts +96 -96
  107. package/dist/toolbar/balloon/balloontoolbar.d.ts +122 -122
  108. package/dist/toolbar/block/blockbuttonview.d.ts +30 -30
  109. package/dist/toolbar/block/blocktoolbar.d.ts +166 -166
  110. package/dist/toolbar/normalizetoolbarconfig.d.ts +35 -35
  111. package/dist/toolbar/toolbarlinebreakview.d.ts +13 -13
  112. package/dist/toolbar/toolbarseparatorview.d.ts +13 -13
  113. package/dist/toolbar/toolbarview.d.ts +271 -271
  114. package/dist/tooltipmanager.d.ts +190 -193
  115. package/dist/view.d.ts +385 -388
  116. package/dist/viewcollection.d.ts +134 -134
  117. package/package.json +6 -6
@@ -1,296 +1,296 @@
1
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 { DropdownView } from './dropdownview.js';
6
- import { ViewCollection } from '../viewcollection.js';
7
- import type { View } from '../view.js';
8
- import { type UIModel } from '../model.js';
9
- import { type DropdownButton } from './button/dropdownbutton.js';
10
- import type { FocusableView } from '../focuscycler.js';
11
- import type { FalsyValue } from '../template.js';
12
- import { type BodyCollection } from '../editorui/bodycollection.js';
13
- import { type Collection, type Locale } from '@ckeditor/ckeditor5-utils';
14
- import '../../theme/components/dropdown/toolbardropdown.css';
15
- import '../../theme/components/dropdown/listdropdown.css';
16
- import type { DropdownMenuDefinition } from './menu/utils.js';
17
- import type { ButtonLabelView } from '../button/buttonlabelview.js';
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 { DropdownView } from "./dropdownview.js";
6
+ import { ViewCollection } from "../viewcollection.js";
7
+ import type { View } from "../view.js";
8
+ import { type UIModel } from "../model.js";
9
+ import { type DropdownButton } from "./button/dropdownbutton.js";
10
+ import type { FocusableView } from "../focuscycler.js";
11
+ import type { FalsyValue } from "../template.js";
12
+ import { type BodyCollection } from "../editorui/bodycollection.js";
13
+ import { type Collection, type Locale } from "@ckeditor/ckeditor5-utils";
14
+ import "../../theme/components/dropdown/toolbardropdown.css";
15
+ import "../../theme/components/dropdown/listdropdown.css";
16
+ import type { DropdownMenuDefinition } from "./menu/utils.js";
17
+ import type { ButtonLabelView } from "../button/buttonlabelview.js";
18
18
  /**
19
- * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
20
- * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
21
- * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.
22
- *
23
- * # Creating dropdowns
24
- *
25
- * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as
26
- * definition of the button:
27
- *
28
- * ```ts
29
- * const dropdown = createDropdown( model );
30
- *
31
- * // Configure dropdown's button properties:
32
- * dropdown.buttonView.set( {
33
- * label: 'A dropdown',
34
- * withText: true
35
- * } );
36
- *
37
- * dropdown.render();
38
- *
39
- * // Will render a dropdown labeled "A dropdown" with an empty panel.
40
- * document.body.appendChild( dropdown.element );
41
- * ```
42
- *
43
- * You can also provide other button views (they need to implement the
44
- * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use
45
- * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.
46
- *
47
- * ```ts
48
- * const dropdown = createDropdown( locale, SplitButtonView );
49
- *
50
- * // Configure dropdown's button properties:
51
- * dropdown.buttonView.set( {
52
- * label: 'A dropdown',
53
- * withText: true
54
- * } );
55
- *
56
- * dropdown.buttonView.on( 'execute', () => {
57
- * // Add the behavior of the "action part" of the split button.
58
- * // Split button consists of the "action part" and "arrow part".
59
- * // The arrow opens the dropdown while the action part can have some other behavior.
60
- * } );
61
- *
62
- * dropdown.render();
63
- *
64
- * // Will render a dropdown labeled "A dropdown" with an empty panel.
65
- * document.body.appendChild( dropdown.element );
66
- * ```
67
- *
68
- * # Adding content to the dropdown's panel
69
- *
70
- * The content of the panel can be inserted directly into the `dropdown.panelView.element`:
71
- *
72
- * ```ts
73
- * dropdown.panelView.element.textContent = 'Content of the panel';
74
- * ```
75
- *
76
- * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}
77
- * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).
78
- * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or
79
- * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.
80
- *
81
- * @param locale The locale instance.
82
- * @param ButtonClassOrInstance The dropdown button view class. Needs to implement the
83
- * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
84
- * @returns The dropdown view instance.
85
- */
86
- export declare function createDropdown(locale: Locale | undefined, ButtonClassOrInstance?: (new (locale?: Locale) => DropdownButton & FocusableView) | (DropdownButton & FocusableView)): DropdownView;
19
+ * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
20
+ * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
21
+ * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.
22
+ *
23
+ * # Creating dropdowns
24
+ *
25
+ * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as
26
+ * definition of the button:
27
+ *
28
+ * ```ts
29
+ * const dropdown = createDropdown( model );
30
+ *
31
+ * // Configure dropdown's button properties:
32
+ * dropdown.buttonView.set( {
33
+ * label: 'A dropdown',
34
+ * withText: true
35
+ * } );
36
+ *
37
+ * dropdown.render();
38
+ *
39
+ * // Will render a dropdown labeled "A dropdown" with an empty panel.
40
+ * document.body.appendChild( dropdown.element );
41
+ * ```
42
+ *
43
+ * You can also provide other button views (they need to implement the
44
+ * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use
45
+ * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.
46
+ *
47
+ * ```ts
48
+ * const dropdown = createDropdown( locale, SplitButtonView );
49
+ *
50
+ * // Configure dropdown's button properties:
51
+ * dropdown.buttonView.set( {
52
+ * label: 'A dropdown',
53
+ * withText: true
54
+ * } );
55
+ *
56
+ * dropdown.buttonView.on( 'execute', () => {
57
+ * // Add the behavior of the "action part" of the split button.
58
+ * // Split button consists of the "action part" and "arrow part".
59
+ * // The arrow opens the dropdown while the action part can have some other behavior.
60
+ * } );
61
+ *
62
+ * dropdown.render();
63
+ *
64
+ * // Will render a dropdown labeled "A dropdown" with an empty panel.
65
+ * document.body.appendChild( dropdown.element );
66
+ * ```
67
+ *
68
+ * # Adding content to the dropdown's panel
69
+ *
70
+ * The content of the panel can be inserted directly into the `dropdown.panelView.element`:
71
+ *
72
+ * ```ts
73
+ * dropdown.panelView.element.textContent = 'Content of the panel';
74
+ * ```
75
+ *
76
+ * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}
77
+ * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).
78
+ * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or
79
+ * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.
80
+ *
81
+ * @param locale The locale instance.
82
+ * @param ButtonClassOrInstance The dropdown button view class. Needs to implement the
83
+ * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
84
+ * @returns The dropdown view instance.
85
+ */
86
+ export declare function createDropdown(locale: Locale | undefined, ButtonClassOrInstance?: (new (locale?: Locale) => DropdownButton & FocusableView) | DropdownButton & FocusableView): DropdownView;
87
87
  /**
88
- * Adds a menu UI component to a dropdown and sets all common behaviors and interactions between the dropdown and the menu.
89
- *
90
- * Use this helper to create multi-level dropdown menus that are displayed in a toolbar.
91
- *
92
- * Internally, it creates an instance of {@link module:ui/dropdown/menu/dropdownmenurootlistview~DropdownMenuRootListView}.
93
- *
94
- * Example:
95
- *
96
- * ```ts
97
- * const definitions = [
98
- * {
99
- * id: 'menu_1',
100
- * menu: 'Menu 1',
101
- * children: [
102
- * {
103
- * id: 'menu_1_a',
104
- * label: 'Item A'
105
- * },
106
- * {
107
- * id: 'menu_1_b',
108
- * label: 'Item B'
109
- * }
110
- * ]
111
- * },
112
- * {
113
- * id: 'top_a',
114
- * label: 'Top Item A'
115
- * },
116
- * {
117
- * id: 'top_b',
118
- * label: 'Top Item B'
119
- * }
120
- * ];
121
- *
122
- * const dropdownView = createDropdown( editor.locale );
123
- *
124
- * addMenuToDropdown( dropdownView, editor.ui.view.body, definitions );
125
- * ```
126
- *
127
- * After using this helper, the `dropdown` will fire {@link module:ui/dropdown/dropdownview~DropdownViewEvent `execute`} event when
128
- * a nested menu button is pressed.
129
- *
130
- * The helper will make sure that the `dropdownMenuRootListView` is lazy loaded, i.e., the menu component structure will be initialized
131
- * and rendered only after the `dropdown` is opened for the first time.
132
- *
133
- * @param dropdownView A dropdown instance to which the menu component will be added.
134
- * @param body Body collection to which floating menu panels will be added.
135
- * @param definition The menu component definition.
136
- * @param options.ariaLabel Label used by assistive technologies to describe the top-level menu.
137
- */
88
+ * Adds a menu UI component to a dropdown and sets all common behaviors and interactions between the dropdown and the menu.
89
+ *
90
+ * Use this helper to create multi-level dropdown menus that are displayed in a toolbar.
91
+ *
92
+ * Internally, it creates an instance of {@link module:ui/dropdown/menu/dropdownmenurootlistview~DropdownMenuRootListView}.
93
+ *
94
+ * Example:
95
+ *
96
+ * ```ts
97
+ * const definitions = [
98
+ * {
99
+ * id: 'menu_1',
100
+ * menu: 'Menu 1',
101
+ * children: [
102
+ * {
103
+ * id: 'menu_1_a',
104
+ * label: 'Item A'
105
+ * },
106
+ * {
107
+ * id: 'menu_1_b',
108
+ * label: 'Item B'
109
+ * }
110
+ * ]
111
+ * },
112
+ * {
113
+ * id: 'top_a',
114
+ * label: 'Top Item A'
115
+ * },
116
+ * {
117
+ * id: 'top_b',
118
+ * label: 'Top Item B'
119
+ * }
120
+ * ];
121
+ *
122
+ * const dropdownView = createDropdown( editor.locale );
123
+ *
124
+ * addMenuToDropdown( dropdownView, editor.ui.view.body, definitions );
125
+ * ```
126
+ *
127
+ * After using this helper, the `dropdown` will fire {@link module:ui/dropdown/dropdownview~DropdownViewEvent `execute`} event when
128
+ * a nested menu button is pressed.
129
+ *
130
+ * The helper will make sure that the `dropdownMenuRootListView` is lazy loaded, i.e., the menu component structure will be initialized
131
+ * and rendered only after the `dropdown` is opened for the first time.
132
+ *
133
+ * @param dropdownView A dropdown instance to which the menu component will be added.
134
+ * @param body Body collection to which floating menu panels will be added.
135
+ * @param definition The menu component definition.
136
+ * @param options.ariaLabel Label used by assistive technologies to describe the top-level menu.
137
+ */
138
138
  export declare function addMenuToDropdown(dropdownView: DropdownView, body: BodyCollection, definition: DropdownMenuDefinition, options?: {
139
- ariaLabel?: string;
139
+ ariaLabel?: string;
140
140
  }): void;
141
141
  /**
142
- * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
143
- *
144
- * ```ts
145
- * const buttonsCreator = () => {
146
- * const buttons = [];
147
- *
148
- * // Either create a new ButtonView instance or create existing.
149
- * buttons.push( new ButtonView() );
150
- * buttons.push( editor.ui.componentFactory.create( 'someButton' ) );
151
- * };
152
- *
153
- * const dropdown = createDropdown( locale );
154
- *
155
- * addToolbarToDropdown( dropdown, buttonsCreator, { isVertical: true } );
156
- *
157
- * // Will render a vertical button dropdown labeled "A button dropdown"
158
- * // with a button group in the panel containing two buttons.
159
- * // Buttons inside the dropdown will be created on first dropdown panel open.
160
- * dropdown.render()
161
- * document.body.appendChild( dropdown.element );
162
- * ```
163
- *
164
- * **Note:** To improve the accessibility, you can tell the dropdown to focus the first active button of the toolbar when the dropdown
165
- * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}. See the documentation of `options` to learn more.
166
- *
167
- * **Note:** Toolbar view will be created on first open of the dropdown.
168
- *
169
- * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
170
- *
171
- * @param dropdownView A dropdown instance to which `ToolbarView` will be added.
172
- * @param options.enableActiveItemFocusOnDropdownOpen When set `true`, the focus will automatically move to the first
173
- * active {@link module:ui/toolbar/toolbarview~ToolbarView#items item} of the toolbar upon
174
- * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen opening} the dropdown. Active items are those with the `isOn` property set
175
- * `true` (for instance {@link module:ui/button/buttonview~ButtonView buttons}). If no active items is found, the toolbar will be focused
176
- * as a whole resulting in the focus moving to its first focusable item (default behavior of
177
- * {@link module:ui/dropdown/dropdownview~DropdownView}).
178
- * @param options.ariaLabel Label used by assistive technologies to describe toolbar element.
179
- * @param options.maxWidth The maximum width of the toolbar element.
180
- * Details: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.
181
- * @param options.class An additional CSS class added to the toolbar element.
182
- * @param options.isCompact When set true, makes the toolbar look compact with toolbar element.
183
- * @param options.isVertical Controls the orientation of toolbar items.
184
- */
142
+ * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
143
+ *
144
+ * ```ts
145
+ * const buttonsCreator = () => {
146
+ * const buttons = [];
147
+ *
148
+ * // Either create a new ButtonView instance or create existing.
149
+ * buttons.push( new ButtonView() );
150
+ * buttons.push( editor.ui.componentFactory.create( 'someButton' ) );
151
+ * };
152
+ *
153
+ * const dropdown = createDropdown( locale );
154
+ *
155
+ * addToolbarToDropdown( dropdown, buttonsCreator, { isVertical: true } );
156
+ *
157
+ * // Will render a vertical button dropdown labeled "A button dropdown"
158
+ * // with a button group in the panel containing two buttons.
159
+ * // Buttons inside the dropdown will be created on first dropdown panel open.
160
+ * dropdown.render()
161
+ * document.body.appendChild( dropdown.element );
162
+ * ```
163
+ *
164
+ * **Note:** To improve the accessibility, you can tell the dropdown to focus the first active button of the toolbar when the dropdown
165
+ * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}. See the documentation of `options` to learn more.
166
+ *
167
+ * **Note:** Toolbar view will be created on first open of the dropdown.
168
+ *
169
+ * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.
170
+ *
171
+ * @param dropdownView A dropdown instance to which `ToolbarView` will be added.
172
+ * @param options.enableActiveItemFocusOnDropdownOpen When set `true`, the focus will automatically move to the first
173
+ * active {@link module:ui/toolbar/toolbarview~ToolbarView#items item} of the toolbar upon
174
+ * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen opening} the dropdown. Active items are those with the `isOn` property set
175
+ * `true` (for instance {@link module:ui/button/buttonview~ButtonView buttons}). If no active items is found, the toolbar will be focused
176
+ * as a whole resulting in the focus moving to its first focusable item (default behavior of
177
+ * {@link module:ui/dropdown/dropdownview~DropdownView}).
178
+ * @param options.ariaLabel Label used by assistive technologies to describe toolbar element.
179
+ * @param options.maxWidth The maximum width of the toolbar element.
180
+ * Details: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.
181
+ * @param options.class An additional CSS class added to the toolbar element.
182
+ * @param options.isCompact When set true, makes the toolbar look compact with toolbar element.
183
+ * @param options.isVertical Controls the orientation of toolbar items.
184
+ */
185
185
  export declare function addToolbarToDropdown(dropdownView: DropdownView, buttonsOrCallback: Array<View> | ViewCollection | (() => Array<View> | ViewCollection), options?: {
186
- enableActiveItemFocusOnDropdownOpen?: boolean;
187
- ariaLabel?: string;
188
- maxWidth?: string;
189
- class?: string;
190
- isCompact?: boolean;
191
- isVertical?: boolean;
186
+ enableActiveItemFocusOnDropdownOpen?: boolean;
187
+ ariaLabel?: string;
188
+ maxWidth?: string;
189
+ class?: string;
190
+ isCompact?: boolean;
191
+ isVertical?: boolean;
192
192
  }): void;
193
193
  /**
194
- * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
195
- *
196
- * ```ts
197
- * const items = new Collection<ListDropdownItemDefinition>();
198
- *
199
- * items.add( {
200
- * type: 'button',
201
- * model: new Model( {
202
- * withText: true,
203
- * label: 'First item',
204
- * labelStyle: 'color: red'
205
- * } )
206
- * } );
207
- *
208
- * items.add( {
209
- * type: 'button',
210
- * model: new Model( {
211
- * withText: true,
212
- * label: 'Second item',
213
- * labelStyle: 'color: green',
214
- * class: 'foo'
215
- * } )
216
- * } );
217
- *
218
- * const dropdown = createDropdown( locale );
219
- *
220
- * addListToDropdown( dropdown, items );
221
- *
222
- * // Will render a dropdown with a list in the panel containing two items.
223
- * dropdown.render()
224
- * document.body.appendChild( dropdown.element );
225
- * ```
226
- *
227
- * The `items` collection passed to this methods controls the presence and attributes of respective
228
- * {@link module:ui/list/listitemview~ListItemView list items}.
229
- *
230
- * **Note:** To improve the accessibility, when a list is added to the dropdown using this helper the dropdown will automatically attempt
231
- * to focus the first active item (a host to a {@link module:ui/button/buttonview~ButtonView} with
232
- * {@link module:ui/button/buttonview~ButtonView#isOn} set `true`) or the very first item when none are active.
233
- *
234
- * **Note:** List view will be created on first open of the dropdown.
235
- *
236
- * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.
237
- *
238
- * @param dropdownView A dropdown instance to which `ListVIew` will be added.
239
- * @param itemsOrCallback A collection of the list item definitions or a callback returning a list item definitions to populate the list.
240
- * @param options.ariaLabel Label used by assistive technologies to describe list element.
241
- * @param options.role Will be reflected by the `role` DOM attribute in `ListVIew` and used by assistive technologies.
242
- */
194
+ * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
195
+ *
196
+ * ```ts
197
+ * const items = new Collection<ListDropdownItemDefinition>();
198
+ *
199
+ * items.add( {
200
+ * type: 'button',
201
+ * model: new Model( {
202
+ * withText: true,
203
+ * label: 'First item',
204
+ * labelStyle: 'color: red'
205
+ * } )
206
+ * } );
207
+ *
208
+ * items.add( {
209
+ * type: 'button',
210
+ * model: new Model( {
211
+ * withText: true,
212
+ * label: 'Second item',
213
+ * labelStyle: 'color: green',
214
+ * class: 'foo'
215
+ * } )
216
+ * } );
217
+ *
218
+ * const dropdown = createDropdown( locale );
219
+ *
220
+ * addListToDropdown( dropdown, items );
221
+ *
222
+ * // Will render a dropdown with a list in the panel containing two items.
223
+ * dropdown.render()
224
+ * document.body.appendChild( dropdown.element );
225
+ * ```
226
+ *
227
+ * The `items` collection passed to this methods controls the presence and attributes of respective
228
+ * {@link module:ui/list/listitemview~ListItemView list items}.
229
+ *
230
+ * **Note:** To improve the accessibility, when a list is added to the dropdown using this helper the dropdown will automatically attempt
231
+ * to focus the first active item (a host to a {@link module:ui/button/buttonview~ButtonView} with
232
+ * {@link module:ui/button/buttonview~ButtonView#isOn} set `true`) or the very first item when none are active.
233
+ *
234
+ * **Note:** List view will be created on first open of the dropdown.
235
+ *
236
+ * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.
237
+ *
238
+ * @param dropdownView A dropdown instance to which `ListVIew` will be added.
239
+ * @param itemsOrCallback A collection of the list item definitions or a callback returning a list item definitions to populate the list.
240
+ * @param options.ariaLabel Label used by assistive technologies to describe list element.
241
+ * @param options.role Will be reflected by the `role` DOM attribute in `ListVIew` and used by assistive technologies.
242
+ */
243
243
  export declare function addListToDropdown(dropdownView: DropdownView, itemsOrCallback: Collection<ListDropdownItemDefinition> | (() => Collection<ListDropdownItemDefinition>), options?: {
244
- ariaLabel?: string;
245
- role?: string;
244
+ ariaLabel?: string;
245
+ role?: string;
246
246
  }): void;
247
247
  /**
248
- * A helper to be used on an existing {@link module:ui/dropdown/dropdownview~DropdownView} that focuses
249
- * a specific child in DOM when the dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}.
250
- *
251
- * @param dropdownView A dropdown instance to which the focus behavior will be added.
252
- * @param childSelectorCallback A callback executed when the dropdown gets open. It should return a {@link module:ui/view~View}
253
- * instance (child of {@link module:ui/dropdown/dropdownview~DropdownView#panelView}) that will get focused or a falsy value.
254
- * If falsy value is returned, a default behavior of the dropdown will engage focusing the first focusable child in
255
- * the {@link module:ui/dropdown/dropdownview~DropdownView#panelView}.
256
- */
248
+ * A helper to be used on an existing {@link module:ui/dropdown/dropdownview~DropdownView} that focuses
249
+ * a specific child in DOM when the dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}.
250
+ *
251
+ * @param dropdownView A dropdown instance to which the focus behavior will be added.
252
+ * @param childSelectorCallback A callback executed when the dropdown gets open. It should return a {@link module:ui/view~View}
253
+ * instance (child of {@link module:ui/dropdown/dropdownview~DropdownView#panelView}) that will get focused or a falsy value.
254
+ * If falsy value is returned, a default behavior of the dropdown will engage focusing the first focusable child in
255
+ * the {@link module:ui/dropdown/dropdownview~DropdownView#panelView}.
256
+ */
257
257
  export declare function focusChildOnDropdownOpen(dropdownView: DropdownView, childSelectorCallback: () => View | FalsyValue): void;
258
258
  /**
259
- * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
260
- * utility.
261
- */
259
+ * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
260
+ * utility.
261
+ */
262
262
  export type ListDropdownItemDefinition = ListDropdownSeparatorDefinition | ListDropdownButtonDefinition | ListDropdownGroupDefinition;
263
263
  /**
264
- * A definition of the 'separator' list item.
265
- */
264
+ * A definition of the 'separator' list item.
265
+ */
266
266
  export type ListDropdownSeparatorDefinition = {
267
- type: 'separator';
267
+ type: "separator";
268
268
  };
269
269
  /**
270
- * A definition of the 'button' or 'switchbutton' list item.
271
- */
270
+ * A definition of the 'button' or 'switchbutton' list item.
271
+ */
272
272
  export type ListDropdownButtonDefinition = {
273
- type: 'button' | 'switchbutton';
274
- /**
275
- * Model of the item. Its properties fuel the newly created list item (or its children, depending on the `type`).
276
- */
277
- model: UIModel;
278
- /**
279
- * A view that will be used as a button body in the list item.
280
- */
281
- labelView?: ButtonLabelView;
273
+ type: "button" | "switchbutton";
274
+ /**
275
+ * Model of the item. Its properties fuel the newly created list item (or its children, depending on the `type`).
276
+ */
277
+ model: UIModel;
278
+ /**
279
+ * A view that will be used as a button body in the list item.
280
+ */
281
+ labelView?: ButtonLabelView;
282
282
  };
283
283
  /**
284
- * A definition of the group inside the list. A group can contain one or more list items (buttons).
285
- */
284
+ * A definition of the group inside the list. A group can contain one or more list items (buttons).
285
+ */
286
286
  export type ListDropdownGroupDefinition = {
287
- type: 'group';
288
- /**
289
- * The visible label of the group.
290
- */
291
- label: string;
292
- /**
293
- * The collection of the child list items inside this group.
294
- */
295
- items: Collection<ListDropdownButtonDefinition>;
287
+ type: "group";
288
+ /**
289
+ * The visible label of the group.
290
+ */
291
+ label: string;
292
+ /**
293
+ * The collection of the child list items inside this group.
294
+ */
295
+ items: Collection<ListDropdownButtonDefinition>;
296
296
  };