@vaadin/popover 24.8.4 → 25.0.0-alpha10

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.
@@ -169,16 +169,13 @@ const isLastOverlay = (overlay) => {
169
169
  *
170
170
  * ### Styling
171
171
  *
172
- * `<vaadin-popover>` uses `<vaadin-popover-overlay>` internal
173
- * themable component as the actual visible overlay.
174
- *
175
- * See [`<vaadin-overlay>`](#/elements/vaadin-overlay) documentation
176
- * for `<vaadin-popover-overlay>` parts.
177
- *
178
- * In addition to `<vaadin-overlay>` parts, the following parts are available for styling:
172
+ * The following shadow DOM parts are available for styling:
179
173
  *
180
174
  * Part name | Description
181
175
  * -----------------|-------------------------------------------
176
+ * `backdrop` | Backdrop of the overlay
177
+ * `overlay` | The overlay container
178
+ * `content` | The overlay content
182
179
  * `arrow` | Optional arrow pointing to the target when using `theme="arrow"`
183
180
  *
184
181
  * The following state attributes are available for styling:
@@ -187,9 +184,6 @@ const isLastOverlay = (overlay) => {
187
184
  * -----------------|----------------------------------------
188
185
  * `position` | Reflects the `position` property value.
189
186
  *
190
- * Note: the `theme` attribute value set on `<vaadin-popover>` is
191
- * propagated to the internal `<vaadin-popover-overlay>` component.
192
- *
193
187
  * ### Custom CSS Properties
194
188
  *
195
189
  * The following custom CSS properties are available on the `<vaadin-popover>` element:
@@ -224,7 +218,7 @@ class Popover extends PopoverPositionMixin(
224
218
  static get styles() {
225
219
  return css`
226
220
  :host {
227
- display: none !important;
221
+ display: contents;
228
222
  }
229
223
  `;
230
224
  }
@@ -232,7 +226,7 @@ class Popover extends PopoverPositionMixin(
232
226
  static get properties() {
233
227
  return {
234
228
  /**
235
- * String used to label the overlay to screen reader users.
229
+ * String used to label the popover to screen reader users.
236
230
  *
237
231
  * @attr {string} accessible-name
238
232
  */
@@ -241,7 +235,7 @@ class Popover extends PopoverPositionMixin(
241
235
  },
242
236
 
243
237
  /**
244
- * Id of the element used as label of the overlay to screen reader users.
238
+ * Id of the element used as label of the popover to screen reader users.
245
239
  *
246
240
  * @attr {string} accessible-name-ref
247
241
  */
@@ -258,20 +252,18 @@ class Popover extends PopoverPositionMixin(
258
252
  },
259
253
 
260
254
  /**
261
- * Height to be set on the overlay content.
262
- *
263
- * @attr {string} content-height
255
+ * Set the height of the overlay.
256
+ * If a unitless number is provided, pixels are assumed.
264
257
  */
265
- contentHeight: {
258
+ height: {
266
259
  type: String,
267
260
  },
268
261
 
269
262
  /**
270
- * Width to be set on the overlay content.
271
- *
272
- * @attr {string} content-width
263
+ * Set the width of the overlay.
264
+ * If a unitless number is provided, pixels are assumed.
273
265
  */
274
- contentWidth: {
266
+ width: {
275
267
  type: String,
276
268
  },
277
269
 
@@ -322,6 +314,15 @@ class Popover extends PopoverPositionMixin(
322
314
  observer: '__openedChanged',
323
315
  },
324
316
 
317
+ /**
318
+ * The `role` attribute value to be set on the popover.
319
+ * When not specified, defaults to 'dialog'.
320
+ */
321
+ role: {
322
+ type: String,
323
+ reflectToAttribute: true,
324
+ },
325
+
325
326
  /**
326
327
  * The `role` attribute value to be set on the overlay.
327
328
  *
@@ -329,7 +330,6 @@ class Popover extends PopoverPositionMixin(
329
330
  */
330
331
  overlayRole: {
331
332
  type: String,
332
- value: 'dialog',
333
333
  },
334
334
 
335
335
  /**
@@ -417,20 +417,11 @@ class Popover extends PopoverPositionMixin(
417
417
  value: false,
418
418
  sync: true,
419
419
  },
420
-
421
- /** @private */
422
- __overlayId: {
423
- type: String,
424
- },
425
420
  };
426
421
  }
427
422
 
428
423
  static get observers() {
429
- return [
430
- '__updateContentHeight(contentHeight, _overlayElement)',
431
- '__updateContentWidth(contentWidth, _overlayElement)',
432
- '__updateAriaAttributes(opened, overlayRole, target)',
433
- ];
424
+ return ['__sizeChanged(width, height, _overlayElement)', '__updateAriaAttributes(opened, role, target)'];
434
425
  }
435
426
 
436
427
  /**
@@ -466,7 +457,7 @@ class Popover extends PopoverPositionMixin(
466
457
  constructor() {
467
458
  super();
468
459
 
469
- this.__overlayId = `vaadin-popover-${generateUniqueId()}`;
460
+ this.__generatedId = `vaadin-popover-${generateUniqueId()}`;
470
461
 
471
462
  this.__onGlobalClick = this.__onGlobalClick.bind(this);
472
463
  this.__onGlobalKeyDown = this.__onGlobalKeyDown.bind(this);
@@ -485,10 +476,7 @@ class Popover extends PopoverPositionMixin(
485
476
 
486
477
  return html`
487
478
  <vaadin-popover-overlay
488
- id="${this.__overlayId}"
489
- role="${this.overlayRole}"
490
- aria-label="${ifDefined(this.accessibleName)}"
491
- aria-labelledby="${ifDefined(this.accessibleNameRef)}"
479
+ id="overlay"
492
480
  .renderer="${this.renderer}"
493
481
  .owner="${this}"
494
482
  theme="${ifDefined(this._theme)}"
@@ -510,11 +498,14 @@ class Popover extends PopoverPositionMixin(
510
498
  @opened-changed="${this.__onOpenedChanged}"
511
499
  .restoreFocusOnClose="${this.__shouldRestoreFocus}"
512
500
  .restoreFocusNode="${this.target}"
501
+ exportparts="backdrop, overlay, content, arrow"
513
502
  @vaadin-overlay-escape-press="${this.__onEscapePress}"
514
503
  @vaadin-overlay-outside-click="${this.__onOutsideClick}"
515
504
  @vaadin-overlay-open="${this.__onOverlayOpened}"
516
505
  @vaadin-overlay-closed="${this.__onOverlayClosed}"
517
- ></vaadin-popover-overlay>
506
+ >
507
+ <slot></slot>
508
+ </vaadin-popover-overlay>
518
509
  `;
519
510
  }
520
511
 
@@ -536,13 +527,52 @@ class Popover extends PopoverPositionMixin(
536
527
  ready() {
537
528
  super.ready();
538
529
 
539
- this._overlayElement = this.$[this.__overlayId];
530
+ this._overlayElement = this.$.overlay;
531
+
532
+ if (!this.hasAttribute('role')) {
533
+ this.role = 'dialog';
534
+ }
535
+ }
536
+
537
+ /** @protected */
538
+ willUpdate(props) {
539
+ super.willUpdate(props);
540
+
541
+ if (props.has('overlayRole')) {
542
+ this.role = this.overlayRole;
543
+ }
544
+ }
545
+
546
+ /** @protected */
547
+ updated(props) {
548
+ super.updated(props);
549
+
550
+ if (props.has('accessibleName')) {
551
+ if (this.accessibleName) {
552
+ this.setAttribute('aria-label', this.accessibleName);
553
+ } else {
554
+ this.removeAttribute('aria-label');
555
+ }
556
+ }
557
+
558
+ if (props.has('accessibleNameRef')) {
559
+ if (this.accessibleNameRef) {
560
+ this.setAttribute('aria-labelledby', this.accessibleNameRef);
561
+ } else {
562
+ this.removeAttribute('aria-labelledby');
563
+ }
564
+ }
540
565
  }
541
566
 
542
567
  /** @protected */
543
568
  connectedCallback() {
544
569
  super.connectedCallback();
545
570
 
571
+ // If no user ID is provided, set generated ID
572
+ if (!this.id) {
573
+ this.id = this.__generatedId;
574
+ }
575
+
546
576
  document.documentElement.addEventListener('click', this.__onGlobalClick, true);
547
577
  }
548
578
 
@@ -597,7 +627,7 @@ class Popover extends PopoverPositionMixin(
597
627
  }
598
628
 
599
629
  /** @private */
600
- __updateAriaAttributes(opened, overlayRole, target) {
630
+ __updateAriaAttributes(opened, role, target) {
601
631
  if (this.__oldTarget) {
602
632
  const oldEffectiveTarget = this.__oldTarget.ariaTarget || this.__oldTarget;
603
633
  oldEffectiveTarget.removeAttribute('aria-haspopup');
@@ -608,13 +638,13 @@ class Popover extends PopoverPositionMixin(
608
638
  if (target) {
609
639
  const effectiveTarget = target.ariaTarget || target;
610
640
 
611
- const isDialog = overlayRole === 'dialog' || overlayRole === 'alertdialog';
641
+ const isDialog = role === 'dialog' || role === 'alertdialog';
612
642
  effectiveTarget.setAttribute('aria-haspopup', isDialog ? 'dialog' : 'true');
613
643
 
614
644
  effectiveTarget.setAttribute('aria-expanded', opened ? 'true' : 'false');
615
645
 
616
646
  if (opened) {
617
- effectiveTarget.setAttribute('aria-controls', this.__overlayId);
647
+ effectiveTarget.setAttribute('aria-controls', this.id);
618
648
  } else {
619
649
  effectiveTarget.removeAttribute('aria-controls');
620
650
  }
@@ -793,7 +823,7 @@ class Popover extends PopoverPositionMixin(
793
823
  return;
794
824
  }
795
825
 
796
- if ((this.__hasTrigger('focus') && this.__mouseDownInside) || this._overlayElement.contains(event.relatedTarget)) {
826
+ if ((this.__hasTrigger('focus') && this.__mouseDownInside) || this.contains(event.relatedTarget)) {
797
827
  return;
798
828
  }
799
829
 
@@ -821,7 +851,7 @@ class Popover extends PopoverPositionMixin(
821
851
  return;
822
852
  }
823
853
 
824
- if (this._overlayElement.contains(event.relatedTarget)) {
854
+ if (this.contains(event.relatedTarget)) {
825
855
  return;
826
856
  }
827
857
 
@@ -852,7 +882,8 @@ class Popover extends PopoverPositionMixin(
852
882
  if (
853
883
  (this.__hasTrigger('focus') && this.__mouseDownInside) ||
854
884
  event.relatedTarget === this.target ||
855
- this._overlayElement.contains(event.relatedTarget)
885
+ event.relatedTarget === this._overlayElement ||
886
+ this.contains(event.relatedTarget)
856
887
  ) {
857
888
  return;
858
889
  }
@@ -910,6 +941,11 @@ class Popover extends PopoverPositionMixin(
910
941
  }
911
942
 
912
943
  if (this.__hasTrigger('focus')) {
944
+ // Do not restore focus if closed on focusout on Tab
945
+ if (isKeyboardActive()) {
946
+ this.__shouldRestoreFocus = false;
947
+ }
948
+
913
949
  this._openedStateController.close(true);
914
950
  }
915
951
  }
@@ -983,27 +1019,9 @@ class Popover extends PopoverPositionMixin(
983
1019
  }
984
1020
 
985
1021
  /** @private */
986
- __updateDimension(overlay, dimension, value) {
987
- const prop = `--_vaadin-popover-content-${dimension}`;
988
-
989
- if (value) {
990
- overlay.style.setProperty(prop, value);
991
- } else {
992
- overlay.style.removeProperty(prop);
993
- }
994
- }
995
-
996
- /** @private */
997
- __updateContentHeight(height, overlay) {
998
- if (overlay) {
999
- this.__updateDimension(overlay, 'height', height);
1000
- }
1001
- }
1002
-
1003
- /** @private */
1004
- __updateContentWidth(width, overlay) {
1022
+ __sizeChanged(width, height, overlay) {
1005
1023
  if (overlay) {
1006
- this.__updateDimension(overlay, 'width', width);
1024
+ requestAnimationFrame(() => overlay.setBounds({ width, height }, false));
1007
1025
  }
1008
1026
  }
1009
1027
 
@@ -7,12 +7,8 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
7
7
 
8
8
  const popoverOverlay = css`
9
9
  :host {
10
- --vaadin-popover-offset-top: var(--_vaadin-popover-default-offset);
11
- --vaadin-popover-offset-bottom: var(--_vaadin-popover-default-offset);
12
- --vaadin-popover-offset-start: var(--_vaadin-popover-default-offset);
13
- --vaadin-popover-offset-end: var(--_vaadin-popover-default-offset);
14
10
  --vaadin-popover-arrow-size: 0.5rem;
15
- --_vaadin-popover-default-offset: var(--lumo-space-xs);
11
+ --_default-offset: var(--lumo-space-xs);
16
12
  }
17
13
 
18
14
  [part='overlay'] {
@@ -24,11 +20,11 @@ const popoverOverlay = css`
24
20
  }
25
21
 
26
22
  :host([theme~='no-padding']) [part='content'] {
27
- padding: 0;
23
+ padding: 0 !important;
28
24
  }
29
25
 
30
26
  :host([theme~='arrow']) {
31
- --_vaadin-popover-default-offset: calc(var(--lumo-space-s) + var(--vaadin-popover-arrow-size) / 2);
27
+ --_default-offset: calc(var(--lumo-space-s) + var(--vaadin-popover-arrow-size) / 2);
32
28
  }
33
29
 
34
30
  /* top / bottom position */
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-popover",
11
- "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.4/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "overlay-class",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  {
47
47
  "name": "accessible-name",
48
- "description": "String used to label the overlay to screen reader users.",
48
+ "description": "String used to label the popover to screen reader users.",
49
49
  "value": {
50
50
  "type": [
51
51
  "string",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  {
58
58
  "name": "accessible-name-ref",
59
- "description": "Id of the element used as label of the overlay to screen reader users.",
59
+ "description": "Id of the element used as label of the popover to screen reader users.",
60
60
  "value": {
61
61
  "type": [
62
62
  "string",
@@ -77,8 +77,8 @@
77
77
  }
78
78
  },
79
79
  {
80
- "name": "content-height",
81
- "description": "Height to be set on the overlay content.",
80
+ "name": "height",
81
+ "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
82
82
  "value": {
83
83
  "type": [
84
84
  "string",
@@ -88,8 +88,8 @@
88
88
  }
89
89
  },
90
90
  {
91
- "name": "content-width",
92
- "description": "Width to be set on the overlay content.",
91
+ "name": "width",
92
+ "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
93
93
  "value": {
94
94
  "type": [
95
95
  "string",
@@ -142,6 +142,17 @@
142
142
  ]
143
143
  }
144
144
  },
145
+ {
146
+ "name": "role",
147
+ "description": "The `role` attribute value to be set on the popover.\nWhen not specified, defaults to 'dialog'.",
148
+ "value": {
149
+ "type": [
150
+ "string",
151
+ "null",
152
+ "undefined"
153
+ ]
154
+ }
155
+ },
145
156
  {
146
157
  "name": "overlay-role",
147
158
  "description": "The `role` attribute value to be set on the overlay.",
@@ -257,7 +268,7 @@
257
268
  },
258
269
  {
259
270
  "name": "accessibleName",
260
- "description": "String used to label the overlay to screen reader users.",
271
+ "description": "String used to label the popover to screen reader users.",
261
272
  "value": {
262
273
  "type": [
263
274
  "string",
@@ -268,7 +279,7 @@
268
279
  },
269
280
  {
270
281
  "name": "accessibleNameRef",
271
- "description": "Id of the element used as label of the overlay to screen reader users.",
282
+ "description": "Id of the element used as label of the popover to screen reader users.",
272
283
  "value": {
273
284
  "type": [
274
285
  "string",
@@ -289,8 +300,8 @@
289
300
  }
290
301
  },
291
302
  {
292
- "name": "contentHeight",
293
- "description": "Height to be set on the overlay content.",
303
+ "name": "height",
304
+ "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
294
305
  "value": {
295
306
  "type": [
296
307
  "string",
@@ -300,8 +311,8 @@
300
311
  }
301
312
  },
302
313
  {
303
- "name": "contentWidth",
304
- "description": "Width to be set on the overlay content.",
314
+ "name": "width",
315
+ "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
305
316
  "value": {
306
317
  "type": [
307
318
  "string",
@@ -354,6 +365,17 @@
354
365
  ]
355
366
  }
356
367
  },
368
+ {
369
+ "name": "role",
370
+ "description": "The `role` attribute value to be set on the popover.\nWhen not specified, defaults to 'dialog'.",
371
+ "value": {
372
+ "type": [
373
+ "string",
374
+ "null",
375
+ "undefined"
376
+ ]
377
+ }
378
+ },
357
379
  {
358
380
  "name": "overlayRole",
359
381
  "description": "The `role` attribute value to be set on the overlay.",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-popover",
19
- "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\n`<vaadin-popover>` uses `<vaadin-popover-overlay>` internal\nthemable component as the actual visible overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.4/#/elements/vaadin-overlay) documentation\nfor `<vaadin-popover-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\nNote: the `theme` attribute value set on `<vaadin-popover>` is\npropagated to the internal `<vaadin-popover-overlay>` component.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-popover>` is a Web Component for creating overlays\nthat are positioned next to specified DOM element (target).\n\nUnlike `<vaadin-tooltip>`, the popover supports rich content\nthat can be provided by using `renderer` function.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container\n`content` | The overlay content\n`arrow` | Optional arrow pointing to the target when using `theme=\"arrow\"`\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|----------------------------------------\n`position` | Reflects the `position` property value.\n\n### Custom CSS Properties\n\nThe following custom CSS properties are available on the `<vaadin-popover>` element:\n\nCustom CSS property | Description\n---------------------------------|-------------\n`--vaadin-popover-offset-top` | Used as an offset when the popover is aligned vertically below the target\n`--vaadin-popover-offset-bottom` | Used as an offset when the popover is aligned vertically above the target\n`--vaadin-popover-offset-start` | Used as an offset when the popover is aligned horizontally after the target\n`--vaadin-popover-offset-end` | Used as an offset when the popover is aligned horizontally before the target\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -91,28 +91,28 @@
91
91
  },
92
92
  {
93
93
  "name": ".accessibleName",
94
- "description": "String used to label the overlay to screen reader users.",
94
+ "description": "String used to label the popover to screen reader users.",
95
95
  "value": {
96
96
  "kind": "expression"
97
97
  }
98
98
  },
99
99
  {
100
100
  "name": ".accessibleNameRef",
101
- "description": "Id of the element used as label of the overlay to screen reader users.",
101
+ "description": "Id of the element used as label of the popover to screen reader users.",
102
102
  "value": {
103
103
  "kind": "expression"
104
104
  }
105
105
  },
106
106
  {
107
- "name": ".contentHeight",
108
- "description": "Height to be set on the overlay content.",
107
+ "name": ".height",
108
+ "description": "Set the height of the overlay.\nIf a unitless number is provided, pixels are assumed.",
109
109
  "value": {
110
110
  "kind": "expression"
111
111
  }
112
112
  },
113
113
  {
114
- "name": ".contentWidth",
115
- "description": "Width to be set on the overlay content.",
114
+ "name": ".width",
115
+ "description": "Set the width of the overlay.\nIf a unitless number is provided, pixels are assumed.",
116
116
  "value": {
117
117
  "kind": "expression"
118
118
  }
@@ -138,6 +138,13 @@
138
138
  "kind": "expression"
139
139
  }
140
140
  },
141
+ {
142
+ "name": ".role",
143
+ "description": "The `role` attribute value to be set on the popover.\nWhen not specified, defaults to 'dialog'.",
144
+ "value": {
145
+ "kind": "expression"
146
+ }
147
+ },
141
148
  {
142
149
  "name": ".overlayRole",
143
150
  "description": "The `role` attribute value to be set on the overlay.",
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
@@ -1,108 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
3
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
-
5
- const popoverOverlay = css`
6
- :host {
7
- --vaadin-popover-offset-top: var(--_vaadin-popover-default-offset);
8
- --vaadin-popover-offset-bottom: var(--_vaadin-popover-default-offset);
9
- --vaadin-popover-offset-start: var(--_vaadin-popover-default-offset);
10
- --vaadin-popover-offset-end: var(--_vaadin-popover-default-offset);
11
- --vaadin-popover-arrow-size: 0.5rem;
12
- --_vaadin-popover-default-offset: 0.25rem;
13
- }
14
-
15
- [part='overlay'] {
16
- outline: none;
17
- }
18
-
19
- [part='content'] {
20
- padding: 0.25rem 0.5rem;
21
- }
22
-
23
- :host([theme~='no-padding']) [part='content'] {
24
- padding: 0;
25
- }
26
-
27
- :host([theme~='arrow']) {
28
- --_vaadin-popover-default-offset: calc(0.25rem + var(--vaadin-popover-arrow-size) / 1.25);
29
- }
30
-
31
- /* top / bottom position */
32
- :host([theme~='arrow'][position^='top']) [part='arrow'],
33
- :host([theme~='arrow'][position^='bottom']) [part='arrow'] {
34
- border-left: var(--vaadin-popover-arrow-size) solid transparent;
35
- border-right: var(--vaadin-popover-arrow-size) solid transparent;
36
- }
37
-
38
- :host([theme~='arrow'][position^='bottom'][bottom-aligned]) [part='arrow'],
39
- :host([theme~='arrow'][position^='top'][bottom-aligned]) [part='arrow'] {
40
- bottom: calc(var(--vaadin-popover-arrow-size) * -1);
41
- border-top: var(--vaadin-popover-arrow-size) solid var(--material-background-color);
42
- filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.14));
43
- }
44
-
45
- :host([theme~='arrow'][position^='bottom'][top-aligned]) [part='arrow'],
46
- :host([theme~='arrow'][position^='top'][top-aligned]) [part='arrow'] {
47
- top: calc(var(--vaadin-popover-arrow-size) * -1);
48
- border-bottom: var(--vaadin-popover-arrow-size) solid var(--material-background-color);
49
- filter: drop-shadow(0 -2px 1px rgba(0, 0, 0, 0.14));
50
- }
51
-
52
- :host([theme~='arrow'][position^='bottom'][start-aligned]) [part='arrow'],
53
- :host([theme~='arrow'][position^='top'][start-aligned]) [part='arrow'] {
54
- transform: translateX(-50%);
55
- inset-inline-start: 1.5rem;
56
- }
57
-
58
- :host([theme~='arrow'][position^='bottom'][end-aligned]) [part='arrow'],
59
- :host([theme~='arrow'][position^='top'][end-aligned]) [part='arrow'] {
60
- transform: translateX(50%);
61
- inset-inline-end: 1.5rem;
62
- }
63
-
64
- :host([theme~='arrow'][position^='bottom'][arrow-centered]) [part='arrow'],
65
- :host([theme~='arrow'][position^='top'][arrow-centered]) [part='arrow'] {
66
- transform: translateX(-50%);
67
- inset-inline-start: 50%;
68
- }
69
-
70
- /* start / end position */
71
- :host([theme~='arrow'][position^='start']) [part='arrow'],
72
- :host([theme~='arrow'][position^='end']) [part='arrow'] {
73
- border-top: var(--vaadin-popover-arrow-size) solid transparent;
74
- border-bottom: var(--vaadin-popover-arrow-size) solid transparent;
75
- }
76
-
77
- :host([theme~='arrow'][position^='start'][start-aligned]) [part='arrow'],
78
- :host([theme~='arrow'][position^='end'][start-aligned]) [part='arrow'] {
79
- inset-inline-start: calc(var(--vaadin-popover-arrow-size) * -1);
80
- border-right: var(--vaadin-popover-arrow-size) solid var(--material-background-color);
81
- filter: drop-shadow(-2px 0 1px rgba(0, 0, 0, 0.14));
82
- }
83
-
84
- :host([theme~='arrow'][position^='start'][end-aligned]) [part='arrow'],
85
- :host([theme~='arrow'][position^='end'][end-aligned]) [part='arrow'] {
86
- inset-inline-end: calc(var(--vaadin-popover-arrow-size) * -1);
87
- border-left: var(--vaadin-popover-arrow-size) solid var(--material-background-color);
88
- filter: drop-shadow(2px 0 1px rgba(0, 0, 0, 0.14));
89
- }
90
-
91
- :host([theme~='arrow'][position^='start'][top-aligned]) [part='arrow'],
92
- :host([theme~='arrow'][position^='end'][top-aligned]) [part='arrow'] {
93
- top: 0.5rem;
94
- }
95
-
96
- :host([theme~='arrow'][position='start'][top-aligned]) [part='arrow'],
97
- :host([theme~='arrow'][position='end'][top-aligned]) [part='arrow'] {
98
- top: 50%;
99
- transform: translateY(-50%);
100
- }
101
-
102
- :host([theme~='arrow'][position^='start'][bottom-aligned]) [part='arrow'],
103
- :host([theme~='arrow'][position^='end'][bottom-aligned]) [part='arrow'] {
104
- bottom: 0.5rem;
105
- }
106
- `;
107
-
108
- registerStyles('vaadin-popover-overlay', [overlay, popoverOverlay], { moduleId: 'material-popover-overlay' });
@@ -1,2 +0,0 @@
1
- import './vaadin-popover-styles.js';
2
- import '../../src/vaadin-popover.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-popover-styles.js';
2
- import '../../src/vaadin-popover.js';