@vaadin/menu-bar 24.2.0-alpha1 → 24.2.0-alpha11
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 +14 -14
- package/src/vaadin-menu-bar-mixin.js +7 -0
- package/src/vaadin-menu-bar-overlay.d.ts +4 -2
- package/src/vaadin-menu-bar-overlay.js +25 -6
- package/theme/lumo/vaadin-menu-bar.js +0 -1
- package/theme/material/vaadin-menu-bar.js +0 -1
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/menu-bar",
|
|
3
|
-
"version": "24.2.0-
|
|
3
|
+
"version": "24.2.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,26 +37,26 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
39
|
"@polymer/polymer": "^3.0.0",
|
|
40
|
-
"@vaadin/a11y-base": "24.2.0-
|
|
41
|
-
"@vaadin/button": "24.2.0-
|
|
42
|
-
"@vaadin/component-base": "24.2.0-
|
|
43
|
-
"@vaadin/context-menu": "24.2.0-
|
|
44
|
-
"@vaadin/item": "24.2.0-
|
|
45
|
-
"@vaadin/list-box": "24.2.0-
|
|
46
|
-
"@vaadin/overlay": "24.2.0-
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "24.2.0-
|
|
48
|
-
"@vaadin/vaadin-material-styles": "24.2.0-
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "24.2.0-
|
|
40
|
+
"@vaadin/a11y-base": "24.2.0-alpha11",
|
|
41
|
+
"@vaadin/button": "24.2.0-alpha11",
|
|
42
|
+
"@vaadin/component-base": "24.2.0-alpha11",
|
|
43
|
+
"@vaadin/context-menu": "24.2.0-alpha11",
|
|
44
|
+
"@vaadin/item": "24.2.0-alpha11",
|
|
45
|
+
"@vaadin/list-box": "24.2.0-alpha11",
|
|
46
|
+
"@vaadin/overlay": "24.2.0-alpha11",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "24.2.0-alpha11",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "24.2.0-alpha11",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "24.2.0-alpha11"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@esm-bundle/chai": "^4.3.4",
|
|
53
|
-
"@vaadin/icon": "24.2.0-
|
|
54
|
-
"@vaadin/testing-helpers": "^0.
|
|
53
|
+
"@vaadin/icon": "24.2.0-alpha11",
|
|
54
|
+
"@vaadin/testing-helpers": "^0.5.0",
|
|
55
55
|
"sinon": "^13.0.2"
|
|
56
56
|
},
|
|
57
57
|
"web-types": [
|
|
58
58
|
"web-types.json",
|
|
59
59
|
"web-types.lit.json"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "a958207d5f6a09ca0e2dcf9f62194b3f92c8766a"
|
|
62
62
|
}
|
|
@@ -276,6 +276,13 @@ export const MenuBarMixin = (superClass) =>
|
|
|
276
276
|
}
|
|
277
277
|
const items = buttons.filter((_, idx) => idx >= i).map((b) => b.item);
|
|
278
278
|
this.__updateOverflow(items);
|
|
279
|
+
|
|
280
|
+
const remaining = buttons.slice(0, i);
|
|
281
|
+
// Ensure there is at least one button with tabindex set to 0
|
|
282
|
+
// so that menu-bar is not skipped when navigating with Tab
|
|
283
|
+
if (i > 0 && !remaining.some((btn) => btn.getAttribute('tabindex') === '0')) {
|
|
284
|
+
this._setTabindex(remaining[i - 1], true);
|
|
285
|
+
}
|
|
279
286
|
}
|
|
280
287
|
}
|
|
281
288
|
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
6
7
|
import { MenuOverlayMixin } from '@vaadin/context-menu/src/vaadin-menu-overlay-mixin.js';
|
|
7
|
-
import {
|
|
8
|
+
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
9
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* An element used internally by `<vaadin-menu-bar>`. Not intended to be used separately.
|
|
11
13
|
*/
|
|
12
|
-
declare class MenuBarOverlay extends MenuOverlayMixin(
|
|
14
|
+
declare class MenuBarOverlay extends MenuOverlayMixin(OverlayMixin(DirMixin(ThemableMixin(HTMLElement)))) {}
|
|
13
15
|
|
|
14
16
|
declare global {
|
|
15
17
|
interface HTMLElementTagNameMap {
|
|
@@ -3,24 +3,43 @@
|
|
|
3
3
|
* Copyright (c) 2019 - 2023 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
+
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
|
+
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
6
8
|
import { MenuOverlayMixin } from '@vaadin/context-menu/src/vaadin-menu-overlay-mixin.js';
|
|
7
9
|
import { styles } from '@vaadin/context-menu/src/vaadin-menu-overlay-styles.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
+
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
11
|
+
import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
|
|
12
|
+
import { registerStyles, ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
13
|
|
|
11
|
-
registerStyles('vaadin-menu-bar-overlay', styles, {
|
|
14
|
+
registerStyles('vaadin-menu-bar-overlay', [overlayStyles, styles], {
|
|
15
|
+
moduleId: 'vaadin-menu-bar-overlay-styles',
|
|
16
|
+
});
|
|
12
17
|
|
|
13
18
|
/**
|
|
14
19
|
* An element used internally by `<vaadin-menu-bar>`. Not intended to be used separately.
|
|
15
20
|
*
|
|
16
|
-
* @extends
|
|
21
|
+
* @extends HTMLElement
|
|
22
|
+
* @mixes DirMixin
|
|
17
23
|
* @mixes MenuOverlayMixin
|
|
18
|
-
* @
|
|
24
|
+
* @mixes OverlayMixin
|
|
25
|
+
* @mixes ThemableMixin
|
|
26
|
+
* @protected
|
|
19
27
|
*/
|
|
20
|
-
class MenuBarOverlay extends MenuOverlayMixin(
|
|
28
|
+
export class MenuBarOverlay extends MenuOverlayMixin(OverlayMixin(DirMixin(ThemableMixin(PolymerElement)))) {
|
|
21
29
|
static get is() {
|
|
22
30
|
return 'vaadin-menu-bar-overlay';
|
|
23
31
|
}
|
|
32
|
+
|
|
33
|
+
static get template() {
|
|
34
|
+
return html`
|
|
35
|
+
<div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
|
|
36
|
+
<div part="overlay" id="overlay" tabindex="0">
|
|
37
|
+
<div part="content" id="content">
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
24
43
|
}
|
|
25
44
|
|
|
26
45
|
customElements.define(MenuBarOverlay.is, MenuBarOverlay);
|
|
@@ -3,5 +3,4 @@ import './vaadin-menu-bar-item-styles.js';
|
|
|
3
3
|
import './vaadin-menu-bar-list-box-styles.js';
|
|
4
4
|
import './vaadin-menu-bar-overlay-styles.js';
|
|
5
5
|
import './vaadin-menu-bar-styles.js';
|
|
6
|
-
import '@vaadin/overlay/theme/lumo/vaadin-overlay.js';
|
|
7
6
|
import '../../src/vaadin-menu-bar.js';
|
|
@@ -3,5 +3,4 @@ import './vaadin-menu-bar-item-styles.js';
|
|
|
3
3
|
import './vaadin-menu-bar-list-box-styles.js';
|
|
4
4
|
import './vaadin-menu-bar-styles.js';
|
|
5
5
|
import './vaadin-menu-bar-overlay-styles.js';
|
|
6
|
-
import '@vaadin/overlay/theme/material/vaadin-overlay.js';
|
|
7
6
|
import '../../src/vaadin-menu-bar.js';
|
package/web-types.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/menu-bar",
|
|
4
|
-
"version": "24.2.0-
|
|
4
|
+
"version": "24.2.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-menu-bar",
|
|
11
|
-
"description": "`<vaadin-menu-bar>` is a Web Component providing a set of horizontally stacked buttons offering\nthe user quick access to a consistent set of commands. Each button can toggle a submenu with\nsupport for additional levels of nested menus.\n\nTo create the menu bar, first add the component to the page:\n\n```\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-
|
|
11
|
+
"description": "`<vaadin-menu-bar>` is a Web Component providing a set of horizontally stacked buttons offering\nthe user quick access to a consistent set of commands. Each button can toggle a submenu with\nsupport for additional levels of nested menus.\n\nTo create the menu bar, first add the component to the page:\n\n```\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-menu-bar#property-items) property to initialize the structure:\n\n```\ndocument.querySelector('vaadin-menu-bar').items = [{text: 'File'}, {text: 'Edit'}];\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n------------------|----------------\n`container` | The container wrapping menu bar buttons.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|----------------------------------\n`disabled` | Set when the menu bar is disabled\n`has-single-button` | Set when there is only one button visible\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-menu-bar>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-menu-bar-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-item).\n- `<vaadin-menu-bar-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-overlay).",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "disabled",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/menu-bar",
|
|
4
|
-
"version": "24.2.0-
|
|
4
|
+
"version": "24.2.0-alpha11",
|
|
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-menu-bar",
|
|
19
|
-
"description": "`<vaadin-menu-bar>` is a Web Component providing a set of horizontally stacked buttons offering\nthe user quick access to a consistent set of commands. Each button can toggle a submenu with\nsupport for additional levels of nested menus.\n\nTo create the menu bar, first add the component to the page:\n\n```\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-
|
|
19
|
+
"description": "`<vaadin-menu-bar>` is a Web Component providing a set of horizontally stacked buttons offering\nthe user quick access to a consistent set of commands. Each button can toggle a submenu with\nsupport for additional levels of nested menus.\n\nTo create the menu bar, first add the component to the page:\n\n```\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-menu-bar#property-items) property to initialize the structure:\n\n```\ndocument.querySelector('vaadin-menu-bar').items = [{text: 'File'}, {text: 'Edit'}];\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n------------------|----------------\n`container` | The container wrapping menu bar buttons.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n--------------------|----------------------------------\n`disabled` | Set when the menu bar is disabled\n`has-single-button` | Set when there is only one button visible\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-menu-bar>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-menu-bar-button>` - has the same API as [`<vaadin-button>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-item).\n- `<vaadin-menu-bar-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.2.0-alpha11/#/elements/vaadin-overlay).",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|