@vaadin/menu-bar 24.4.6 → 24.4.8

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": "24.4.6",
3
+ "version": "24.4.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,21 +39,21 @@
39
39
  "dependencies": {
40
40
  "@open-wc/dedupe-mixin": "^1.3.0",
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/a11y-base": "~24.4.6",
43
- "@vaadin/button": "~24.4.6",
44
- "@vaadin/component-base": "~24.4.6",
45
- "@vaadin/context-menu": "~24.4.6",
46
- "@vaadin/item": "~24.4.6",
47
- "@vaadin/list-box": "~24.4.6",
48
- "@vaadin/overlay": "~24.4.6",
49
- "@vaadin/vaadin-lumo-styles": "~24.4.6",
50
- "@vaadin/vaadin-material-styles": "~24.4.6",
51
- "@vaadin/vaadin-themable-mixin": "~24.4.6",
42
+ "@vaadin/a11y-base": "~24.4.8",
43
+ "@vaadin/button": "~24.4.8",
44
+ "@vaadin/component-base": "~24.4.8",
45
+ "@vaadin/context-menu": "~24.4.8",
46
+ "@vaadin/item": "~24.4.8",
47
+ "@vaadin/list-box": "~24.4.8",
48
+ "@vaadin/overlay": "~24.4.8",
49
+ "@vaadin/vaadin-lumo-styles": "~24.4.8",
50
+ "@vaadin/vaadin-material-styles": "~24.4.8",
51
+ "@vaadin/vaadin-themable-mixin": "~24.4.8",
52
52
  "lit": "^3.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@esm-bundle/chai": "^4.3.4",
56
- "@vaadin/icon": "~24.4.6",
56
+ "@vaadin/icon": "~24.4.8",
57
57
  "@vaadin/testing-helpers": "^0.6.0",
58
58
  "sinon": "^13.0.2"
59
59
  },
@@ -61,5 +61,5 @@
61
61
  "web-types.json",
62
62
  "web-types.lit.json"
63
63
  ],
64
- "gitHead": "46d3cdb72eb99d544c7bb86c3de95043b9e5857f"
64
+ "gitHead": "862a104b4fc9925dad79cd0cab2d7d9231d789de"
65
65
  }
@@ -30,11 +30,6 @@ class MenuBarButton extends Button {
30
30
  :host([slot='overflow']) {
31
31
  margin-inline-end: 0;
32
32
  }
33
-
34
- [part='label'] ::slotted(vaadin-menu-bar-item) {
35
- position: relative;
36
- z-index: 1;
37
- }
38
33
  `,
39
34
  ];
40
35
  }
@@ -17,11 +17,6 @@ registerStyles(
17
17
  :host([slot='overflow']) {
18
18
  margin-inline-end: 0;
19
19
  }
20
-
21
- [part='label'] ::slotted(vaadin-menu-bar-item) {
22
- position: relative;
23
- z-index: 1;
24
- }
25
20
  `,
26
21
  { moduleId: 'vaadin-menu-bar-button-styles' },
27
22
  );
@@ -250,7 +250,7 @@ export const MenuBarMixin = (superClass) =>
250
250
  });
251
251
  this.addController(this._overflowController);
252
252
 
253
- this.addEventListener('mousedown', () => this._hideTooltip());
253
+ this.addEventListener('mousedown', () => this._hideTooltip(true));
254
254
  this.addEventListener('mouseleave', () => this._hideTooltip());
255
255
 
256
256
  this._subMenu.addEventListener('item-selected', this.__onItemSelected.bind(this));
@@ -883,6 +883,13 @@ export const MenuBarMixin = (superClass) =>
883
883
  this._expandedButton = button;
884
884
 
885
885
  requestAnimationFrame(async () => {
886
+ // After changing items, buttons are recreated so the old button is
887
+ // no longer in the DOM. Reset position target to null to prevent
888
+ // overlay from closing due to target width / height equal to 0.
889
+ if (overlay.positionTarget && !overlay.positionTarget.isConnected) {
890
+ overlay.positionTarget = null;
891
+ }
892
+
886
893
  button.dispatchEvent(
887
894
  new CustomEvent('opensubmenu', {
888
895
  detail: {
@@ -65,6 +65,16 @@ export interface MenuBarEventMap extends HTMLElementEventMap, MenuBarCustomEvent
65
65
  * - `<vaadin-menu-bar-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
66
66
  * - `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
67
67
  *
68
+ * The `<vaadin-menu-bar-item>` sub-menu elements have the following additional state attributes
69
+ * on top of the built-in `<vaadin-item>` state attributes:
70
+ *
71
+ * Attribute | Description
72
+ * ---------- |-------------
73
+ * `expanded` | Expanded parent item.
74
+ *
75
+ * Note: the `theme` attribute value set on `<vaadin-menu-bar>` is
76
+ * propagated to the internal components listed above.
77
+ *
68
78
  * @fires {CustomEvent} item-selected - Fired when a submenu item or menu bar button without children is clicked.
69
79
  */
70
80
  declare class MenuBar extends MenuBarMixin(DisabledMixin(ElementMixin(ThemableMixin(HTMLElement)))) {
@@ -56,6 +56,16 @@ import { MenuBarMixin } from './vaadin-menu-bar-mixin.js';
56
56
  * - `<vaadin-menu-bar-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
57
57
  * - `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
58
58
  *
59
+ * The `<vaadin-menu-bar-item>` sub-menu elements have the following additional state attributes
60
+ * on top of the built-in `<vaadin-item>` state attributes:
61
+ *
62
+ * Attribute | Description
63
+ * ---------- |-------------
64
+ * `expanded` | Expanded parent item.
65
+ *
66
+ * Note: the `theme` attribute value set on `<vaadin-menu-bar>` is
67
+ * propagated to the internal components listed above.
68
+ *
59
69
  * @fires {CustomEvent<boolean>} item-selected - Fired when a submenu item or menu bar button without children is clicked.
60
70
  *
61
71
  * @customElement
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.6",
4
+ "version": "24.4.8",
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.4.6/#/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.4.6/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.4.6/#/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.4.6/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.4.6/#/elements/vaadin-overlay).",
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.4.8/#/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.4.8/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.4.8/#/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.4.8/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.4.8/#/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",
@@ -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.6",
4
+ "version": "24.4.8",
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.4.6/#/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.4.6/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.4.6/#/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.4.6/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.4.6/#/elements/vaadin-overlay).",
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.4.8/#/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.4.8/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.4.8/#/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.4.8/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.4.8/#/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
  {