@vaadin/menu-bar 25.2.12 → 25.2.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/menu-bar",
3
- "version": "25.2.12",
3
+ "version": "25.2.14",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,23 +35,23 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "~25.2.12",
39
- "@vaadin/button": "~25.2.12",
40
- "@vaadin/component-base": "~25.2.12",
41
- "@vaadin/context-menu": "~25.2.12",
42
- "@vaadin/item": "~25.2.12",
43
- "@vaadin/list-box": "~25.2.12",
44
- "@vaadin/overlay": "~25.2.12",
45
- "@vaadin/vaadin-themable-mixin": "~25.2.12",
38
+ "@vaadin/a11y-base": "~25.2.14",
39
+ "@vaadin/button": "~25.2.14",
40
+ "@vaadin/component-base": "~25.2.14",
41
+ "@vaadin/context-menu": "~25.2.14",
42
+ "@vaadin/item": "~25.2.14",
43
+ "@vaadin/list-box": "~25.2.14",
44
+ "@vaadin/overlay": "~25.2.14",
45
+ "@vaadin/vaadin-themable-mixin": "~25.2.14",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@vaadin/aura": "~25.2.12",
50
- "@vaadin/chai-plugins": "~25.2.12",
51
- "@vaadin/icon": "~25.2.12",
52
- "@vaadin/test-runner-commands": "~25.2.12",
49
+ "@vaadin/aura": "~25.2.14",
50
+ "@vaadin/chai-plugins": "~25.2.14",
51
+ "@vaadin/icon": "~25.2.14",
52
+ "@vaadin/test-runner-commands": "~25.2.14",
53
53
  "@vaadin/testing-helpers": "^2.0.0",
54
- "@vaadin/vaadin-lumo-styles": "~25.2.12",
54
+ "@vaadin/vaadin-lumo-styles": "~25.2.14",
55
55
  "sinon": "^22.0.0"
56
56
  },
57
57
  "customElements": "custom-elements.json",
@@ -59,5 +59,5 @@
59
59
  "web-types.json",
60
60
  "web-types.lit.json"
61
61
  ],
62
- "gitHead": "7261133c2bc1c781f5b00037d896bac5443a4e00"
62
+ "gitHead": "7f2566cacb4ca4f83c44fbcc79776b4a3aa0823e"
63
63
  }
@@ -15,6 +15,12 @@ export const menuBarStyles = css`
15
15
  display: none !important;
16
16
  }
17
17
 
18
+ /* Keep the width measured with all buttons in flow while the host is frozen */
19
+ :host([overflow-frozen]) {
20
+ contain: inline-size !important;
21
+ contain-intrinsic-inline-size: var(--_vaadin-menu-bar-content-width);
22
+ }
23
+
18
24
  [part='container'] {
19
25
  display: flex;
20
26
  flex-wrap: nowrap;
@@ -56,6 +56,9 @@ const DEFAULT_I18N = {
56
56
  moreOptions: 'More options',
57
57
  };
58
58
 
59
+ // Two client rects of the same edge can differ by float noise, a few 1e-5 px under browser zoom
60
+ const OVERFLOW_TOLERANCE = 0.1;
61
+
59
62
  export const MenuBarMixin = (superClass) =>
60
63
  class MenuBarMixinClass extends I18nMixin(
61
64
  KeyboardDirectionMixin(ResizeMixin(FocusMixin(DisabledMixin(superClass)))),
@@ -472,7 +475,6 @@ export const MenuBarMixin = (superClass) =>
472
475
  buttons.forEach((button) => {
473
476
  button.style.visibility = '';
474
477
  button.style.position = '';
475
- button.style.width = '';
476
478
 
477
479
  // Teleport item component back from "overflow" sub-menu
478
480
  const item = button.item && button.item.component;
@@ -483,6 +485,19 @@ export const MenuBarMixin = (superClass) =>
483
485
  this.__updateOverflow([]);
484
486
  }
485
487
 
488
+ /**
489
+ * Restores all buttons, the overflow button and the state attributes, so that
490
+ * the measurement does not use the button margins of the previous state.
491
+ *
492
+ * @param {!Array<!HTMLElement>} buttons
493
+ * @private
494
+ */
495
+ __restoreState(buttons) {
496
+ this.__restoreButtons(buttons);
497
+ this.toggleAttribute('has-single-button', buttons.length === 1);
498
+ this.__updateVisibleAttributes(buttons);
499
+ }
500
+
486
501
  /** @private */
487
502
  __restoreItem(button, item) {
488
503
  button.appendChild(item);
@@ -498,49 +513,154 @@ export const MenuBarMixin = (superClass) =>
498
513
  this._hasOverflow = items.length > 0;
499
514
  }
500
515
 
501
- /** @private */
502
- __setOverflowItems(buttons, overflow) {
503
- const container = this._container;
504
-
505
- // Prevent the container from shrinking while buttons are being hidden.
506
- // The host has min-width: 0 so it can shrink inside flex/grid layouts.
507
- // Without this lock, hiding a button reduces the host width, which
508
- // shrinks the container (width: 100%), shifting all button positions
509
- // and causing a cascading collapse where every button appears to overflow.
510
- container.style.minWidth = `${container.offsetWidth}px`;
511
-
512
- if (container.offsetWidth < container.scrollWidth) {
513
- this._hasOverflow = true;
514
-
515
- const isRTL = this.__isRTL;
516
- const containerLeft = container.offsetLeft;
517
-
518
- const remaining = [...buttons];
519
- while (remaining.length) {
520
- const lastButton = remaining[remaining.length - 1];
521
- const btnLeft = lastButton.offsetLeft - containerLeft;
522
-
523
- // If this button isn't overflowing, then the rest aren't either
524
- if (
525
- (!isRTL && btnLeft + lastButton.offsetWidth < container.offsetWidth - overflow.offsetWidth) ||
526
- (isRTL && btnLeft >= overflow.offsetWidth)
527
- ) {
528
- break;
529
- }
516
+ /**
517
+ * Inline end edge of the element, mirrored in RTL. Unlike `offsetWidth` and `scrollWidth`,
518
+ * the rect keeps the fraction that browser zoom leaves on the width.
519
+ *
520
+ * @param {!HTMLElement} el
521
+ * @return {number}
522
+ * @private
523
+ */
524
+ __getInlineEnd(el) {
525
+ const { left, right } = el.getBoundingClientRect();
526
+ return this.__isRTL ? -left : right;
527
+ }
530
528
 
531
- const btn = this.reverseCollapse ? remaining.shift() : remaining.pop();
529
+ /**
530
+ * Whether the element ends past the container, with the tolerance for fractional widths.
531
+ *
532
+ * @param {!HTMLElement} el
533
+ * @return {boolean}
534
+ * @private
535
+ */
536
+ __isPastContainerEnd(el) {
537
+ return this.__getInlineEnd(el) > this.__getInlineEnd(this._container) + OVERFLOW_TOLERANCE;
538
+ }
539
+
540
+ /**
541
+ * Layout of the buttons, the overflow button and the container, read in one batch
542
+ * before any button is hidden. Positions are mirrored in RTL so that a larger value
543
+ * is always further along the inline axis.
544
+ *
545
+ * @typedef {object} MenuBarOverflowLayout
546
+ * @property {number[]} starts Inline start of each button
547
+ * @property {number[]} ends Inline end of each button
548
+ * @property {number[]} margins Inline start margin of each button
549
+ * @property {number} overflowExtent Space the overflow button adds after the last button
550
+ * @property {number} containerWidth Width of the container
551
+ * @property {number} contentWidth Width of all buttons and the overflow button in flow
552
+ */
553
+
554
+ /**
555
+ * @param {!Array<!HTMLElement>} buttons
556
+ * @param {!HTMLElement} overflow
557
+ * @return {!MenuBarOverflowLayout}
558
+ * @private
559
+ */
560
+ __getOverflowLayout(buttons, overflow) {
561
+ const isRTL = this.__isRTL;
562
+ const rects = buttons.map((btn) => btn.getBoundingClientRect());
563
+ const ends = rects.map(({ left, right }) => (isRTL ? -left : right));
564
+ const overflowEnd = this.__getInlineEnd(overflow);
565
+ const containerRect = this._container.getBoundingClientRect();
566
+ const containerStart = isRTL ? -containerRect.right : containerRect.left;
532
567
 
533
- // Save width for buttons with component
534
- btn.style.width = getComputedStyle(btn).width;
535
- btn.style.visibility = 'hidden';
536
- btn.style.position = 'absolute';
568
+ return {
569
+ starts: rects.map(({ left, right }) => (isRTL ? -right : left)),
570
+ ends,
571
+ // `auto` resolves to 0 while the content overflows.
572
+ margins: buttons.map((btn) => parseFloat(getComputedStyle(btn).marginInlineStart) || 0),
573
+ overflowExtent: overflowEnd - ends.at(-1),
574
+ containerWidth: containerRect.width,
575
+ contentWidth: overflowEnd - containerStart,
576
+ };
577
+ }
578
+
579
+ /**
580
+ * Picks the buttons to collapse so that the rest plus the overflow button end inside
581
+ * the container. Hiding a button only shifts the buttons after it, so the end of any
582
+ * kept range follows from one measurement.
583
+ *
584
+ * @param {!Array<!HTMLElement>} buttons
585
+ * @param {!MenuBarOverflowLayout} layout
586
+ * @return {!Array<!HTMLElement>} buttons to collapse, in DOM order
587
+ * @private
588
+ */
589
+ __getButtonsToCollapse(buttons, { starts, ends, margins, overflowExtent, containerWidth }) {
590
+ let lo = 0;
591
+ let hi = buttons.length - 1;
592
+
593
+ // The first kept button keeps its own start margin in front of the range.
594
+ while (lo <= hi && margins[lo] + ends[hi] - starts[lo] + overflowExtent > containerWidth + OVERFLOW_TOLERANCE) {
595
+ if (this.reverseCollapse) {
596
+ lo += 1;
597
+ } else {
598
+ hi -= 1;
537
599
  }
600
+ }
601
+
602
+ return buttons.filter((_, i) => i < lo || i > hi);
603
+ }
604
+
605
+ /**
606
+ * Keeps the intrinsic width of the host at the given value. A parent sized by content,
607
+ * such as a split layout pane, shrinks the host once the buttons are out of flow. The
608
+ * width the host had with all buttons in flow keeps the collapse that was decided for it.
609
+ * The `overflow-frozen` attribute marks the frozen state for the styles and for the next
610
+ * detection. It is internal and not documented.
611
+ *
612
+ * @param {number} width
613
+ * @private
614
+ */
615
+ __freezeWidth(width) {
616
+ this.style.setProperty('--_vaadin-menu-bar-content-width', `${width}px`);
617
+ this.setAttribute('overflow-frozen', '');
618
+ }
619
+
620
+ /** @private */
621
+ __unfreezeWidth() {
622
+ this.style.removeProperty('--_vaadin-menu-bar-content-width');
623
+ this.removeAttribute('overflow-frozen');
624
+ }
538
625
 
539
- const items = buttons.filter((b) => !remaining.includes(b)).map((b) => b.item);
540
- this.__updateOverflow(items);
626
+ /**
627
+ * Shows the overflow button and collapses buttons into it when the last button
628
+ * does not fit in the container. Freezes the host width when the parent shrinks
629
+ * the host after the collapse. A frozen host stays frozen until all buttons and the
630
+ * overflow button fit, so that its flex basis does not change between detections
631
+ * when another element in the same row depends on it.
632
+ *
633
+ * @param {!Array<!HTMLElement>} buttons
634
+ * @param {!HTMLElement} overflow
635
+ * @private
636
+ */
637
+ __setOverflowItems(buttons, overflow) {
638
+ const lastButton = buttons.at(-1);
639
+ // A frozen host is as wide as all buttons plus the overflow button, so the quick
640
+ // check would report a fit one overflow button too early. Measure instead.
641
+ const wasFrozen = this.hasAttribute('overflow-frozen');
642
+ if (!lastButton || (!wasFrozen && !this.__isPastContainerEnd(lastButton))) {
643
+ this.__unfreezeWidth();
644
+ return;
541
645
  }
646
+ this._hasOverflow = true;
542
647
 
543
- container.style.minWidth = '';
648
+ // Read the layout once the overflow button is in flow
649
+ const layout = this.__getOverflowLayout(buttons, overflow);
650
+ const collapsed = this.__getButtonsToCollapse(buttons, layout);
651
+
652
+ // Write the DOM state
653
+ collapsed.forEach((btn) => {
654
+ btn.style.visibility = 'hidden';
655
+ btn.style.position = 'absolute';
656
+ });
657
+ this.__updateOverflow(collapsed.map((btn) => btn.item));
658
+
659
+ if (collapsed.length === 0) {
660
+ this.__unfreezeWidth();
661
+ } else if (wasFrozen || this.__isPastContainerEnd(overflow)) {
662
+ this.__freezeWidth(layout.contentWidth);
663
+ }
544
664
  }
545
665
 
546
666
  /** @private */
@@ -556,8 +676,7 @@ export const MenuBarMixin = (superClass) =>
556
676
  const buttons = this._buttons.filter((btn) => btn !== overflow);
557
677
  const oldOverflowCount = this.__getOverflowCount(overflow);
558
678
 
559
- // Reset all buttons in the menu bar and the overflow button
560
- this.__restoreButtons(buttons);
679
+ this.__restoreState(buttons);
561
680
 
562
681
  // Hide any overflowing buttons and put them in the 'overflow' button
563
682
  this.__setOverflowItems(buttons, overflow);
@@ -582,8 +701,12 @@ export const MenuBarMixin = (superClass) =>
582
701
  this._setTabindex(visibleButtons[visibleButtons.length - 1], true);
583
702
  }
584
703
 
585
- // Apply first/last visible attributes to the visible buttons
586
- visibleButtons.forEach((btn, index, visibleButtons) => {
704
+ this.__updateVisibleAttributes(visibleButtons);
705
+ }
706
+
707
+ /** @private */
708
+ __updateVisibleAttributes(visibleButtons) {
709
+ visibleButtons.forEach((btn, index) => {
587
710
  btn.toggleAttribute('first-visible', index === 0);
588
711
  btn.toggleAttribute('last-visible', !this._hasOverflow && index === visibleButtons.length - 1);
589
712
  });
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.2.12",
4
+ "version": "25.2.14",
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```html\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.2.12/#/elements/vaadin-menu-bar#property-items) property to initialize the structure:\n\n```js\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:---------------------------|\n| `--vaadin-menu-bar-gap` |\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.2.12/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.12/#/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.2.12/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-submenu>` - has the same API as [`<vaadin-context-menu>`](https://cdn.vaadin.com/vaadin-web-components/25.2.12/#/elements/vaadin-context-menu).\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.",
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```html\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.2.14/#/elements/vaadin-menu-bar#property-items) property to initialize the structure:\n\n```js\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:---------------------------|\n| `--vaadin-menu-bar-gap` |\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.2.14/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.14/#/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.2.14/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-submenu>` - has the same API as [`<vaadin-context-menu>`](https://cdn.vaadin.com/vaadin-web-components/25.2.14/#/elements/vaadin-context-menu).\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.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "disabled",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/menu-bar",
4
- "version": "25.2.12",
4
+ "version": "25.2.14",
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```html\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.2.12/#/elements/vaadin-menu-bar#property-items) property to initialize the structure:\n\n```js\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:---------------------------|\n| `--vaadin-menu-bar-gap` |\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.2.12/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.12/#/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.2.12/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-submenu>` - has the same API as [`<vaadin-context-menu>`](https://cdn.vaadin.com/vaadin-web-components/25.2.12/#/elements/vaadin-context-menu).\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.",
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```html\n<vaadin-menu-bar></vaadin-menu-bar>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.2.14/#/elements/vaadin-menu-bar#property-items) property to initialize the structure:\n\n```js\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\nThe following custom CSS properties are available for styling:\n\nCustom CSS property |\n:---------------------------|\n| `--vaadin-menu-bar-gap` |\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.2.14/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.2.14/#/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.2.14/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-submenu>` - has the same API as [`<vaadin-context-menu>`](https://cdn.vaadin.com/vaadin-web-components/25.2.14/#/elements/vaadin-context-menu).\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.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {