@ni/nimble-components 20.8.0 → 20.9.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 +49 -9
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +7 -4
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +2 -0
- package/dist/esm/table-column/number-text/index.js +23 -3
- package/dist/esm/table-column/number-text/index.js.map +1 -1
- package/dist/esm/table-column/number-text/models/decimal-formatter.d.ts +1 -1
- package/dist/esm/table-column/number-text/models/decimal-formatter.js +4 -4
- package/dist/esm/table-column/number-text/models/decimal-formatter.js.map +1 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.d.ts +3 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js +21 -1
- package/dist/esm/table-column/number-text/models/table-column-number-text-validator.js.map +1 -1
- package/package.json +1 -1
|
@@ -10149,11 +10149,14 @@ try{return this.format(e)}catch{return""}}}class VL extends PL{constructor(e){su
|
|
|
10149
10149
|
return this.getFormatterForNumber(t).format(t)}getFormatterForNumber(e){if(0===e)return this.defaultFormatter
|
|
10150
10150
|
const t=Math.abs(e)
|
|
10151
10151
|
return t>=VL.exponentialUpperBound||t<VL.exponentialLowerBound?this.exponentialFormatter:t<1?this.leadingZeroFormatter:this.defaultFormatter}}VL.maximumDigits=6,VL.exponentialLowerBound=995e-6,VL.exponentialUpperBound=999999.5
|
|
10152
|
-
class zL extends PL{constructor(e,t){super(),this.formatter=new Intl.NumberFormat(e,{maximumFractionDigits:
|
|
10153
|
-
return this.formatter.format(t)}willRoundToZero(e){return 0===Math.round(e*this.tenPowDecimalDigits)}}const HL=["invalidDecimalDigits"]
|
|
10152
|
+
class zL extends PL{constructor(e,t,n){super(),this.formatter=new Intl.NumberFormat(e,{maximumFractionDigits:n,minimumFractionDigits:t,useGrouping:!0}),this.tenPowDecimalDigits=10**n}format(e){const t=this.willRoundToZero(e)?0:e
|
|
10153
|
+
return this.formatter.format(t)}willRoundToZero(e){return 0===Math.round(e*this.tenPowDecimalDigits)}}const HL=["invalidDecimalDigits","invalidDecimalMaximumDigits","decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits"]
|
|
10154
10154
|
class BL extends rL{constructor(e){super(e,HL)}validateDecimalDigits(e,t){const n=!!(e===FL&&"number"==typeof t)&&this.isInvalidDecimalDigitsValue(t)
|
|
10155
|
-
this.setConditionValue("invalidDecimalDigits",n)}
|
|
10156
|
-
this.
|
|
10155
|
+
this.setConditionValue("invalidDecimalDigits",n)}validateDecimalMaximumDigits(e,t){const n=!!(e===FL&&"number"==typeof t)&&this.isInvalidDecimalDigitsValue(t)
|
|
10156
|
+
this.setConditionValue("invalidDecimalMaximumDigits",n)}validateNoMutuallyExclusiveProperties(e,t,n){const i=!!(e===FL)&&("number"==typeof t&&"number"==typeof n)
|
|
10157
|
+
this.setConditionValue("decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits",i)}isInvalidDecimalDigitsValue(e){return e<0||e>20}}class qL extends ZN{constructor(){super(...arguments),this.validator=new BL(this.columnInternals),this.langSubscriber={handleChange:()=>{this.updateColumnConfig()}}}connectedCallback(){super.connectedCallback(),sa.subscribe(this.langSubscriber,this),this.updateColumnConfig()}disconnectedCallback(){super.disconnectedCallback(),sa.unsubscribe(this.langSubscriber,this)}get validity(){return this.validator.getValidity()}getColumnInternalsOptions(){return{cellRecordFieldNames:["value"],cellViewTag:DL,groupHeaderViewTag:OL,delegatedEvents:[],sortOperation:wF}}formatChanged(){this.updateColumnConfig()}alignmentChanged(){this.updateColumnConfig()}decimalDigitsChanged(){this.updateColumnConfig()}decimalMaximumDigitsChanged(){this.updateColumnConfig()}updateColumnConfig(){if(this.validator.validateDecimalDigits(this.format,this.decimalDigits),this.validator.validateDecimalMaximumDigits(this.format,this.decimalMaximumDigits),this.validator.validateNoMutuallyExclusiveProperties(this.format,this.decimalDigits,this.decimalMaximumDigits),this.validator.isValid()){const e={formatter:this.createFormatter(),alignment:this.determineCellContentAlignment()}
|
|
10158
|
+
this.columnInternals.columnConfig=e}else this.columnInternals.columnConfig=void 0}createFormatter(){let e,t
|
|
10159
|
+
return this.format===FL?(e="number"==typeof this.decimalMaximumDigits?0:this.decimalDigits??2,t=this.decimalMaximumDigits??this.decimalDigits??2,new zL(sa.getValueFor(this),e,t)):new VL(sa.getValueFor(this))}determineCellContentAlignment(){return this.alignment===NL?KN:this.alignment===LL||this.format===FL&&"number"!=typeof this.decimalMaximumDigits?JN:KN}}e([se],qL.prototype,"format",void 0),e([se],qL.prototype,"alignment",void 0),e([se({attribute:"decimal-digits",converter:oe})],qL.prototype,"decimalDigits",void 0),e([se({attribute:"decimal-maximum-digits",converter:oe})],qL.prototype,"decimalMaximumDigits",void 0)
|
|
10157
10160
|
const ZL=qL.compose({baseName:"table-column-number-text",template:AN,styles:$N})
|
|
10158
10161
|
vi.getOrCreate().withPrefix("nimble").register(ZL()),vi.tagFor(qL)
|
|
10159
10162
|
const jL=[...gL,"invalidIconName"]
|