@ni/nimble-components 20.18.0 → 20.18.1
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 +90 -134
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +280 -279
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/esm/table-column/number-text/index.d.ts +1 -1
- package/dist/esm/unit/base/unit.d.ts +1 -1
- package/dist/esm/unit/byte/index.js +1 -1
- package/dist/esm/unit/byte/index.js.map +1 -1
- package/dist/esm/unit/volt/index.js +1 -1
- package/dist/esm/unit/volt/index.js.map +1 -1
- package/dist/esm/utilities/unit-format/decimal-unit-format.d.ts +2 -2
- package/dist/esm/utilities/unit-format/decimal-unit-format.js +1 -1
- package/dist/esm/utilities/unit-format/decimal-unit-format.js.map +1 -1
- package/dist/esm/utilities/unit-format/default-unit-format.d.ts +1 -1
- package/dist/esm/utilities/unit-format/default-unit-format.js +1 -1
- package/dist/esm/utilities/unit-format/default-unit-format.js.map +1 -1
- package/dist/esm/utilities/unit-format/{unit-scale/base → scaled-unit}/scaled-unit.d.ts +1 -1
- package/dist/esm/utilities/unit-format/scaled-unit/scaled-unit.js.map +1 -0
- package/dist/esm/utilities/unit-format/scaled-unit-format/intl-number-format-scaled-unit-format.d.ts +11 -0
- package/dist/esm/utilities/unit-format/{unit-scale/base → scaled-unit-format}/intl-number-format-scaled-unit-format.js +2 -2
- package/dist/esm/utilities/unit-format/scaled-unit-format/intl-number-format-scaled-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/scaled-unit-format/manually-translated-scaled-unit-format.d.ts +43 -0
- package/dist/esm/utilities/unit-format/{manually-translated-unit-scale/base → scaled-unit-format}/manually-translated-scaled-unit-format.js +27 -14
- package/dist/esm/utilities/unit-format/scaled-unit-format/manually-translated-scaled-unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/{unit-scale/base → scaled-unit-format}/scaled-unit-format.d.ts +1 -1
- package/dist/esm/utilities/unit-format/{unit-scale/base → scaled-unit-format}/scaled-unit-format.js.map +1 -1
- package/dist/esm/utilities/unit-format/{base/unit-format.d.ts → unit-format.d.ts} +1 -1
- package/dist/esm/utilities/unit-format/unit-format.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-1024-unit-scale.d.ts +9 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-1024-unit-scale.js +31 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-1024-unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale.d.ts +1 -1
- package/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale.js +16 -35
- package/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale.js.map +1 -1
- package/dist/esm/utilities/unit-format/unit-scale/passthrough-unit-scale.d.ts +1 -1
- package/dist/esm/utilities/unit-format/unit-scale/passthrough-unit-scale.js +4 -4
- package/dist/esm/utilities/unit-format/unit-scale/passthrough-unit-scale.js.map +1 -1
- package/dist/esm/utilities/unit-format/unit-scale/{base/unit-scale.d.ts → unit-scale.d.ts} +1 -1
- package/dist/esm/utilities/unit-format/unit-scale/unit-scale.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/utilities/metrix-prefixes.d.ts +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/utilities/metrix-prefixes.js +17 -0
- package/dist/esm/utilities/unit-format/unit-scale/utilities/metrix-prefixes.js.map +1 -0
- package/dist/esm/utilities/unit-format/unit-scale/volt-unit-scale.d.ts +9 -0
- package/dist/esm/utilities/unit-format/unit-scale/volt-unit-scale.js +24 -0
- package/dist/esm/utilities/unit-format/unit-scale/volt-unit-scale.js.map +1 -0
- package/package.json +1 -1
- package/dist/esm/utilities/unit-format/base/unit-format.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-scaled-unit-format.d.ts +0 -18
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-scaled-unit-format.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-unit-scale.d.ts +0 -10
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-unit-scale.js +0 -19
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/manually-translated-unit-scale.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefix.d.ts +0 -10
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefix.js +0 -17
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefix.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefixes-metric.d.ts +0 -5
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefixes-metric.js +0 -21
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-prefixes-metric.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-translation.d.ts +0 -9
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-translation.js +0 -11
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/base/unit-translation.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/byte-1024-unit-scale.d.ts +0 -9
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/byte-1024-unit-scale.js +0 -26
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/byte-1024-unit-scale.js.map +0 -1
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/volt-unit-scale.d.ts +0 -9
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/volt-unit-scale.js +0 -19
- package/dist/esm/utilities/unit-format/manually-translated-unit-scale/volt-unit-scale.js.map +0 -1
- package/dist/esm/utilities/unit-format/unit-scale/base/intl-number-format-scaled-unit-format.d.ts +0 -11
- package/dist/esm/utilities/unit-format/unit-scale/base/intl-number-format-scaled-unit-format.js.map +0 -1
- package/dist/esm/utilities/unit-format/unit-scale/base/scaled-unit.js.map +0 -1
- package/dist/esm/utilities/unit-format/unit-scale/base/unit-scale.js.map +0 -1
- /package/dist/esm/utilities/unit-format/{unit-scale/base → scaled-unit}/scaled-unit.js +0 -0
- /package/dist/esm/utilities/unit-format/{unit-scale/base → scaled-unit-format}/scaled-unit-format.js +0 -0
- /package/dist/esm/utilities/unit-format/{base/unit-format.js → unit-format.js} +0 -0
- /package/dist/esm/utilities/unit-format/unit-scale/{base/unit-scale.js → unit-scale.js} +0 -0
|
@@ -16301,7 +16301,7 @@
|
|
|
16301
16301
|
|
|
16302
16302
|
/**
|
|
16303
16303
|
* Do not edit directly
|
|
16304
|
-
* Generated on
|
|
16304
|
+
* Generated on Thu, 18 Jan 2024 17:06:46 GMT
|
|
16305
16305
|
*/
|
|
16306
16306
|
|
|
16307
16307
|
const Information100DarkUi = "#a46eff";
|
|
@@ -66460,7 +66460,7 @@ img.ProseMirror-separator {
|
|
|
66460
66460
|
* A formatter for units that can be formatted/translated by Intl.NumberFormat
|
|
66461
66461
|
*/
|
|
66462
66462
|
class IntlNumberFormatScaledUnitFormat extends ScaledUnitFormat {
|
|
66463
|
-
constructor(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions
|
|
66463
|
+
constructor(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions) {
|
|
66464
66464
|
super(scaledUnitFormatFactoryOptions);
|
|
66465
66465
|
this.formatter = new Intl.NumberFormat(this.locale, {
|
|
66466
66466
|
...unitSpecificIntlNumberFormatOptions,
|
|
@@ -66468,7 +66468,7 @@ img.ProseMirror-separator {
|
|
|
66468
66468
|
...this.intlNumberFormatOptions
|
|
66469
66469
|
});
|
|
66470
66470
|
}
|
|
66471
|
-
static createFactory(unitSpecificIntlNumberFormatOptions
|
|
66471
|
+
static createFactory(unitSpecificIntlNumberFormatOptions) {
|
|
66472
66472
|
return (scaledUnitFormatFactoryOptions) => new IntlNumberFormatScaledUnitFormat(scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions);
|
|
66473
66473
|
}
|
|
66474
66474
|
format(value) {
|
|
@@ -66544,7 +66544,7 @@ img.ProseMirror-separator {
|
|
|
66544
66544
|
class PassthroughUnitScale extends UnitScale {
|
|
66545
66545
|
constructor() {
|
|
66546
66546
|
super([
|
|
66547
|
-
new ScaledUnit(10 ** 0, IntlNumberFormatScaledUnitFormat.createFactory())
|
|
66547
|
+
new ScaledUnit(10 ** 0, IntlNumberFormatScaledUnitFormat.createFactory({}))
|
|
66548
66548
|
]);
|
|
66549
66549
|
}
|
|
66550
66550
|
}
|
|
@@ -68527,25 +68527,38 @@ img.ProseMirror-separator {
|
|
|
68527
68527
|
|
|
68528
68528
|
const template$1 = html `<template slot="unit"></template>`;
|
|
68529
68529
|
|
|
68530
|
+
/**
|
|
68531
|
+
* Representations of a unit in a particular language
|
|
68532
|
+
*/
|
|
68533
|
+
class UnitTranslation {
|
|
68534
|
+
constructor(singular, plural, symbol) {
|
|
68535
|
+
this.singular = singular;
|
|
68536
|
+
this.plural = plural;
|
|
68537
|
+
this.symbol = symbol;
|
|
68538
|
+
}
|
|
68539
|
+
}
|
|
68530
68540
|
/**
|
|
68531
68541
|
* A formatter for units that are not supported by Intl.NumberFormat
|
|
68532
68542
|
*/
|
|
68533
68543
|
class ManuallyTranslatedScaledUnitFormat extends ScaledUnitFormat {
|
|
68534
|
-
constructor(scaledUnitFormatFactoryOptions, unitTranslations,
|
|
68544
|
+
constructor(scaledUnitFormatFactoryOptions, { unitTranslations, scaledPrefixText }) {
|
|
68535
68545
|
super(scaledUnitFormatFactoryOptions);
|
|
68536
|
-
|
|
68537
|
-
|
|
68546
|
+
if (!unitTranslations.get('en')) {
|
|
68547
|
+
throw new Error('English translations must exist with locale string "en"');
|
|
68548
|
+
}
|
|
68538
68549
|
this.pluralRules = new Intl.PluralRules(this.locale);
|
|
68539
68550
|
this.formatter = new Intl.NumberFormat(this.locale, this.intlNumberFormatOptions);
|
|
68540
|
-
this.unitTranslation = this.getTranslationToUse(this.locale);
|
|
68551
|
+
this.unitTranslation = this.getTranslationToUse(unitTranslations, this.locale);
|
|
68552
|
+
this.scaledPrefixText = scaledPrefixText;
|
|
68541
68553
|
}
|
|
68542
|
-
static createFactory(
|
|
68543
|
-
return (scaledUnitFormatFactoryOptions) => new ManuallyTranslatedScaledUnitFormat(scaledUnitFormatFactoryOptions,
|
|
68554
|
+
static createFactory(manuallyTranslatedScaledUnitFormatOptions) {
|
|
68555
|
+
return (scaledUnitFormatFactoryOptions) => new ManuallyTranslatedScaledUnitFormat(scaledUnitFormatFactoryOptions, manuallyTranslatedScaledUnitFormatOptions);
|
|
68544
68556
|
}
|
|
68545
68557
|
format(value) {
|
|
68546
68558
|
const formatted = this.formatter.format(value);
|
|
68547
|
-
|
|
68548
|
-
|
|
68559
|
+
// For non-base units (which are a scaled prefix text of empty string)
|
|
68560
|
+
if (this.scaledPrefixText !== '') {
|
|
68561
|
+
return `${formatted} ${this.scaledPrefixText}${this.unitTranslation.symbol}`;
|
|
68549
68562
|
}
|
|
68550
68563
|
// Some languages have more than two forms (singular/plural) of cardinal
|
|
68551
68564
|
// numbers, but we are treating anything other than the 'one' form as plural.
|
|
@@ -68562,123 +68575,65 @@ img.ProseMirror-separator {
|
|
|
68562
68575
|
: this.unitTranslation.plural;
|
|
68563
68576
|
return `${formatted} ${unitLabel}`;
|
|
68564
68577
|
}
|
|
68565
|
-
getTranslationToUse(locale) {
|
|
68578
|
+
getTranslationToUse(unitTranslations, locale) {
|
|
68566
68579
|
const localeObject = new Intl.Locale(locale ?? 'en');
|
|
68567
68580
|
const language = localeObject.language;
|
|
68568
68581
|
const region = localeObject.region;
|
|
68569
68582
|
const regionSpecificMatchedTranslations = region
|
|
68570
|
-
?
|
|
68571
|
-
:
|
|
68583
|
+
? unitTranslations.get(`${language}-${region}`)
|
|
68584
|
+
: undefined;
|
|
68572
68585
|
return (regionSpecificMatchedTranslations
|
|
68573
|
-
??
|
|
68574
|
-
??
|
|
68575
|
-
}
|
|
68576
|
-
}
|
|
68577
|
-
|
|
68578
|
-
/**
|
|
68579
|
-
* A unit scale that is not supported by Intl.NumberFormat and has manually provided translation strings
|
|
68580
|
-
*/
|
|
68581
|
-
class ManuallyTranslatedUnitScale extends UnitScale {
|
|
68582
|
-
constructor(unitTranslations, supportedUnitPrefixes) {
|
|
68583
|
-
super(ManuallyTranslatedUnitScale.createSupportedScaledUnits(unitTranslations, supportedUnitPrefixes));
|
|
68584
|
-
}
|
|
68585
|
-
static createSupportedScaledUnits(unitTranslations, supportedUnitPrefixes) {
|
|
68586
|
-
if (!unitTranslations.get('en')) {
|
|
68587
|
-
throw new Error('English translations must exist');
|
|
68588
|
-
}
|
|
68589
|
-
const supportedUnits = supportedUnitPrefixes.map(unitPrefix => new ScaledUnit(unitPrefix.scaleFactor, ManuallyTranslatedScaledUnitFormat.createFactory(unitTranslations, unitPrefix)));
|
|
68590
|
-
return supportedUnits;
|
|
68591
|
-
}
|
|
68592
|
-
}
|
|
68593
|
-
|
|
68594
|
-
/**
|
|
68595
|
-
* A prefix that represents a scaling factor when applied to a base unit.
|
|
68596
|
-
* A base unit is represented as scale factor 1 and empty text.
|
|
68597
|
-
*/
|
|
68598
|
-
class UnitPrefix {
|
|
68599
|
-
constructor(scaleFactor, text) {
|
|
68600
|
-
this.scaleFactor = scaleFactor;
|
|
68601
|
-
this.text = text;
|
|
68602
|
-
if (scaleFactor === 1 && text !== '') {
|
|
68603
|
-
throw new Error('Base scale factor of 1 has unused text and should be empty string');
|
|
68604
|
-
}
|
|
68605
|
-
}
|
|
68606
|
-
isBase() {
|
|
68607
|
-
return this.scaleFactor === 1;
|
|
68608
|
-
}
|
|
68609
|
-
}
|
|
68610
|
-
|
|
68611
|
-
/**
|
|
68612
|
-
* Representations of a base unit in a particular language
|
|
68613
|
-
*/
|
|
68614
|
-
class UnitTranslation {
|
|
68615
|
-
constructor(singular, plural, symbol) {
|
|
68616
|
-
this.singular = singular;
|
|
68617
|
-
this.plural = plural;
|
|
68618
|
-
this.symbol = symbol;
|
|
68586
|
+
?? unitTranslations.get(language)
|
|
68587
|
+
?? unitTranslations.get('en'));
|
|
68619
68588
|
}
|
|
68620
68589
|
}
|
|
68621
68590
|
|
|
68591
|
+
const unitTranslations$1 = new Map([
|
|
68592
|
+
['en', new UnitTranslation('byte', 'bytes', 'B')],
|
|
68593
|
+
['fr', new UnitTranslation('octet', 'octets', 'o')],
|
|
68594
|
+
['de', new UnitTranslation('Byte', 'Byte', 'B')],
|
|
68595
|
+
['ja', new UnitTranslation('バイト', 'バイト', 'B')],
|
|
68596
|
+
['zh', new UnitTranslation('字节', '字节', 'B')]
|
|
68597
|
+
]);
|
|
68598
|
+
const byte1024Prefixes = [
|
|
68599
|
+
[1024 ** 0, ''],
|
|
68600
|
+
[1024 ** 1, 'Ki'],
|
|
68601
|
+
[1024 ** 2, 'Mi'],
|
|
68602
|
+
[1024 ** 3, 'Gi'],
|
|
68603
|
+
[1024 ** 4, 'Ti'],
|
|
68604
|
+
[1024 ** 5, 'Pi']
|
|
68605
|
+
];
|
|
68622
68606
|
/**
|
|
68623
68607
|
* Byte units (1024-based)
|
|
68624
68608
|
*/
|
|
68625
|
-
class Byte1024UnitScale extends
|
|
68609
|
+
class Byte1024UnitScale extends UnitScale {
|
|
68626
68610
|
constructor() {
|
|
68627
|
-
super(new
|
|
68628
|
-
|
|
68629
|
-
|
|
68630
|
-
|
|
68631
|
-
['ja', new UnitTranslation('バイト', 'バイト', 'B')],
|
|
68632
|
-
['zh', new UnitTranslation('字节', '字节', 'B')]
|
|
68633
|
-
]), [
|
|
68634
|
-
new UnitPrefix(1024 ** 0, ''),
|
|
68635
|
-
new UnitPrefix(1024 ** 1, 'Ki'),
|
|
68636
|
-
new UnitPrefix(1024 ** 2, 'Mi'),
|
|
68637
|
-
new UnitPrefix(1024 ** 3, 'Gi'),
|
|
68638
|
-
new UnitPrefix(1024 ** 4, 'Ti'),
|
|
68639
|
-
new UnitPrefix(1024 ** 5, 'Pi')
|
|
68640
|
-
]);
|
|
68611
|
+
super(byte1024Prefixes.map(([scaleFactor, scaledPrefixText]) => new ScaledUnit(scaleFactor, ManuallyTranslatedScaledUnitFormat.createFactory({
|
|
68612
|
+
unitTranslations: unitTranslations$1,
|
|
68613
|
+
scaledPrefixText
|
|
68614
|
+
}))));
|
|
68641
68615
|
}
|
|
68642
68616
|
}
|
|
68643
68617
|
const byte1024UnitScale = new Byte1024UnitScale();
|
|
68644
68618
|
|
|
68619
|
+
const byteUnitScaleOptions = [
|
|
68620
|
+
[1000 ** 0, 'byte', 'long'],
|
|
68621
|
+
[1000 ** 1, 'kilobyte', 'short'],
|
|
68622
|
+
[1000 ** 2, 'megabyte', 'short'],
|
|
68623
|
+
[1000 ** 3, 'gigabyte', 'short'],
|
|
68624
|
+
[1000 ** 4, 'terabyte', 'short'],
|
|
68625
|
+
[1000 ** 5, 'petabyte', 'short']
|
|
68626
|
+
];
|
|
68645
68627
|
/**
|
|
68646
68628
|
* Byte units (1000-based)
|
|
68647
68629
|
*/
|
|
68648
68630
|
class ByteUnitScale extends UnitScale {
|
|
68649
68631
|
constructor() {
|
|
68650
|
-
super([
|
|
68651
|
-
|
|
68652
|
-
|
|
68653
|
-
|
|
68654
|
-
|
|
68655
|
-
})),
|
|
68656
|
-
new ScaledUnit(10 ** 3, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68657
|
-
style: 'unit',
|
|
68658
|
-
unit: 'kilobyte',
|
|
68659
|
-
unitDisplay: 'short'
|
|
68660
|
-
})),
|
|
68661
|
-
new ScaledUnit(10 ** 6, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68662
|
-
style: 'unit',
|
|
68663
|
-
unit: 'megabyte',
|
|
68664
|
-
unitDisplay: 'short'
|
|
68665
|
-
})),
|
|
68666
|
-
new ScaledUnit(10 ** 9, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68667
|
-
style: 'unit',
|
|
68668
|
-
unit: 'gigabyte',
|
|
68669
|
-
unitDisplay: 'short'
|
|
68670
|
-
})),
|
|
68671
|
-
new ScaledUnit(10 ** 12, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68672
|
-
style: 'unit',
|
|
68673
|
-
unit: 'terabyte',
|
|
68674
|
-
unitDisplay: 'short'
|
|
68675
|
-
})),
|
|
68676
|
-
new ScaledUnit(10 ** 15, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68677
|
-
style: 'unit',
|
|
68678
|
-
unit: 'petabyte',
|
|
68679
|
-
unitDisplay: 'short'
|
|
68680
|
-
}))
|
|
68681
|
-
]);
|
|
68632
|
+
super(byteUnitScaleOptions.map(([scaleFactor, unit, unitDisplay]) => new ScaledUnit(scaleFactor, IntlNumberFormatScaledUnitFormat.createFactory({
|
|
68633
|
+
style: 'unit',
|
|
68634
|
+
unit,
|
|
68635
|
+
unitDisplay
|
|
68636
|
+
}))));
|
|
68682
68637
|
}
|
|
68683
68638
|
}
|
|
68684
68639
|
const byteUnitScale = new ByteUnitScale();
|
|
@@ -68711,38 +68666,39 @@ img.ProseMirror-separator {
|
|
|
68711
68666
|
});
|
|
68712
68667
|
DesignSystem.getOrCreate().withPrefix('nimble').register(nimbleUnitByte());
|
|
68713
68668
|
|
|
68714
|
-
|
|
68715
|
-
|
|
68716
|
-
|
|
68717
|
-
|
|
68718
|
-
|
|
68719
|
-
|
|
68720
|
-
|
|
68721
|
-
|
|
68722
|
-
|
|
68723
|
-
|
|
68724
|
-
|
|
68725
|
-
|
|
68726
|
-
|
|
68727
|
-
|
|
68728
|
-
|
|
68729
|
-
new UnitPrefix(10 ** 12, 'T'),
|
|
68730
|
-
new UnitPrefix(10 ** 15, 'P'),
|
|
68731
|
-
new UnitPrefix(10 ** 18, 'E')
|
|
68669
|
+
const metricPrefixes = [
|
|
68670
|
+
[10 ** -15, 'f'],
|
|
68671
|
+
[10 ** -12, 'p'],
|
|
68672
|
+
[10 ** -9, 'n'],
|
|
68673
|
+
[10 ** -6, 'μ'],
|
|
68674
|
+
[10 ** -3, 'm'],
|
|
68675
|
+
[10 ** -2, 'c'],
|
|
68676
|
+
[10 ** -1, 'd'],
|
|
68677
|
+
[10 ** 0, ''],
|
|
68678
|
+
[10 ** 3, 'k'],
|
|
68679
|
+
[10 ** 6, 'M'],
|
|
68680
|
+
[10 ** 9, 'G'],
|
|
68681
|
+
[10 ** 12, 'T'],
|
|
68682
|
+
[10 ** 15, 'P'],
|
|
68683
|
+
[10 ** 18, 'E']
|
|
68732
68684
|
];
|
|
68733
68685
|
|
|
68686
|
+
const unitTranslations = new Map([
|
|
68687
|
+
['en', new UnitTranslation('volt', 'volts', 'V')],
|
|
68688
|
+
['fr', new UnitTranslation('volt', 'volts', 'V')],
|
|
68689
|
+
['de', new UnitTranslation('Volt', 'Volt', 'V')],
|
|
68690
|
+
['ja', new UnitTranslation('ボルト', 'ボルト', 'V')],
|
|
68691
|
+
['zh', new UnitTranslation('伏特', '伏特', 'V')]
|
|
68692
|
+
]);
|
|
68734
68693
|
/**
|
|
68735
68694
|
* Voltage unit scale
|
|
68736
68695
|
*/
|
|
68737
|
-
class VoltUnitScale extends
|
|
68696
|
+
class VoltUnitScale extends UnitScale {
|
|
68738
68697
|
constructor() {
|
|
68739
|
-
super(new
|
|
68740
|
-
|
|
68741
|
-
|
|
68742
|
-
|
|
68743
|
-
['ja', new UnitTranslation('ボルト', 'ボルト', 'V')],
|
|
68744
|
-
['zh', new UnitTranslation('伏特', '伏特', 'V')]
|
|
68745
|
-
]), unitPrefixesMetric);
|
|
68698
|
+
super(metricPrefixes.map(([scaleFactor, scaledPrefixText]) => new ScaledUnit(scaleFactor, ManuallyTranslatedScaledUnitFormat.createFactory({
|
|
68699
|
+
unitTranslations,
|
|
68700
|
+
scaledPrefixText
|
|
68701
|
+
}))));
|
|
68746
68702
|
}
|
|
68747
68703
|
}
|
|
68748
68704
|
const voltUnitScale = new VoltUnitScale();
|