@ni/nimble-components 21.10.1 → 21.10.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.
@@ -3344,7 +3344,7 @@ break
3344
3344
  case la:case da:this.open&&this.valueUpdatedByInput&&(this.valueUpdatedByInput=!1)
3345
3345
  break
3346
3346
  default:return e}return e}focusoutHandler(t){const e=super.focusoutHandler(t)
3347
- return this.open=!1,this.emitChangeIfValueUpdated(),e}focusAndScrollOptionIntoView(){this.open&&super.focusAndScrollOptionIntoView()}openChanged(){super.openChanged(),this.dropdownButton&&(this.dropdownButton.checked=this.open)}regionChanged(t,e){this.region&&this.controlWrapper&&(this.region.anchorElement=this.controlWrapper)}controlWrapperChanged(t,e){this.region&&this.controlWrapper&&(this.region.anchorElement=this.controlWrapper)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}maxHeightChanged(){this.updateListboxMaxHeightCssVariable()}updateListboxMaxHeightCssVariable(){this.listbox&&this.listbox.style.setProperty("--ni-private-select-max-height",`${this.maxHeight}px`)}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
3347
+ return this.open=!1,this.emitChangeIfValueUpdated(),e}registerOption(t){this.options.includes(t)||this.options.push(t)}focusAndScrollOptionIntoView(){this.open&&super.focusAndScrollOptionIntoView()}openChanged(){super.openChanged(),this.dropdownButton&&(this.dropdownButton.checked=this.open)}regionChanged(t,e){this.region&&this.controlWrapper&&(this.region.anchorElement=this.controlWrapper)}controlWrapperChanged(t,e){this.region&&this.controlWrapper&&(this.region.anchorElement=this.controlWrapper)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}maxHeightChanged(){this.updateListboxMaxHeightCssVariable()}updateListboxMaxHeightCssVariable(){this.listbox&&this.listbox.style.setProperty("--ni-private-select-max-height",`${this.maxHeight}px`)}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
3348
3348
  this.ariaLabel?t?.setAttribute("aria-label",this.ariaLabel):t?.removeAttribute("aria-label")}emitChangeIfValueUpdated(){this.valueUpdatedByInput&&(this.value!==this.valueBeforeTextUpdate&&this.$emit("change"),this.valueUpdatedByInput=!1)}}t([st],hg.prototype,"appearance",void 0),t([g],hg.prototype,"dropdownButton",void 0),t([st({attribute:"error-text"})],hg.prototype,"errorText",void 0),t([st({attribute:"error-visible",mode:"boolean"})],hg.prototype,"errorVisible",void 0),t([g],hg.prototype,"region",void 0),t([g],hg.prototype,"controlWrapper",void 0),t([g],hg.prototype,"hasOverflow",void 0)
3349
3349
  const ug=hg.compose({baseName:"combobox",baseClass:Zn,template:(t,e)=>Z`
3350
3350
  <template
@@ -4007,7 +4007,7 @@ const vv=yt`
4007
4007
  display: none;
4008
4008
  }
4009
4009
  `
4010
- class bv extends Fn{constructor(){super(...arguments),this.hidden=!1,this.visuallyHidden=!1,this.hasOverflow=!1}get elementTextContent(){return this.contentSlot.assignedNodes().map((t=>t.textContent?.trim())).join(" ")}}t([st({mode:"boolean"})],bv.prototype,"hidden",void 0),t([st({attribute:"visually-hidden",mode:"boolean"})],bv.prototype,"visuallyHidden",void 0),t([g],bv.prototype,"hasOverflow",void 0)
4010
+ class bv extends Fn{constructor(){super(...arguments),this.hidden=!1,this.visuallyHidden=!1,this.hasOverflow=!1}get elementTextContent(){return this.contentSlot.assignedNodes().map((t=>t.textContent?.trim())).join(" ")}connectedCallback(){super.connectedCallback(),this.isListOptionOwner(this.parentElement)&&this.parentElement.registerOption(this)}isListOptionOwner(t){return!!t&&"function"==typeof t.registerOption}}t([st({mode:"boolean"})],bv.prototype,"hidden",void 0),t([st({attribute:"visually-hidden",mode:"boolean"})],bv.prototype,"visuallyHidden",void 0),t([g],bv.prototype,"hasOverflow",void 0)
4011
4011
  const yv=bv.compose({baseName:"list-option",baseClass:Fn,template:(t,e)=>Z`
4012
4012
  <template
4013
4013
  aria-checked="${t=>t.ariaChecked}"
@@ -8917,7 +8917,7 @@ this.collapsible&&this.open&&(t.preventDefault(),this.open=!1),this.selectedInde
8917
8917
  break
8918
8918
  case"Tab":return this.collapsible&&this.open&&(t.preventDefault(),this.open=!1),!0}return this.open||this.indexWhenOpened===this.selectedIndex||(this.updateValue(!0),this.indexWhenOpened=this.selectedIndex),!(e===la||e===da)}selectedIndexChanged(t,e){this.setSelectedOptions(),this.updateValue()}disabledChanged(t,e){super.disabledChanged&&super.disabledChanged(t,e),this.ariaDisabled=this.disabled?"true":"false"}formResetCallback(){this.setProxyOptions(),super.setDefaultSelectedOption(),-1===this.selectedIndex&&(this.selectedIndex=0)}selectNextOption(){for(let t=this.selectedIndex+1;t<this.options.length;t++)if(!this.options[t]?.disabled){this.selectedIndex=t
8919
8919
  break}}selectPreviousOption(){for(let t=this.selectedIndex-1;t>=0;t--)if(!this.options[t]?.disabled){this.selectedIndex=t
8920
- break}}setSelectedOptions(){this.open&&-1===this.selectedIndex||super.setSelectedOptions()}focusAndScrollOptionIntoView(){this.open&&(super.focusAndScrollOptionIntoView(),window.requestAnimationFrame((()=>{this.filterInput?.focus()})))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}sizeChanged(t,e){super.sizeChanged(t,e),this.proxy&&(this.proxy.size=e)}openChanged(){if(this.collapsible){if(this.open)return this.initializeOpenState(),void(this.indexWhenOpened=this.selectedIndex)
8920
+ break}}registerOption(t){this.options.includes(t)||this.options.push(t)}setSelectedOptions(){this.open&&-1===this.selectedIndex||super.setSelectedOptions()}focusAndScrollOptionIntoView(){this.open&&(super.focusAndScrollOptionIntoView(),window.requestAnimationFrame((()=>{this.filterInput?.focus()})))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}sizeChanged(t,e){super.sizeChanged(t,e),this.proxy&&(this.proxy.size=e)}openChanged(){if(this.collapsible){if(this.open)return this.initializeOpenState(),void(this.indexWhenOpened=this.selectedIndex)
8921
8921
  this.filter="",this.filterInput&&(this.filterInput.value=""),this.ariaControls="",this.ariaExpanded="false"}}selectedOptionsChanged(t,e){this.options?.forEach(((t,n)=>{const i=m.getNotifier(t)
8922
8922
  i.unsubscribe(this,"selected"),t.selected=e.includes(t),i.subscribe(this,"selected")
8923
8923
  const o=this.proxy?.options.item(n)