@vaadin/menu-bar 24.3.4 → 24.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/menu-bar",
3
- "version": "24.3.4",
3
+ "version": "24.4.0-alpha10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,20 +37,20 @@
37
37
  "dependencies": {
38
38
  "@open-wc/dedupe-mixin": "^1.3.0",
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "~24.3.4",
41
- "@vaadin/button": "~24.3.4",
42
- "@vaadin/component-base": "~24.3.4",
43
- "@vaadin/context-menu": "~24.3.4",
44
- "@vaadin/item": "~24.3.4",
45
- "@vaadin/list-box": "~24.3.4",
46
- "@vaadin/overlay": "~24.3.4",
47
- "@vaadin/vaadin-lumo-styles": "~24.3.4",
48
- "@vaadin/vaadin-material-styles": "~24.3.4",
49
- "@vaadin/vaadin-themable-mixin": "~24.3.4"
40
+ "@vaadin/a11y-base": "24.4.0-alpha10",
41
+ "@vaadin/button": "24.4.0-alpha10",
42
+ "@vaadin/component-base": "24.4.0-alpha10",
43
+ "@vaadin/context-menu": "24.4.0-alpha10",
44
+ "@vaadin/item": "24.4.0-alpha10",
45
+ "@vaadin/list-box": "24.4.0-alpha10",
46
+ "@vaadin/overlay": "24.4.0-alpha10",
47
+ "@vaadin/vaadin-lumo-styles": "24.4.0-alpha10",
48
+ "@vaadin/vaadin-material-styles": "24.4.0-alpha10",
49
+ "@vaadin/vaadin-themable-mixin": "24.4.0-alpha10"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@esm-bundle/chai": "^4.3.4",
53
- "@vaadin/icon": "~24.3.4",
53
+ "@vaadin/icon": "24.4.0-alpha10",
54
54
  "@vaadin/testing-helpers": "^0.6.0",
55
55
  "sinon": "^13.0.2"
56
56
  },
@@ -58,5 +58,5 @@
58
58
  "web-types.json",
59
59
  "web-types.lit.json"
60
60
  ],
61
- "gitHead": "dc5d3fd1d0f11a130b3574c455b62ce6b5706ffc"
61
+ "gitHead": "c563c01d6ac5157f5a5885c8f6048d1cf4c727b4"
62
62
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { Button } from '@vaadin/button/src/vaadin-button.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ListMixin } from '@vaadin/a11y-base/src/list-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
@@ -138,6 +138,11 @@ export declare class MenuBarMixinClass {
138
138
  */
139
139
  openOnHover: boolean | null | undefined;
140
140
 
141
+ /**
142
+ * Closes the current submenu.
143
+ */
144
+ close(): void;
145
+
141
146
  protected readonly _buttons: HTMLElement[];
142
147
 
143
148
  protected readonly _container: HTMLElement;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
@@ -908,11 +908,18 @@ export const MenuBarMixin = (superClass) =>
908
908
  * @param {boolean} restoreFocus
909
909
  * @protected
910
910
  */
911
- _close(restoreFocus) {
911
+ _close(restoreFocus = false) {
912
912
  this.style.pointerEvents = '';
913
913
  this.__deactivateButton(restoreFocus);
914
914
  if (this._subMenu.opened) {
915
915
  this._subMenu.close();
916
916
  }
917
917
  }
918
+
919
+ /**
920
+ * Closes the current submenu.
921
+ */
922
+ close() {
923
+ this._close();
924
+ }
918
925
  };
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
@@ -1,23 +1,30 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-menu-bar-item.js';
7
7
  import './vaadin-menu-bar-list-box.js';
8
8
  import './vaadin-menu-bar-overlay.js';
9
- import { html } from '@polymer/polymer/lib/utils/html-tag.js';
9
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
10
+ import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
10
11
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
- import { ContextMenu } from '@vaadin/context-menu/src/vaadin-context-menu.js';
12
+ import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
13
+ import { ContextMenuMixin } from '@vaadin/context-menu/src/vaadin-context-menu-mixin.js';
14
+ import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
12
15
 
13
16
  /**
14
17
  * An element used internally by `<vaadin-menu-bar>`. Not intended to be used separately.
15
18
  *
16
19
  * @customElement
17
- * @extends ContextMenu
20
+ * @extends HTMLElement
21
+ * @mixes ContextMenuMixin
22
+ * @mixes ControllerMixin
23
+ * @mixes OverlayClassMixin
24
+ * @mixes ThemePropertyMixin
18
25
  * @protected
19
26
  */
20
- class MenuBarSubmenu extends ContextMenu {
27
+ class MenuBarSubmenu extends ContextMenuMixin(OverlayClassMixin(ControllerMixin(ThemePropertyMixin(PolymerElement)))) {
21
28
  static get is() {
22
29
  return 'vaadin-menu-bar-submenu';
23
30
  }
@@ -53,6 +60,19 @@ class MenuBarSubmenu extends ContextMenu {
53
60
  return 'vaadin-menu-bar';
54
61
  }
55
62
 
63
+ /**
64
+ * @param {DocumentFragment} dom
65
+ * @return {ShadowRoot}
66
+ * @protected
67
+ * @override
68
+ */
69
+ _attachDom(dom) {
70
+ const root = this.attachShadow({ mode: 'open' });
71
+ root.appendChild(dom);
72
+ root.appendChild(this._overlayElement);
73
+ return root;
74
+ }
75
+
56
76
  /**
57
77
  * Overriding the observer to not add global "contextmenu" listener.
58
78
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { DisabledMixin } from '@vaadin/a11y-base/src/disabled-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2019 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2019 - 2024 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-menu-bar-submenu.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import './vaadin-menu-bar-button-styles.js';
2
+ import '../../src/vaadin-menu-bar-button.js';
@@ -0,0 +1,2 @@
1
+ import '@vaadin/vaadin-lumo-styles/sizing.js';
2
+ import '@vaadin/vaadin-lumo-styles/spacing.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ import '@vaadin/vaadin-lumo-styles/style.js';
@@ -0,0 +1,6 @@
1
+ import './vaadin-menu-bar-button.js';
2
+ import './vaadin-menu-bar-item-styles.js';
3
+ import './vaadin-menu-bar-list-box-styles.js';
4
+ import './vaadin-menu-bar-overlay-styles.js';
5
+ import './vaadin-menu-bar-styles.js';
6
+ import '../../src/vaadin-menu-bar.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import './vaadin-menu-bar-button-styles.js';
2
+ import '../../src/vaadin-menu-bar-button.js';
@@ -0,0 +1 @@
1
+ import '@vaadin/vaadin-material-styles/typography.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import './vaadin-menu-bar-button.js';
2
+ import './vaadin-menu-bar-item-styles.js';
3
+ import './vaadin-menu-bar-list-box-styles.js';
4
+ import './vaadin-menu-bar-styles.js';
5
+ import './vaadin-menu-bar-overlay-styles.js';
6
+ import '../../src/vaadin-menu-bar.js';
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.3.4",
4
+ "version": "24.4.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.3.4/#/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.3.4/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.3.4/#/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.3.4/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.3.4/#/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.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.4.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.4.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.4.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.4.0-alpha10/#/elements/vaadin-overlay).",
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.3.4",
4
+ "version": "24.4.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.3.4/#/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.3.4/#/elements/vaadin-button).\n- `<vaadin-menu-bar-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/24.3.4/#/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.3.4/#/elements/vaadin-list-box).\n- `<vaadin-menu-bar-overlay>` - has the same API as [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/24.3.4/#/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.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.4.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.4.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.4.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.4.0-alpha10/#/elements/vaadin-overlay).",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {