@ni/spright-components 4.1.5 → 4.1.7
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.
|
@@ -4601,6 +4601,7 @@ const Hb="underline",Ub="outline",qb="block",jb=Mt`
|
|
|
4601
4601
|
border-bottom-color: ${Ml};
|
|
4602
4602
|
}
|
|
4603
4603
|
|
|
4604
|
+
:host([readonly]) .root,
|
|
4604
4605
|
:host([disabled]) .root {
|
|
4605
4606
|
border-color: rgba(${Cl}, 0.1);
|
|
4606
4607
|
}
|
|
@@ -4642,6 +4643,7 @@ const Hb="underline",Ub="outline",qb="block",jb=Mt`
|
|
|
4642
4643
|
width: 100%;
|
|
4643
4644
|
}
|
|
4644
4645
|
|
|
4646
|
+
:host([readonly]:hover) .root::after,
|
|
4645
4647
|
:host([disabled]:hover) .root::after {
|
|
4646
4648
|
width: 0px;
|
|
4647
4649
|
}
|
|
@@ -4720,11 +4722,20 @@ const Hb="underline",Ub="outline",qb="block",jb=Mt`
|
|
|
4720
4722
|
}
|
|
4721
4723
|
|
|
4722
4724
|
:host(:hover) .root {
|
|
4725
|
+
border-bottom-width: ${jl};
|
|
4723
4726
|
padding-bottom: 0;
|
|
4724
4727
|
}
|
|
4725
4728
|
|
|
4729
|
+
:host([readonly]) .root,
|
|
4726
4730
|
:host([disabled]) .root {
|
|
4727
4731
|
background-color: rgba(${Cl}, 0.07);
|
|
4732
|
+
border-color: transparent;
|
|
4733
|
+
}
|
|
4734
|
+
|
|
4735
|
+
:host([error-visible][readonly]) .root,
|
|
4736
|
+
:host([error-visible][disabled]) .root {
|
|
4737
|
+
padding-bottom: 0;
|
|
4738
|
+
border-bottom-color: ${kl};
|
|
4728
4739
|
}
|
|
4729
4740
|
`),Mh(Ub,Mt`
|
|
4730
4741
|
.root {
|
|
@@ -9378,7 +9389,7 @@ _i.getOrCreate().withPrefix("nimble").register(mO())
|
|
|
9378
9389
|
const gO="nimble-spinner",vO=t=>t instanceof ub,bO=t=>t instanceof vb
|
|
9379
9390
|
let yO=class extends Fi{}
|
|
9380
9391
|
class wO extends(An(yO)){constructor(){super(...arguments),this.proxy=document.createElement("select")}}const xO=t=>!t.visuallyHidden&&!t.disabled&&!t.hidden,CO=t=>!t.visuallyHidden&&!t.hidden
|
|
9381
|
-
class kO extends wO{constructor(){super(...arguments),this.appearance=Hg,this.errorVisible=!1,this.filterMode=Gg.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=nl("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?hb(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
|
|
9392
|
+
class kO extends wO{constructor(){super(...arguments),this.appearance=Hg,this.errorVisible=!1,this.filterMode=Gg.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=nl("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?hb(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
9393
|
let n=t
|
|
9383
9394
|
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
9395
|
this.options.forEach((t=>{const e=x.getNotifier(t)
|
|
@@ -9473,10 +9484,12 @@ const t=[]
|
|
|
9473
9484
|
for(const e of this.slottedOptions)if(bO(e)){if(e.hidden)continue
|
|
9474
9485
|
const n=this.getGroupOptions(e),i=this.filterMatchesText(e.labelContent)
|
|
9475
9486
|
n.forEach((e=>{e.visuallyHidden=!i&&this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e)}))}else vO(e)&&(e.visuallyHidden=this.isOptionHiddenOrFilteredOut(e),e.visuallyHidden||t.push(e))
|
|
9476
|
-
this.filteredOptions=t}getGroupOptions(t){return Array.from(t.children).filter((t=>vO(t))).map((e=>(t.hidden&&vO(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()
|
|
9487
|
+
this.filteredOptions=t}getGroupOptions(t){return Array.from(t.children).filter((t=>vO(t))).map((e=>(t.hidden&&vO(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
9488
|
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
9489
|
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()}
|
|
9490
|
+
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
|
|
9491
|
+
const t=this.firstSelectedOption
|
|
9492
|
+
t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],kO.prototype,"appearance",void 0),t([ft({attribute:"position"})],kO.prototype,"positionAttribute",void 0),t([ft({attribute:"error-text"})],kO.prototype,"errorText",void 0),t([ft({attribute:"error-visible",mode:"boolean"})],kO.prototype,"errorVisible",void 0),t([ft({attribute:"filter-mode"})],kO.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],kO.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],kO.prototype,"loadingVisible",void 0),t([C],kO.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],kO.prototype,"open",void 0),t([C],kO.prototype,"position",void 0),t([C],kO.prototype,"control",void 0),t([C],kO.prototype,"scrollableRegion",void 0),t([C],kO.prototype,"filterInput",void 0),t([C],kO.prototype,"anchoredRegion",void 0),t([C],kO.prototype,"hasOverflow",void 0),t([C],kO.prototype,"filteredOptions",void 0),t([C],kO.prototype,"filter",void 0),t([C],kO.prototype,"availableViewportHeight",void 0),t([k],kO.prototype,"collapsible",null),t([k],kO.prototype,"labelContent",null),t([k],kO.prototype,"displayValue",null)
|
|
9480
9493
|
const SO=kO.compose({baseName:"select",baseClass:ns,template:(t,e)=>Q`
|
|
9481
9494
|
<template
|
|
9482
9495
|
class="${t=>[t.collapsible&&"collapsible",t.collapsible&&t.open&&"open",t.disabled&&"disabled",t.collapsible&&t.position].filter(Boolean).join(" ")}"
|