@vaadin/vaadin-menu-bar
Advanced tools
Comparing version 1.1.0-alpha1 to 1.1.0-alpha2
@@ -13,3 +13,3 @@ { | ||
"name": "@vaadin/vaadin-menu-bar", | ||
"version": "1.1.0-alpha1", | ||
"version": "1.1.0-alpha2", | ||
"main": "vaadin-menu-bar.js", | ||
@@ -28,2 +28,3 @@ "author": "Vaadin Ltd", | ||
"@webcomponents/webcomponentsjs": "2.2.0", | ||
"@webcomponents/webcomponentsjs": "2.2.0", | ||
"inherits": "2.0.3", | ||
@@ -44,3 +45,9 @@ "samsam": "1.1.3", | ||
}, | ||
"devDependencies": { | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify" | ||
}, | ||
"scripts": { | ||
"generate-typings": "gen-typescript-declarations --outDir . --verify" | ||
}, | ||
"devDependencies": { | ||
"@polymer/iron-component-page": "^4.0.0", | ||
@@ -47,0 +54,0 @@ "@polymer/iron-test-helpers": "^3.0.0", |
@@ -24,3 +24,3 @@ /** | ||
/** | ||
* @memberof Vaadin | ||
* @extends PolymerElement | ||
*/ | ||
@@ -27,0 +27,0 @@ class MenuBarButtonElement extends ButtonElement { |
@@ -68,2 +68,3 @@ /** | ||
const containerWidth = container.offsetWidth; | ||
const isRTL = this.getAttribute('dir') === 'rtl'; | ||
@@ -82,3 +83,6 @@ if (container.offsetWidth < container.scrollWidth) { | ||
const btnWidth = btn.offsetWidth; | ||
if ((btn.offsetLeft + btnWidth) < (containerWidth - overflow.offsetWidth)) { | ||
if ( | ||
(!isRTL && (btn.offsetLeft + btnWidth) < (containerWidth - overflow.offsetWidth)) || | ||
(isRTL && btn.offsetLeft >= overflow.offsetWidth) | ||
) { | ||
break; | ||
@@ -103,2 +107,3 @@ } | ||
const btn = buttons[i]; | ||
const btnWidth = btn.getBoundingClientRect().width; | ||
@@ -109,6 +114,6 @@ if (getComputedStyle(btn).visibility !== 'hidden') { | ||
const overflowLeft = overflow.offsetLeft; | ||
const btnWidth = btn.getBoundingClientRect().width; | ||
if ((overflowLeft + overflow.offsetWidth + btnWidth) < containerWidth) { | ||
if ( | ||
(!isRTL && (overflow.offsetLeft + overflow.offsetWidth + btnWidth) < containerWidth) || | ||
(isRTL && (btnWidth < overflow.offsetLeft)) | ||
) { | ||
btn.disabled = btn.item.disabled; | ||
@@ -115,0 +120,0 @@ btn.style.visibility = ''; |
@@ -214,4 +214,4 @@ /** | ||
const endAligned = overlay.hasAttribute('end-aligned'); | ||
if (this.__isRTL) { | ||
if (endAligned) { | ||
if (endAligned) { | ||
if (this.__isRTL) { | ||
overlay.style.left = left + 'px'; | ||
@@ -221,4 +221,2 @@ } else { | ||
} | ||
} else if (endAligned) { | ||
overlay.style.right = parseInt(getComputedStyle(overlay).right) - width + 'px'; | ||
} | ||
@@ -303,3 +301,3 @@ } | ||
button.dispatchEvent(new CustomEvent('opensubmenu', {detail: { | ||
x: rect.left, | ||
x: this.__isRTL ? rect.right : rect.left, | ||
y: rect.bottom, | ||
@@ -306,0 +304,0 @@ children: items |
@@ -9,3 +9,3 @@ /** | ||
/** | ||
* @memberof Vaadin | ||
* @extends PolymerElement | ||
*/ | ||
@@ -12,0 +12,0 @@ class MenuBarSubmenuElement extends ContextMenuElement { |
@@ -45,7 +45,7 @@ /** | ||
* | ||
* @memberof Vaadin | ||
* @mixes Vaadin.MenuBar.ButtonsMixin | ||
* @mixes Vaadin.MenuBar.InteractionsMixin | ||
* @mixes Vaadin.ElementMixin | ||
* @mixes Vaadin.ThemableMixin | ||
* @extends PolymerElement | ||
* @mixes MenuBar.ButtonsMixin | ||
* @mixes MenuBar.InteractionsMixin | ||
* @mixes ElementMixin | ||
* @mixes ThemableMixin | ||
* @demo demo/index.html | ||
@@ -107,3 +107,3 @@ */ | ||
static get version() { | ||
return '1.1.0-alpha1'; | ||
return '1.1.0-alpha2'; | ||
} | ||
@@ -110,0 +110,0 @@ |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
52206
1029