@ni/nimble-components 33.12.1 → 34.0.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 +43 -1
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +3 -2
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/number-field/index.d.ts +10 -0
- package/dist/esm/number-field/index.js +43 -0
- package/dist/esm/number-field/index.js.map +1 -1
- package/dist/esm/number-field/template.js +1 -1
- package/dist/esm/number-field/template.js.map +1 -1
- package/dist/esm/number-field/testing/number-field.pageobject.d.ts +23 -0
- package/dist/esm/number-field/testing/number-field.pageobject.js +38 -0
- package/dist/esm/number-field/testing/number-field.pageobject.js.map +1 -0
- package/package.json +2 -2
|
@@ -4942,7 +4942,8 @@ const fy="underline",my="outline",gy="block",vy="frameless",by=Mt`
|
|
|
4942
4942
|
>
|
|
4943
4943
|
<slot ${ie("defaultSlottedNodes")}></slot>
|
|
4944
4944
|
</label>`)
|
|
4945
|
-
class wy extends(nv(_v(ts))){constructor(){super(...arguments),this.appearance=fy,this.fullBleed=!1,this.appearanceReadOnly=!1}connectedCallback(){super.connectedCallback(),this.control.setAttribute("role","spinbutton")}}t(
|
|
4945
|
+
class wy extends(nv(_v(ts))){constructor(){super(...arguments),this.appearance=fy,this.fullBleed=!1,this.appearanceReadOnly=!1,this.decimalSeparator=".",this.inputFilterRegExp=this.buildFilterRegExp(this.decimalSeparator),this.langSubscriber={handleChange:()=>this.updateDecimalSeparatorAndInputFilter()}}connectedCallback(){super.connectedCallback(),this.control.setAttribute("role","spinbutton"),this.updateDecimalSeparatorAndInputFilter(),Qa.subscribe(this.langSubscriber,this)}disconnectedCallback(){super.disconnectedCallback(),Qa.unsubscribe(this.langSubscriber,this)}sanitizeInput(t){return t.replace(this.inputFilterRegExp,"")}syncValueFromInnerControl(){this.value="."!==this.decimalSeparator?this.control.value.replace(this.decimalSeparator,"."):this.control.value}syncValueToInnerControl(){this.control.value="."!==this.decimalSeparator?this.value.replace(".",this.decimalSeparator):this.value}updateDecimalSeparatorAndInputFilter(){const t=this.decimalSeparator
|
|
4946
|
+
this.decimalSeparator=this.getSeparatorForLanguange(Qa.getValueFor(this)),this.decimalSeparator!==t&&(this.inputFilterRegExp=this.buildFilterRegExp(this.decimalSeparator),this.control.value=this.control.value.replace(t,this.decimalSeparator))}getSeparatorForLanguange(t){return Intl.NumberFormat(t).formatToParts(1.1).find((t=>"decimal"===t.type)).value}buildFilterRegExp(t){return new RegExp(`[^0-9\\-+e${t}]`,"g")}}t([ft],wy.prototype,"appearance",void 0),t([ft({attribute:"full-bleed",mode:"boolean"})],wy.prototype,"fullBleed",void 0),t([ft({attribute:"appearance-readonly",mode:"boolean"})],wy.prototype,"appearanceReadOnly",void 0)
|
|
4946
4947
|
const xy=wy.compose({baseName:"number-field",baseClass:ts,template:(t,e)=>Q`
|
|
4947
4948
|
<template class="${t=>t.readOnly?"readonly":""}">
|
|
4948
4949
|
${yy}
|
|
@@ -4966,7 +4967,7 @@ const xy=wy.compose({baseName:"number-field",baseClass:ts,template:(t,e)=>Q`
|
|
|
4966
4967
|
?required="${t=>t.required}"
|
|
4967
4968
|
size="${t=>t.size}"
|
|
4968
4969
|
type="text"
|
|
4969
|
-
inputmode="
|
|
4970
|
+
inputmode="text"
|
|
4970
4971
|
min="${t=>t.min}"
|
|
4971
4972
|
max="${t=>t.max}"
|
|
4972
4973
|
step="${t=>t.step}"
|