@vaadin/popover 25.3.0-alpha8 → 25.3.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.
@@ -62,6 +62,20 @@
62
62
  "description": "A mixin providing common popover overlay functionality.",
63
63
  "name": "PopoverOverlayMixin",
64
64
  "members": [
65
+ {
66
+ "kind": "field",
67
+ "name": "autofocus",
68
+ "privacy": "public",
69
+ "type": {
70
+ "text": "boolean"
71
+ },
72
+ "description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
73
+ "attribute": "autofocus",
74
+ "inheritedFrom": {
75
+ "name": "OverlayFocusMixin",
76
+ "package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
77
+ }
78
+ },
65
79
  {
66
80
  "kind": "method",
67
81
  "name": "bringToFront",
@@ -94,7 +108,7 @@
94
108
  "type": {
95
109
  "text": "boolean"
96
110
  },
97
- "description": "When true, opening the overlay moves focus to the first focusable child,\nor to the overlay part with tabindex if there are no focusable children.",
111
+ "description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
98
112
  "attribute": "focus-trap",
99
113
  "inheritedFrom": {
100
114
  "name": "OverlayFocusMixin",
@@ -355,12 +369,24 @@
355
369
  }
356
370
  ],
357
371
  "attributes": [
372
+ {
373
+ "name": "autofocus",
374
+ "type": {
375
+ "text": "boolean"
376
+ },
377
+ "description": "Set to true to move focus into the overlay automatically on open.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
378
+ "fieldName": "autofocus",
379
+ "inheritedFrom": {
380
+ "name": "OverlayFocusMixin",
381
+ "package": "@vaadin/overlay/src/vaadin-overlay-focus-mixin.js"
382
+ }
383
+ },
358
384
  {
359
385
  "name": "focus-trap",
360
386
  "type": {
361
387
  "text": "boolean"
362
388
  },
363
- "description": "When true, opening the overlay moves focus to the first focusable child,\nor to the overlay part with tabindex if there are no focusable children.",
389
+ "description": "Set to true to move focus into the overlay automatically on open\nand keep it inside: Tab and Shift+Tab cycle through the overlay's\ncontent until the overlay is closed.\n\nFocus moves to the first tabbable element in the tab order. This\ncan be the overlay itself if it has `tabindex` attribute set to `0`\non the host element or the `overlay` shadow DOM part.",
364
390
  "fieldName": "focusTrap",
365
391
  "inheritedFrom": {
366
392
  "name": "OverlayFocusMixin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/popover",
3
- "version": "25.3.0-alpha8",
3
+ "version": "25.3.0-alpha9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,19 +37,19 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.3.0-alpha8",
41
- "@vaadin/component-base": "25.3.0-alpha8",
42
- "@vaadin/lit-renderer": "25.3.0-alpha8",
43
- "@vaadin/overlay": "25.3.0-alpha8",
44
- "@vaadin/vaadin-themable-mixin": "25.3.0-alpha8",
40
+ "@vaadin/a11y-base": "25.3.0-alpha9",
41
+ "@vaadin/component-base": "25.3.0-alpha9",
42
+ "@vaadin/lit-renderer": "25.3.0-alpha9",
43
+ "@vaadin/overlay": "25.3.0-alpha9",
44
+ "@vaadin/vaadin-themable-mixin": "25.3.0-alpha9",
45
45
  "lit": "^3.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vaadin/aura": "25.3.0-alpha8",
49
- "@vaadin/chai-plugins": "25.3.0-alpha8",
50
- "@vaadin/test-runner-commands": "25.3.0-alpha8",
48
+ "@vaadin/aura": "25.3.0-alpha9",
49
+ "@vaadin/chai-plugins": "25.3.0-alpha9",
50
+ "@vaadin/test-runner-commands": "25.3.0-alpha9",
51
51
  "@vaadin/testing-helpers": "^2.0.0",
52
- "@vaadin/vaadin-lumo-styles": "25.3.0-alpha8",
52
+ "@vaadin/vaadin-lumo-styles": "25.3.0-alpha9",
53
53
  "sinon": "^22.0.0"
54
54
  },
55
55
  "customElements": "custom-elements.json",
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "ccbb4aaffb63c745c6da0426b532d4d05e47af29"
60
+ "gitHead": "cb915ebde095ec5b94a87af93dd4530f51984c52"
61
61
  }
@@ -8,6 +8,7 @@ import { css, html, LitElement } from 'lit';
8
8
  import { ifDefined } from 'lit/directives/if-defined.js';
9
9
  import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
10
10
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
+ import { setOrRemoveAttribute } from '@vaadin/component-base/src/dom-utils.js';
11
12
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
13
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
13
14
  import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
@@ -608,27 +609,15 @@ class Popover extends PopoverPositionMixin(
608
609
  }
609
610
 
610
611
  if (props.has('accessibleName')) {
611
- if (this.accessibleName) {
612
- this.setAttribute('aria-label', this.accessibleName);
613
- } else {
614
- this.removeAttribute('aria-label');
615
- }
612
+ setOrRemoveAttribute(this, 'aria-label', this.accessibleName);
616
613
  }
617
614
 
618
615
  if (props.has('accessibleNameRef')) {
619
- if (this.accessibleNameRef) {
620
- this.setAttribute('aria-labelledby', this.accessibleNameRef);
621
- } else {
622
- this.removeAttribute('aria-labelledby');
623
- }
616
+ setOrRemoveAttribute(this, 'aria-labelledby', this.accessibleNameRef);
624
617
  }
625
618
 
626
619
  if (props.has('modal')) {
627
- if (this.modal) {
628
- this.setAttribute('aria-modal', 'true');
629
- } else {
630
- this.removeAttribute('aria-modal');
631
- }
620
+ setOrRemoveAttribute(this, 'aria-modal', this.modal);
632
621
  }
633
622
  }
634
623
 
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.3.0-alpha8",
4
+ "version": "25.3.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.3.0-alpha8",
4
+ "version": "25.3.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {