@ni/nimble-components 20.8.0 → 20.10.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 +66 -9
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +2427 -2423
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/icons/all-icons.d.ts +1 -0
- package/dist/esm/icons/all-icons.js +1 -0
- package/dist/esm/icons/all-icons.js.map +1 -1
- package/dist/esm/icons/floppy-disk-pen.d.ts +13 -0
- package/dist/esm/icons/floppy-disk-pen.js +16 -0
- package/dist/esm/icons/floppy-disk-pen.js.map +1 -0
- 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 +2 -2
|
@@ -16288,7 +16288,7 @@
|
|
|
16288
16288
|
|
|
16289
16289
|
/**
|
|
16290
16290
|
* Do not edit directly
|
|
16291
|
-
* Generated on
|
|
16291
|
+
* Generated on Mon, 23 Oct 2023 13:57:47 GMT
|
|
16292
16292
|
*/
|
|
16293
16293
|
|
|
16294
16294
|
const Information100DarkUi = "#a46eff";
|
|
@@ -19145,6 +19145,10 @@
|
|
|
19145
19145
|
name: 'floppy_disk_checkmark_16_x_16',
|
|
19146
19146
|
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M12.455 5h-1.041l-1.005 1H12v3H4V6h3.782L6.79 5H3.583A.585.585 0 0 0 3 5.598V12.5l1.5 1.497 7.858.003a.602.602 0 0 0 .6-.6L13 5.545A.513.513 0 0 0 12.455 5ZM11 13H8v-2H6v2H5v-3h6Zm2-10.99L9.091 5.9 7 3.79l.919-.89 1.164 1.208L12.128 1.1l.872.91"/></svg>`
|
|
19147
19147
|
};
|
|
19148
|
+
const floppyDiskPen16X16 = {
|
|
19149
|
+
name: 'floppy_disk_pen_16_x_16',
|
|
19150
|
+
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-2" d="M7.17 11.108 7.299 11H7V9H5v2H4V8h6v.696l1.626-1.386c.107-.09.228-.155.355-.206L12 3.546c0-.33-.215-.546-.545-.546H2.583A.585.585 0 0 0 2 3.598V10.5l1.5 1.497 3.136.001.535-.89ZM3 7V4h8v3H3Z"/><path class="cls-1" d="M12.275 8.07c.218-.185.693-.008 1.205.552.512.56.635 1.038.418 1.223l-.92.784-1.621-1.775.918-.783Zm-4.92 6.113 1.98-.899-.985.164.043-.94-.32.161.104-.652-1.17 1.786.348.38Zm2.212-.645L6 15l1.945-3.236 2.1-1.791 1.622 1.774-2.1 1.79Zm2.862-2.49-1.622-1.774c-.118-.13.148-.349.262-.224l1.623 1.775c.117.128-.15.348-.263.224Zm-.522.452-1.622-1.775c-.118-.129.148-.349.262-.223l1.623 1.774c.117.128-.15.348-.263.224Z"/></svg>`
|
|
19151
|
+
};
|
|
19148
19152
|
const floppyDiskStarArrowRight16X16 = {
|
|
19149
19153
|
name: 'floppy_disk_star_arrow_right_16_x_16',
|
|
19150
19154
|
data: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path class="cls-1" d="M5.5 2.5a1 1 0 1 0-1 1 1 1 0 0 0 1-1Zm7.5.002L9.638.819l.496 1.293H7v.828h3.134L9.638 4.18ZM12.455 5H3.583A.585.585 0 0 0 3 5.598V12.5l1.5 1.497 7.858.003a.602.602 0 0 0 .6-.6L13 5.545A.513.513 0 0 0 12.455 5ZM11 13H8v-2H6v2H5v-3h6Zm1-4H4V6h8Z"/></svg>`
|
|
@@ -22571,6 +22575,19 @@
|
|
|
22571
22575
|
registerIcon('icon-floppy-disk-checkmark', IconFloppyDiskCheckmark);
|
|
22572
22576
|
DesignSystem.tagFor(IconFloppyDiskCheckmark);
|
|
22573
22577
|
|
|
22578
|
+
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
22579
|
+
// See generation source in nimble-components/build/generate-icons
|
|
22580
|
+
/**
|
|
22581
|
+
* The icon component for the 'floppyDiskPen' icon
|
|
22582
|
+
*/
|
|
22583
|
+
class IconFloppyDiskPen extends Icon {
|
|
22584
|
+
constructor() {
|
|
22585
|
+
super(floppyDiskPen16X16);
|
|
22586
|
+
}
|
|
22587
|
+
}
|
|
22588
|
+
registerIcon('icon-floppy-disk-pen', IconFloppyDiskPen);
|
|
22589
|
+
DesignSystem.tagFor(IconFloppyDiskPen);
|
|
22590
|
+
|
|
22574
22591
|
// AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
|
|
22575
22592
|
// See generation source in nimble-components/build/generate-icons
|
|
22576
22593
|
/**
|
|
@@ -68630,14 +68647,14 @@ img.ProseMirror-separator {
|
|
|
68630
68647
|
* The formatter for a number-text column whose format is configured to be 'decimal'.
|
|
68631
68648
|
*/
|
|
68632
68649
|
class DecimalFormatter extends NumberFormatter {
|
|
68633
|
-
constructor(locale,
|
|
68650
|
+
constructor(locale, minimumFractionDigits, maximumFractionDigits) {
|
|
68634
68651
|
super();
|
|
68635
68652
|
this.formatter = new Intl.NumberFormat(locale, {
|
|
68636
|
-
maximumFractionDigits
|
|
68637
|
-
minimumFractionDigits
|
|
68653
|
+
maximumFractionDigits,
|
|
68654
|
+
minimumFractionDigits,
|
|
68638
68655
|
useGrouping: true
|
|
68639
68656
|
});
|
|
68640
|
-
this.tenPowDecimalDigits = 10 **
|
|
68657
|
+
this.tenPowDecimalDigits = 10 ** maximumFractionDigits;
|
|
68641
68658
|
}
|
|
68642
68659
|
format(number) {
|
|
68643
68660
|
// The NumberFormat option of `signDisplay: "negative"` is not supported in all browsers nimble supports.
|
|
@@ -68652,7 +68669,11 @@ img.ProseMirror-separator {
|
|
|
68652
68669
|
}
|
|
68653
68670
|
}
|
|
68654
68671
|
|
|
68655
|
-
const numberTextValidityFlagNames = [
|
|
68672
|
+
const numberTextValidityFlagNames = [
|
|
68673
|
+
'invalidDecimalDigits',
|
|
68674
|
+
'invalidDecimalMaximumDigits',
|
|
68675
|
+
'decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits'
|
|
68676
|
+
];
|
|
68656
68677
|
// The maximum and minimum allowed configuration for 'maximumFractionDigits'
|
|
68657
68678
|
// and 'minimumFractionDigits' on the NumberFormat.
|
|
68658
68679
|
const minimumValidDecimalDigits = 0;
|
|
@@ -68672,6 +68693,22 @@ img.ProseMirror-separator {
|
|
|
68672
68693
|
: false;
|
|
68673
68694
|
this.setConditionValue('invalidDecimalDigits', invalid);
|
|
68674
68695
|
}
|
|
68696
|
+
validateDecimalMaximumDigits(format, decimalMaximumDigits) {
|
|
68697
|
+
const shouldValidateDecimalDigitsValue = format === NumberTextFormat.decimal
|
|
68698
|
+
&& typeof decimalMaximumDigits === 'number';
|
|
68699
|
+
const invalid = shouldValidateDecimalDigitsValue
|
|
68700
|
+
? this.isInvalidDecimalDigitsValue(decimalMaximumDigits)
|
|
68701
|
+
: false;
|
|
68702
|
+
this.setConditionValue('invalidDecimalMaximumDigits', invalid);
|
|
68703
|
+
}
|
|
68704
|
+
validateNoMutuallyExclusiveProperties(format, decimalDigits, decimalMaximumDigits) {
|
|
68705
|
+
const shouldValidateMutuallyExclusiveProperties = format === NumberTextFormat.decimal;
|
|
68706
|
+
const invalid = shouldValidateMutuallyExclusiveProperties
|
|
68707
|
+
? typeof decimalDigits === 'number'
|
|
68708
|
+
&& typeof decimalMaximumDigits === 'number'
|
|
68709
|
+
: false;
|
|
68710
|
+
this.setConditionValue('decimalDigitsMutuallyExclusiveWithDecimalMaximumDigits', invalid);
|
|
68711
|
+
}
|
|
68675
68712
|
isInvalidDecimalDigitsValue(decimalDigits) {
|
|
68676
68713
|
return (decimalDigits < minimumValidDecimalDigits
|
|
68677
68714
|
|| decimalDigits > maximumValidDecimalDigits);
|
|
@@ -68723,8 +68760,13 @@ img.ProseMirror-separator {
|
|
|
68723
68760
|
decimalDigitsChanged() {
|
|
68724
68761
|
this.updateColumnConfig();
|
|
68725
68762
|
}
|
|
68763
|
+
decimalMaximumDigitsChanged() {
|
|
68764
|
+
this.updateColumnConfig();
|
|
68765
|
+
}
|
|
68726
68766
|
updateColumnConfig() {
|
|
68727
68767
|
this.validator.validateDecimalDigits(this.format, this.decimalDigits);
|
|
68768
|
+
this.validator.validateDecimalMaximumDigits(this.format, this.decimalMaximumDigits);
|
|
68769
|
+
this.validator.validateNoMutuallyExclusiveProperties(this.format, this.decimalDigits, this.decimalMaximumDigits);
|
|
68728
68770
|
if (this.validator.isValid()) {
|
|
68729
68771
|
const columnConfig = {
|
|
68730
68772
|
formatter: this.createFormatter(),
|
|
@@ -68737,9 +68779,17 @@ img.ProseMirror-separator {
|
|
|
68737
68779
|
}
|
|
68738
68780
|
}
|
|
68739
68781
|
createFormatter() {
|
|
68782
|
+
let minimumDigits;
|
|
68783
|
+
let maximumDigits;
|
|
68740
68784
|
switch (this.format) {
|
|
68741
68785
|
case NumberTextFormat.decimal:
|
|
68742
|
-
|
|
68786
|
+
minimumDigits = typeof this.decimalMaximumDigits === 'number'
|
|
68787
|
+
? 0
|
|
68788
|
+
: this.decimalDigits ?? defaultDecimalDigits;
|
|
68789
|
+
maximumDigits = this.decimalMaximumDigits
|
|
68790
|
+
?? this.decimalDigits
|
|
68791
|
+
?? defaultDecimalDigits;
|
|
68792
|
+
return new DecimalFormatter(lang$1.getValueFor(this), minimumDigits, maximumDigits);
|
|
68743
68793
|
default:
|
|
68744
68794
|
return new DefaultFormatter(lang$1.getValueFor(this));
|
|
68745
68795
|
}
|
|
@@ -68751,8 +68801,9 @@ img.ProseMirror-separator {
|
|
|
68751
68801
|
if (this.alignment === NumberTextAlignment.right) {
|
|
68752
68802
|
return TextCellViewBaseAlignment.right;
|
|
68753
68803
|
}
|
|
68754
|
-
// Look at format to determine the default alignment
|
|
68755
|
-
if (this.format === NumberTextFormat.decimal
|
|
68804
|
+
// Look at format and decimal max digits to determine the default alignment
|
|
68805
|
+
if (this.format === NumberTextFormat.decimal
|
|
68806
|
+
&& typeof this.decimalMaximumDigits !== 'number') {
|
|
68756
68807
|
return TextCellViewBaseAlignment.right;
|
|
68757
68808
|
}
|
|
68758
68809
|
return TextCellViewBaseAlignment.left;
|
|
@@ -68767,6 +68818,12 @@ img.ProseMirror-separator {
|
|
|
68767
68818
|
__decorate$1([
|
|
68768
68819
|
attr({ attribute: 'decimal-digits', converter: nullableNumberConverter })
|
|
68769
68820
|
], TableColumnNumberText.prototype, "decimalDigits", void 0);
|
|
68821
|
+
__decorate$1([
|
|
68822
|
+
attr({
|
|
68823
|
+
attribute: 'decimal-maximum-digits',
|
|
68824
|
+
converter: nullableNumberConverter
|
|
68825
|
+
})
|
|
68826
|
+
], TableColumnNumberText.prototype, "decimalMaximumDigits", void 0);
|
|
68770
68827
|
const nimbleTableColumnNumberText = TableColumnNumberText.compose({
|
|
68771
68828
|
baseName: 'table-column-number-text',
|
|
68772
68829
|
template: template$b,
|