@vaadin/menu-bar 24.7.2 → 24.8.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/package.json +15 -15
- package/src/vaadin-menu-bar-mixin.d.ts +6 -12
- package/src/vaadin-menu-bar-mixin.js +36 -40
- package/web-types.json +17 -8
- package/web-types.lit.json +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/menu-bar",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.8.0-alpha10",
|
|
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": "
|
|
41
|
-
"@vaadin/button": "
|
|
42
|
-
"@vaadin/component-base": "
|
|
43
|
-
"@vaadin/context-menu": "
|
|
44
|
-
"@vaadin/item": "
|
|
45
|
-
"@vaadin/list-box": "
|
|
46
|
-
"@vaadin/overlay": "
|
|
47
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
48
|
-
"@vaadin/vaadin-material-styles": "
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
40
|
+
"@vaadin/a11y-base": "24.8.0-alpha10",
|
|
41
|
+
"@vaadin/button": "24.8.0-alpha10",
|
|
42
|
+
"@vaadin/component-base": "24.8.0-alpha10",
|
|
43
|
+
"@vaadin/context-menu": "24.8.0-alpha10",
|
|
44
|
+
"@vaadin/item": "24.8.0-alpha10",
|
|
45
|
+
"@vaadin/list-box": "24.8.0-alpha10",
|
|
46
|
+
"@vaadin/overlay": "24.8.0-alpha10",
|
|
47
|
+
"@vaadin/vaadin-lumo-styles": "24.8.0-alpha10",
|
|
48
|
+
"@vaadin/vaadin-material-styles": "24.8.0-alpha10",
|
|
49
|
+
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha10",
|
|
50
50
|
"lit": "^3.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@vaadin/chai-plugins": "
|
|
54
|
-
"@vaadin/icon": "
|
|
55
|
-
"@vaadin/test-runner-commands": "
|
|
53
|
+
"@vaadin/chai-plugins": "24.8.0-alpha10",
|
|
54
|
+
"@vaadin/icon": "24.8.0-alpha10",
|
|
55
|
+
"@vaadin/test-runner-commands": "24.8.0-alpha10",
|
|
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": "f8c79ffc67eccc3ade226dfe52fbf7d3d46428cf"
|
|
64
64
|
}
|
|
@@ -9,6 +9,7 @@ import type { FocusMixinClass } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
|
9
9
|
import type { KeyboardDirectionMixinClass } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
10
10
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
11
11
|
import type { ControllerMixinClass } from '@vaadin/component-base/src/controller-mixin.js';
|
|
12
|
+
import type { I18nMixinClass } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
12
13
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
13
14
|
|
|
14
15
|
export type MenuBarItem<TItemData extends object = object> = {
|
|
@@ -56,7 +57,7 @@ export type SubMenuItem<TItemData extends object = object> = {
|
|
|
56
57
|
} & TItemData;
|
|
57
58
|
|
|
58
59
|
export interface MenuBarI18n {
|
|
59
|
-
moreOptions
|
|
60
|
+
moreOptions?: string;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
export declare function MenuBarMixin<T extends Constructor<HTMLElement>, TItem extends MenuBarItem = MenuBarItem>(
|
|
@@ -64,6 +65,7 @@ export declare function MenuBarMixin<T extends Constructor<HTMLElement>, TItem e
|
|
|
64
65
|
): Constructor<ControllerMixinClass> &
|
|
65
66
|
Constructor<DisabledMixinClass> &
|
|
66
67
|
Constructor<FocusMixinClass> &
|
|
68
|
+
Constructor<I18nMixinClass<MenuBarI18n>> &
|
|
67
69
|
Constructor<KeyboardDirectionMixinClass> &
|
|
68
70
|
Constructor<KeyboardMixinClass> &
|
|
69
71
|
Constructor<MenuBarMixinClass<TItem>> &
|
|
@@ -121,17 +123,9 @@ export declare class MenuBarMixinClass<TItem extends MenuBarItem = MenuBarItem>
|
|
|
121
123
|
items: TItem[];
|
|
122
124
|
|
|
123
125
|
/**
|
|
124
|
-
* The object used to localize this component.
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* To update individual properties, extend the existing i18n object like so:
|
|
129
|
-
* ```
|
|
130
|
-
* menuBar.i18n = {
|
|
131
|
-
* ...menuBar.i18n,
|
|
132
|
-
* moreOptions: 'More options'
|
|
133
|
-
* }
|
|
134
|
-
* ```
|
|
126
|
+
* The object used to localize this component. To change the default
|
|
127
|
+
* localization, replace this with an object that provides all properties, or
|
|
128
|
+
* just the individual properties you want to change.
|
|
135
129
|
*
|
|
136
130
|
* The object has the following JSON structure and default values:
|
|
137
131
|
* ```
|
|
@@ -8,20 +8,27 @@ import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
|
8
8
|
import { isElementFocused, isElementHidden, isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
9
9
|
import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
10
10
|
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
11
|
+
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
11
12
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
12
13
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
13
14
|
|
|
15
|
+
const DEFAULT_I18N = {
|
|
16
|
+
moreOptions: 'More options',
|
|
17
|
+
};
|
|
18
|
+
|
|
14
19
|
/**
|
|
15
20
|
* @polymerMixin
|
|
16
|
-
* @mixes DisabledMixin
|
|
17
21
|
* @mixes ControllerMixin
|
|
22
|
+
* @mixes DisabledMixin
|
|
18
23
|
* @mixes FocusMixin
|
|
24
|
+
* @mixes I18nMixin
|
|
19
25
|
* @mixes KeyboardDirectionMixin
|
|
20
26
|
* @mixes ResizeMixin
|
|
21
27
|
*/
|
|
22
28
|
export const MenuBarMixin = (superClass) =>
|
|
23
|
-
class MenuBarMixinClass extends
|
|
24
|
-
|
|
29
|
+
class MenuBarMixinClass extends I18nMixin(
|
|
30
|
+
DEFAULT_I18N,
|
|
31
|
+
KeyboardDirectionMixin(ResizeMixin(FocusMixin(DisabledMixin(ControllerMixin(superClass))))),
|
|
25
32
|
) {
|
|
26
33
|
static get properties() {
|
|
27
34
|
return {
|
|
@@ -108,38 +115,6 @@ export const MenuBarMixin = (superClass) =>
|
|
|
108
115
|
value: () => [],
|
|
109
116
|
},
|
|
110
117
|
|
|
111
|
-
/**
|
|
112
|
-
* The object used to localize this component.
|
|
113
|
-
* To change the default localization, replace the entire
|
|
114
|
-
* `i18n` object with a custom one.
|
|
115
|
-
*
|
|
116
|
-
* To update individual properties, extend the existing i18n object like so:
|
|
117
|
-
* ```
|
|
118
|
-
* menuBar.i18n = {
|
|
119
|
-
* ...menuBar.i18n,
|
|
120
|
-
* moreOptions: 'More options'
|
|
121
|
-
* }
|
|
122
|
-
* ```
|
|
123
|
-
*
|
|
124
|
-
* The object has the following JSON structure and default values:
|
|
125
|
-
* ```
|
|
126
|
-
* {
|
|
127
|
-
* moreOptions: 'More options'
|
|
128
|
-
* }
|
|
129
|
-
* ```
|
|
130
|
-
*
|
|
131
|
-
* @type {!MenuBarI18n}
|
|
132
|
-
* @default {English/US}
|
|
133
|
-
*/
|
|
134
|
-
i18n: {
|
|
135
|
-
type: Object,
|
|
136
|
-
value: () => {
|
|
137
|
-
return {
|
|
138
|
-
moreOptions: 'More options',
|
|
139
|
-
};
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
|
|
143
118
|
/**
|
|
144
119
|
* A space-delimited list of CSS class names
|
|
145
120
|
* to set on each sub-menu overlay element.
|
|
@@ -202,13 +177,34 @@ export const MenuBarMixin = (superClass) =>
|
|
|
202
177
|
return [
|
|
203
178
|
'_themeChanged(_theme, _overflow, _container)',
|
|
204
179
|
'__hasOverflowChanged(_hasOverflow, _overflow)',
|
|
205
|
-
'__i18nChanged(
|
|
180
|
+
'__i18nChanged(__effectiveI18n, _overflow)',
|
|
206
181
|
'_menuItemsChanged(items, _overflow, _container)',
|
|
207
182
|
'_reverseCollapseChanged(reverseCollapse, _overflow, _container)',
|
|
208
183
|
'_tabNavigationChanged(tabNavigation, _overflow, _container)',
|
|
209
184
|
];
|
|
210
185
|
}
|
|
211
186
|
|
|
187
|
+
/**
|
|
188
|
+
* The object used to localize this component. To change the default
|
|
189
|
+
* localization, replace this with an object that provides all properties, or
|
|
190
|
+
* just the individual properties you want to change.
|
|
191
|
+
*
|
|
192
|
+
* The object has the following JSON structure and default values:
|
|
193
|
+
* ```
|
|
194
|
+
* {
|
|
195
|
+
* moreOptions: 'More options'
|
|
196
|
+
* }
|
|
197
|
+
* ```
|
|
198
|
+
* @return {!MenuBarI18n}
|
|
199
|
+
*/
|
|
200
|
+
get i18n() {
|
|
201
|
+
return super.i18n;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
set i18n(value) {
|
|
205
|
+
super.i18n = value;
|
|
206
|
+
}
|
|
207
|
+
|
|
212
208
|
constructor() {
|
|
213
209
|
super();
|
|
214
210
|
this.__boundOnContextMenuKeydown = this.__onContextMenuKeydown.bind(this);
|
|
@@ -423,10 +419,10 @@ export const MenuBarMixin = (superClass) =>
|
|
|
423
419
|
}
|
|
424
420
|
|
|
425
421
|
/** @private */
|
|
426
|
-
__i18nChanged(
|
|
427
|
-
if (overflow &&
|
|
428
|
-
if (
|
|
429
|
-
overflow.setAttribute('aria-label',
|
|
422
|
+
__i18nChanged(effectiveI18n, overflow) {
|
|
423
|
+
if (overflow && effectiveI18n && effectiveI18n.moreOptions !== undefined) {
|
|
424
|
+
if (effectiveI18n.moreOptions) {
|
|
425
|
+
overflow.setAttribute('aria-label', effectiveI18n.moreOptions);
|
|
430
426
|
} else {
|
|
431
427
|
overflow.removeAttribute('aria-label');
|
|
432
428
|
}
|
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.
|
|
4
|
+
"version": "24.8.0-alpha10",
|
|
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.
|
|
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.8.0-alpha10/#/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.8.0-alpha10/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha10/#/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.8.0-alpha10/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha10/#/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",
|
|
@@ -21,6 +21,15 @@
|
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"name": "i18n",
|
|
26
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.",
|
|
27
|
+
"value": {
|
|
28
|
+
"type": [
|
|
29
|
+
"Object"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
24
33
|
{
|
|
25
34
|
"name": "overlay-class",
|
|
26
35
|
"description": "A space-delimited list of CSS class names\nto set on each sub-menu overlay element.",
|
|
@@ -91,20 +100,20 @@
|
|
|
91
100
|
}
|
|
92
101
|
},
|
|
93
102
|
{
|
|
94
|
-
"name": "
|
|
95
|
-
"description": "
|
|
103
|
+
"name": "i18n",
|
|
104
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n```\n{\n moreOptions: 'More options'\n}\n```",
|
|
96
105
|
"value": {
|
|
97
106
|
"type": [
|
|
98
|
-
"
|
|
107
|
+
"MenuBarI18n"
|
|
99
108
|
]
|
|
100
109
|
}
|
|
101
110
|
},
|
|
102
111
|
{
|
|
103
|
-
"name": "
|
|
104
|
-
"description": "
|
|
112
|
+
"name": "items",
|
|
113
|
+
"description": "Defines a hierarchical structure, where root level items represent menu bar buttons,\nand `children` property configures a submenu with items to be opened below\nthe button on click, Enter, Space, Up and Down arrow keys.\n\n#### Example\n\n```js\nmenubar.items = [\n {\n text: 'File',\n className: 'file',\n children: [\n {text: 'Open', className: 'file open'}\n {text: 'Auto Save', checked: true},\n ]\n },\n {component: 'hr'},\n {\n text: 'Edit',\n children: [\n {text: 'Undo', disabled: true},\n {text: 'Redo'}\n ]\n },\n {text: 'Help'}\n];\n```\n\n#### Disabled buttons\n\nWhen disabled, menu bar buttons (root-level items) are rendered\nas \"dimmed\" and prevent all user interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```\n// Set before any menu bar is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true;\n```\n```\n// Set before any menu bar is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true;\n```",
|
|
105
114
|
"value": {
|
|
106
115
|
"type": [
|
|
107
|
-
"
|
|
116
|
+
"Array.<MenuBarItem>"
|
|
108
117
|
]
|
|
109
118
|
}
|
|
110
119
|
},
|
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.
|
|
4
|
+
"version": "24.8.0-alpha10",
|
|
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.
|
|
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.8.0-alpha10/#/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.8.0-alpha10/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha10/#/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.8.0-alpha10/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.8.0-alpha10/#/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
|
{
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
"name": ".
|
|
52
|
-
"description": "
|
|
51
|
+
"name": ".i18n",
|
|
52
|
+
"description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n```\n{\n moreOptions: 'More options'\n}\n```",
|
|
53
53
|
"value": {
|
|
54
54
|
"kind": "expression"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
|
-
"name": ".
|
|
59
|
-
"description": "
|
|
58
|
+
"name": ".items",
|
|
59
|
+
"description": "Defines a hierarchical structure, where root level items represent menu bar buttons,\nand `children` property configures a submenu with items to be opened below\nthe button on click, Enter, Space, Up and Down arrow keys.\n\n#### Example\n\n```js\nmenubar.items = [\n {\n text: 'File',\n className: 'file',\n children: [\n {text: 'Open', className: 'file open'}\n {text: 'Auto Save', checked: true},\n ]\n },\n {component: 'hr'},\n {\n text: 'Edit',\n children: [\n {text: 'Undo', disabled: true},\n {text: 'Redo'}\n ]\n },\n {text: 'Help'}\n];\n```\n\n#### Disabled buttons\n\nWhen disabled, menu bar buttons (root-level items) are rendered\nas \"dimmed\" and prevent all user interactions (mouse and keyboard).\n\nSince disabled buttons are not focusable and cannot react to hover\nevents by default, it can cause accessibility issues by making them\nentirely invisible to assistive technologies, and prevents the use\nof Tooltips to explain why the action is not available. This can be\naddressed by enabling the feature flag `accessibleDisabledButtons`,\nwhich makes disabled buttons focusable and hoverable, while still\npreventing them from being triggered:\n\n```\n// Set before any menu bar is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true;\n```\n```\n// Set before any menu bar is attached to the DOM.\nwindow.Vaadin.featureFlags.accessibleDisabledButtons = true;\n```",
|
|
60
60
|
"value": {
|
|
61
61
|
"kind": "expression"
|
|
62
62
|
}
|