@vaadin/popover 25.0.0-alpha8 → 25.0.0-alpha9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/popover",
3
- "version": "25.0.0-alpha8",
3
+ "version": "25.0.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,17 +39,17 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "@open-wc/dedupe-mixin": "^1.3.0",
42
- "@vaadin/a11y-base": "25.0.0-alpha8",
43
- "@vaadin/component-base": "25.0.0-alpha8",
44
- "@vaadin/lit-renderer": "25.0.0-alpha8",
45
- "@vaadin/overlay": "25.0.0-alpha8",
46
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha8",
47
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha8",
42
+ "@vaadin/a11y-base": "25.0.0-alpha9",
43
+ "@vaadin/component-base": "25.0.0-alpha9",
44
+ "@vaadin/lit-renderer": "25.0.0-alpha9",
45
+ "@vaadin/overlay": "25.0.0-alpha9",
46
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
47
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
48
48
  "lit": "^3.0.0"
49
49
  },
50
50
  "devDependencies": {
51
- "@vaadin/chai-plugins": "25.0.0-alpha8",
52
- "@vaadin/test-runner-commands": "25.0.0-alpha8",
51
+ "@vaadin/chai-plugins": "25.0.0-alpha9",
52
+ "@vaadin/test-runner-commands": "25.0.0-alpha9",
53
53
  "@vaadin/testing-helpers": "^2.0.0",
54
54
  "sinon": "^18.0.0"
55
55
  },
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "ebf53673d5f639d2b1b6f2b31f640f530643ee2f"
60
+ "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
61
61
  }
@@ -50,7 +50,7 @@ const popoverOverlay = css`
50
50
  }
51
51
 
52
52
  :host([theme~='no-padding']) [part='content'] {
53
- padding: 0;
53
+ padding: 0 !important;
54
54
  }
55
55
 
56
56
  /* Increase the area of the popover so the pointer can go from the target directly to it. */
@@ -4,6 +4,7 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, LitElement } from 'lit';
7
+ import { isElementFocused } from '@vaadin/a11y-base/src/focus-utils.js';
7
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
9
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
10
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
@@ -44,6 +45,21 @@ class PopoverOverlay extends PopoverOverlayMixin(
44
45
  `;
45
46
  }
46
47
 
48
+ /** @protected */
49
+ updated(props) {
50
+ super.updated(props);
51
+
52
+ if (props.has('restoreFocusNode') && this.opened) {
53
+ // Save focus to be restored when target is set while opened
54
+ if (this.restoreFocusNode && isElementFocused(this.restoreFocusNode.focusElement || this.restoreFocusNode)) {
55
+ this.__focusRestorationController.saveFocus();
56
+ } else if (!this.restoreFocusNode) {
57
+ // Do not restore focus when target is cleared while opened
58
+ this.__focusRestorationController.focusNode = null;
59
+ }
60
+ }
61
+ }
62
+
47
63
  /**
48
64
  * @override
49
65
  * @protected
@@ -59,22 +75,6 @@ class PopoverOverlay extends PopoverOverlayMixin(
59
75
  get _modalRoot() {
60
76
  return this.owner;
61
77
  }
62
-
63
- /**
64
- * @protected
65
- * @override
66
- */
67
- _attachOverlay() {
68
- this.showPopover();
69
- }
70
-
71
- /**
72
- * @protected
73
- * @override
74
- */
75
- _detachOverlay() {
76
- this.hidePopover();
77
- }
78
78
  }
79
79
 
80
80
  defineCustomElement(PopoverOverlay);
@@ -469,7 +469,6 @@ class Popover extends PopoverPositionMixin(
469
469
  return html`
470
470
  <vaadin-popover-overlay
471
471
  id="overlay"
472
- popover="manual"
473
472
  .renderer="${this.renderer}"
474
473
  .owner="${this}"
475
474
  theme="${ifDefined(this._theme)}"
@@ -20,7 +20,7 @@ const popoverOverlay = css`
20
20
  }
21
21
 
22
22
  :host([theme~='no-padding']) [part='content'] {
23
- padding: 0;
23
+ padding: 0 !important;
24
24
  }
25
25
 
26
26
  :host([theme~='arrow']) {
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "25.0.0-alpha8",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/popover",
4
- "version": "25.0.0-alpha8",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {