@vaadin/popover 25.0.0-alpha2 → 25.0.0-alpha20

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.
@@ -4,7 +4,6 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
7
- import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
8
7
  import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
9
8
  import { PopoverPositionMixin } from './vaadin-popover-position-mixin.js';
10
9
  import { PopoverTargetMixin } from './vaadin-popover-target-mixin.js';
@@ -37,16 +36,13 @@ export type PopoverEventMap = HTMLElementEventMap & PopoverCustomEventMap;
37
36
  *
38
37
  * ### Styling
39
38
  *
40
- * `<vaadin-popover>` uses `<vaadin-popover-overlay>` internal
41
- * themable component as the actual visible overlay.
42
- *
43
- * See [`<vaadin-overlay>`](#/elements/vaadin-overlay) documentation
44
- * for `<vaadin-popover-overlay>` parts.
45
- *
46
- * In addition to `<vaadin-overlay>` parts, the following parts are available for styling:
39
+ * The following shadow DOM parts are available for styling:
47
40
  *
48
41
  * Part name | Description
49
42
  * -----------------|-------------------------------------------
43
+ * `backdrop` | Backdrop of the overlay
44
+ * `overlay` | The overlay container
45
+ * `content` | The overlay content
50
46
  * `arrow` | Optional arrow pointing to the target when using `theme="arrow"`
51
47
  *
52
48
  * The following state attributes are available for styling:
@@ -55,9 +51,6 @@ export type PopoverEventMap = HTMLElementEventMap & PopoverCustomEventMap;
55
51
  * -----------------|----------------------------------------
56
52
  * `position` | Reflects the `position` property value.
57
53
  *
58
- * Note: the `theme` attribute value set on `<vaadin-popover>` is
59
- * propagated to the internal `<vaadin-popover-overlay>` component.
60
- *
61
54
  * ### Custom CSS Properties
62
55
  *
63
56
  * The following custom CSS properties are available on the `<vaadin-popover>` element:
@@ -74,9 +67,7 @@ export type PopoverEventMap = HTMLElementEventMap & PopoverCustomEventMap;
74
67
  * @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
75
68
  * @fires {CustomEvent} closed - Fired when the popover is closed.
76
69
  */
77
- declare class Popover extends PopoverPositionMixin(
78
- PopoverTargetMixin(OverlayClassMixin(ThemePropertyMixin(ElementMixin(HTMLElement)))),
79
- ) {
70
+ declare class Popover extends PopoverPositionMixin(PopoverTargetMixin(ThemePropertyMixin(ElementMixin(HTMLElement)))) {
80
71
  /**
81
72
  * Sets the default focus delay to be used by all popover instances,
82
73
  * except for those that have focus delay configured using property.
@@ -96,16 +87,18 @@ declare class Popover extends PopoverPositionMixin(
96
87
  static setDefaultHoverDelay(hoverDelay: number): void;
97
88
 
98
89
  /**
99
- * String used to label the overlay to screen reader users.
90
+ * String used to label the popover to screen reader users.
100
91
  *
101
92
  * @attr {string} accessible-name
93
+ * @deprecated Use `aria-label` attribute on the popover instead
102
94
  */
103
95
  accessibleName: string | null | undefined;
104
96
 
105
97
  /**
106
- * Id of the element used as label of the overlay to screen reader users.
98
+ * Id of the element used as label of the popover to screen reader users.
107
99
  *
108
100
  * @attr {string} accessible-name-ref
101
+ * @deprecated Use `aria-labelledby` attribute on the popover instead
109
102
  */
110
103
  accessibleNameRef: string | null | undefined;
111
104
 
@@ -116,18 +109,16 @@ declare class Popover extends PopoverPositionMixin(
116
109
  autofocus: boolean;
117
110
 
118
111
  /**
119
- * Height to be set on the overlay content.
120
- *
121
- * @attr {string} content-height
112
+ * Set the height of the popover.
113
+ * If a unitless number is provided, pixels are assumed.
122
114
  */
123
- contentHeight: string;
115
+ height: string | null;
124
116
 
125
117
  /**
126
- * Width to be set on the overlay content.
127
- *
128
- * @attr {string} content-width
118
+ * Set the width of the popover.
119
+ * If a unitless number is provided, pixels are assumed.
129
120
  */
130
- contentWidth: string;
121
+ width: string | null;
131
122
 
132
123
  /**
133
124
  * The delay in milliseconds before the popover is opened
@@ -161,60 +152,60 @@ declare class Popover extends PopoverPositionMixin(
161
152
  hoverDelay: number;
162
153
 
163
154
  /**
164
- * True if the popover overlay is opened, false otherwise.
155
+ * True if the popover is visible and available for interaction.
165
156
  */
166
157
  opened: boolean;
167
158
 
168
159
  /**
169
- * The `role` attribute value to be set on the overlay.
160
+ * The `role` attribute value to be set on the popover.
170
161
  *
171
162
  * @attr {string} overlay-role
163
+ * @deprecated Use standard `role` attribute on the popover instead
172
164
  */
173
165
  overlayRole: string;
174
166
 
175
167
  /**
176
- * Custom function for rendering the content of the overlay.
168
+ * Custom function for rendering the content of the popover.
177
169
  * Receives two arguments:
178
170
  *
179
171
  * - `root` The root container DOM element. Append your content to it.
180
- * - `popover` The reference to the `vaadin-popover` element (overlay host).
172
+ * - `popover` The reference to the `vaadin-popover` element.
173
+ *
174
+ * @deprecated Add content elements as children of the popover using default slot
181
175
  */
182
176
  renderer: PopoverRenderer | null | undefined;
183
177
 
184
178
  /**
185
179
  * When true, the popover prevents interacting with background elements
186
180
  * by setting `pointer-events` style on the document body to `none`.
187
- * This also enables trapping focus inside the overlay.
181
+ * This also enables trapping focus inside the popover.
188
182
  */
189
183
  modal: boolean;
190
184
 
191
185
  /**
192
- * Set to true to disable closing popover overlay on outside click.
186
+ * Set to true to disable closing popover on outside click.
193
187
  *
194
188
  * @attr {boolean} no-close-on-outside-click
195
189
  */
196
190
  noCloseOnOutsideClick: boolean;
197
191
 
198
192
  /**
199
- * Set to true to disable closing popover overlay on Escape press.
200
- * When the popover is modal, pressing Escape anywhere in the
201
- * document closes the overlay. Otherwise, only Escape press
202
- * from the popover itself or its target closes the overlay.
193
+ * Set to true to disable closing popover on Escape press.
203
194
  *
204
195
  * @attr {boolean} no-close-on-esc
205
196
  */
206
197
  noCloseOnEsc: boolean;
207
198
 
208
199
  /**
209
- * Popover trigger mode, used to configure how the overlay is opened or closed.
200
+ * Popover trigger mode, used to configure how the popover is opened or closed.
210
201
  * Could be set to multiple by providing an array, e.g. `trigger = ['hover', 'focus']`.
211
202
  *
212
203
  * Supported values:
213
204
  * - `click` (default) - opens and closes on target click.
214
205
  * - `hover` - opens on target mouseenter, closes on target mouseleave. Moving mouse
215
- * to the popover overlay content keeps the overlay opened.
206
+ * to the popover content keeps the popover opened.
216
207
  * - `focus` - opens on target focus, closes on target blur. Moving focus to the
217
- * popover overlay content keeps the overlay opened.
208
+ * popover content keeps the popover opened.
218
209
  *
219
210
  * In addition to the behavior specified by `trigger`, the popover can be closed by:
220
211
  * - pressing Escape key (unless `noCloseOnEsc` property is true)
@@ -227,7 +218,7 @@ declare class Popover extends PopoverPositionMixin(
227
218
  trigger: PopoverTrigger[] | null | undefined;
228
219
 
229
220
  /**
230
- * When true, the overlay has a backdrop (modality curtain) on top of the
221
+ * When true, the popover has a backdrop (modality curtain) on top of the
231
222
  * underlying page content, covering the whole viewport.
232
223
  *
233
224
  * @attr {boolean} with-backdrop
@@ -239,6 +230,8 @@ declare class Popover extends PopoverPositionMixin(
239
230
  * While performing the update, it invokes the renderer passed in the `renderer` property.
240
231
  *
241
232
  * It is not guaranteed that the update happens immediately (synchronously) after it is requested.
233
+ *
234
+ * @deprecated Add content elements as children of the popover using default slot
242
235
  */
243
236
  requestContentUpdate(): void;
244
237