@vaadin/menu-bar 23.0.7 → 23.0.10
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 +9 -9
- package/src/vaadin-menu-bar-button.js +1 -1
- package/src/vaadin-menu-bar-buttons-mixin.d.ts +1 -1
- package/src/vaadin-menu-bar-buttons-mixin.js +21 -7
- package/src/vaadin-menu-bar-interactions-mixin.d.ts +1 -1
- package/src/vaadin-menu-bar-interactions-mixin.js +5 -5
- package/src/vaadin-menu-bar.d.ts +2 -2
- package/src/vaadin-menu-bar.js +4 -4
- package/theme/lumo/vaadin-menu-bar-button-styles.js +1 -1
- package/theme/lumo/vaadin-menu-bar-item-styles.js +1 -1
- package/theme/lumo/vaadin-menu-bar-overlay-styles.js +1 -1
- package/theme/material/vaadin-menu-bar-button-styles.js +1 -1
- package/theme/material/vaadin-menu-bar-item-styles.js +1 -1
- package/theme/material/vaadin-menu-bar-overlay-styles.js +1 -1
- package/theme/material/vaadin-menu-bar-styles.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/menu-bar",
|
|
3
|
-
"version": "23.0.
|
|
3
|
+
"version": "23.0.10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
37
37
|
"@polymer/polymer": "^3.0.0",
|
|
38
|
-
"@vaadin/button": "^23.0.
|
|
39
|
-
"@vaadin/component-base": "^23.0.
|
|
40
|
-
"@vaadin/vaadin-context-menu": "^23.0.
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "^23.0.
|
|
42
|
-
"@vaadin/vaadin-material-styles": "^23.0.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "^23.0.
|
|
38
|
+
"@vaadin/button": "^23.0.10",
|
|
39
|
+
"@vaadin/component-base": "^23.0.10",
|
|
40
|
+
"@vaadin/vaadin-context-menu": "^23.0.10",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "^23.0.10",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "^23.0.10",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "^23.0.10"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
47
|
-
"@vaadin/icon": "^23.0.
|
|
47
|
+
"@vaadin/icon": "^23.0.10",
|
|
48
48
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
49
49
|
"sinon": "^9.2.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e8402a55ce0e823ae6da5c97486998cfd931b1d3"
|
|
52
52
|
}
|
|
@@ -7,7 +7,7 @@ import { Constructor } from '@open-wc/dedupe-mixin';
|
|
|
7
7
|
import { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
8
8
|
|
|
9
9
|
export declare function ButtonsMixin<T extends Constructor<HTMLElement>>(
|
|
10
|
-
base: T
|
|
10
|
+
base: T,
|
|
11
11
|
): T & Constructor<ButtonsMixinClass> & Constructor<ResizeMixinClass>;
|
|
12
12
|
|
|
13
13
|
export declare class ButtonsMixinClass {
|
|
@@ -19,8 +19,8 @@ export const ButtonsMixin = (superClass) =>
|
|
|
19
19
|
*/
|
|
20
20
|
_hasOverflow: {
|
|
21
21
|
type: Boolean,
|
|
22
|
-
value: false
|
|
23
|
-
}
|
|
22
|
+
value: false,
|
|
23
|
+
},
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -28,6 +28,16 @@ export const ButtonsMixin = (superClass) =>
|
|
|
28
28
|
return ['_menuItemsChanged(items, items.splices)'];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Override getter from `ResizeMixin` to observe parent.
|
|
33
|
+
*
|
|
34
|
+
* @protected
|
|
35
|
+
* @override
|
|
36
|
+
*/
|
|
37
|
+
get _observeParent() {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
/** @protected */
|
|
32
42
|
ready() {
|
|
33
43
|
super.ready();
|
|
@@ -95,8 +105,13 @@ export const ButtonsMixin = (superClass) =>
|
|
|
95
105
|
item.classList.remove('vaadin-menu-item');
|
|
96
106
|
}
|
|
97
107
|
}
|
|
98
|
-
this.
|
|
99
|
-
|
|
108
|
+
this.__updateOverflow([]);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** @private */
|
|
112
|
+
__updateOverflow(items) {
|
|
113
|
+
this._overflow.item = { children: items };
|
|
114
|
+
this._hasOverflow = items.length > 0;
|
|
100
115
|
}
|
|
101
116
|
|
|
102
117
|
/** @private */
|
|
@@ -127,9 +142,8 @@ export const ButtonsMixin = (superClass) =>
|
|
|
127
142
|
// save width for buttons with component
|
|
128
143
|
btn.style.width = btnStyle.width;
|
|
129
144
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
};
|
|
145
|
+
const items = buttons.filter((_, idx) => idx >= i).map((b) => b.item);
|
|
146
|
+
this.__updateOverflow(items);
|
|
133
147
|
}
|
|
134
148
|
}
|
|
135
149
|
|
|
@@ -16,8 +16,8 @@ export const InteractionsMixin = (superClass) =>
|
|
|
16
16
|
* @attr {boolean} open-on-hover
|
|
17
17
|
*/
|
|
18
18
|
openOnHover: {
|
|
19
|
-
type: Boolean
|
|
20
|
-
}
|
|
19
|
+
type: Boolean,
|
|
20
|
+
},
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -324,9 +324,9 @@ export const InteractionsMixin = (superClass) =>
|
|
|
324
324
|
button.dispatchEvent(
|
|
325
325
|
new CustomEvent('opensubmenu', {
|
|
326
326
|
detail: {
|
|
327
|
-
children: items
|
|
328
|
-
}
|
|
329
|
-
})
|
|
327
|
+
children: items,
|
|
328
|
+
},
|
|
329
|
+
}),
|
|
330
330
|
);
|
|
331
331
|
|
|
332
332
|
this._setExpanded(button, true);
|
package/src/vaadin-menu-bar.d.ts
CHANGED
|
@@ -138,13 +138,13 @@ declare class MenuBar extends ButtonsMixin(DisabledMixin(InteractionsMixin(Eleme
|
|
|
138
138
|
addEventListener<K extends keyof MenuBarEventMap>(
|
|
139
139
|
type: K,
|
|
140
140
|
listener: (this: MenuBar, ev: MenuBarEventMap[K]) => void,
|
|
141
|
-
options?: boolean | AddEventListenerOptions
|
|
141
|
+
options?: boolean | AddEventListenerOptions,
|
|
142
142
|
): void;
|
|
143
143
|
|
|
144
144
|
removeEventListener<K extends keyof MenuBarEventMap>(
|
|
145
145
|
type: K,
|
|
146
146
|
listener: (this: MenuBar, ev: MenuBarEventMap[K]) => void,
|
|
147
|
-
options?: boolean | EventListenerOptions
|
|
147
|
+
options?: boolean | EventListenerOptions,
|
|
148
148
|
): void;
|
|
149
149
|
}
|
|
150
150
|
|
package/src/vaadin-menu-bar.js
CHANGED
|
@@ -164,7 +164,7 @@ class MenuBar extends ButtonsMixin(DisabledMixin(InteractionsMixin(ElementMixin(
|
|
|
164
164
|
*/
|
|
165
165
|
items: {
|
|
166
166
|
type: Array,
|
|
167
|
-
value: () => []
|
|
167
|
+
value: () => [],
|
|
168
168
|
},
|
|
169
169
|
|
|
170
170
|
/**
|
|
@@ -194,10 +194,10 @@ class MenuBar extends ButtonsMixin(DisabledMixin(InteractionsMixin(ElementMixin(
|
|
|
194
194
|
type: Object,
|
|
195
195
|
value: () => {
|
|
196
196
|
return {
|
|
197
|
-
moreOptions: 'More options'
|
|
197
|
+
moreOptions: 'More options',
|
|
198
198
|
};
|
|
199
|
-
}
|
|
200
|
-
}
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
203
|
|