@ni/nimble-components 11.8.4 → 11.8.5

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.
@@ -2127,12 +2127,20 @@ const Rh=ut`
2127
2127
  display: none;
2128
2128
  }
2129
2129
  `
2130
- class Bh extends mi{constructor(){super(...arguments),this.focusOutHandler=()=>{this.open=!1}}setPositioning(){this.$fastController.isConnected&&super.setPositioning()}slottedOptionsChanged(t,e){const i=this.value
2131
- super.slottedOptionsChanged(t,e),i&&(this.value=i)}connectedCallback(){super.connectedCallback(),this.setPositioning(),this.updateInputAriaLabel(),this.addEventListener("focusout",this.focusOutHandler)}disconnectedCallback(){this.removeEventListener("focusout",this.focusOutHandler)}toggleButtonClickHandler(t){t.stopImmediatePropagation()}toggleButtonChangeHandler(t){this.open=this.dropdownButton.checked,t.stopImmediatePropagation()}toggleButtonKeyDownHandler(t){switch(t.key){case Ce:case xe:case Oe:case ke:return this.open=!0,this.stopPropagation(t),!1
2130
+ class Bh extends mi{constructor(){super(...arguments),this.valueUpdatedByInput=!1}setPositioning(){this.$fastController.isConnected&&super.setPositioning()}slottedOptionsChanged(t,e){const i=this.value
2131
+ super.slottedOptionsChanged(t,e),i&&(this.value=i)}connectedCallback(){super.connectedCallback(),this.setPositioning(),this.updateInputAriaLabel()}toggleButtonClickHandler(t){t.stopImmediatePropagation()}toggleButtonChangeHandler(t){this.open=this.dropdownButton.checked,t.stopImmediatePropagation()}toggleButtonKeyDownHandler(t){switch(t.key){case Ce:case xe:case Oe:case ke:return this.open=!0,this.stopPropagation(t),!1
2132
2132
  default:return!0}}filterOptions(){super.filterOptions()
2133
2133
  const t=this.filteredOptions.filter((t=>!t.disabled))
2134
- this.filteredOptions=t}openChanged(){super.openChanged(),this.dropdownButton&&(this.dropdownButton.checked=this.open)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
2135
- this.ariaLabel?t?.setAttribute("aria-label",this.ariaLabel):t?.removeAttribute("aria-label")}}zn([v],Bh.prototype,"dropdownButton",void 0),zn([tt({attribute:"error-text"})],Bh.prototype,"errorText",void 0)
2134
+ this.filteredOptions=t}inputHandler(t){const e=super.inputHandler(t)
2135
+ return this.valueUpdatedByInput||(this.valueBeforeTextUpdate=this.value),this.value=this.control.value,this.valueUpdatedByInput=!0,e}keydownHandler(t){const e=super.keydownHandler(t)
2136
+ if(t.ctrlKey||t.altKey)return e
2137
+ switch(t.key){case ke:this.emitChangeIfValueUpdated()
2138
+ break
2139
+ case xe:case Ce:this.open&&this.valueUpdatedByInput&&(this.valueUpdatedByInput=!1)
2140
+ break
2141
+ default:return e}return e}focusoutHandler(t){const e=super.focusoutHandler(t)
2142
+ return this.open=!1,this.emitChangeIfValueUpdated(),e}openChanged(){super.openChanged(),this.dropdownButton&&(this.dropdownButton.checked=this.open)}ariaLabelChanged(t,e){this.updateInputAriaLabel()}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
2143
+ 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)}}zn([v],Bh.prototype,"dropdownButton",void 0),zn([tt({attribute:"error-text"})],Bh.prototype,"errorText",void 0)
2136
2144
  const Nh=Bh.compose({baseName:"combobox",baseClass:mi,template:(t,e)=>q`
2137
2145
  <template
2138
2146
  aria-disabled="${t=>t.ariaDisabled}"