@vaadin/menu-bar 25.0.0-alpha2 → 25.0.0-alpha20
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 -16
- package/src/styles/vaadin-menu-bar-base-styles.d.ts +8 -0
- package/src/styles/vaadin-menu-bar-base-styles.js +56 -0
- package/src/styles/vaadin-menu-bar-button-base-styles.d.ts +8 -0
- package/src/styles/vaadin-menu-bar-button-base-styles.js +47 -0
- package/src/styles/vaadin-menu-bar-item-base-styles.d.ts +8 -0
- package/src/styles/vaadin-menu-bar-item-base-styles.js +8 -0
- package/src/styles/vaadin-menu-bar-overlay-base-styles.d.ts +8 -0
- package/src/styles/vaadin-menu-bar-overlay-base-styles.js +9 -0
- package/src/vaadin-menu-bar-button.d.ts +19 -0
- package/src/vaadin-menu-bar-button.js +4 -13
- package/src/vaadin-menu-bar-item.js +5 -11
- package/src/vaadin-menu-bar-list-box.js +5 -18
- package/src/vaadin-menu-bar-mixin.d.ts +5 -12
- package/src/vaadin-menu-bar-mixin.js +155 -156
- package/src/vaadin-menu-bar-overlay.js +7 -4
- package/src/vaadin-menu-bar-submenu.d.ts +20 -0
- package/src/vaadin-menu-bar-submenu.js +83 -8
- package/src/vaadin-menu-bar.d.ts +3 -6
- package/src/vaadin-menu-bar.js +11 -27
- package/vaadin-menu-bar.js +1 -1
- package/web-types.json +4 -26
- package/web-types.lit.json +4 -11
- package/src/vaadin-menu-bar-submenu-mixin.js +0 -66
- package/theme/lumo/vaadin-menu-bar-button-styles.d.ts +0 -1
- package/theme/lumo/vaadin-menu-bar-button-styles.js +0 -128
- package/theme/lumo/vaadin-menu-bar-button.d.ts +0 -2
- package/theme/lumo/vaadin-menu-bar-button.js +0 -2
- package/theme/lumo/vaadin-menu-bar-item-styles.d.ts +0 -2
- package/theme/lumo/vaadin-menu-bar-item-styles.js +0 -27
- package/theme/lumo/vaadin-menu-bar-list-box-styles.d.ts +0 -1
- package/theme/lumo/vaadin-menu-bar-list-box-styles.js +0 -5
- package/theme/lumo/vaadin-menu-bar-overlay-styles.d.ts +0 -1
- package/theme/lumo/vaadin-menu-bar-overlay-styles.js +0 -13
- package/theme/lumo/vaadin-menu-bar-styles.d.ts +0 -1
- package/theme/lumo/vaadin-menu-bar-styles.js +0 -17
- package/theme/lumo/vaadin-menu-bar.d.ts +0 -6
- package/theme/lumo/vaadin-menu-bar.js +0 -6
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-alpha20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"theme",
|
|
25
24
|
"vaadin-*.d.ts",
|
|
26
25
|
"vaadin-*.js",
|
|
27
26
|
"web-types.json",
|
|
@@ -35,27 +34,27 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@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-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha20",
|
|
38
|
+
"@vaadin/button": "25.0.0-alpha20",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-alpha20",
|
|
40
|
+
"@vaadin/context-menu": "25.0.0-alpha20",
|
|
41
|
+
"@vaadin/item": "25.0.0-alpha20",
|
|
42
|
+
"@vaadin/list-box": "25.0.0-alpha20",
|
|
43
|
+
"@vaadin/overlay": "25.0.0-alpha20",
|
|
44
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha20",
|
|
47
45
|
"lit": "^3.0.0"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
51
|
-
"@vaadin/icon": "25.0.0-
|
|
52
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
48
|
+
"@vaadin/chai-plugins": "25.0.0-alpha20",
|
|
49
|
+
"@vaadin/icon": "25.0.0-alpha20",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha20",
|
|
53
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
54
|
-
"
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha20",
|
|
53
|
+
"sinon": "^21.0.0"
|
|
55
54
|
},
|
|
56
55
|
"web-types": [
|
|
57
56
|
"web-types.json",
|
|
58
57
|
"web-types.lit.json"
|
|
59
58
|
],
|
|
60
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "c948aae591a30b432f3784000d4677674cae56e0"
|
|
61
60
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const menuBarStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([hidden]) {
|
|
14
|
+
display: none !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[part='container'] {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: nowrap;
|
|
20
|
+
margin: calc((var(--vaadin-focus-ring-width) + 2px) * -1);
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
padding: calc(var(--vaadin-focus-ring-width) + 2px);
|
|
23
|
+
position: relative;
|
|
24
|
+
width: 100%;
|
|
25
|
+
--_gap: var(--vaadin-menu-bar-gap, 0px);
|
|
26
|
+
--_bw: var(--vaadin-button-border-width, 1px);
|
|
27
|
+
gap: var(--_gap);
|
|
28
|
+
--_rad-button: var(--vaadin-button-border-radius, var(--vaadin-radius-m));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
::slotted(vaadin-menu-bar-button:not(:first-of-type)) {
|
|
32
|
+
margin-inline-start: min(var(--_bw) * -1 + var(--_gap) * 1000, 0px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
::slotted(vaadin-menu-bar-button) {
|
|
36
|
+
border-radius: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
::slotted([first-visible]),
|
|
40
|
+
:host([has-single-button]) ::slotted([slot='overflow']),
|
|
41
|
+
::slotted(vaadin-menu-bar-button[theme~='tertiary']) {
|
|
42
|
+
border-start-start-radius: var(--_rad-button);
|
|
43
|
+
border-end-start-radius: var(--_rad-button);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
::slotted(:is([last-visible], [slot='overflow'])),
|
|
47
|
+
::slotted(vaadin-menu-bar-button[theme~='tertiary']) {
|
|
48
|
+
border-start-end-radius: var(--_rad-button);
|
|
49
|
+
border-end-end-radius: var(--_rad-button);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
:host([theme~='end-aligned']) ::slotted(vaadin-menu-bar-button[first-visible]),
|
|
53
|
+
:host([theme~='end-aligned'][has-single-button]) ::slotted(vaadin-menu-bar-button) {
|
|
54
|
+
margin-inline-start: auto;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { css } from 'lit';
|
|
7
|
+
|
|
8
|
+
export const menuBarButtonStyles = css`
|
|
9
|
+
:host {
|
|
10
|
+
flex-shrink: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
:host([focus-ring]) {
|
|
14
|
+
z-index: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host([slot='overflow']) {
|
|
18
|
+
margin-inline-end: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.vaadin-button-container {
|
|
22
|
+
gap: inherit;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(:not([slot='overflow']):not([theme~='icon'])[aria-haspopup]) [part='suffix'] {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
gap: inherit;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host(:not([slot='overflow']):not([theme~='icon'])[aria-haspopup]) [part='suffix']::after {
|
|
32
|
+
background: currentColor;
|
|
33
|
+
content: '';
|
|
34
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
35
|
+
mask-image: var(--_vaadin-icon-chevron-down);
|
|
36
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
::slotted(vaadin-menu-bar-item) {
|
|
40
|
+
padding: 0;
|
|
41
|
+
gap: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
::slotted(vaadin-menu-bar-item)::after {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { contextMenuItemStyles } from '@vaadin/context-menu/src/styles/vaadin-context-menu-item-base-styles.js';
|
|
7
|
+
|
|
8
|
+
export const menuBarItemStyles = contextMenuItemStyles;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { menuOverlayStyles } from '@vaadin/context-menu/src/styles/vaadin-menu-overlay-base-styles.js';
|
|
7
|
+
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
|
|
8
|
+
|
|
9
|
+
export const menuBarOverlayStyles = [overlayStyles, menuOverlayStyles];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import { Button } from '@vaadin/button/src/vaadin-button.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An element used internally by `<vaadin-menu-bar>`. Not intended to be used separately.
|
|
10
|
+
*/
|
|
11
|
+
declare class MenuBarButton extends Button {}
|
|
12
|
+
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'vaadin-menu-bar-button': MenuBarButton;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { MenuBarButton };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Button } from '@vaadin/button/src/vaadin-button.js';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import {
|
|
8
|
+
import { menuBarButtonStyles } from './styles/vaadin-menu-bar-button-base-styles.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* An element used internally by `<vaadin-menu-bar>`. Not intended to be used separately.
|
|
@@ -20,18 +20,7 @@ class MenuBarButton extends Button {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
static get styles() {
|
|
23
|
-
return [
|
|
24
|
-
super.styles,
|
|
25
|
-
css`
|
|
26
|
-
:host {
|
|
27
|
-
flex-shrink: 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
:host([slot='overflow']) {
|
|
31
|
-
margin-inline-end: 0;
|
|
32
|
-
}
|
|
33
|
-
`,
|
|
34
|
-
];
|
|
23
|
+
return [super.styles, menuBarButtonStyles];
|
|
35
24
|
}
|
|
36
25
|
|
|
37
26
|
/**
|
|
@@ -65,3 +54,5 @@ class MenuBarButton extends Button {
|
|
|
65
54
|
}
|
|
66
55
|
|
|
67
56
|
defineCustomElement(MenuBarButton);
|
|
57
|
+
|
|
58
|
+
export { MenuBarButton };
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
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 { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { menuBarItemStyles } from './styles/vaadin-menu-bar-item-base-styles.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* An element used internally by `<vaadin-menu-bar>`. Not intended to be used separately.
|
|
@@ -20,21 +22,13 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
20
22
|
* @mixes ThemableMixin
|
|
21
23
|
* @protected
|
|
22
24
|
*/
|
|
23
|
-
class MenuBarItem extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
25
|
+
class MenuBarItem extends ItemMixin(ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
24
26
|
static get is() {
|
|
25
27
|
return 'vaadin-menu-bar-item';
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
static get styles() {
|
|
29
|
-
return
|
|
30
|
-
:host {
|
|
31
|
-
display: inline-block;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([hidden]) {
|
|
35
|
-
display: none !important;
|
|
36
|
-
}
|
|
37
|
-
`;
|
|
31
|
+
return menuBarItemStyles;
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
/** @protected */
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Copyright (c) 2019 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { ListMixin } from '@vaadin/a11y-base/src/list-mixin.js';
|
|
8
8
|
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
|
+
import { listBoxStyles } from '@vaadin/list-box/src/styles/vaadin-list-box-base-styles.js';
|
|
12
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
13
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -20,28 +22,13 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
20
22
|
* @mixes ThemableMixin
|
|
21
23
|
* @protected
|
|
22
24
|
*/
|
|
23
|
-
class MenuBarListBox extends ListMixin(ThemableMixin(DirMixin(PolylitMixin(LitElement)))) {
|
|
25
|
+
class MenuBarListBox extends ListMixin(ThemableMixin(DirMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
24
26
|
static get is() {
|
|
25
27
|
return 'vaadin-menu-bar-list-box';
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
static get styles() {
|
|
29
|
-
return
|
|
30
|
-
:host {
|
|
31
|
-
display: flex;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
:host([hidden]) {
|
|
35
|
-
display: none !important;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[part='items'] {
|
|
39
|
-
height: 100%;
|
|
40
|
-
width: 100%;
|
|
41
|
-
overflow-y: auto;
|
|
42
|
-
-webkit-overflow-scrolling: touch;
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
31
|
+
return listBoxStyles;
|
|
45
32
|
}
|
|
46
33
|
|
|
47
34
|
static get properties() {
|
|
@@ -10,6 +10,7 @@ import type { KeyboardDirectionMixinClass } from '@vaadin/a11y-base/src/keyboard
|
|
|
10
10
|
import type { KeyboardMixinClass } from '@vaadin/a11y-base/src/keyboard-mixin.js';
|
|
11
11
|
import type { I18nMixinClass } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
12
12
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
13
|
+
import type { MenuBarButton } from './vaadin-menu-bar-button.js';
|
|
13
14
|
|
|
14
15
|
export type MenuBarItem<TItemData extends object = object> = {
|
|
15
16
|
/**
|
|
@@ -113,7 +114,7 @@ export declare class MenuBarMixinClass<TItem extends MenuBarItem = MenuBarItem>
|
|
|
113
114
|
* which makes disabled buttons focusable and hoverable, while still
|
|
114
115
|
* preventing them from being triggered:
|
|
115
116
|
*
|
|
116
|
-
* ```
|
|
117
|
+
* ```js
|
|
117
118
|
* // Set before any menu bar is attached to the DOM.
|
|
118
119
|
* window.Vaadin.featureFlags.accessibleDisabledButtons = true;
|
|
119
120
|
* ```
|
|
@@ -126,7 +127,7 @@ export declare class MenuBarMixinClass<TItem extends MenuBarItem = MenuBarItem>
|
|
|
126
127
|
* just the individual properties you want to change.
|
|
127
128
|
*
|
|
128
129
|
* The object has the following JSON structure and default values:
|
|
129
|
-
* ```
|
|
130
|
+
* ```js
|
|
130
131
|
* {
|
|
131
132
|
* moreOptions: 'More options'
|
|
132
133
|
* }
|
|
@@ -134,14 +135,6 @@ export declare class MenuBarMixinClass<TItem extends MenuBarItem = MenuBarItem>
|
|
|
134
135
|
*/
|
|
135
136
|
i18n: MenuBarI18n;
|
|
136
137
|
|
|
137
|
-
/**
|
|
138
|
-
* A space-delimited list of CSS class names
|
|
139
|
-
* to set on each sub-menu overlay element.
|
|
140
|
-
*
|
|
141
|
-
* @attr {string} overlay-class
|
|
142
|
-
*/
|
|
143
|
-
overlayClass: string;
|
|
144
|
-
|
|
145
138
|
/**
|
|
146
139
|
* If true, the submenu will open on hover (mouseover) instead of click.
|
|
147
140
|
* @attr {boolean} open-on-hover
|
|
@@ -167,11 +160,11 @@ export declare class MenuBarMixinClass<TItem extends MenuBarItem = MenuBarItem>
|
|
|
167
160
|
*/
|
|
168
161
|
close(): void;
|
|
169
162
|
|
|
170
|
-
protected readonly _buttons:
|
|
163
|
+
protected readonly _buttons: MenuBarButton[];
|
|
171
164
|
|
|
172
165
|
protected readonly _container: HTMLElement;
|
|
173
166
|
|
|
174
|
-
protected readonly _overflow:
|
|
167
|
+
protected readonly _overflow: MenuBarButton;
|
|
175
168
|
|
|
176
169
|
protected _hasOverflow: boolean;
|
|
177
170
|
}
|