@ni/nimble-components 20.1.3 → 20.1.4

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.
@@ -1788,7 +1788,7 @@ const Sd=we`
1788
1788
  background-color: ${da};
1789
1789
  }
1790
1790
 
1791
- :host(:hover[aria-selected='true']) {
1791
+ :host(:hover[aria-current]) {
1792
1792
  background-color: ${ca};
1793
1793
  }
1794
1794
 
@@ -1864,12 +1864,12 @@ const Sd=we`
1864
1864
  border-bottom-width: var(--ni-private-focus-indicator-width);
1865
1865
  }
1866
1866
 
1867
- :host([aria-selected='true']) a::after {
1867
+ :host([aria-current]) a::after {
1868
1868
  width: 100%;
1869
1869
  border-bottom-width: var(--ni-private-active-indicator-width);
1870
1870
  }
1871
1871
 
1872
- :host([disabled][aria-selected='true']) a::after {
1872
+ :host([disabled][aria-current]) a::after {
1873
1873
  border-bottom-color: rgba(${va}, 0.3);
1874
1874
  }
1875
1875
 
@@ -1926,7 +1926,7 @@ class Rd extends Vt{constructor(){super(...arguments),this.tabIds=[],this.isDisa
1926
1926
  this.activetab=void 0,this.tabs.forEach(((t,n)=>{const i=this.tabIds[n],o=this.activeid===i
1927
1927
  !e&&this.isFocusableElement(t)&&(e=t)
1928
1928
  const r=this.activeid===i&&this.isFocusableElement(t)
1929
- t.setAttribute("id",i),t.setAttribute("aria-selected",o?"true":"false"),t.removeEventListener("click",this.handleTabClick),t.addEventListener("click",this.handleTabClick),t.removeEventListener("keydown",this.handleTabKeyDown),t.addEventListener("keydown",this.handleTabKeyDown),t.setAttribute("tabindex",r?"0":"-1"),o&&(this.activetab=t),t.style.gridRow="",t.style.gridColumn=`${n+1}`})),!e||this.activetab&&this.isFocusableElement(this.activetab)||e.setAttribute("tabindex","0")},this.handleTabClick=e=>{const t=e.currentTarget
1929
+ t.setAttribute("id",i),o?t.setAttribute("aria-current","page"):t.removeAttribute("aria-current"),t.removeEventListener("click",this.handleTabClick),t.addEventListener("click",this.handleTabClick),t.removeEventListener("keydown",this.handleTabKeyDown),t.addEventListener("keydown",this.handleTabKeyDown),t.setAttribute("tabindex",r?"0":"-1"),o&&(this.activetab=t),t.style.gridRow="",t.style.gridColumn=`${n+1}`})),!e||this.activetab&&this.isFocusableElement(this.activetab)||e.setAttribute("tabindex","0")},this.handleTabClick=e=>{const t=e.currentTarget
1930
1930
  1===t.nodeType&&this.isFocusableElement(t)&&this.tabs.forEach((e=>{e.setAttribute("tabindex",e===t?"0":"-1")}))},this.handleTabKeyDown=e=>{let t
1931
1931
  switch(e.key){case Zs:e.preventDefault(),this.adjustBackward()
1932
1932
  break
@@ -1948,7 +1948,7 @@ let t=0
1948
1948
  const n=e.find((e=>e===document.activeElement))
1949
1949
  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)
1950
1950
  break}t-1<0?t=e.length-1:t-=1}},this.focusTabByIndex=(e,t)=>{const n=e[t]
1951
- 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-${Xs()}`))}focusFirstOrLast(e){const t=this.tabs.filter((e=>this.isFocusableElement(e))),n=e?t.length-1:0,i=this.tabs.indexOf(t[n])
1951
+ n.focus(),this.tabs.forEach((e=>{e.setAttribute("tabindex",e===n?"0":"-1"),e.setAttribute("aria-selected",e===n?"true":"false")}))}}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-${Xs()}`))}focusFirstOrLast(e){const t=this.tabs.filter((e=>this.isFocusableElement(e))),n=e?t.length-1:0,i=this.tabs.indexOf(t[n])
1952
1952
  i>-1&&this.focusTabByIndex(this.tabs,i)}getTabAnchor(e){return e.shadowRoot.querySelector("a")}}e([se],Rd.prototype,"activeid",void 0),e([m],Rd.prototype,"tabs",void 0),Pt(Rd,Ye)
1953
1953
  const Ed=Rd.compose({baseName:"anchor-tabs",template:(e,t)=>G`
1954
1954
  ${Qe(0,t)}