@vaadin/popover 25.2.7 → 25.3.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.
- package/custom-elements.json +35 -2
- package/package.json +11 -11
- package/src/vaadin-popover-focus-controller.js +3 -3
- package/src/vaadin-popover-overlay.js +3 -2
- package/src/vaadin-popover.js +5 -15
- package/web-types.json +2 -4
- package/web-types.lit.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -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": "
|
|
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": "
|
|
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",
|
|
@@ -1127,6 +1153,13 @@
|
|
|
1127
1153
|
"description": "The `role` attribute value to be set on the popover.\nWhen not specified, defaults to 'dialog'.",
|
|
1128
1154
|
"fieldName": "role"
|
|
1129
1155
|
},
|
|
1156
|
+
{
|
|
1157
|
+
"type": {
|
|
1158
|
+
"text": "string"
|
|
1159
|
+
},
|
|
1160
|
+
"description": "The theme variants to apply to the component.",
|
|
1161
|
+
"name": "theme"
|
|
1162
|
+
},
|
|
1130
1163
|
{
|
|
1131
1164
|
"name": "trigger",
|
|
1132
1165
|
"type": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/popover",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.3.0-alpha10",
|
|
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": "
|
|
41
|
-
"@vaadin/component-base": "
|
|
42
|
-
"@vaadin/lit-renderer": "
|
|
43
|
-
"@vaadin/overlay": "
|
|
44
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
40
|
+
"@vaadin/a11y-base": "25.3.0-alpha10",
|
|
41
|
+
"@vaadin/component-base": "25.3.0-alpha10",
|
|
42
|
+
"@vaadin/lit-renderer": "25.3.0-alpha10",
|
|
43
|
+
"@vaadin/overlay": "25.3.0-alpha10",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.3.0-alpha10",
|
|
45
45
|
"lit": "^3.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@vaadin/aura": "
|
|
49
|
-
"@vaadin/chai-plugins": "
|
|
50
|
-
"@vaadin/test-runner-commands": "
|
|
48
|
+
"@vaadin/aura": "25.3.0-alpha10",
|
|
49
|
+
"@vaadin/chai-plugins": "25.3.0-alpha10",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.3.0-alpha10",
|
|
51
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.3.0-alpha10",
|
|
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": "
|
|
60
|
+
"gitHead": "f2833abdf9b613fa0d0ed216830e3f4de87b7dac"
|
|
61
61
|
}
|
|
@@ -4,7 +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 { getActiveTrappingNode } from '@vaadin/a11y-base/src/focus-trap-controller.js';
|
|
7
|
-
import { getDeepActiveElement,
|
|
7
|
+
import { getDeepActiveElement, getTabbableElements, isElementFocused } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Controller that routes Tab and Shift+Tab when a non-modal popover is opened.
|
|
@@ -158,7 +158,7 @@ export class PopoverFocusController {
|
|
|
158
158
|
* @private
|
|
159
159
|
*/
|
|
160
160
|
__getLastPopoverFocusable() {
|
|
161
|
-
const lastContent =
|
|
161
|
+
const lastContent = getTabbableElements(this.host._overlayElement.$.content).pop();
|
|
162
162
|
return lastContent || this.host;
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -171,7 +171,7 @@ export class PopoverFocusController {
|
|
|
171
171
|
__getScopeFocusables() {
|
|
172
172
|
const host = this.host;
|
|
173
173
|
const scope = getActiveTrappingNode(host) || document.body;
|
|
174
|
-
return
|
|
174
|
+
return getTabbableElements(scope).filter((el) => el === host || !host.contains(el));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
/**
|
|
@@ -16,6 +16,7 @@ import { PopoverOverlayMixin } from './vaadin-popover-overlay-mixin.js';
|
|
|
16
16
|
/**
|
|
17
17
|
* An element used internally by `<vaadin-popover>`. Not intended to be used separately.
|
|
18
18
|
*
|
|
19
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
19
20
|
* @customElement vaadin-popover-overlay
|
|
20
21
|
* @extends HTMLElement
|
|
21
22
|
* @private
|
|
@@ -78,11 +79,11 @@ class PopoverOverlay extends PopoverOverlayMixin(
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
/**
|
|
81
|
-
* Override method from OverlayFocusMixin to use owner as focus
|
|
82
|
+
* Override method from OverlayFocusMixin to use owner as focus root
|
|
82
83
|
* @protected
|
|
83
84
|
* @override
|
|
84
85
|
*/
|
|
85
|
-
get
|
|
86
|
+
get _focusRoot() {
|
|
86
87
|
return this.owner;
|
|
87
88
|
}
|
|
88
89
|
|
package/src/vaadin-popover.js
CHANGED
|
@@ -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';
|
|
@@ -216,6 +217,7 @@ const hasOnlyNestedOverlays = (overlay) => getOverlaysOnTop(overlay).every((el)
|
|
|
216
217
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
217
218
|
* @fires {CustomEvent} closed - Fired when the popover is closed.
|
|
218
219
|
*
|
|
220
|
+
* @attr {string} theme - The theme variants to apply to the component.
|
|
219
221
|
* @customElement vaadin-popover
|
|
220
222
|
* @extends HTMLElement
|
|
221
223
|
*/
|
|
@@ -607,27 +609,15 @@ class Popover extends PopoverPositionMixin(
|
|
|
607
609
|
}
|
|
608
610
|
|
|
609
611
|
if (props.has('accessibleName')) {
|
|
610
|
-
|
|
611
|
-
this.setAttribute('aria-label', this.accessibleName);
|
|
612
|
-
} else {
|
|
613
|
-
this.removeAttribute('aria-label');
|
|
614
|
-
}
|
|
612
|
+
setOrRemoveAttribute(this, 'aria-label', this.accessibleName);
|
|
615
613
|
}
|
|
616
614
|
|
|
617
615
|
if (props.has('accessibleNameRef')) {
|
|
618
|
-
|
|
619
|
-
this.setAttribute('aria-labelledby', this.accessibleNameRef);
|
|
620
|
-
} else {
|
|
621
|
-
this.removeAttribute('aria-labelledby');
|
|
622
|
-
}
|
|
616
|
+
setOrRemoveAttribute(this, 'aria-labelledby', this.accessibleNameRef);
|
|
623
617
|
}
|
|
624
618
|
|
|
625
619
|
if (props.has('modal')) {
|
|
626
|
-
|
|
627
|
-
this.setAttribute('aria-modal', 'true');
|
|
628
|
-
} else {
|
|
629
|
-
this.removeAttribute('aria-modal');
|
|
630
|
-
}
|
|
620
|
+
setOrRemoveAttribute(this, 'aria-modal', this.modal);
|
|
631
621
|
}
|
|
632
622
|
}
|
|
633
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.
|
|
4
|
+
"version": "25.3.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -159,9 +159,7 @@
|
|
|
159
159
|
"description": "The theme variants to apply to the component.",
|
|
160
160
|
"value": {
|
|
161
161
|
"type": [
|
|
162
|
-
"string"
|
|
163
|
-
"null",
|
|
164
|
-
"undefined"
|
|
162
|
+
"string"
|
|
165
163
|
]
|
|
166
164
|
}
|
|
167
165
|
},
|