@ckeditor/ckeditor5-ui 35.2.1 → 35.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/package.json +31 -23
  2. package/src/bindings/addkeyboardhandlingforgrid.js +45 -57
  3. package/src/bindings/clickoutsidehandler.js +15 -21
  4. package/src/bindings/injectcsstransitiondisabler.js +16 -20
  5. package/src/bindings/preventdefault.js +6 -8
  6. package/src/bindings/submithandler.js +5 -7
  7. package/src/button/button.js +5 -0
  8. package/src/button/buttonview.js +220 -259
  9. package/src/button/switchbuttonview.js +56 -71
  10. package/src/colorgrid/colorgridview.js +135 -197
  11. package/src/colorgrid/colortileview.js +37 -47
  12. package/src/colorgrid/utils.js +57 -66
  13. package/src/componentfactory.js +79 -93
  14. package/src/dropdown/button/dropdownbutton.js +5 -0
  15. package/src/dropdown/button/dropdownbuttonview.js +44 -57
  16. package/src/dropdown/button/splitbuttonview.js +159 -207
  17. package/src/dropdown/dropdownpanelfocusable.js +5 -0
  18. package/src/dropdown/dropdownpanelview.js +101 -112
  19. package/src/dropdown/dropdownview.js +396 -438
  20. package/src/dropdown/utils.js +164 -213
  21. package/src/editableui/editableuiview.js +125 -141
  22. package/src/editableui/inline/inlineeditableuiview.js +44 -54
  23. package/src/editorui/bodycollection.js +61 -75
  24. package/src/editorui/boxed/boxededitoruiview.js +91 -104
  25. package/src/editorui/editoruiview.js +30 -39
  26. package/src/focuscycler.js +214 -245
  27. package/src/formheader/formheaderview.js +58 -70
  28. package/src/icon/iconview.js +145 -111
  29. package/src/iframe/iframeview.js +37 -49
  30. package/src/index.js +0 -17
  31. package/src/input/inputview.js +170 -198
  32. package/src/inputnumber/inputnumberview.js +48 -56
  33. package/src/inputtext/inputtextview.js +14 -18
  34. package/src/label/labelview.js +44 -53
  35. package/src/labeledfield/labeledfieldview.js +212 -235
  36. package/src/labeledfield/utils.js +39 -57
  37. package/src/labeledinput/labeledinputview.js +190 -221
  38. package/src/list/listitemview.js +40 -50
  39. package/src/list/listseparatorview.js +15 -19
  40. package/src/list/listview.js +94 -115
  41. package/src/model.js +19 -25
  42. package/src/notification/notification.js +151 -202
  43. package/src/panel/balloon/balloonpanelview.js +535 -628
  44. package/src/panel/balloon/contextualballoon.js +611 -732
  45. package/src/panel/sticky/stickypanelview.js +238 -270
  46. package/src/template.js +1049 -1479
  47. package/src/toolbar/balloon/balloontoolbar.js +337 -424
  48. package/src/toolbar/block/blockbuttonview.js +32 -42
  49. package/src/toolbar/block/blocktoolbar.js +375 -477
  50. package/src/toolbar/normalizetoolbarconfig.js +17 -21
  51. package/src/toolbar/toolbarlinebreakview.js +15 -19
  52. package/src/toolbar/toolbarseparatorview.js +15 -19
  53. package/src/toolbar/toolbarview.js +866 -1053
  54. package/src/tooltipmanager.js +324 -353
  55. package/src/view.js +389 -430
  56. package/src/viewcollection.js +147 -178
  57. package/src/button/button.jsdoc +0 -165
  58. package/src/dropdown/button/dropdownbutton.jsdoc +0 -22
  59. package/src/dropdown/dropdownpanelfocusable.jsdoc +0 -27
@@ -2,18 +2,14 @@
2
2
  * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module ui/list/listview
8
7
  */
9
-
10
8
  import View from '../view';
11
9
  import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
12
10
  import FocusCycler from '../focuscycler';
13
11
  import KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';
14
-
15
12
  import '../../theme/components/list/list.css';
16
-
17
13
  /**
18
14
  * The list view class.
19
15
  *
@@ -21,115 +17,98 @@ import '../../theme/components/list/list.css';
21
17
  * @implements module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable
22
18
  */
23
19
  export default class ListView extends View {
24
- /**
25
- * @inheritDoc
26
- */
27
- constructor() {
28
- super();
29
-
30
- /**
31
- * Collection of the child list views.
32
- *
33
- * @readonly
34
- * @member {module:ui/viewcollection~ViewCollection}
35
- */
36
- this.items = this.createCollection();
37
-
38
- /**
39
- * Tracks information about DOM focus in the list.
40
- *
41
- * @readonly
42
- * @member {module:utils/focustracker~FocusTracker}
43
- */
44
- this.focusTracker = new FocusTracker();
45
-
46
- /**
47
- * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
48
- *
49
- * @readonly
50
- * @member {module:utils/keystrokehandler~KeystrokeHandler}
51
- */
52
- this.keystrokes = new KeystrokeHandler();
53
-
54
- /**
55
- * Helps cycling over focusable {@link #items} in the list.
56
- *
57
- * @readonly
58
- * @protected
59
- * @member {module:ui/focuscycler~FocusCycler}
60
- */
61
- this._focusCycler = new FocusCycler( {
62
- focusables: this.items,
63
- focusTracker: this.focusTracker,
64
- keystrokeHandler: this.keystrokes,
65
- actions: {
66
- // Navigate list items backwards using the arrowup key.
67
- focusPrevious: 'arrowup',
68
-
69
- // Navigate toolbar items forwards using the arrowdown key.
70
- focusNext: 'arrowdown'
71
- }
72
- } );
73
-
74
- this.setTemplate( {
75
- tag: 'ul',
76
-
77
- attributes: {
78
- class: [
79
- 'ck',
80
- 'ck-reset',
81
- 'ck-list'
82
- ]
83
- },
84
-
85
- children: this.items
86
- } );
87
- }
88
-
89
- /**
90
- * @inheritDoc
91
- */
92
- render() {
93
- super.render();
94
-
95
- // Items added before rendering should be known to the #focusTracker.
96
- for ( const item of this.items ) {
97
- this.focusTracker.add( item.element );
98
- }
99
-
100
- this.items.on( 'add', ( evt, item ) => {
101
- this.focusTracker.add( item.element );
102
- } );
103
-
104
- this.items.on( 'remove', ( evt, item ) => {
105
- this.focusTracker.remove( item.element );
106
- } );
107
-
108
- // Start listening for the keystrokes coming from #element.
109
- this.keystrokes.listenTo( this.element );
110
- }
111
-
112
- /**
113
- * @inheritDoc
114
- */
115
- destroy() {
116
- super.destroy();
117
-
118
- this.focusTracker.destroy();
119
- this.keystrokes.destroy();
120
- }
121
-
122
- /**
123
- * Focuses the first focusable in {@link #items}.
124
- */
125
- focus() {
126
- this._focusCycler.focusFirst();
127
- }
128
-
129
- /**
130
- * Focuses the last focusable in {@link #items}.
131
- */
132
- focusLast() {
133
- this._focusCycler.focusLast();
134
- }
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ constructor(locale) {
24
+ super(locale);
25
+ /**
26
+ * Collection of the child list views.
27
+ *
28
+ * @readonly
29
+ * @member {module:ui/viewcollection~ViewCollection}
30
+ */
31
+ this.items = this.createCollection();
32
+ /**
33
+ * Tracks information about DOM focus in the list.
34
+ *
35
+ * @readonly
36
+ * @member {module:utils/focustracker~FocusTracker}
37
+ */
38
+ this.focusTracker = new FocusTracker();
39
+ /**
40
+ * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
41
+ *
42
+ * @readonly
43
+ * @member {module:utils/keystrokehandler~KeystrokeHandler}
44
+ */
45
+ this.keystrokes = new KeystrokeHandler();
46
+ /**
47
+ * Helps cycling over focusable {@link #items} in the list.
48
+ *
49
+ * @readonly
50
+ * @protected
51
+ * @member {module:ui/focuscycler~FocusCycler}
52
+ */
53
+ this._focusCycler = new FocusCycler({
54
+ focusables: this.items,
55
+ focusTracker: this.focusTracker,
56
+ keystrokeHandler: this.keystrokes,
57
+ actions: {
58
+ // Navigate list items backwards using the arrowup key.
59
+ focusPrevious: 'arrowup',
60
+ // Navigate toolbar items forwards using the arrowdown key.
61
+ focusNext: 'arrowdown'
62
+ }
63
+ });
64
+ this.setTemplate({
65
+ tag: 'ul',
66
+ attributes: {
67
+ class: [
68
+ 'ck',
69
+ 'ck-reset',
70
+ 'ck-list'
71
+ ]
72
+ },
73
+ children: this.items
74
+ });
75
+ }
76
+ /**
77
+ * @inheritDoc
78
+ */
79
+ render() {
80
+ super.render();
81
+ // Items added before rendering should be known to the #focusTracker.
82
+ for (const item of this.items) {
83
+ this.focusTracker.add(item.element);
84
+ }
85
+ this.items.on('add', (evt, item) => {
86
+ this.focusTracker.add(item.element);
87
+ });
88
+ this.items.on('remove', (evt, item) => {
89
+ this.focusTracker.remove(item.element);
90
+ });
91
+ // Start listening for the keystrokes coming from #element.
92
+ this.keystrokes.listenTo(this.element);
93
+ }
94
+ /**
95
+ * @inheritDoc
96
+ */
97
+ destroy() {
98
+ super.destroy();
99
+ this.focusTracker.destroy();
100
+ this.keystrokes.destroy();
101
+ }
102
+ /**
103
+ * Focuses the first focusable in {@link #items}.
104
+ */
105
+ focus() {
106
+ this._focusCycler.focusFirst();
107
+ }
108
+ /**
109
+ * Focuses the last focusable in {@link #items}.
110
+ */
111
+ focusLast() {
112
+ this._focusCycler.focusLast();
113
+ }
135
114
  }
package/src/model.js CHANGED
@@ -2,38 +2,32 @@
2
2
  * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module ui/model
8
7
  */
9
-
10
- import mix from '@ckeditor/ckeditor5-utils/src/mix';
11
- import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
8
+ import { Observable } from '@ckeditor/ckeditor5-utils/src/observablemixin';
12
9
  import { extend } from 'lodash-es';
13
-
14
10
  /**
15
11
  * The base MVC model class.
16
12
  *
17
13
  * @mixes module:utils/observablemixin~ObservableMixin
18
14
  */
19
- export default class Model {
20
- /**
21
- * Creates a new Model instance.
22
- *
23
- * @param {Object} [attributes] The model state attributes to be defined during the instance creation.
24
- * @param {Object} [properties] The (out of state) properties to be appended to the instance during creation.
25
- */
26
- constructor( attributes, properties ) {
27
- // Extend this instance with the additional (out of state) properties.
28
- if ( properties ) {
29
- extend( this, properties );
30
- }
31
-
32
- // Initialize the attributes.
33
- if ( attributes ) {
34
- this.set( attributes );
35
- }
36
- }
15
+ export default class Model extends Observable {
16
+ /**
17
+ * Creates a new Model instance.
18
+ *
19
+ * @param {Object} [attributes] The model state attributes to be defined during the instance creation.
20
+ * @param {Object} [properties] The (out of state) properties to be appended to the instance during creation.
21
+ */
22
+ constructor(attributes, properties) {
23
+ super();
24
+ // Extend this instance with the additional (out of state) properties.
25
+ if (properties) {
26
+ extend(this, properties);
27
+ }
28
+ // Initialize the attributes.
29
+ if (attributes) {
30
+ this.set(attributes);
31
+ }
32
+ }
37
33
  }
38
-
39
- mix( Model, ObservableMixin );
@@ -2,15 +2,11 @@
2
2
  * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module ui/notification/notification
8
7
  */
9
-
10
8
  /* globals window */
11
-
12
9
  import ContextPlugin from '@ckeditor/ckeditor5-core/src/contextplugin';
13
-
14
10
  /**
15
11
  * The Notification plugin.
16
12
  *
@@ -24,202 +20,155 @@ import ContextPlugin from '@ckeditor/ckeditor5-core/src/contextplugin';
24
20
  * @extends module:core/contextplugin~ContextPlugin
25
21
  */
26
22
  export default class Notification extends ContextPlugin {
27
- /**
28
- * @inheritDoc
29
- */
30
- static get pluginName() {
31
- return 'Notification';
32
- }
33
-
34
- /**
35
- * @inheritDoc
36
- */
37
- init() {
38
- // Each unhandled and not stopped `show:warning` event is displayed as a system alert.
39
- this.on( 'show:warning', ( evt, data ) => {
40
- window.alert( data.message ); // eslint-disable-line no-alert
41
- }, { priority: 'lowest' } );
42
- }
43
-
44
- /**
45
- * Shows a success notification.
46
- *
47
- * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
48
- * using the `data.namespace` option. For example:
49
- *
50
- * showSuccess( 'Image is uploaded.', {
51
- * namespace: 'upload:image'
52
- * } );
53
- *
54
- * will fire the `show:success:upload:image` event.
55
- *
56
- * You can provide the title of the notification:
57
- *
58
- * showSuccess( 'Image is uploaded.', {
59
- * title: 'Image upload success'
60
- * } );
61
- *
62
- * @param {String} message The content of the notification.
63
- * @param {Object} [data={}] Additional data.
64
- * @param {String} [data.namespace] Additional event namespace.
65
- * @param {String} [data.title] The title of the notification.
66
- */
67
- showSuccess( message, data = {} ) {
68
- this._showNotification( {
69
- message,
70
- type: 'success',
71
- namespace: data.namespace,
72
- title: data.title
73
- } );
74
- }
75
-
76
- /**
77
- * Shows an information notification.
78
- *
79
- * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
80
- * using the `data.namespace` option. For example:
81
- *
82
- * showInfo( 'Editor is offline.', {
83
- * namespace: 'editor:status'
84
- * } );
85
- *
86
- * will fire the `show:info:editor:status` event.
87
- *
88
- * You can provide the title of the notification:
89
- *
90
- * showInfo( 'Editor is offline.', {
91
- * title: 'Network information'
92
- * } );
93
- *
94
- * @param {String} message The content of the notification.
95
- * @param {Object} [data={}] Additional data.
96
- * @param {String} [data.namespace] Additional event namespace.
97
- * @param {String} [data.title] The title of the notification.
98
- */
99
- showInfo( message, data = {} ) {
100
- this._showNotification( {
101
- message,
102
- type: 'info',
103
- namespace: data.namespace,
104
- title: data.title
105
- } );
106
- }
107
-
108
- /**
109
- * Shows a warning notification.
110
- *
111
- * By default, it fires the {@link #event:show:warning `show:warning` event}
112
- * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
113
- *
114
- * showWarning( 'Image upload error.', {
115
- * namespace: 'upload:image'
116
- * } );
117
- *
118
- * will fire the `show:warning:upload:image` event.
119
- *
120
- * You can provide the title of the notification:
121
- *
122
- * showWarning( 'Image upload error.', {
123
- * title: 'Upload failed'
124
- * } );
125
- *
126
- * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
127
- * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
128
- *
129
- * notifications.on( 'show:warning', ( evt, data ) => {
130
- * // Do something with the data.
131
- *
132
- * // Stop this event to prevent displaying it as an alert.
133
- * evt.stop();
134
- * } );
135
- *
136
- * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
137
- *
138
- * notifications.on( 'show:warning', ( evt, data ) => {
139
- * // Show the warning in the UI, but do not stop it.
140
- * } );
141
- *
142
- * notifications.on( 'show:warning', ( evt, data ) => {
143
- * // Log the warning to some error tracker.
144
- *
145
- * // Stop this event to prevent displaying it as an alert.
146
- * evt.stop();
147
- * }, { priority: 'low' } );
148
- *
149
- * @param {String} message The content of the notification.
150
- * @param {Object} [data={}] Additional data.
151
- * @param {String} [data.namespace] Additional event namespace.
152
- * @param {String} [data.title] The title of the notification.
153
- */
154
- showWarning( message, data = {} ) {
155
- this._showNotification( {
156
- message,
157
- type: 'warning',
158
- namespace: data.namespace,
159
- title: data.title
160
- } );
161
- }
162
-
163
- /**
164
- * Fires the `show` event with the specified type, namespace and message.
165
- *
166
- * @private
167
- * @param {Object} data The message data.
168
- * @param {String} data.message The content of the notification.
169
- * @param {'success'|'info'|'warning'} data.type The type of the message.
170
- * @param {String} [data.namespace] Additional event namespace.
171
- * @param {String} [data.title=''] The title of the notification.
172
- */
173
- _showNotification( data ) {
174
- const event = `show:${ data.type }` + ( data.namespace ? `:${ data.namespace }` : '' );
175
-
176
- this.fire( event, {
177
- message: data.message,
178
- type: data.type,
179
- title: data.title || ''
180
- } );
181
- }
182
-
183
- /**
184
- * Fired when one of the `showSuccess()`, `showInfo()`, `showWarning()` methods is called.
185
- *
186
- * @event show
187
- * @param {Object} data The notification data.
188
- * @param {String} data.message The content of the notification.
189
- * @param {String} data.title The title of the notification.
190
- * @param {'success'|'info'|'warning'} data.type The type of the notification.
191
- */
192
-
193
- /**
194
- * Fired when the `showSuccess()` method is called.
195
- *
196
- * @event show:success
197
- * @param {Object} data The notification data.
198
- * @param {String} data.message The content of the notification.
199
- * @param {String} data.title The title of the notification.
200
- * @param {'success'} data.type The type of the notification.
201
- */
202
-
203
- /**
204
- * Fired when the `showInfo()` method is called.
205
- *
206
- * @event show:info
207
- * @param {Object} data The notification data.
208
- * @param {String} data.message The content of the notification.
209
- * @param {String} data.title The title of the notification.
210
- * @param {'info'} data.type The type of the notification.
211
- */
212
-
213
- /**
214
- * Fired when the `showWarning()` method is called.
215
- *
216
- * When this event is not handled or stopped by `event.stop()`, the `data.message` of this event will
217
- * be automatically displayed as a system alert.
218
- *
219
- * @event show:warning
220
- * @param {Object} data The notification data.
221
- * @param {String} data.message The content of the notification.
222
- * @param {String} data.title The title of the notification.
223
- * @param {'warning'} data.type The type of the notification.
224
- */
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ static get pluginName() {
27
+ return 'Notification';
28
+ }
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ init() {
33
+ // Each unhandled and not stopped `show:warning` event is displayed as a system alert.
34
+ this.on('show:warning', (evt, data) => {
35
+ window.alert(data.message); // eslint-disable-line no-alert
36
+ }, { priority: 'lowest' });
37
+ }
38
+ /**
39
+ * Shows a success notification.
40
+ *
41
+ * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended
42
+ * using the `data.namespace` option. For example:
43
+ *
44
+ * showSuccess( 'Image is uploaded.', {
45
+ * namespace: 'upload:image'
46
+ * } );
47
+ *
48
+ * will fire the `show:success:upload:image` event.
49
+ *
50
+ * You can provide the title of the notification:
51
+ *
52
+ * showSuccess( 'Image is uploaded.', {
53
+ * title: 'Image upload success'
54
+ * } );
55
+ *
56
+ * @param {String} message The content of the notification.
57
+ * @param {Object} [data={}] Additional data.
58
+ * @param {String} [data.namespace] Additional event namespace.
59
+ * @param {String} [data.title] The title of the notification.
60
+ */
61
+ showSuccess(message, data = {}) {
62
+ this._showNotification({
63
+ message,
64
+ type: 'success',
65
+ namespace: data.namespace,
66
+ title: data.title
67
+ });
68
+ }
69
+ /**
70
+ * Shows an information notification.
71
+ *
72
+ * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended
73
+ * using the `data.namespace` option. For example:
74
+ *
75
+ * showInfo( 'Editor is offline.', {
76
+ * namespace: 'editor:status'
77
+ * } );
78
+ *
79
+ * will fire the `show:info:editor:status` event.
80
+ *
81
+ * You can provide the title of the notification:
82
+ *
83
+ * showInfo( 'Editor is offline.', {
84
+ * title: 'Network information'
85
+ * } );
86
+ *
87
+ * @param {String} message The content of the notification.
88
+ * @param {Object} [data={}] Additional data.
89
+ * @param {String} [data.namespace] Additional event namespace.
90
+ * @param {String} [data.title] The title of the notification.
91
+ */
92
+ showInfo(message, data = {}) {
93
+ this._showNotification({
94
+ message,
95
+ type: 'info',
96
+ namespace: data.namespace,
97
+ title: data.title
98
+ });
99
+ }
100
+ /**
101
+ * Shows a warning notification.
102
+ *
103
+ * By default, it fires the {@link #event:show:warning `show:warning` event}
104
+ * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:
105
+ *
106
+ * showWarning( 'Image upload error.', {
107
+ * namespace: 'upload:image'
108
+ * } );
109
+ *
110
+ * will fire the `show:warning:upload:image` event.
111
+ *
112
+ * You can provide the title of the notification:
113
+ *
114
+ * showWarning( 'Image upload error.', {
115
+ * title: 'Upload failed'
116
+ * } );
117
+ *
118
+ * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.
119
+ * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:
120
+ *
121
+ * notifications.on( 'show:warning', ( evt, data ) => {
122
+ * // Do something with the data.
123
+ *
124
+ * // Stop this event to prevent displaying it as an alert.
125
+ * evt.stop();
126
+ * } );
127
+ *
128
+ * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:
129
+ *
130
+ * notifications.on( 'show:warning', ( evt, data ) => {
131
+ * // Show the warning in the UI, but do not stop it.
132
+ * } );
133
+ *
134
+ * notifications.on( 'show:warning', ( evt, data ) => {
135
+ * // Log the warning to some error tracker.
136
+ *
137
+ * // Stop this event to prevent displaying it as an alert.
138
+ * evt.stop();
139
+ * }, { priority: 'low' } );
140
+ *
141
+ * @param {String} message The content of the notification.
142
+ * @param {Object} [data={}] Additional data.
143
+ * @param {String} [data.namespace] Additional event namespace.
144
+ * @param {String} [data.title] The title of the notification.
145
+ */
146
+ showWarning(message, data = {}) {
147
+ this._showNotification({
148
+ message,
149
+ type: 'warning',
150
+ namespace: data.namespace,
151
+ title: data.title
152
+ });
153
+ }
154
+ /**
155
+ * Fires the `show` event with the specified type, namespace and message.
156
+ *
157
+ * @private
158
+ * @param {Object} data The message data.
159
+ * @param {String} data.message The content of the notification.
160
+ * @param {'success'|'info'|'warning'} data.type The type of the message.
161
+ * @param {String} [data.namespace] Additional event namespace.
162
+ * @param {String} [data.title=''] The title of the notification.
163
+ */
164
+ _showNotification(data) {
165
+ const event = data.namespace ?
166
+ `show:${data.type}:${data.namespace}` :
167
+ `show:${data.type}`;
168
+ this.fire(event, {
169
+ message: data.message,
170
+ type: data.type,
171
+ title: data.title || ''
172
+ });
173
+ }
225
174
  }