@ni/nimble-components 20.0.1 → 20.0.2
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/dist/all-components-bundle.js +6 -3
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2 -2
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/anchor-tabs/index.d.ts +1 -0
- package/dist/esm/anchor-tabs/index.js +5 -2
- package/dist/esm/anchor-tabs/index.js.map +1 -1
- package/dist/esm/src/anchor-tabs/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1937,7 +1937,7 @@ const ph=we`
|
|
|
1937
1937
|
align-self: end;
|
|
1938
1938
|
}
|
|
1939
1939
|
`
|
|
1940
|
-
class gh extends Vt{constructor(){super(...arguments),this.tabIds=[],this.isDisabledElement=e=>"true"===e.getAttribute("aria-disabled"),this.isFocusableElement=e=>!this.isDisabledElement(e),this.setTabs=()=>{let e
|
|
1940
|
+
class gh extends Vt{constructor(){super(...arguments),this.tabIds=[],this.isDisabledElement=e=>"true"===e.getAttribute("aria-disabled"),this.isHiddenElement=e=>e.hasAttribute("hidden"),this.isFocusableElement=e=>!this.isDisabledElement(e)&&!this.isHiddenElement(e),this.setTabs=()=>{let e
|
|
1941
1941
|
this.activetab=void 0,this.tabs.forEach(((t,n)=>{const i=this.tabIds[n],o=this.activeid===i
|
|
1942
1942
|
!e&&this.isFocusableElement(t)&&(e=t)
|
|
1943
1943
|
const r=this.activeid===i&&this.isFocusableElement(t)
|
|
@@ -1963,7 +1963,7 @@ let t=0
|
|
|
1963
1963
|
const n=e.find((e=>e===document.activeElement))
|
|
1964
1964
|
for(t=n?e.indexOf(n)-1:0,t=t<0?e.length-1:t;t>=0&&e.length>1;){if(this.isFocusableElement(e[t])){this.focusTabByIndex(e,t)
|
|
1965
1965
|
break}t-1<0?t=e.length-1:t-=1}},this.focusTabByIndex=(e,t)=>{const n=e[t]
|
|
1966
|
-
n.focus(),this.tabs.forEach((e=>{e.setAttribute("tabindex",e===n?"0":"-1")}))}}activeidChanged(e,t){this.$fastController.isConnected&&this.setTabs()}tabsChanged(){this.$fastController.isConnected&&(this.tabIds=this.getTabIds(),this.setTabs())}connectedCallback(){super.connectedCallback(),this.tabIds=this.getTabIds()}getTabIds(){return this.tabs.map((e=>e.getAttribute("id")??`tab-${Ns()}`))}focusFirstOrLast(e){const t=this.tabs.filter((e
|
|
1966
|
+
n.focus(),this.tabs.forEach((e=>{e.setAttribute("tabindex",e===n?"0":"-1")}))}}activeidChanged(e,t){this.$fastController.isConnected&&this.setTabs()}tabsChanged(){this.$fastController.isConnected&&(this.tabIds=this.getTabIds(),this.setTabs())}connectedCallback(){super.connectedCallback(),this.tabIds=this.getTabIds()}getTabIds(){return this.tabs.map((e=>e.getAttribute("id")??`tab-${Ns()}`))}focusFirstOrLast(e){const t=this.tabs.filter((e=>this.isFocusableElement(e))),n=e?t.length-1:0,i=this.tabs.indexOf(t[n])
|
|
1967
1967
|
i>-1&&this.focusTabByIndex(this.tabs,i)}getTabAnchor(e){return e.shadowRoot.querySelector("a")}}e([se],gh.prototype,"activeid",void 0),e([m],gh.prototype,"tabs",void 0),Pt(gh,Ye)
|
|
1968
1968
|
const fh=gh.compose({baseName:"anchor-tabs",template:(e,t)=>G`
|
|
1969
1969
|
${Qe(0,t)}
|