@ckeditor/ckeditor5-ui 36.0.1 → 37.0.0-alpha.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 (114) hide show
  1. package/package.json +24 -23
  2. package/src/augmentation.d.ts +86 -0
  3. package/src/augmentation.js +5 -0
  4. package/src/bindings/addkeyboardhandlingforgrid.d.ts +27 -0
  5. package/src/bindings/addkeyboardhandlingforgrid.js +42 -34
  6. package/src/bindings/clickoutsidehandler.d.ts +28 -0
  7. package/src/bindings/clickoutsidehandler.js +5 -6
  8. package/src/bindings/csstransitiondisablermixin.d.ts +40 -0
  9. package/src/bindings/csstransitiondisablermixin.js +55 -0
  10. package/src/bindings/injectcsstransitiondisabler.d.ts +59 -0
  11. package/src/bindings/injectcsstransitiondisabler.js +23 -20
  12. package/src/bindings/preventdefault.d.ts +33 -0
  13. package/src/bindings/preventdefault.js +13 -15
  14. package/src/bindings/submithandler.d.ts +57 -0
  15. package/src/bindings/submithandler.js +23 -24
  16. package/src/button/button.d.ts +154 -0
  17. package/src/button/buttonview.d.ts +155 -0
  18. package/src/button/buttonview.js +16 -60
  19. package/src/button/switchbuttonview.d.ts +45 -0
  20. package/src/button/switchbuttonview.js +9 -18
  21. package/src/colorgrid/colorgridview.d.ts +132 -0
  22. package/src/colorgrid/colorgridview.js +13 -44
  23. package/src/colorgrid/colortileview.d.ts +28 -0
  24. package/src/colorgrid/colortileview.js +2 -15
  25. package/src/colorgrid/utils.d.ts +47 -0
  26. package/src/colorgrid/utils.js +7 -13
  27. package/src/componentfactory.d.ts +81 -0
  28. package/src/componentfactory.js +22 -36
  29. package/src/dropdown/button/dropdownbutton.d.ts +25 -0
  30. package/src/dropdown/button/dropdownbuttonview.d.ts +48 -0
  31. package/src/dropdown/button/dropdownbuttonview.js +11 -21
  32. package/src/dropdown/button/splitbuttonview.d.ts +145 -0
  33. package/src/dropdown/button/splitbuttonview.js +11 -52
  34. package/src/dropdown/dropdownpanelfocusable.d.ts +21 -0
  35. package/src/dropdown/dropdownpanelview.d.ts +62 -0
  36. package/src/dropdown/dropdownpanelview.js +2 -30
  37. package/src/dropdown/dropdownview.d.ts +315 -0
  38. package/src/dropdown/dropdownview.js +121 -222
  39. package/src/dropdown/utils.d.ts +219 -0
  40. package/src/dropdown/utils.js +112 -106
  41. package/src/editableui/editableuiview.d.ts +72 -0
  42. package/src/editableui/editableuiview.js +16 -44
  43. package/src/editableui/inline/inlineeditableuiview.d.ts +40 -0
  44. package/src/editableui/inline/inlineeditableuiview.js +5 -15
  45. package/src/editorui/bodycollection.d.ts +51 -0
  46. package/src/editorui/bodycollection.js +2 -16
  47. package/src/editorui/boxed/boxededitoruiview.d.ts +40 -0
  48. package/src/editorui/boxed/boxededitoruiview.js +1 -27
  49. package/src/editorui/editorui.d.ts +263 -0
  50. package/src/editorui/editorui.js +27 -134
  51. package/src/editorui/editoruiview.d.ts +39 -0
  52. package/src/editorui/editoruiview.js +1 -10
  53. package/src/focuscycler.d.ts +183 -0
  54. package/src/focuscycler.js +34 -90
  55. package/src/formheader/formheaderview.d.ts +53 -0
  56. package/src/formheader/formheaderview.js +3 -24
  57. package/src/icon/iconview.d.ts +78 -0
  58. package/src/icon/iconview.js +0 -50
  59. package/src/iframe/iframeview.d.ts +50 -0
  60. package/src/iframe/iframeview.js +2 -2
  61. package/src/index.d.ts +55 -0
  62. package/src/index.js +2 -0
  63. package/src/input/inputview.d.ts +121 -0
  64. package/src/input/inputview.js +0 -82
  65. package/src/inputnumber/inputnumberview.d.ts +49 -0
  66. package/src/inputnumber/inputnumberview.js +5 -28
  67. package/src/inputtext/inputtextview.d.ts +18 -0
  68. package/src/inputtext/inputtextview.js +0 -2
  69. package/src/label/labelview.d.ts +36 -0
  70. package/src/label/labelview.js +0 -20
  71. package/src/labeledfield/labeledfieldview.d.ts +182 -0
  72. package/src/labeledfield/labeledfieldview.js +20 -126
  73. package/src/labeledfield/utils.d.ts +93 -0
  74. package/src/labeledfield/utils.js +24 -18
  75. package/src/labeledinput/labeledinputview.d.ts +125 -0
  76. package/src/labeledinput/labeledinputview.js +7 -90
  77. package/src/list/listitemview.d.ts +35 -0
  78. package/src/list/listitemview.js +0 -16
  79. package/src/list/listseparatorview.d.ts +18 -0
  80. package/src/list/listseparatorview.js +0 -2
  81. package/src/list/listview.d.ts +59 -0
  82. package/src/list/listview.js +0 -33
  83. package/src/model.d.ts +22 -0
  84. package/src/model.js +2 -4
  85. package/src/notification/notification.d.ts +211 -0
  86. package/src/notification/notification.js +64 -51
  87. package/src/panel/balloon/balloonpanelview.d.ts +685 -0
  88. package/src/panel/balloon/balloonpanelview.js +146 -168
  89. package/src/panel/balloon/contextualballoon.d.ts +299 -0
  90. package/src/panel/balloon/contextualballoon.js +42 -172
  91. package/src/panel/sticky/stickypanelview.d.ts +132 -0
  92. package/src/panel/sticky/stickypanelview.js +0 -115
  93. package/src/template.d.ts +942 -0
  94. package/src/template.js +397 -461
  95. package/src/toolbar/balloon/balloontoolbar.d.ts +118 -0
  96. package/src/toolbar/balloon/balloontoolbar.js +14 -81
  97. package/src/toolbar/block/blockbuttonview.d.ts +35 -0
  98. package/src/toolbar/block/blockbuttonview.js +1 -13
  99. package/src/toolbar/block/blocktoolbar.d.ts +153 -0
  100. package/src/toolbar/block/blocktoolbar.js +31 -69
  101. package/src/toolbar/normalizetoolbarconfig.d.ts +39 -0
  102. package/src/toolbar/normalizetoolbarconfig.js +12 -8
  103. package/src/toolbar/toolbarlinebreakview.d.ts +18 -0
  104. package/src/toolbar/toolbarlinebreakview.js +0 -2
  105. package/src/toolbar/toolbarseparatorview.d.ts +18 -0
  106. package/src/toolbar/toolbarseparatorview.js +0 -2
  107. package/src/toolbar/toolbarview.d.ts +265 -0
  108. package/src/toolbar/toolbarview.js +54 -305
  109. package/src/tooltipmanager.d.ts +180 -0
  110. package/src/tooltipmanager.js +48 -95
  111. package/src/view.d.ts +422 -0
  112. package/src/view.js +182 -251
  113. package/src/viewcollection.d.ts +139 -0
  114. package/src/viewcollection.js +62 -56
@@ -29,26 +29,26 @@ const defaultLimiterElement = global.document.body;
29
29
  * accept any custom position set provided by the user compatible with the
30
30
  * {@link module:utils/dom/position~Options options}.
31
31
  *
32
- * const panel = new BalloonPanelView( locale );
33
- * const childView = new ChildView();
34
- * const positions = BalloonPanelView.defaultPositions;
35
- *
36
- * panel.render();
37
- *
38
- * // Add a child view to the panel's content collection.
39
- * panel.content.add( childView );
40
- *
41
- * // Start pinning the panel to an element with the "target" id DOM.
42
- * // The balloon will remain pinned until unpin() is called.
43
- * panel.pin( {
44
- * target: document.querySelector( '#target' ),
45
- * positions: [
46
- * positions.northArrowSouth,
47
- * positions.southArrowNorth
48
- * ]
49
- * } );
50
- *
51
- * @extends module:ui/view~View
32
+ * ```ts
33
+ * const panel = new BalloonPanelView( locale );
34
+ * const childView = new ChildView();
35
+ * const positions = BalloonPanelView.defaultPositions;
36
+ *
37
+ * panel.render();
38
+ *
39
+ * // Add a child view to the panel's content collection.
40
+ * panel.content.add( childView );
41
+ *
42
+ * // Start pinning the panel to an element with the "target" id DOM.
43
+ * // The balloon will remain pinned until unpin() is called.
44
+ * panel.pin( {
45
+ * target: document.querySelector( '#target' ),
46
+ * positions: [
47
+ * positions.northArrowSouth,
48
+ * positions.southArrowNorth
49
+ * ]
50
+ * } );
51
+ * ```
52
52
  */
53
53
  export default class BalloonPanelView extends View {
54
54
  /**
@@ -57,76 +57,13 @@ export default class BalloonPanelView extends View {
57
57
  constructor(locale) {
58
58
  super(locale);
59
59
  const bind = this.bindTemplate;
60
- /**
61
- * The absolute top position of the balloon panel in pixels.
62
- *
63
- * @observable
64
- * @default 0
65
- * @member {Number} #top
66
- */
67
60
  this.set('top', 0);
68
- /**
69
- * The absolute left position of the balloon panel in pixels.
70
- *
71
- * @observable
72
- * @default 0
73
- * @member {Number} #left
74
- */
75
61
  this.set('left', 0);
76
- /**
77
- * The balloon panel's current position. The position name is reflected in the CSS class set
78
- * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for the "arrow_nw" position. The class
79
- * controls the minor aspects of the balloon's visual appearance like the placement
80
- * of an {@link #withArrow arrow}. To support a new position, an additional CSS must be created.
81
- *
82
- * Default position names correspond with
83
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
84
- *
85
- * See the {@link #attachTo} and {@link #pin} methods to learn about custom balloon positions.
86
- *
87
- * @observable
88
- * @default 'arrow_nw'
89
- * @member {'arrow_nw'|'arrow_ne'|'arrow_sw'|'arrow_se'} #position
90
- */
91
62
  this.set('position', 'arrow_nw');
92
- /**
93
- * Controls whether the balloon panel is visible or not.
94
- *
95
- * @observable
96
- * @default false
97
- * @member {Boolean} #isVisible
98
- */
99
63
  this.set('isVisible', false);
100
- /**
101
- * Controls whether the balloon panel has an arrow. The presence of the arrow
102
- * is reflected in the `ck-balloon-panel_with-arrow` CSS class.
103
- *
104
- * @observable
105
- * @default true
106
- * @member {Boolean} #withArrow
107
- */
108
64
  this.set('withArrow', true);
109
- /**
110
- * An additional CSS class added to the {@link #element}.
111
- *
112
- * @observable
113
- * @member {String} #class
114
- */
115
65
  this.set('class', undefined);
116
- /**
117
- * A callback that starts pinning the panel when {@link #isVisible} gets
118
- * `true`. Used by {@link #pin}.
119
- *
120
- * @private
121
- * @member {Function} #_pinWhenIsVisibleCallback
122
- */
123
66
  this._pinWhenIsVisibleCallback = null;
124
- /**
125
- * A collection of the child views that creates the balloon panel contents.
126
- *
127
- * @readonly
128
- * @member {module:ui/viewcollection~ViewCollection}
129
- */
130
67
  this.content = this.createCollection();
131
68
  this.setTemplate({
132
69
  tag: 'div',
@@ -171,28 +108,29 @@ export default class BalloonPanelView extends View {
171
108
  * This method accepts configuration {@link module:utils/dom/position~Options options}
172
109
  * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
173
110
  *
174
- * const panel = new BalloonPanelView( locale );
175
- * const positions = BalloonPanelView.defaultPositions;
111
+ * ```ts
112
+ * const panel = new BalloonPanelView( locale );
113
+ * const positions = BalloonPanelView.defaultPositions;
176
114
  *
177
- * panel.render();
115
+ * panel.render();
178
116
  *
179
- * // Attach the panel to an element with the "target" id DOM.
180
- * panel.attachTo( {
181
- * target: document.querySelector( '#target' ),
182
- * positions: [
183
- * positions.northArrowSouth,
184
- * positions.southArrowNorth
185
- * ]
186
- * } );
117
+ * // Attach the panel to an element with the "target" id DOM.
118
+ * panel.attachTo( {
119
+ * target: document.querySelector( '#target' ),
120
+ * positions: [
121
+ * positions.northArrowSouth,
122
+ * positions.southArrowNorth
123
+ * ]
124
+ * } );
125
+ * ```
187
126
  *
188
127
  * **Note**: Attaching the panel will also automatically {@link #show} it.
189
128
  *
190
129
  * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
191
130
  * See the {@link #pin} method for a more permanent positioning strategy.
192
131
  *
193
- * @param {module:utils/dom/position~Options} options Positioning options compatible with
194
- * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
195
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
132
+ * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.
133
+ * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
196
134
  */
197
135
  attachTo(options) {
198
136
  this.show();
@@ -239,27 +177,28 @@ export default class BalloonPanelView extends View {
239
177
  * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
240
178
  * and is immune to the changing environment.
241
179
  *
242
- * const panel = new BalloonPanelView( locale );
243
- * const positions = BalloonPanelView.defaultPositions;
180
+ * ```ts
181
+ * const panel = new BalloonPanelView( locale );
182
+ * const positions = BalloonPanelView.defaultPositions;
244
183
  *
245
- * panel.render();
184
+ * panel.render();
246
185
  *
247
- * // Pin the panel to an element with the "target" id DOM.
248
- * panel.pin( {
249
- * target: document.querySelector( '#target' ),
250
- * positions: [
251
- * positions.northArrowSouth,
252
- * positions.southArrowNorth
253
- * ]
254
- * } );
186
+ * // Pin the panel to an element with the "target" id DOM.
187
+ * panel.pin( {
188
+ * target: document.querySelector( '#target' ),
189
+ * positions: [
190
+ * positions.northArrowSouth,
191
+ * positions.southArrowNorth
192
+ * ]
193
+ * } );
194
+ * ```
255
195
  *
256
196
  * To leave the pinned state, use the {@link #unpin} method.
257
197
  *
258
198
  * **Note**: Pinning the panel will also automatically {@link #show} it.
259
199
  *
260
- * @param {module:utils/dom/position~Options} options Positioning options compatible with
261
- * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
262
- * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
200
+ * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.
201
+ * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
263
202
  */
264
203
  pin(options) {
265
204
  this.unpin();
@@ -294,9 +233,7 @@ export default class BalloonPanelView extends View {
294
233
  /**
295
234
  * Starts managing the pinned state of the panel. See {@link #pin}.
296
235
  *
297
- * @private
298
- * @param {module:utils/dom/position~Options} options Positioning options compatible with
299
- * {@link module:utils/dom/position~getOptimalPosition}.
236
+ * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.
300
237
  */
301
238
  _startPinning(options) {
302
239
  this.attachTo(options);
@@ -322,8 +259,6 @@ export default class BalloonPanelView extends View {
322
259
  }
323
260
  /**
324
261
  * Stops managing the pinned state of the panel. See {@link #pin}.
325
- *
326
- * @private
327
262
  */
328
263
  _stopPinning() {
329
264
  this.stopListening(global.document, 'scroll');
@@ -333,6 +268,7 @@ export default class BalloonPanelView extends View {
333
268
  /**
334
269
  * A side offset of the arrow tip from the edge of the balloon. Controlled by CSS.
335
270
  *
271
+ * ```
336
272
  * ┌───────────────────────┐
337
273
  * │ │
338
274
  * │ Balloon │
@@ -343,14 +279,15 @@ export default class BalloonPanelView extends View {
343
279
  * | \/
344
280
  * >┼─────┼< ─────────────────────── side offset
345
281
  *
282
+ * ```
346
283
  *
347
284
  * @default 25
348
- * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowSideOffset
349
285
  */
350
286
  BalloonPanelView.arrowSideOffset = 25;
351
287
  /**
352
288
  * A height offset of the arrow from the edge of the balloon. Controlled by CSS.
353
289
  *
290
+ * ```
354
291
  * ┌───────────────────────┐
355
292
  * │ │
356
293
  * │ Balloon │
@@ -373,16 +310,16 @@ BalloonPanelView.arrowSideOffset = 25;
373
310
  * │ ╲ │
374
311
  * │ │ │
375
312
  * │ └────────────────────────┘
376
- *
313
+ * ```
377
314
  *
378
315
  * @default 10
379
- * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHeightOffset
380
316
  */
381
317
  BalloonPanelView.arrowHeightOffset = 10;
382
318
  /**
383
319
  * A vertical offset of the balloon panel from the edge of the viewport if sticky.
384
320
  * It helps in accessing toolbar buttons underneath the balloon panel.
385
321
  *
322
+ * ```
386
323
  * ┌───────────────────────────────────────────────────┐
387
324
  * │ Target │
388
325
  * │ │
@@ -397,16 +334,13 @@ BalloonPanelView.arrowHeightOffset = 10;
397
334
  * │ └───────────────────────────────────────────────────┘ │
398
335
  * │ Viewport │
399
336
  * └───────────────────────────────────────────────────────┘
337
+ * ```
400
338
  *
401
339
  * @default 20
402
- * @member {Number} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset
403
340
  */
404
341
  BalloonPanelView.stickyVerticalOffset = 20;
405
342
  /**
406
343
  * Function used to calculate the optimal position for the balloon.
407
- *
408
- * @protected
409
- * @member {Function} module:ui/panel/balloon/balloonpanelview~BalloonPanelView._getOptimalPosition
410
344
  */
411
345
  BalloonPanelView._getOptimalPosition = getOptimalPosition;
412
346
  /**
@@ -415,293 +349,343 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
415
349
  *
416
350
  * The available positioning functions are as follows:
417
351
  *
418
- *
419
- *
420
352
  * **North west**
421
353
  *
422
354
  * * `northWestArrowSouthWest`
423
355
  *
356
+ * ```
424
357
  * +-----------------+
425
358
  * | Balloon |
426
359
  * +-----------------+
427
360
  * V
428
361
  * [ Target ]
362
+ * ```
429
363
  *
430
364
  * * `northWestArrowSouthMiddleWest`
431
365
  *
366
+ * ```
432
367
  * +-----------------+
433
368
  * | Balloon |
434
369
  * +-----------------+
435
370
  * V
436
371
  * [ Target ]
372
+ * ```
437
373
  *
438
374
  * * `northWestArrowSouth`
439
375
  *
376
+ * ```
440
377
  * +-----------------+
441
378
  * | Balloon |
442
379
  * +-----------------+
443
380
  * V
444
381
  * [ Target ]
382
+ * ```
445
383
  *
446
384
  * * `northWestArrowSouthMiddleEast`
447
385
  *
386
+ * ```
448
387
  * +-----------------+
449
388
  * | Balloon |
450
389
  * +-----------------+
451
390
  * V
452
391
  * [ Target ]
392
+ * ```
453
393
  *
454
394
  * * `northWestArrowSouthEast`
455
395
  *
396
+ * ```
456
397
  * +-----------------+
457
398
  * | Balloon |
458
399
  * +-----------------+
459
400
  * V
460
401
  * [ Target ]
461
- *
462
- *
402
+ * ```
463
403
  *
464
404
  * **North**
465
405
  *
466
406
  * * `northArrowSouthWest`
467
407
  *
408
+ * ```
468
409
  * +-----------------+
469
410
  * | Balloon |
470
411
  * +-----------------+
471
412
  * V
472
413
  * [ Target ]
414
+ * ```
473
415
  *
474
416
  * * `northArrowSouthMiddleWest`
475
417
  *
418
+ * ```
476
419
  * +-----------------+
477
420
  * | Balloon |
478
421
  * +-----------------+
479
422
  * V
480
423
  * [ Target ]
481
- *
424
+ * ```
482
425
  * * `northArrowSouth`
483
426
  *
427
+ * ```
484
428
  * +-----------------+
485
429
  * | Balloon |
486
430
  * +-----------------+
487
431
  * V
488
432
  * [ Target ]
433
+ * ```
489
434
  *
490
435
  * * `northArrowSouthMiddleEast`
491
436
  *
437
+ * ```
492
438
  * +-----------------+
493
439
  * | Balloon |
494
440
  * +-----------------+
495
441
  * V
496
442
  * [ Target ]
443
+ * ```
497
444
  *
498
445
  * * `northArrowSouthEast`
499
446
  *
447
+ * ```
500
448
  * +-----------------+
501
449
  * | Balloon |
502
450
  * +-----------------+
503
451
  * V
504
452
  * [ Target ]
453
+ * ```
505
454
  *
506
455
  * **North east**
507
456
  *
508
457
  * * `northEastArrowSouthWest`
509
458
  *
459
+ * ```
510
460
  * +-----------------+
511
461
  * | Balloon |
512
462
  * +-----------------+
513
463
  * V
514
464
  * [ Target ]
515
- *
465
+ * ```
516
466
  *
517
467
  * * `northEastArrowSouthMiddleWest`
518
468
  *
469
+ * ```
519
470
  * +-----------------+
520
471
  * | Balloon |
521
472
  * +-----------------+
522
473
  * V
523
474
  * [ Target ]
475
+ * ```
524
476
  *
525
477
  * * `northEastArrowSouth`
526
478
  *
479
+ * ```
527
480
  * +-----------------+
528
481
  * | Balloon |
529
482
  * +-----------------+
530
483
  * V
531
484
  * [ Target ]
485
+ * ```
532
486
  *
533
487
  * * `northEastArrowSouthMiddleEast`
534
488
  *
489
+ * ```
535
490
  * +-----------------+
536
491
  * | Balloon |
537
492
  * +-----------------+
538
493
  * V
539
494
  * [ Target ]
495
+ * ```
540
496
  *
541
497
  * * `northEastArrowSouthEast`
542
498
  *
499
+ * ```
543
500
  * +-----------------+
544
501
  * | Balloon |
545
502
  * +-----------------+
546
503
  * V
547
504
  * [ Target ]
548
- *
549
- *
505
+ * ```
550
506
  *
551
507
  * **South**
552
508
  *
553
- *
554
509
  * * `southArrowNorthWest`
555
510
  *
511
+ * ```
556
512
  * [ Target ]
557
513
  * ^
558
514
  * +-----------------+
559
515
  * | Balloon |
560
516
  * +-----------------+
517
+ * ```
561
518
  *
562
519
  * * `southArrowNorthMiddleWest`
563
520
  *
521
+ * ```
564
522
  * [ Target ]
565
523
  * ^
566
524
  * +-----------------+
567
525
  * | Balloon |
568
526
  * +-----------------+
527
+ * ```
569
528
  *
570
529
  * * `southArrowNorth`
571
530
  *
531
+ * ```
572
532
  * [ Target ]
573
533
  * ^
574
534
  * +-----------------+
575
535
  * | Balloon |
576
536
  * +-----------------+
537
+ * ```
577
538
  *
578
539
  * * `southArrowNorthMiddleEast`
579
540
  *
541
+ * ```
580
542
  * [ Target ]
581
543
  * ^
582
544
  * +-----------------+
583
545
  * | Balloon |
584
546
  * +-----------------+
547
+ * ```
585
548
  *
586
549
  * * `southArrowNorthEast`
587
550
  *
551
+ * ```
588
552
  * [ Target ]
589
553
  * ^
590
554
  * +-----------------+
591
555
  * | Balloon |
592
556
  * +-----------------+
593
- *
594
- *
557
+ * ```
595
558
  *
596
559
  * **South west**
597
560
  *
598
561
  * * `southWestArrowNorthWest`
599
562
  *
563
+ *
564
+ * ```
600
565
  * [ Target ]
601
566
  * ^
602
567
  * +-----------------+
603
568
  * | Balloon |
604
569
  * +-----------------+
570
+ * ```
605
571
  *
606
572
  * * `southWestArrowNorthMiddleWest`
607
573
  *
574
+ * ```
608
575
  * [ Target ]
609
576
  * ^
610
577
  * +-----------------+
611
578
  * | Balloon |
612
579
  * +-----------------+
580
+ * ```
613
581
  *
614
582
  * * `southWestArrowNorth`
615
583
  *
584
+ * ```
616
585
  * [ Target ]
617
586
  * ^
618
587
  * +-----------------+
619
588
  * | Balloon |
620
589
  * +-----------------+
590
+ * ```
621
591
  *
622
592
  * * `southWestArrowNorthMiddleEast`
623
593
  *
594
+ * ```
624
595
  * [ Target ]
625
596
  * ^
626
597
  * +-----------------+
627
598
  * | Balloon |
628
599
  * +-----------------+
600
+ * ```
629
601
  *
630
602
  * * `southWestArrowNorthEast`
631
603
  *
604
+ * ```
632
605
  * [ Target ]
633
606
  * ^
634
607
  * +-----------------+
635
608
  * | Balloon |
636
609
  * +-----------------+
637
- *
638
- *
610
+ * ```
639
611
  *
640
612
  * **South east**
641
613
  *
642
614
  * * `southEastArrowNorthWest`
643
615
  *
616
+ * ```
644
617
  * [ Target ]
645
618
  * ^
646
619
  * +-----------------+
647
620
  * | Balloon |
648
621
  * +-----------------+
622
+ * ```
623
+ *
649
624
  * * `southEastArrowNorthMiddleWest`
650
625
  *
626
+ * ```
651
627
  * [ Target ]
652
628
  * ^
653
629
  * +-----------------+
654
630
  * | Balloon |
655
631
  * +-----------------+
632
+ * ```
656
633
  *
657
634
  * * `southEastArrowNorth`
658
635
  *
636
+ * ```
659
637
  * [ Target ]
660
638
  * ^
661
639
  * +-----------------+
662
640
  * | Balloon |
663
641
  * +-----------------+
642
+ * ```
664
643
  *
665
644
  * * `southEastArrowNorthMiddleEast`
666
645
  *
646
+ * ```
667
647
  * [ Target ]
668
648
  * ^
669
649
  * +-----------------+
670
650
  * | Balloon |
671
651
  * +-----------------+
652
+ * ```
672
653
  *
673
654
  * * `southEastArrowNorthEast`
674
655
  *
656
+ * ```
675
657
  * [ Target ]
676
658
  * ^
677
659
  * +-----------------+
678
660
  * | Balloon |
679
661
  * +-----------------+
680
- *
681
- *
662
+ * ```
682
663
  *
683
664
  * **West**
684
665
  *
685
666
  * * `westArrowEast`
686
667
  *
668
+ * ```
687
669
  * +-----------------+
688
670
  * | Balloon |>[ Target ]
689
671
  * +-----------------+
672
+ * ```
690
673
  *
691
674
  * **East**
692
675
  *
693
676
  * * `eastArrowWest`
694
677
  *
678
+ * ```
695
679
  * +-----------------+
696
680
  * [ Target ]<| Balloon |
697
681
  * +-----------------+
698
- *
699
- *
682
+ * ```
700
683
  *
701
684
  * **Sticky**
702
685
  *
703
686
  * * `viewportStickyNorth`
704
687
  *
688
+ * ```
705
689
  * +---------------------------+
706
690
  * | [ Target ] |
707
691
  * | |
@@ -716,6 +700,7 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
716
700
  * | +---------------------------+ |
717
701
  * | Viewport |
718
702
  * +-----------------------------------+
703
+ * ```
719
704
  *
720
705
  * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.
721
706
  *
@@ -726,17 +711,12 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
726
711
  *
727
712
  * The name that the position function returns will be reflected in the balloon panel's class that
728
713
  * controls the placement of the "arrow". See {@link #position} to learn more.
729
- *
730
- * @member {Object.<String,module:utils/dom/position~PositioningFunction>}
731
- * module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions
732
714
  */
733
715
  BalloonPanelView.defaultPositions = generatePositions();
734
- // Returns the DOM element for given object or null, if there is none,
735
- // e.g. when the passed object is a Rect instance or so.
736
- //
737
- // @private
738
- // @param {*} object
739
- // @returns {HTMLElement|null}
716
+ /**
717
+ * Returns the DOM element for given object or null, if there is none,
718
+ * e.g. when the passed object is a Rect instance or so.
719
+ */
740
720
  function getDomElement(object) {
741
721
  if (isElement(object)) {
742
722
  return object;
@@ -753,22 +733,21 @@ function getDomElement(object) {
753
733
  * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
754
734
  * {@link module:utils/dom/position~PositioningFunction positioning functions} adjusted by the specific offsets.
755
735
  *
756
- * @protected
757
- * @param {Object} [options] Options to generate positions. If not specified, this helper will simply return
736
+ * @internal
737
+ * @param options Options to generate positions. If not specified, this helper will simply return
758
738
  * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.
759
- * @param {Number} [options.sideOffset] A custom side offset (in pixels) of each position. If
739
+ * @param options.sideOffset A custom side offset (in pixels) of each position. If
760
740
  * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowSideOffset the default value}
761
741
  * will be used.
762
- * @param {Number} [options.heightOffset] A custom height offset (in pixels) of each position. If
742
+ * @param options.heightOffset A custom height offset (in pixels) of each position. If
763
743
  * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHeightOffset the default value}
764
744
  * will be used.
765
- * @param {Number} [options.stickyVerticalOffset] A custom offset (in pixels) of the `viewportStickyNorth` positioning function.
745
+ * @param options.stickyVerticalOffset A custom offset (in pixels) of the `viewportStickyNorth` positioning function.
766
746
  * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}
767
747
  * will be used.
768
- * @param {Object} [options.config] Additional configuration of the balloon balloon panel view.
748
+ * @param options.config Additional configuration of the balloon balloon panel view.
769
749
  * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more
770
750
  * about {@link module:utils/dom/position~PositioningFunction positioning functions}.
771
- * @returns {Object.<String,module:utils/dom/position~PositioningFunction>}
772
751
  */
773
752
  export function generatePositions(options = {}) {
774
753
  const { sideOffset = BalloonPanelView.arrowSideOffset, heightOffset = BalloonPanelView.arrowHeightOffset, stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset, config } = options;
@@ -989,21 +968,20 @@ export function generatePositions(options = {}) {
989
968
  };
990
969
  }
991
970
  };
992
- // Returns the top coordinate for positions starting with `north*`.
993
- //
994
- // @private
995
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
996
- // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
997
- // @returns {Number}
971
+ /**
972
+ * Returns the top coordinate for positions starting with `north*`.
973
+ *
974
+ * @param targetRect A rect of the target.
975
+ * @param balloonRect A rect of the balloon.
976
+ */
998
977
  function getNorthTop(targetRect, balloonRect) {
999
978
  return targetRect.top - balloonRect.height - heightOffset;
1000
979
  }
1001
- // Returns the top coordinate for positions starting with `south*`.
1002
- //
1003
- // @private
1004
- // @param {utils/dom/rect~Rect} targetRect A rect of the target.
1005
- // @param {utils/dom/rect~Rect} elementRect A rect of the balloon.
1006
- // @returns {Number}
980
+ /**
981
+ * Returns the top coordinate for positions starting with `south*`.
982
+ *
983
+ * @param targetRect A rect of the target.
984
+ */
1007
985
  function getSouthTop(targetRect) {
1008
986
  return targetRect.bottom + heightOffset;
1009
987
  }