@vaadin/menu-bar 23.1.0-alpha1 → 23.1.0-alpha4
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 +10 -10
- 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 +3 -3
- package/src/vaadin-menu-bar-interactions-mixin.d.ts +1 -1
- package/src/vaadin-menu-bar-interactions-mixin.js +14 -10
- 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.1.0-
|
|
3
|
+
"version": "23.1.0-alpha4",
|
|
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.1.0-
|
|
39
|
-
"@vaadin/component-base": "23.1.0-
|
|
40
|
-
"@vaadin/vaadin-context-menu": "23.1.0-
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "23.1.0-
|
|
42
|
-
"@vaadin/vaadin-material-styles": "23.1.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "23.1.0-
|
|
38
|
+
"@vaadin/button": "23.1.0-alpha4",
|
|
39
|
+
"@vaadin/component-base": "23.1.0-alpha4",
|
|
40
|
+
"@vaadin/vaadin-context-menu": "23.1.0-alpha4",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "23.1.0-alpha4",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "23.1.0-alpha4",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "23.1.0-alpha4"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
47
|
-
"@vaadin/icon": "23.1.0-
|
|
47
|
+
"@vaadin/icon": "23.1.0-alpha4",
|
|
48
48
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
49
|
-
"sinon": "^
|
|
49
|
+
"sinon": "^13.0.2"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "aacdb7fe09811894751f0378ff7fb66071892c71"
|
|
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
|
|
|
@@ -128,7 +128,7 @@ export const ButtonsMixin = (superClass) =>
|
|
|
128
128
|
btn.style.width = btnStyle.width;
|
|
129
129
|
}
|
|
130
130
|
overflow.item = {
|
|
131
|
-
children: buttons.filter((b, idx) => idx >= i).map((b) => b.item)
|
|
131
|
+
children: buttons.filter((b, idx) => idx >= i).map((b) => b.item),
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -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
|
|
|
@@ -214,14 +214,14 @@ export const InteractionsMixin = (superClass) =>
|
|
|
214
214
|
const overlay = e.target;
|
|
215
215
|
const { width, height, left } = this._expandedButton.getBoundingClientRect();
|
|
216
216
|
if (overlay.hasAttribute('bottom-aligned')) {
|
|
217
|
-
overlay.style.bottom = parseInt(getComputedStyle(overlay).bottom) + height
|
|
217
|
+
overlay.style.bottom = `${parseInt(getComputedStyle(overlay).bottom) + height}px`;
|
|
218
218
|
}
|
|
219
219
|
const endAligned = overlay.hasAttribute('end-aligned');
|
|
220
220
|
if (endAligned) {
|
|
221
221
|
if (this.__isRTL) {
|
|
222
|
-
overlay.style.left = left
|
|
222
|
+
overlay.style.left = `${left}px`;
|
|
223
223
|
} else {
|
|
224
|
-
overlay.style.right = parseInt(getComputedStyle(overlay).right) - width
|
|
224
|
+
overlay.style.right = `${parseInt(getComputedStyle(overlay).right) - width}px`;
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
@@ -315,9 +315,9 @@ export const InteractionsMixin = (superClass) =>
|
|
|
315
315
|
button.dispatchEvent(
|
|
316
316
|
new CustomEvent('opensubmenu', {
|
|
317
317
|
detail: {
|
|
318
|
-
children: items
|
|
319
|
-
}
|
|
320
|
-
})
|
|
318
|
+
children: items,
|
|
319
|
+
},
|
|
320
|
+
}),
|
|
321
321
|
);
|
|
322
322
|
|
|
323
323
|
this._setExpanded(button, true);
|
|
@@ -352,7 +352,9 @@ export const InteractionsMixin = (superClass) =>
|
|
|
352
352
|
_focusLastItem() {
|
|
353
353
|
const list = this._subMenu.$.overlay.firstElementChild;
|
|
354
354
|
const item = list.items[list.items.length - 1];
|
|
355
|
-
|
|
355
|
+
if (item) {
|
|
356
|
+
item.focus();
|
|
357
|
+
}
|
|
356
358
|
}
|
|
357
359
|
|
|
358
360
|
/** @private */
|
|
@@ -397,6 +399,8 @@ export const InteractionsMixin = (superClass) =>
|
|
|
397
399
|
_close(restoreFocus) {
|
|
398
400
|
this.style.pointerEvents = '';
|
|
399
401
|
this.__deactivateButton(restoreFocus);
|
|
400
|
-
this._subMenu.opened
|
|
402
|
+
if (this._subMenu.opened) {
|
|
403
|
+
this._subMenu.close();
|
|
404
|
+
}
|
|
401
405
|
}
|
|
402
406
|
};
|
package/src/vaadin-menu-bar.d.ts
CHANGED
|
@@ -144,13 +144,13 @@ declare class MenuBar extends ButtonsMixin(DisabledMixin(InteractionsMixin(Eleme
|
|
|
144
144
|
addEventListener<K extends keyof MenuBarEventMap>(
|
|
145
145
|
type: K,
|
|
146
146
|
listener: (this: MenuBar, ev: MenuBarEventMap[K]) => void,
|
|
147
|
-
options?: boolean | AddEventListenerOptions
|
|
147
|
+
options?: boolean | AddEventListenerOptions,
|
|
148
148
|
): void;
|
|
149
149
|
|
|
150
150
|
removeEventListener<K extends keyof MenuBarEventMap>(
|
|
151
151
|
type: K,
|
|
152
152
|
listener: (this: MenuBar, ev: MenuBarEventMap[K]) => void,
|
|
153
|
-
options?: boolean | EventListenerOptions
|
|
153
|
+
options?: boolean | EventListenerOptions,
|
|
154
154
|
): void;
|
|
155
155
|
}
|
|
156
156
|
|
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
|
|