@ni/nimble-components 20.0.0 → 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.
@@ -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=>!this.isDisabledElement(e))),n=e?t.length-1:0,i=this.tabs.indexOf(t[n])
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)}
@@ -2334,7 +2334,8 @@ const Eh=mi.tagFor(Mh),Fh={name:"add_16_x_16",data:'<svg xmlns="http://www.w3.or
2334
2334
  height: 100%;
2335
2335
  }
2336
2336
  `
2337
- class Dp extends Vt{constructor(e){super(),this.icon=e}}e([se],Dp.prototype,"severity",void 0)
2337
+ class Dp extends Vt{constructor(e){super(),this.icon=e}connectedCallback(){super.connectedCallback(),this.forwardAriaLabelToSvg()}ariaLabelChanged(){this.forwardAriaLabelToSvg()}forwardAriaLabelToSvg(){const e=this.shadowRoot?.querySelector("svg")
2338
+ e&&(null!==this.ariaLabel&&void 0!==this.ariaLabel?e.setAttribute("aria-label",this.ariaLabel):e.removeAttribute("aria-label"))}}e([se],Dp.prototype,"severity",void 0),Pt(Dp,dn)
2338
2339
  const Tp=(e,t)=>{const n=t.compose({baseName:e,template:Fp,styles:Op,baseClass:t})
2339
2340
  mi.getOrCreate().withPrefix("nimble").register(n())}
2340
2341
  class zp extends Dp{constructor(){super(Wd)}}Tp("icon-exclamation-mark",zp)