@ni/nimble-components 32.2.4 → 32.2.6

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.
@@ -9378,7 +9378,7 @@ _i.getOrCreate().withPrefix("nimble").register(fO())
9378
9378
  const mO="nimble-spinner",gO=t=>t instanceof hb,vO=t=>t instanceof gb
9379
9379
  let bO=class extends Fi{}
9380
9380
  class yO extends(An(bO)){constructor(){super(...arguments),this.proxy=document.createElement("select")}}const wO=t=>!t.visuallyHidden&&!t.disabled&&!t.hidden,xO=t=>!t.visuallyHidden&&!t.hidden
9381
- class CO extends yO{constructor(){super(...arguments),this.appearance=Vg,this.errorVisible=!1,this.filterMode=Wg.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=el("listbox-"),this.hasOverflow=!1,this.filteredOptions=[],this.filter="",this.availableViewportHeight=0,this._value="",this.forcedPosition=!1}get collapsible(){return!(this.multiple||"number"==typeof this.size)}get labelContent(){return this.$fastController.isConnected?db(this.labelSlot):""}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.open&&this.initializeOpenState()}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
9381
+ class CO extends yO{constructor(){super(...arguments),this.appearance=Vg,this.errorVisible=!1,this.filterMode=Wg.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=el("listbox-"),this.hasOverflow=!1,this.filteredOptions=[],this.filter="",this.availableViewportHeight=0,this._value="",this.forcedPosition=!1,this.selectedOptionObserver=new MutationObserver((()=>{this.updateDisplayValue()}))}get collapsible(){return!(this.multiple||"number"==typeof this.size)}get labelContent(){return this.$fastController.isConnected?db(this.labelSlot):""}connectedCallback(){super.connectedCallback(),this.forcedPosition=!!this.positionAttribute,this.open&&this.initializeOpenState(),this.observeSelectedOptionTextContent()}disconnectedCallback(){super.disconnectedCallback(),this.selectedOptionObserver?.disconnect()}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
9382
9382
  let n=t
9383
9383
  if(this.options?.length){const t=this.options.findIndex((t=>t.value===n)),e=this.options[this.selectedIndex]?.value??null,i=this.options[t]?.value??null;-1!==t&&e===i||(n="",this.selectedIndex=t),n=this.firstSelectedOption?.value??n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value"),this.updateDisplayValue())}get displayValue(){return x.track(this,"displayValue"),this.firstSelectedOption?.text??""}anchoredRegionChanged(t,e){this.anchoredRegion&&this.control&&(this.anchoredRegion.anchorElement=this.control)}controlChanged(t,e){this.anchoredRegion&&this.control&&(this.anchoredRegion.anchorElement=this.control)}slottedOptionsChanged(t,e){const n=this.value
9384
9384
  this.options.forEach((t=>{const e=x.getNotifier(t)
@@ -9473,10 +9473,12 @@ const t=[]
9473
9473
  for(const e of this.slottedOptions)if(vO(e)){if(e.hidden)continue
9474
9474
  const n=this.getGroupOptions(e),i=this.filterMatchesText(e.labelContent)
9475
9475
  n.forEach((e=>{e.visuallyHidden=!i&&this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e)}))}else gO(e)&&(e.visuallyHidden=this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e))
9476
- this.filteredOptions=t}getGroupOptions(t){return Array.from(t.children).filter((t=>gO(t))).map((e=>(t.hidden&&gO(e)&&(e.visuallyHidden=!0),e)))}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.value??""),t&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}clearSelect(){const t=this.getPlaceholderOption()
9476
+ this.filteredOptions=t}getGroupOptions(t){return Array.from(t.children).filter((t=>gO(t))).map((e=>(t.hidden&&gO(e)&&(e.visuallyHidden=!0),e)))}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.value??"",this.observeSelectedOptionTextContent()),t&&(this.$emit("input"),this.$emit("change",this,{bubbles:!0,composed:void 0}))}clearSelect(){const t=this.getPlaceholderOption()
9477
9477
  this.selectedIndex=t?this.options.indexOf(t):-1}setProxyOptions(){this.proxy instanceof HTMLSelectElement&&this.options&&(this.proxy.options.length=0,this.options.forEach((t=>{const e=t.proxy||(t instanceof HTMLOptionElement?t.cloneNode():null)
9478
9478
  e&&this.proxy.options.add(e)})))}filterChanged(){this.filterOptions()}emitFilterInputEvent(){const t={filterText:this.filter}
9479
- this.$emit("filter-input",t,{bubbles:!0})}initializeOpenState(){this.setActiveOption(this.selectedIndex),this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView()}}t([ft],CO.prototype,"appearance",void 0),t([ft({attribute:"position"})],CO.prototype,"positionAttribute",void 0),t([ft({attribute:"error-text"})],CO.prototype,"errorText",void 0),t([ft({attribute:"error-visible",mode:"boolean"})],CO.prototype,"errorVisible",void 0),t([ft({attribute:"filter-mode"})],CO.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],CO.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],CO.prototype,"loadingVisible",void 0),t([C],CO.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],CO.prototype,"open",void 0),t([C],CO.prototype,"position",void 0),t([C],CO.prototype,"control",void 0),t([C],CO.prototype,"scrollableRegion",void 0),t([C],CO.prototype,"filterInput",void 0),t([C],CO.prototype,"anchoredRegion",void 0),t([C],CO.prototype,"hasOverflow",void 0),t([C],CO.prototype,"filteredOptions",void 0),t([C],CO.prototype,"filter",void 0),t([C],CO.prototype,"availableViewportHeight",void 0),t([k],CO.prototype,"collapsible",null),t([k],CO.prototype,"labelContent",null),t([k],CO.prototype,"displayValue",null)
9479
+ this.$emit("filter-input",t,{bubbles:!0})}initializeOpenState(){this.setActiveOption(this.selectedIndex),this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView()}observeSelectedOptionTextContent(){if(this.selectedOptionObserver?.disconnect(),-1===this.selectedIndex)return
9480
+ const t=this.firstSelectedOption
9481
+ t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],CO.prototype,"appearance",void 0),t([ft({attribute:"position"})],CO.prototype,"positionAttribute",void 0),t([ft({attribute:"error-text"})],CO.prototype,"errorText",void 0),t([ft({attribute:"error-visible",mode:"boolean"})],CO.prototype,"errorVisible",void 0),t([ft({attribute:"filter-mode"})],CO.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],CO.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],CO.prototype,"loadingVisible",void 0),t([C],CO.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],CO.prototype,"open",void 0),t([C],CO.prototype,"position",void 0),t([C],CO.prototype,"control",void 0),t([C],CO.prototype,"scrollableRegion",void 0),t([C],CO.prototype,"filterInput",void 0),t([C],CO.prototype,"anchoredRegion",void 0),t([C],CO.prototype,"hasOverflow",void 0),t([C],CO.prototype,"filteredOptions",void 0),t([C],CO.prototype,"filter",void 0),t([C],CO.prototype,"availableViewportHeight",void 0),t([k],CO.prototype,"collapsible",null),t([k],CO.prototype,"labelContent",null),t([k],CO.prototype,"displayValue",null)
9480
9482
  const kO=CO.compose({baseName:"select",baseClass:ns,template:(t,e)=>Q`
9481
9483
  <template
9482
9484
  class="${t=>[t.collapsible&&"collapsible",t.collapsible&&t.open&&"open",t.disabled&&"disabled",t.collapsible&&t.position].filter(Boolean).join(" ")}"
@@ -10966,7 +10968,7 @@ const xF="nimble-table-cell",CF=Q`
10966
10968
  </span>
10967
10969
  </template>
10968
10970
  `
10969
- class kF extends We{constructor(){super(...arguments),this.selectable=!1,this.selected=!1,this.hideSelection=!1,this.expanded=!1,this.reserveCollapseSpace=!1,this.columnNotifiers=[],this.columns=[],this.nestingLevel=0,this.isParentRow=!1,this.menuOpen=!1,this.rowOperationGridCellHidden=!1,this.loading=!1,this.cellIndentLevels=[],this.cellStates=[],this.animationClass="",this.allowHover=!1,this.ignoreSelectionChangeEvents=!1,this.removeAnimatingClass=()=>{this.animationClass="",this.expandIcon?.removeEventListener("transitionend",this.removeAnimatingClass)}}get isTopLevelParentRow(){return this.isParentRow&&0===this.nestingLevel}get isNestedParent(){return this.isParentRow&&this.nestingLevel>0}get showSelectionCheckbox(){return this.selectable&&!this.hideSelection}get ariaSelected(){return this.selectable?this.selected?"true":"false":null}onSelectionCheckboxChange(t){if(this.ignoreSelectionChangeEvents)return
10971
+ class kF extends We{constructor(){super(...arguments),this.selectable=!1,this.selected=!1,this.hideSelection=!1,this.expanded=!1,this.reserveCollapseSpace=!1,this.columnNotifiers=[],this.columns=[],this.nestingLevel=0,this.isParentRow=!1,this.menuOpen=!1,this.rowOperationGridCellHidden=!1,this.loading=!1,this.cellIndentLevels=[],this.cellStates=[],this.animationClass="",this.allowHover=!1,this.ignoreSelectionChangeEvents=!1,this.removeAnimatingClass=()=>{this.animationClass="",this.expandIcon?.removeEventListener("transitionend",this.removeAnimatingClass)}}get isTopLevelParentRow(){return this.isParentRow&&0===this.nestingLevel}get isNestedParent(){return this.isParentRow&&this.nestingLevel>0}get showSelectionCheckbox(){return this.selectable&&!this.hideSelection}get ariaSelected(){return this.selectable?this.selected?"true":"false":null}disconnectedCallback(){super.disconnectedCallback(),this.removeColumnObservers()}onSelectionCheckboxChange(t){if(this.ignoreSelectionChangeEvents)return
10970
10972
  const e=t.target.checked
10971
10973
  this.onSelectionChange(!e,e)}onSelectionChange(t,e){this.selected=e
10972
10974
  const n={oldState:t,newState:e}
@@ -11527,7 +11529,8 @@ t&&this.isInTable(t)&&this.setDefaultFocus()}get hasActiveRowOrCellFocus(){retur
11527
11529
  if(t===this.virtualizer&&"visibleItems"===e)n=!0
11528
11530
  else if(t===this.table&&"rowElements"===e){for(const t of this.visibleRowNotifiers)t.unsubscribe(this)
11529
11531
  this.visibleRowNotifiers=[]
11530
- for(const t of this.table.rowElements){x.getNotifier(t).subscribe(this,"resolvedRowIndex"),t.resolvedRowIndex===this.rowIndex&&(n=!0)}}else"resolvedRowIndex"===e&&this.isResolvedRowType(t)&&t.resolvedRowIndex===this.rowIndex&&(n=!0)
11532
+ for(const t of this.table.rowElements){const e=x.getNotifier(t)
11533
+ e.subscribe(this,"resolvedRowIndex"),this.visibleRowNotifiers.push(e),t.resolvedRowIndex===this.rowIndex&&(n=!0)}}else"resolvedRowIndex"===e&&this.isResolvedRowType(t)&&t.resolvedRowIndex===this.rowIndex&&(n=!0)
11531
11534
  if(n&&(this.focusType!==GR&&this.focusType!==ZR||this.setCellFocusState(this.columnIndex,this.rowIndex,!1),this.inNavigationMode&&this.hasRowOrCellFocusType())){if(this.rowIndex>this.table.tableData.length-1){if(!(this.table.tableData.length>0))return void(this.focusWithinTable?this.setDefaultFocus():this.focusType=VR)
11532
11535
  this.rowIndex=0}this.focusWithinTable&&this.focusCurrentRow(!1)}}onRowFocusIn(t){if(this.isCurrentlyFocusingElement)return
11533
11536
  const e=t.target