@vaadin/menu-bar 24.9.0-beta1 → 24.9.0-rc1
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 +15 -15
- package/src/vaadin-menu-bar-mixin.js +7 -4
- 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.9.0-
|
|
3
|
+
"version": "24.9.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,22 +37,22 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
39
|
"@polymer/polymer": "^3.0.0",
|
|
40
|
-
"@vaadin/a11y-base": "24.9.0-
|
|
41
|
-
"@vaadin/button": "24.9.0-
|
|
42
|
-
"@vaadin/component-base": "24.9.0-
|
|
43
|
-
"@vaadin/context-menu": "24.9.0-
|
|
44
|
-
"@vaadin/item": "24.9.0-
|
|
45
|
-
"@vaadin/list-box": "24.9.0-
|
|
46
|
-
"@vaadin/overlay": "24.9.0-
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "24.9.0-
|
|
48
|
-
"@vaadin/vaadin-material-styles": "24.9.0-
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "24.9.0-
|
|
40
|
+
"@vaadin/a11y-base": "24.9.0-rc1",
|
|
41
|
+
"@vaadin/button": "24.9.0-rc1",
|
|
42
|
+
"@vaadin/component-base": "24.9.0-rc1",
|
|
43
|
+
"@vaadin/context-menu": "24.9.0-rc1",
|
|
44
|
+
"@vaadin/item": "24.9.0-rc1",
|
|
45
|
+
"@vaadin/list-box": "24.9.0-rc1",
|
|
46
|
+
"@vaadin/overlay": "24.9.0-rc1",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "24.9.0-rc1",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "24.9.0-rc1",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "24.9.0-rc1",
|
|
50
50
|
"lit": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@vaadin/chai-plugins": "24.9.0-
|
|
54
|
-
"@vaadin/icon": "24.9.0-
|
|
55
|
-
"@vaadin/test-runner-commands": "24.9.0-
|
|
53
|
+
"@vaadin/chai-plugins": "24.9.0-rc1",
|
|
54
|
+
"@vaadin/icon": "24.9.0-rc1",
|
|
55
|
+
"@vaadin/test-runner-commands": "24.9.0-rc1",
|
|
56
56
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
57
57
|
"sinon": "^18.0.0"
|
|
58
58
|
},
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"web-types.json",
|
|
61
61
|
"web-types.lit.json"
|
|
62
62
|
],
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "cfe9424405716297d9f1eee425d5a059b2f636f8"
|
|
64
64
|
}
|
|
@@ -741,17 +741,18 @@ export const MenuBarMixin = (superClass) =>
|
|
|
741
741
|
* and open another one for the newly focused button.
|
|
742
742
|
*
|
|
743
743
|
* @param {Element} item
|
|
744
|
+
* @param {FocusOptions=} options
|
|
744
745
|
* @param {boolean} navigating
|
|
745
746
|
* @protected
|
|
746
747
|
* @override
|
|
747
748
|
*/
|
|
748
|
-
_focusItem(item, navigating) {
|
|
749
|
+
_focusItem(item, options, navigating) {
|
|
749
750
|
const wasExpanded = navigating && this.focused === this._expandedButton;
|
|
750
751
|
if (wasExpanded) {
|
|
751
752
|
this._close();
|
|
752
753
|
}
|
|
753
754
|
|
|
754
|
-
super._focusItem(item, navigating);
|
|
755
|
+
super._focusItem(item, options, navigating);
|
|
755
756
|
|
|
756
757
|
this._buttons.forEach((btn) => {
|
|
757
758
|
this._setTabindex(btn, btn === item);
|
|
@@ -976,7 +977,8 @@ export const MenuBarMixin = (superClass) =>
|
|
|
976
977
|
}
|
|
977
978
|
|
|
978
979
|
if (options.keepFocus) {
|
|
979
|
-
|
|
980
|
+
const focusOptions = { focusVisible: isKeyboardActive() };
|
|
981
|
+
this._focusItem(this._expandedButton, focusOptions, false);
|
|
980
982
|
}
|
|
981
983
|
|
|
982
984
|
// Do not focus item when open not from keyboard
|
|
@@ -1020,7 +1022,8 @@ export const MenuBarMixin = (superClass) =>
|
|
|
1020
1022
|
if (button && button.hasAttribute('expanded')) {
|
|
1021
1023
|
this._setExpanded(button, false);
|
|
1022
1024
|
if (restoreFocus) {
|
|
1023
|
-
|
|
1025
|
+
const focusOptions = { focusVisible: isKeyboardActive() };
|
|
1026
|
+
this._focusItem(button, focusOptions, false);
|
|
1024
1027
|
}
|
|
1025
1028
|
this._expandedButton = null;
|
|
1026
1029
|
}
|
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.9.0-
|
|
4
|
+
"version": "24.9.0-rc1",
|
|
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.9.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.9.0-rc1/#/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.9.0-rc1/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.9.0-rc1/#/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.9.0-rc1/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.9.0-rc1/#/elements/vaadin-overlay).\n\nThe `<vaadin-menu-bar-item>` sub-menu elements have the following additional state attributes\non top of the built-in `<vaadin-item>` state attributes:\n\nAttribute | Description\n---------- |-------------\n`expanded` | Expanded parent item.\n\nNote: the `theme` attribute value set on `<vaadin-menu-bar>` is\npropagated to the internal components listed above.",
|
|
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.9.0-
|
|
4
|
+
"version": "24.9.0-rc1",
|
|
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.9.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.9.0-rc1/#/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.9.0-rc1/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.9.0-rc1/#/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.9.0-rc1/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.9.0-rc1/#/elements/vaadin-overlay).\n\nThe `<vaadin-menu-bar-item>` sub-menu elements have the following additional state attributes\non top of the built-in `<vaadin-item>` state attributes:\n\nAttribute | Description\n---------- |-------------\n`expanded` | Expanded parent item.\n\nNote: the `theme` attribute value set on `<vaadin-menu-bar>` is\npropagated to the internal components listed above.",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|