@brightspace-ui-labs/navigation
Advanced tools
Comparing version 5.9.0 to 5.10.0
import './d2l-navigation-band.js'; | ||
import { css, html, LitElement } from 'lit'; | ||
import './d2l-navigation-skip.js'; | ||
import { css, html, LitElement, nothing } from 'lit'; | ||
import { getNextFocusable } from '@brightspace-ui/core/helpers/focus.js'; | ||
@@ -11,2 +13,8 @@ /** | ||
static get properties() { | ||
return { | ||
hasSkipNav: { attribute: 'has-skip-nav', type: Boolean } | ||
}; | ||
} | ||
static get styles() { | ||
@@ -30,5 +38,11 @@ return css` | ||
constructor() { | ||
super(); | ||
this.hasSkipNav = false; | ||
} | ||
render() { | ||
const skipNav = this.hasSkipNav ? html`<d2l-navigation-skip @d2l-navigation-skip-fail="${this._handleSkipNavFail}"></d2l-navigation-skip>` : nothing; | ||
return html` | ||
<d2l-navigation-band><slot name="navigation-band"></slot></d2l-navigation-band> | ||
${skipNav}<d2l-navigation-band><slot name="navigation-band"></slot></d2l-navigation-band> | ||
<slot></slot> | ||
@@ -39,4 +53,11 @@ <div class="d2l-navigation-shadow-drop-border"></div> | ||
_handleSkipNavFail() { | ||
const nextFocusable = getNextFocusable(this.shadowRoot.querySelector('.d2l-navigation-shadow-drop-border')); | ||
if (nextFocusable) { | ||
nextFocusable.focus(); | ||
} | ||
} | ||
} | ||
customElements.define('d2l-navigation', Navigation); |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "التالي", | ||
"previous": "السابق" | ||
"previous": "السابق", | ||
"skipNav": "تجاوز إلى المحتوى الرئيسي" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Nesaf", | ||
"previous": "Blaenorol" | ||
"previous": "Blaenorol", | ||
"skipNav": "neidio i’r prif gynnwys" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Næste", | ||
"previous": "Forrige" | ||
"previous": "Forrige", | ||
"skipNav": "spring videre til hovedindhold" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Weiter", | ||
"previous": "Zurück" | ||
"previous": "Zurück", | ||
"skipNav": "Zum Hauptinhalt springen" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Next", | ||
"previous": "Previous" | ||
"previous": "Previous", | ||
"skipNav": "skip to main content" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Siguiente", | ||
"previous": "Anterior" | ||
"previous": "Anterior", | ||
"skipNav": "pasar al contenido principal" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Siguiente", | ||
"previous": "Anterior" | ||
"previous": "Anterior", | ||
"skipNav": "pasar al contenido principal" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Suivant", | ||
"previous": "Précédent" | ||
"previous": "Précédent", | ||
"skipNav": "passer au contenu principal" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Page suivante", | ||
"previous": "Précédent" | ||
"previous": "Précédent", | ||
"skipNav": "passer au contenu principal" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Page suivante", | ||
"previous": "Précédent" | ||
"previous": "Précédent", | ||
"skipNav": "passer au contenu principal" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "अगला", | ||
"previous": "पिछला" | ||
"previous": "पिछला", | ||
"skipNav": "मुख्य सामग्री में जाएँ" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "次へ", | ||
"previous": "前へ" | ||
"previous": "前へ", | ||
"skipNav": "メインコンテンツへスキップ" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "다음", | ||
"previous": "이전" | ||
"previous": "이전", | ||
"skipNav": "기본 콘텐츠로 건너뛰기" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Volgende", | ||
"previous": "Vorige" | ||
"previous": "Vorige", | ||
"skipNav": "meteen naar hoofdinhoud gaan" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Próximo", | ||
"previous": "Anterior" | ||
"previous": "Anterior", | ||
"skipNav": "passar para conteúdo principal" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Nästa", | ||
"previous": "Föregående" | ||
"previous": "Föregående", | ||
"skipNav": "fortsätt till huvudinnehåll" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "Sonraki", | ||
"previous": "Önceki" | ||
"previous": "Önceki", | ||
"skipNav": "ana içeriğe atla" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "下一个", | ||
"previous": "上一步" | ||
"previous": "上一步", | ||
"skipNav": "跳到主目录" | ||
}; |
@@ -6,3 +6,4 @@ /* eslint quotes: 0 */ | ||
"next": "下一個", | ||
"previous": "上一個" | ||
"previous": "上一個", | ||
"skipNav": "跳至主要內容" | ||
}; |
{ | ||
"name": "@brightspace-ui-labs/navigation", | ||
"version": "5.9.0", | ||
"version": "5.10.0", | ||
"type": "module", | ||
@@ -9,3 +9,3 @@ "repository": "https://github.com/BrightspaceUILabs/navigation.git", | ||
"lint:eslint": "eslint . --ext .js,.html", | ||
"lint:lit": "lit-analyzer d2l-navigation.js d2l-navigation-button-icon.js d2l-navigation-dropdown-button-custom.js d2l-navigation-dropdown-button-icon.js d2l-navigation-link-back.js d2l-navigation-link-icon.js d2l-navigation-link-image.js d2l-navigation-notification-icon.js d2l-navigation-separator.js ./components/d2l-navigation-iterator/d2l-navigation-iterator.js --strict --rules.no-unknown-tag-name off", | ||
"lint:lit": "lit-analyzer d2l-navigation.js d2l-navigation-button-icon.js d2l-navigation-dropdown-button-custom.js d2l-navigation-dropdown-button-icon.js d2l-navigation-link-back.js d2l-navigation-link-icon.js d2l-navigation-link-image.js d2l-navigation-notification-icon.js d2l-navigation-separator.js d2l-navigation-skip.js ./components/d2l-navigation-iterator/d2l-navigation-iterator.js --strict --rules.no-unknown-tag-name off", | ||
"lint:style": "stylelint \"**/*.{js,html}\"", | ||
@@ -36,2 +36,3 @@ "start": "web-dev-server --node-resolve --watch --open --app-index demo/index.html", | ||
"d2l-navigation-shared-styles.js", | ||
"d2l-navigation-skip.js", | ||
"d2l-navigation-styles.js", | ||
@@ -38,0 +39,0 @@ "d2l-navigation.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73728
44
1640