@ni/nimble-components 33.5.0 → 33.6.0
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.
- package/dist/all-components-bundle.js +46 -12
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +42 -16
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/combobox/index.d.ts +1 -0
- package/dist/esm/combobox/index.js +4 -0
- package/dist/esm/combobox/index.js.map +1 -1
- package/dist/esm/combobox/styles.js +17 -8
- package/dist/esm/combobox/styles.js.map +1 -1
- package/dist/esm/patterns/dropdown/styles.js +18 -6
- package/dist/esm/patterns/dropdown/styles.js.map +1 -1
- package/dist/esm/select/index.d.ts +1 -0
- package/dist/esm/select/index.js +4 -0
- package/dist/esm/select/index.js.map +1 -1
- package/dist/esm/select/styles.js +4 -0
- package/dist/esm/select/styles.js.map +1 -1
- package/package.json +1 -1
|
@@ -3218,6 +3218,10 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3218
3218
|
color: ${fd};
|
|
3219
3219
|
}
|
|
3220
3220
|
|
|
3221
|
+
:host([disabled][appearance-readonly]) .label {
|
|
3222
|
+
color: ${pd};
|
|
3223
|
+
}
|
|
3224
|
+
|
|
3221
3225
|
.control {
|
|
3222
3226
|
align-items: center;
|
|
3223
3227
|
cursor: pointer;
|
|
@@ -3239,6 +3243,11 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3239
3243
|
border-color: rgba(${cl}, 0.1);
|
|
3240
3244
|
}
|
|
3241
3245
|
|
|
3246
|
+
:host([disabled][appearance-readonly]) .control {
|
|
3247
|
+
color: ${Wc};
|
|
3248
|
+
border-color: rgba(${cl}, 0.3);
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3242
3251
|
:host([error-visible]) .control,
|
|
3243
3252
|
:host([error-visible][open]) .control,
|
|
3244
3253
|
:host([error-visible][disabled]) .control {
|
|
@@ -3260,8 +3269,11 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3260
3269
|
padding-left: ${Dl};
|
|
3261
3270
|
}
|
|
3262
3271
|
|
|
3263
|
-
.selected-value
|
|
3264
|
-
|
|
3272
|
+
:host([disabled][appearance-readonly]) .selected-value {
|
|
3273
|
+
cursor: text;
|
|
3274
|
+
user-select: text;
|
|
3275
|
+
-webkit-user-select: text;
|
|
3276
|
+
padding-right: ${$l};
|
|
3265
3277
|
}
|
|
3266
3278
|
|
|
3267
3279
|
.indicator {
|
|
@@ -3273,6 +3285,10 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3273
3285
|
align-items: center;
|
|
3274
3286
|
}
|
|
3275
3287
|
|
|
3288
|
+
:host([disabled][appearance-readonly]) .indicator {
|
|
3289
|
+
display: none;
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3276
3292
|
.indicator slot[name='indicator'] svg {
|
|
3277
3293
|
width: ${Tl};
|
|
3278
3294
|
height: ${Tl};
|
|
@@ -3374,10 +3390,6 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3374
3390
|
border-bottom-width: ${Ol};
|
|
3375
3391
|
padding-bottom: 0;
|
|
3376
3392
|
}
|
|
3377
|
-
|
|
3378
|
-
:host([disabled]) .control {
|
|
3379
|
-
border-color: rgba(${cl}, 0.1);
|
|
3380
|
-
}
|
|
3381
3393
|
`),ph(tv,Mt`
|
|
3382
3394
|
.control {
|
|
3383
3395
|
border-width: ${Ol};
|
|
@@ -3426,12 +3438,6 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3426
3438
|
);
|
|
3427
3439
|
}
|
|
3428
3440
|
|
|
3429
|
-
:host([disabled]) *,
|
|
3430
|
-
:host([disabled]) {
|
|
3431
|
-
${Em}
|
|
3432
|
-
color: ${Gc};
|
|
3433
|
-
}
|
|
3434
|
-
|
|
3435
3441
|
.control {
|
|
3436
3442
|
bottom-border-width: var(--ni-private-bottom-border-width);
|
|
3437
3443
|
}
|
|
@@ -3458,6 +3464,18 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3458
3464
|
outline: none;
|
|
3459
3465
|
}
|
|
3460
3466
|
|
|
3467
|
+
.selected-value::placeholder {
|
|
3468
|
+
color: ${Pc};
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
:host([disabled]) .selected-value::placeholder {
|
|
3472
|
+
color: ${Gc};
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
:host([disabled][appearance-readonly]) .selected-value::placeholder {
|
|
3476
|
+
color: ${Pc};
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3461
3479
|
[part='indicator'] {
|
|
3462
3480
|
display: none;
|
|
3463
3481
|
}
|
|
@@ -3468,6 +3486,10 @@ const Xg="nimble-icon-arrow-expander-down",Jg="above",Qg="underline",tv="outline
|
|
|
3468
3486
|
padding-right: ${$l};
|
|
3469
3487
|
}
|
|
3470
3488
|
|
|
3489
|
+
:host([disabled][appearance-readonly]) .end-slot-container {
|
|
3490
|
+
display: none;
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3471
3493
|
.separator {
|
|
3472
3494
|
display: inline;
|
|
3473
3495
|
width: 2px;
|
|
@@ -3506,7 +3528,7 @@ function av(t){return Q`
|
|
|
3506
3528
|
</label>
|
|
3507
3529
|
`)
|
|
3508
3530
|
let cv=class extends Vi{}
|
|
3509
|
-
class dv extends(Fn(cv)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}function hv(t){class e extends t{constructor(){super(...arguments),this.requiredVisible=!1}}return ft({attribute:"required-visible",mode:"boolean"})(e.prototype,"requiredVisible"),e}class uv extends(Ug(hv(dv))){constructor(){super(...arguments),this.appearance=Qg,this.open=!1,this.filteredOptions=[],this.hasOverflow=!1,this.listboxId=kn("listbox-"),this.availableViewportHeight=0,this.valueUpdatedByInput=!1,this._value="",this.filter="",this.forcedPosition=!1}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
|
|
3531
|
+
class dv extends(Fn(cv)){constructor(){super(...arguments),this.proxy=document.createElement("input")}}function hv(t){class e extends t{constructor(){super(...arguments),this.requiredVisible=!1}}return ft({attribute:"required-visible",mode:"boolean"})(e.prototype,"requiredVisible"),e}class uv extends(Ug(hv(dv))){constructor(){super(...arguments),this.appearance=Qg,this.appearanceReadOnly=!1,this.open=!1,this.filteredOptions=[],this.hasOverflow=!1,this.listboxId=kn("listbox-"),this.availableViewportHeight=0,this.valueUpdatedByInput=!1,this._value="",this.filter="",this.forcedPosition=!1}get value(){return x.track(this,"value"),this._value}set value(t){const e=this._value
|
|
3510
3532
|
let n=t
|
|
3511
3533
|
if(this.$fastController.isConnected&&this.options){const e=this.findIndexOfValidOption(t),i=this.options[this.selectedIndex]?.text,s=this.options[e]?.text
|
|
3512
3534
|
i!==s&&(this.selectedIndex=e),n=this.firstSelectedOption?.text||n}e!==n&&(this._value=n,super.valueChanged(e,n),x.notify(this,"value")),this.filter=t,this.filterOptions(),this.selectedIndex=this.findIndexOfValidOption(this.value)}get options(){return x.track(this,"options"),this.filteredOptions&&this.filter?this.filteredOptions:this._options}set options(t){this._options=t,x.notify(this,"options")}get isAutocompleteInline(){return this.autocomplete===ti||this.isAutocompleteBoth}get isAutocompleteList(){return this.autocomplete===ei||this.isAutocompleteBoth}get isAutocompleteBoth(){return this.autocomplete===ni}slottedOptionsChanged(t,e){const n=this.value
|
|
@@ -3542,7 +3564,7 @@ const t=this.getBoundingClientRect(),e=window.innerHeight-t.bottom
|
|
|
3542
3564
|
this.forcedPosition?this.position=this.positionAttribute:t.top>e?this.position=Yn:this.position=Xn,this.positionAttribute=this.forcedPosition?this.positionAttribute:this.position,this.availableViewportHeight=this.position===Yn?Math.trunc(t.top):Math.trunc(e)}focusAndScrollOptionIntoView(){this.open&&this.contains(document.activeElement)&&(this.control.focus(),this.firstSelectedOption&&requestAnimationFrame((()=>{this.firstSelectedOption?.scrollIntoView({block:"nearest"})})))}openChanged(){this.open?(this.ariaControls=this.listboxId,this.ariaExpanded="true",this.setPositioning(),this.focusAndScrollOptionIntoView(),b.queueUpdate((()=>this.focus()))):(this.ariaControls="",this.ariaExpanded="false"),this.dropdownButton&&(this.dropdownButton.checked=this.open)}placeholderChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.placeholder=this.placeholder??"")}setSelectedOptions(){this.selectedOptions=this.selectedIndex>-1?[this.options[this.selectedIndex]]:[],this.ariaActiveDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView()}selectedOptionsChanged(t,e){this.$fastController.isConnected&&this._options.forEach((t=>{t.selected=e.includes(t)}))}positionChanged(t,e){this.positionAttribute=e,this.setPositioning()}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()}updateValue(t){this.$fastController.isConnected&&(this.value=this.firstSelectedOption?.text||this.control.value,this.control.value=this.value),t&&this.$emit("change")}setInputToSelection(){this.firstSelectedOption&&(this.control.value=this.firstSelectedOption.text,this.control.focus())}setInlineSelection(){this.firstSelectedOption&&(this.setInputToSelection(),this.control.setSelectionRange(this.filter.length,this.control.value.length,"backward"))}clearSelectionRange(){const t=this.control.value.length
|
|
3543
3565
|
this.control.setSelectionRange(t,t)}syncValue(){const t=this.selectedIndex>-1?this.firstSelectedOption?.text:this.control.value
|
|
3544
3566
|
this.updateValue(this.value!==t)}updateInputAriaLabel(){const t=this.shadowRoot?.querySelector(".selected-value")
|
|
3545
|
-
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)}findIndexOfValidOption(t){return this.options.findIndex((e=>!e.disabled&&e.text===t))}}t([ft],uv.prototype,"appearance",void 0),t([ft({attribute:"autocomplete",mode:"fromView"})],uv.prototype,"autocomplete",void 0),t([ft({attribute:"position"})],uv.prototype,"positionAttribute",void 0),t([ft({attribute:"open",mode:"boolean"})],uv.prototype,"open",void 0),t([ft],uv.prototype,"placeholder",void 0),t([C],uv.prototype,"position",void 0),t([C],uv.prototype,"region",void 0),t([C],uv.prototype,"controlWrapper",void 0),t([C],uv.prototype,"control",void 0),t([C],uv.prototype,"listbox",void 0),t([C],uv.prototype,"dropdownButton",void 0),t([C],uv.prototype,"filteredOptions",void 0),t([C],uv.prototype,"hasOverflow",void 0),t([C],uv.prototype,"availableViewportHeight",void 0)
|
|
3567
|
+
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)}findIndexOfValidOption(t){return this.options.findIndex((e=>!e.disabled&&e.text===t))}}t([ft],uv.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],uv.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"autocomplete",mode:"fromView"})],uv.prototype,"autocomplete",void 0),t([ft({attribute:"position"})],uv.prototype,"positionAttribute",void 0),t([ft({attribute:"open",mode:"boolean"})],uv.prototype,"open",void 0),t([ft],uv.prototype,"placeholder",void 0),t([C],uv.prototype,"position",void 0),t([C],uv.prototype,"region",void 0),t([C],uv.prototype,"controlWrapper",void 0),t([C],uv.prototype,"control",void 0),t([C],uv.prototype,"listbox",void 0),t([C],uv.prototype,"dropdownButton",void 0),t([C],uv.prototype,"filteredOptions",void 0),t([C],uv.prototype,"hasOverflow",void 0),t([C],uv.prototype,"availableViewportHeight",void 0)
|
|
3546
3568
|
const pv=uv.compose({baseName:"combobox",baseClass:dv,template:(t,e)=>Q`
|
|
3547
3569
|
<template
|
|
3548
3570
|
aria-disabled="${t=>t.ariaDisabled}"
|
|
@@ -9328,6 +9350,10 @@ const KT=Mt`
|
|
|
9328
9350
|
color: ${Gc};
|
|
9329
9351
|
}
|
|
9330
9352
|
|
|
9353
|
+
:host([disabled][appearance-readonly]) .selected-value.placeholder {
|
|
9354
|
+
color: ${Pc};
|
|
9355
|
+
}
|
|
9356
|
+
|
|
9331
9357
|
.selected-value {
|
|
9332
9358
|
order: 1;
|
|
9333
9359
|
}
|
|
@@ -9652,7 +9678,7 @@ const eR="nimble-spinner",nR=t=>t instanceof Sb,iR=t=>t instanceof Db,sR=av(Q`
|
|
|
9652
9678
|
`)
|
|
9653
9679
|
let oR=class extends Vi{}
|
|
9654
9680
|
class rR extends(Fn(oR)){constructor(){super(...arguments),this.proxy=document.createElement("select")}}const aR=t=>!t.visuallyHidden&&!t.disabled&&!t.hidden,lR=t=>!t.visuallyHidden&&!t.hidden
|
|
9655
|
-
class cR extends(Ug(hv(rR))){constructor(){super(...arguments),this.appearance=Qg,this.filterMode=sv.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=kn("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?kb(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
|
|
9681
|
+
class cR extends(Ug(hv(rR))){constructor(){super(...arguments),this.appearance=Qg,this.appearanceReadOnly=!1,this.filterMode=sv.none,this.clearable=!1,this.loadingVisible=!1,this.displayPlaceholder=!1,this.open=!1,this.listboxId=kn("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?kb(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
|
|
9656
9682
|
let n=t
|
|
9657
9683
|
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
|
|
9658
9684
|
this.options.forEach((t=>{const e=x.getNotifier(t)
|
|
@@ -9750,7 +9776,7 @@ this.selectedIndex=t?this.options.indexOf(t):-1}setProxyOptions(){this.proxy ins
|
|
|
9750
9776
|
e&&this.proxy.options.add(e)})))}filterChanged(){this.filterOptions()}emitFilterInputEvent(){const t={filterText:this.filter}
|
|
9751
9777
|
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
|
|
9752
9778
|
const t=this.firstSelectedOption
|
|
9753
|
-
t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],cR.prototype,"appearance",void 0),t([ft({attribute:"position"})],cR.prototype,"positionAttribute",void 0),t([ft({attribute:"filter-mode"})],cR.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],cR.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],cR.prototype,"loadingVisible",void 0),t([C],cR.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],cR.prototype,"open",void 0),t([C],cR.prototype,"position",void 0),t([C],cR.prototype,"control",void 0),t([C],cR.prototype,"scrollableRegion",void 0),t([C],cR.prototype,"filterInput",void 0),t([C],cR.prototype,"anchoredRegion",void 0),t([C],cR.prototype,"hasOverflow",void 0),t([C],cR.prototype,"filteredOptions",void 0),t([C],cR.prototype,"filter",void 0),t([C],cR.prototype,"availableViewportHeight",void 0),t([k],cR.prototype,"collapsible",null),t([k],cR.prototype,"labelContent",null),t([k],cR.prototype,"displayValue",null)
|
|
9779
|
+
t&&this.selectedOptionObserver?.observe(t,{characterData:!0,subtree:!0,childList:!0})}}t([ft],cR.prototype,"appearance",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],cR.prototype,"appearanceReadOnly",void 0),t([ft({attribute:"position"})],cR.prototype,"positionAttribute",void 0),t([ft({attribute:"filter-mode"})],cR.prototype,"filterMode",void 0),t([ft({attribute:"clearable",mode:"boolean"})],cR.prototype,"clearable",void 0),t([ft({attribute:"loading-visible",mode:"boolean"})],cR.prototype,"loadingVisible",void 0),t([C],cR.prototype,"displayPlaceholder",void 0),t([ft({attribute:"open",mode:"boolean"})],cR.prototype,"open",void 0),t([C],cR.prototype,"position",void 0),t([C],cR.prototype,"control",void 0),t([C],cR.prototype,"scrollableRegion",void 0),t([C],cR.prototype,"filterInput",void 0),t([C],cR.prototype,"anchoredRegion",void 0),t([C],cR.prototype,"hasOverflow",void 0),t([C],cR.prototype,"filteredOptions",void 0),t([C],cR.prototype,"filter",void 0),t([C],cR.prototype,"availableViewportHeight",void 0),t([k],cR.prototype,"collapsible",null),t([k],cR.prototype,"labelContent",null),t([k],cR.prototype,"displayValue",null)
|
|
9754
9780
|
const dR=cR.compose({baseName:"select",baseClass:ls,template:(t,e)=>Q`
|
|
9755
9781
|
<template
|
|
9756
9782
|
class="${t=>[t.collapsible&&"collapsible",t.collapsible&&t.open&&"open",t.disabled&&"disabled",t.collapsible&&t.position].filter(Boolean).join(" ")}"
|