@vaadin/menu-bar 25.0.0-alpha5 → 25.0.0-alpha7
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-item.js +2 -2
- package/src/vaadin-menu-bar-list-box.js +2 -2
- package/src/vaadin-menu-bar-mixin.js +79 -117
- package/src/vaadin-menu-bar-overlay.js +2 -2
- package/src/vaadin-menu-bar.js +3 -3
- 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": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha7",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/button": "25.0.0-
|
|
40
|
-
"@vaadin/component-base": "25.0.0-
|
|
41
|
-
"@vaadin/context-menu": "25.0.0-
|
|
42
|
-
"@vaadin/item": "25.0.0-
|
|
43
|
-
"@vaadin/list-box": "25.0.0-
|
|
44
|
-
"@vaadin/overlay": "25.0.0-
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
38
|
+
"@vaadin/a11y-base": "25.0.0-alpha7",
|
|
39
|
+
"@vaadin/button": "25.0.0-alpha7",
|
|
40
|
+
"@vaadin/component-base": "25.0.0-alpha7",
|
|
41
|
+
"@vaadin/context-menu": "25.0.0-alpha7",
|
|
42
|
+
"@vaadin/item": "25.0.0-alpha7",
|
|
43
|
+
"@vaadin/list-box": "25.0.0-alpha7",
|
|
44
|
+
"@vaadin/overlay": "25.0.0-alpha7",
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha7",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha7",
|
|
47
47
|
"lit": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
51
|
-
"@vaadin/icon": "25.0.0-
|
|
52
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
50
|
+
"@vaadin/chai-plugins": "25.0.0-alpha7",
|
|
51
|
+
"@vaadin/icon": "25.0.0-alpha7",
|
|
52
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha7",
|
|
53
53
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
54
54
|
"sinon": "^18.0.0"
|
|
55
55
|
},
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"web-types.json",
|
|
58
58
|
"web-types.lit.json"
|
|
59
59
|
],
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "87f72707ce6866892f8be5782fa0da008e87dcbc"
|
|
61
61
|
}
|
|
@@ -9,7 +9,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
10
|
import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js';
|
|
11
11
|
import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
12
|
-
import {
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
13
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -22,7 +22,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
22
22
|
* @mixes ThemableMixin
|
|
23
23
|
* @protected
|
|
24
24
|
*/
|
|
25
|
-
class MenuBarItem extends ItemMixin(ThemableMixin(DirMixin(
|
|
25
|
+
class MenuBarItem extends ItemMixin(ThemableMixin(DirMixin(LumoInjectionMixin(PolylitMixin(LitElement))))) {
|
|
26
26
|
static get is() {
|
|
27
27
|
return 'vaadin-menu-bar-item';
|
|
28
28
|
}
|
|
@@ -9,7 +9,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
9
9
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
11
|
import { listBoxStyles } from '@vaadin/list-box/src/styles/vaadin-list-box-core-styles.js';
|
|
12
|
-
import {
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
13
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -22,7 +22,7 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
22
22
|
* @mixes ThemableMixin
|
|
23
23
|
* @protected
|
|
24
24
|
*/
|
|
25
|
-
class MenuBarListBox extends ListMixin(ThemableMixin(DirMixin(
|
|
25
|
+
class MenuBarListBox extends ListMixin(ThemableMixin(DirMixin(LumoInjectionMixin(PolylitMixin(LitElement))))) {
|
|
26
26
|
static get is() {
|
|
27
27
|
return 'vaadin-menu-bar-list-box';
|
|
28
28
|
}
|
|
@@ -10,6 +10,8 @@ import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
|
|
|
10
10
|
import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
|
|
11
11
|
import { isElementFocused, isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
|
|
12
12
|
import { KeyboardDirectionMixin } from '@vaadin/a11y-base/src/keyboard-direction-mixin.js';
|
|
13
|
+
import { microTask } from '@vaadin/component-base/src/async.js';
|
|
14
|
+
import { Debouncer } from '@vaadin/component-base/src/debounce.js';
|
|
13
15
|
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
14
16
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
15
17
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
@@ -189,41 +191,9 @@ export const MenuBarMixin = (superClass) =>
|
|
|
189
191
|
type: Boolean,
|
|
190
192
|
sync: true,
|
|
191
193
|
},
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* @type {boolean}
|
|
195
|
-
* @protected
|
|
196
|
-
*/
|
|
197
|
-
_hasOverflow: {
|
|
198
|
-
type: Boolean,
|
|
199
|
-
value: false,
|
|
200
|
-
sync: true,
|
|
201
|
-
},
|
|
202
|
-
|
|
203
|
-
/** @protected */
|
|
204
|
-
_overflow: {
|
|
205
|
-
type: Object,
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
/** @protected */
|
|
209
|
-
_container: {
|
|
210
|
-
type: Object,
|
|
211
|
-
sync: true,
|
|
212
|
-
},
|
|
213
194
|
};
|
|
214
195
|
}
|
|
215
196
|
|
|
216
|
-
static get observers() {
|
|
217
|
-
return [
|
|
218
|
-
'_themeChanged(_theme, _overflow, _container)',
|
|
219
|
-
'__hasOverflowChanged(_hasOverflow, _overflow)',
|
|
220
|
-
'__i18nChanged(__effectiveI18n, _overflow)',
|
|
221
|
-
'__updateButtons(items, disabled, _overflow, _container)',
|
|
222
|
-
'_reverseCollapseChanged(reverseCollapse, _overflow, _container)',
|
|
223
|
-
'_tabNavigationChanged(tabNavigation, _overflow, _container)',
|
|
224
|
-
];
|
|
225
|
-
}
|
|
226
|
-
|
|
227
197
|
/**
|
|
228
198
|
* The object used to localize this component. To change the default
|
|
229
199
|
* localization, replace this with an object that provides all properties, or
|
|
@@ -309,6 +279,18 @@ export const MenuBarMixin = (superClass) =>
|
|
|
309
279
|
return this.shadowRoot.querySelector('vaadin-menu-bar-submenu');
|
|
310
280
|
}
|
|
311
281
|
|
|
282
|
+
/** @private */
|
|
283
|
+
get _hasOverflow() {
|
|
284
|
+
return this._overflow && !this._overflow.hasAttribute('hidden');
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/** @private */
|
|
288
|
+
set _hasOverflow(hasOverflow) {
|
|
289
|
+
if (this._overflow) {
|
|
290
|
+
this._overflow.toggleAttribute('hidden', !hasOverflow);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
312
294
|
/** @protected */
|
|
313
295
|
ready() {
|
|
314
296
|
super.ready();
|
|
@@ -342,16 +324,40 @@ export const MenuBarMixin = (superClass) =>
|
|
|
342
324
|
const overlay = this._subMenu._overlayElement;
|
|
343
325
|
overlay.addEventListener('keydown', this.__boundOnContextMenuKeydown);
|
|
344
326
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
container.addEventListener('mouseover', (e) => this._onMouseOver(e));
|
|
327
|
+
this._container = this.shadowRoot.querySelector('[part="container"]');
|
|
328
|
+
}
|
|
348
329
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
330
|
+
/** @protected */
|
|
331
|
+
updated(props) {
|
|
332
|
+
super.updated(props);
|
|
333
|
+
|
|
334
|
+
if (props.has('items') || props.has('_theme') || props.has('disabled')) {
|
|
335
|
+
this.__renderButtons(this.items);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (props.has('items') || props.has('_theme') || props.has('reverseCollapse')) {
|
|
339
|
+
this.__scheduleOverflow();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (props.has('items')) {
|
|
343
|
+
this.__updateSubMenu();
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (props.has('_theme')) {
|
|
347
|
+
this._themeChanged(this._theme);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (props.has('disabled')) {
|
|
351
|
+
this._overflow.toggleAttribute('disabled', this.disabled);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if (props.has('tabNavigation')) {
|
|
355
|
+
this._tabNavigationChanged(this.tabNavigation);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (props.has('__effectiveI18n')) {
|
|
359
|
+
this.__i18nChanged(this.__effectiveI18n);
|
|
360
|
+
}
|
|
355
361
|
}
|
|
356
362
|
|
|
357
363
|
/**
|
|
@@ -380,84 +386,37 @@ export const MenuBarMixin = (superClass) =>
|
|
|
380
386
|
* @override
|
|
381
387
|
*/
|
|
382
388
|
_onResize() {
|
|
383
|
-
this.
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
/**
|
|
387
|
-
* A callback for the `_theme` property observer.
|
|
388
|
-
* It propagates the host theme to the buttons and the sub menu.
|
|
389
|
-
*
|
|
390
|
-
* @param {string | null} theme
|
|
391
|
-
* @private
|
|
392
|
-
*/
|
|
393
|
-
_themeChanged(theme, overflow, container) {
|
|
394
|
-
if (overflow && container) {
|
|
395
|
-
this.__renderButtons(this.items);
|
|
396
|
-
this.__detectOverflow();
|
|
397
|
-
|
|
398
|
-
if (theme) {
|
|
399
|
-
overflow.setAttribute('theme', theme);
|
|
400
|
-
this._subMenu.setAttribute('theme', theme);
|
|
401
|
-
} else {
|
|
402
|
-
overflow.removeAttribute('theme');
|
|
403
|
-
this._subMenu.removeAttribute('theme');
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* A callback for the 'reverseCollapse' property observer.
|
|
410
|
-
*
|
|
411
|
-
* @param {boolean | null} _reverseCollapse
|
|
412
|
-
* @private
|
|
413
|
-
*/
|
|
414
|
-
_reverseCollapseChanged(_reverseCollapse, overflow, container) {
|
|
415
|
-
if (overflow && container) {
|
|
416
|
-
this.__detectOverflow();
|
|
417
|
-
}
|
|
389
|
+
this.__scheduleOverflow();
|
|
418
390
|
}
|
|
419
391
|
|
|
420
392
|
/** @private */
|
|
421
|
-
|
|
422
|
-
if (
|
|
423
|
-
|
|
424
|
-
this.
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
this._setTabindex(btn, false);
|
|
429
|
-
}
|
|
430
|
-
btn.setAttribute('role', tabNavigation ? 'button' : 'menuitem');
|
|
431
|
-
});
|
|
393
|
+
_themeChanged(theme) {
|
|
394
|
+
if (theme) {
|
|
395
|
+
this._overflow.setAttribute('theme', theme);
|
|
396
|
+
this._subMenu.setAttribute('theme', theme);
|
|
397
|
+
} else {
|
|
398
|
+
this._overflow.removeAttribute('theme');
|
|
399
|
+
this._subMenu.removeAttribute('theme');
|
|
432
400
|
}
|
|
433
|
-
this.setAttribute('role', tabNavigation ? 'group' : 'menubar');
|
|
434
401
|
}
|
|
435
402
|
|
|
436
403
|
/** @private */
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
404
|
+
_tabNavigationChanged(tabNavigation) {
|
|
405
|
+
const target = this.querySelector('[tabindex="0"]');
|
|
406
|
+
this._buttons.forEach((btn) => {
|
|
407
|
+
if (target) {
|
|
408
|
+
this._setTabindex(btn, btn === target);
|
|
409
|
+
} else {
|
|
410
|
+
this._setTabindex(btn, false);
|
|
411
|
+
}
|
|
412
|
+
btn.setAttribute('role', tabNavigation ? 'button' : 'menuitem');
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
this.setAttribute('role', tabNavigation ? 'group' : 'menubar');
|
|
441
416
|
}
|
|
442
417
|
|
|
443
418
|
/** @private */
|
|
444
|
-
|
|
445
|
-
if (!overflow || !container) {
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
if (items !== this._oldItems) {
|
|
450
|
-
this._oldItems = items;
|
|
451
|
-
this.__renderButtons(items);
|
|
452
|
-
this.__detectOverflow();
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
if (disabled !== this._oldDisabled) {
|
|
456
|
-
this._oldDisabled = disabled;
|
|
457
|
-
this.__renderButtons(items);
|
|
458
|
-
overflow.toggleAttribute('disabled', disabled);
|
|
459
|
-
}
|
|
460
|
-
|
|
419
|
+
__updateSubMenu() {
|
|
461
420
|
const subMenu = this._subMenu;
|
|
462
421
|
if (subMenu && subMenu.opened) {
|
|
463
422
|
const button = subMenu._overlayElement.positionTarget;
|
|
@@ -471,12 +430,12 @@ export const MenuBarMixin = (superClass) =>
|
|
|
471
430
|
}
|
|
472
431
|
|
|
473
432
|
/** @private */
|
|
474
|
-
__i18nChanged(effectiveI18n
|
|
475
|
-
if (
|
|
433
|
+
__i18nChanged(effectiveI18n) {
|
|
434
|
+
if (effectiveI18n && effectiveI18n.moreOptions !== undefined) {
|
|
476
435
|
if (effectiveI18n.moreOptions) {
|
|
477
|
-
|
|
436
|
+
this._overflow.setAttribute('aria-label', effectiveI18n.moreOptions);
|
|
478
437
|
} else {
|
|
479
|
-
|
|
438
|
+
this._overflow.removeAttribute('aria-label');
|
|
480
439
|
}
|
|
481
440
|
}
|
|
482
441
|
}
|
|
@@ -561,11 +520,14 @@ export const MenuBarMixin = (superClass) =>
|
|
|
561
520
|
}
|
|
562
521
|
|
|
563
522
|
/** @private */
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}
|
|
523
|
+
__scheduleOverflow() {
|
|
524
|
+
this._overflowDebouncer = Debouncer.debounce(this._overflowDebouncer, microTask, () => {
|
|
525
|
+
this.__detectOverflow();
|
|
526
|
+
});
|
|
527
|
+
}
|
|
568
528
|
|
|
529
|
+
/** @private */
|
|
530
|
+
__detectOverflow() {
|
|
569
531
|
const overflow = this._overflow;
|
|
570
532
|
const buttons = this._buttons.filter((btn) => btn !== overflow);
|
|
571
533
|
const oldOverflowCount = this.__getOverflowCount(overflow);
|
|
@@ -9,7 +9,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
10
|
import { MenuOverlayMixin } from '@vaadin/context-menu/src/vaadin-menu-overlay-mixin.js';
|
|
11
11
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
12
|
-
import {
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
13
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
14
14
|
import { menuBarOverlayStyles } from './styles/vaadin-menu-bar-overlay-core-styles.js';
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ import { menuBarOverlayStyles } from './styles/vaadin-menu-bar-overlay-core-styl
|
|
|
25
25
|
* @protected
|
|
26
26
|
*/
|
|
27
27
|
export class MenuBarOverlay extends MenuOverlayMixin(
|
|
28
|
-
OverlayMixin(DirMixin(ThemableMixin(
|
|
28
|
+
OverlayMixin(DirMixin(ThemableMixin(LumoInjectionMixin(PolylitMixin(LitElement))))),
|
|
29
29
|
) {
|
|
30
30
|
static get is() {
|
|
31
31
|
return 'vaadin-menu-bar-overlay';
|
package/src/vaadin-menu-bar.js
CHANGED
|
@@ -10,7 +10,7 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
|
10
10
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
11
11
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
12
12
|
import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
|
|
13
|
-
import {
|
|
13
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
14
14
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
15
|
import { menuBarStyles } from './styles/vaadin-menu-bar-core-styles.js';
|
|
16
16
|
import { MenuBarMixin } from './vaadin-menu-bar-mixin.js';
|
|
@@ -77,7 +77,7 @@ import { MenuBarMixin } from './vaadin-menu-bar-mixin.js';
|
|
|
77
77
|
* @mixes MenuBarMixin
|
|
78
78
|
* @mixes ThemableMixin
|
|
79
79
|
*/
|
|
80
|
-
class MenuBar extends MenuBarMixin(ElementMixin(ThemableMixin(
|
|
80
|
+
class MenuBar extends MenuBarMixin(ElementMixin(ThemableMixin(LumoInjectionMixin(PolylitMixin(LitElement))))) {
|
|
81
81
|
static get is() {
|
|
82
82
|
return 'vaadin-menu-bar';
|
|
83
83
|
}
|
|
@@ -89,7 +89,7 @@ class MenuBar extends MenuBarMixin(ElementMixin(ThemableMixin(CSSInjectionMixin(
|
|
|
89
89
|
/** @protected */
|
|
90
90
|
render() {
|
|
91
91
|
return html`
|
|
92
|
-
<div part="container">
|
|
92
|
+
<div part="container" @click="${this.__onButtonClick}" @mouseover="${this._onMouseOver}">
|
|
93
93
|
<slot></slot>
|
|
94
94
|
<slot name="overflow"></slot>
|
|
95
95
|
</div>
|
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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha7",
|
|
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/25.0.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/25.0.0-alpha7/#/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/25.0.0-alpha7/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-item).\n- `<vaadin-menu-bar-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/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": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha7",
|
|
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/25.0.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/25.0.0-alpha7/#/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/25.0.0-alpha7/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-item).\n- `<vaadin-menu-bar-list-box>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/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
|
{
|