@itwin/core-quantity 4.0.0-dev.8 → 4.0.0-dev.81
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/CHANGELOG.md +43 -1
- package/lib/cjs/Constants.d.ts +27 -27
- package/lib/cjs/Constants.js +52 -52
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Exception.d.ts +26 -26
- package/lib/cjs/Exception.js +38 -38
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Formatter/Format.d.ts +91 -91
- package/lib/cjs/Formatter/Format.js +328 -329
- package/lib/cjs/Formatter/Format.js.map +1 -1
- package/lib/cjs/Formatter/FormatEnums.d.ts +133 -133
- package/lib/cjs/Formatter/FormatEnums.js +318 -318
- package/lib/cjs/Formatter/FormatEnums.js.map +1 -1
- package/lib/cjs/Formatter/Formatter.d.ts +44 -44
- package/lib/cjs/Formatter/Formatter.js +371 -371
- package/lib/cjs/Formatter/Formatter.js.map +1 -1
- package/lib/cjs/Formatter/FormatterSpec.d.ts +39 -39
- package/lib/cjs/Formatter/FormatterSpec.js +101 -101
- package/lib/cjs/Formatter/FormatterSpec.js.map +1 -1
- package/lib/cjs/Formatter/Interfaces.d.ts +62 -62
- package/lib/cjs/Formatter/Interfaces.js +17 -17
- package/lib/cjs/Formatter/Interfaces.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +86 -86
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js +9 -9
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Parser.d.ts +93 -93
- package/lib/cjs/Parser.d.ts.map +1 -1
- package/lib/cjs/Parser.js +592 -592
- package/lib/cjs/Parser.js.map +1 -1
- package/lib/cjs/ParserSpec.d.ts +34 -34
- package/lib/cjs/ParserSpec.js +47 -47
- package/lib/cjs/ParserSpec.js.map +1 -1
- package/lib/cjs/Quantity.d.ts +27 -27
- package/lib/cjs/Quantity.js +46 -46
- package/lib/cjs/Quantity.js.map +1 -1
- package/lib/cjs/Unit.d.ts +25 -25
- package/lib/cjs/Unit.js +44 -44
- package/lib/cjs/Unit.js.map +1 -1
- package/lib/cjs/core-quantity.d.ts +19 -19
- package/lib/cjs/core-quantity.js +39 -35
- package/lib/cjs/core-quantity.js.map +1 -1
- package/lib/esm/Constants.d.ts +27 -27
- package/lib/esm/Constants.js +49 -48
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Exception.d.ts +26 -26
- package/lib/esm/Exception.js +34 -34
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Formatter/Format.d.ts +91 -91
- package/lib/esm/Formatter/Format.js +323 -324
- package/lib/esm/Formatter/Format.js.map +1 -1
- package/lib/esm/Formatter/FormatEnums.d.ts +133 -133
- package/lib/esm/Formatter/FormatEnums.js +302 -302
- package/lib/esm/Formatter/FormatEnums.js.map +1 -1
- package/lib/esm/Formatter/Formatter.d.ts +44 -44
- package/lib/esm/Formatter/Formatter.js +368 -367
- package/lib/esm/Formatter/Formatter.js.map +1 -1
- package/lib/esm/Formatter/FormatterSpec.d.ts +39 -39
- package/lib/esm/Formatter/FormatterSpec.js +97 -97
- package/lib/esm/Formatter/FormatterSpec.js.map +1 -1
- package/lib/esm/Formatter/Interfaces.d.ts +62 -62
- package/lib/esm/Formatter/Interfaces.js +13 -13
- package/lib/esm/Formatter/Interfaces.js.map +1 -1
- package/lib/esm/Interfaces.d.ts +86 -86
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js +8 -8
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Parser.d.ts +93 -93
- package/lib/esm/Parser.d.ts.map +1 -1
- package/lib/esm/Parser.js +589 -588
- package/lib/esm/Parser.js.map +1 -1
- package/lib/esm/ParserSpec.d.ts +34 -34
- package/lib/esm/ParserSpec.js +43 -43
- package/lib/esm/ParserSpec.js.map +1 -1
- package/lib/esm/Quantity.d.ts +27 -27
- package/lib/esm/Quantity.js +42 -42
- package/lib/esm/Quantity.js.map +1 -1
- package/lib/esm/Unit.d.ts +25 -25
- package/lib/esm/Unit.js +39 -39
- package/lib/esm/Unit.js.map +1 -1
- package/lib/esm/core-quantity.d.ts +19 -19
- package/lib/esm/core-quantity.js +23 -23
- package/lib/esm/core-quantity.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
# Change Log - @itwin/core-quantity
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 12 Apr 2023 13:12:42 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.7.2
|
|
6
|
+
Wed, 12 Apr 2023 13:12:42 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 3.7.1
|
|
11
|
+
Mon, 03 Apr 2023 15:15:37 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 3.7.0
|
|
16
|
+
Wed, 29 Mar 2023 15:02:27 GMT
|
|
17
|
+
|
|
18
|
+
### Updates
|
|
19
|
+
|
|
20
|
+
- Fixed KeepSingleZero format trait where zero wasn't being retained when fractional part was all zeroes.
|
|
21
|
+
|
|
22
|
+
## 3.6.3
|
|
23
|
+
Mon, 27 Mar 2023 16:26:47 GMT
|
|
24
|
+
|
|
25
|
+
_Version update only_
|
|
26
|
+
|
|
27
|
+
## 3.6.2
|
|
28
|
+
Fri, 17 Mar 2023 17:52:32 GMT
|
|
29
|
+
|
|
30
|
+
_Version update only_
|
|
31
|
+
|
|
32
|
+
## 3.6.1
|
|
33
|
+
Fri, 24 Feb 2023 22:00:48 GMT
|
|
34
|
+
|
|
35
|
+
_Version update only_
|
|
36
|
+
|
|
37
|
+
## 3.6.0
|
|
38
|
+
Wed, 08 Feb 2023 14:58:40 GMT
|
|
39
|
+
|
|
40
|
+
_Version update only_
|
|
41
|
+
|
|
42
|
+
## 3.5.6
|
|
43
|
+
Fri, 24 Feb 2023 16:02:47 GMT
|
|
44
|
+
|
|
45
|
+
_Version update only_
|
|
4
46
|
|
|
5
47
|
## 3.5.5
|
|
6
48
|
Thu, 26 Jan 2023 22:53:27 GMT
|
package/lib/cjs/Constants.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/** Constants used internally for both formatting and parsing.
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export declare class QuantityConstants {
|
|
5
|
-
static readonly CHAR_COMMA = 44;
|
|
6
|
-
static readonly CHAR_SPACE = 32;
|
|
7
|
-
static readonly CHAR_NUMBER = 35;
|
|
8
|
-
static readonly CHAR_PLUS = 43;
|
|
9
|
-
static readonly CHAR_MINUS = 45;
|
|
10
|
-
static readonly CHAR_PERIOD = 46;
|
|
11
|
-
static readonly CHAR_SLASH = 47;
|
|
12
|
-
static readonly CHAR_DIVISION_SLASH = 8725;
|
|
13
|
-
static readonly CHAR_FRACTION_SLASH = 8260;
|
|
14
|
-
static readonly CHAR_ONE_QUARTER = 188;
|
|
15
|
-
static readonly CHAR_ONE_HALF = 189;
|
|
16
|
-
static readonly CHAR_THREE_QUARTER = 190;
|
|
17
|
-
static readonly CHAR_DIGIT_ZERO = 48;
|
|
18
|
-
static readonly CHAR_DIGIT_NINE = 57;
|
|
19
|
-
static readonly CHAR_UPPER_E = 69;
|
|
20
|
-
static readonly CHAR_LOWER_E = 101;
|
|
21
|
-
private static _LOCALE_DECIMAL_SEPARATOR;
|
|
22
|
-
private static _LOCALE_THOUSAND_SEPARATOR;
|
|
23
|
-
/** Return the decimal separator for the current locale. */
|
|
24
|
-
static get LocaleSpecificDecimalSeparator(): string;
|
|
25
|
-
/** Return the thousand separator for the current locale. */
|
|
26
|
-
static get LocaleSpecificThousandSeparator(): string;
|
|
27
|
-
}
|
|
1
|
+
/** Constants used internally for both formatting and parsing.
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare class QuantityConstants {
|
|
5
|
+
static readonly CHAR_COMMA = 44;
|
|
6
|
+
static readonly CHAR_SPACE = 32;
|
|
7
|
+
static readonly CHAR_NUMBER = 35;
|
|
8
|
+
static readonly CHAR_PLUS = 43;
|
|
9
|
+
static readonly CHAR_MINUS = 45;
|
|
10
|
+
static readonly CHAR_PERIOD = 46;
|
|
11
|
+
static readonly CHAR_SLASH = 47;
|
|
12
|
+
static readonly CHAR_DIVISION_SLASH = 8725;
|
|
13
|
+
static readonly CHAR_FRACTION_SLASH = 8260;
|
|
14
|
+
static readonly CHAR_ONE_QUARTER = 188;
|
|
15
|
+
static readonly CHAR_ONE_HALF = 189;
|
|
16
|
+
static readonly CHAR_THREE_QUARTER = 190;
|
|
17
|
+
static readonly CHAR_DIGIT_ZERO = 48;
|
|
18
|
+
static readonly CHAR_DIGIT_NINE = 57;
|
|
19
|
+
static readonly CHAR_UPPER_E = 69;
|
|
20
|
+
static readonly CHAR_LOWER_E = 101;
|
|
21
|
+
private static _LOCALE_DECIMAL_SEPARATOR;
|
|
22
|
+
private static _LOCALE_THOUSAND_SEPARATOR;
|
|
23
|
+
/** Return the decimal separator for the current locale. */
|
|
24
|
+
static get LocaleSpecificDecimalSeparator(): string;
|
|
25
|
+
/** Return the thousand separator for the current locale. */
|
|
26
|
+
static get LocaleSpecificThousandSeparator(): string;
|
|
27
|
+
}
|
|
28
28
|
//# sourceMappingURL=Constants.d.ts.map
|
package/lib/cjs/Constants.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.QuantityConstants = void 0;
|
|
8
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9
|
-
/** Constants used internally for both formatting and parsing.
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
class QuantityConstants {
|
|
13
|
-
/** Return the decimal separator for the current locale. */
|
|
14
|
-
static get LocaleSpecificDecimalSeparator() {
|
|
15
|
-
if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)
|
|
16
|
-
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
17
|
-
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = ".";
|
|
18
|
-
const matches = (12345.6789).toLocaleString().match(/345(.*)67/);
|
|
19
|
-
if (matches && matches.length > 1)
|
|
20
|
-
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];
|
|
21
|
-
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
22
|
-
}
|
|
23
|
-
/** Return the thousand separator for the current locale. */
|
|
24
|
-
static get LocaleSpecificThousandSeparator() {
|
|
25
|
-
if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)
|
|
26
|
-
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
27
|
-
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = ",";
|
|
28
|
-
const matches = (12345.6789).toLocaleString().match(/12(.*)345/);
|
|
29
|
-
if (matches && matches.length > 0)
|
|
30
|
-
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];
|
|
31
|
-
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
QuantityConstants.
|
|
36
|
-
QuantityConstants.
|
|
37
|
-
QuantityConstants.
|
|
38
|
-
QuantityConstants.
|
|
39
|
-
QuantityConstants.
|
|
40
|
-
QuantityConstants.
|
|
41
|
-
QuantityConstants.
|
|
42
|
-
QuantityConstants.
|
|
43
|
-
QuantityConstants.
|
|
44
|
-
QuantityConstants.
|
|
45
|
-
QuantityConstants.
|
|
46
|
-
QuantityConstants.
|
|
47
|
-
QuantityConstants.
|
|
48
|
-
QuantityConstants.
|
|
49
|
-
QuantityConstants.
|
|
50
|
-
QuantityConstants.
|
|
51
|
-
QuantityConstants.
|
|
52
|
-
QuantityConstants
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.QuantityConstants = void 0;
|
|
8
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9
|
+
/** Constants used internally for both formatting and parsing.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
class QuantityConstants {
|
|
13
|
+
/** Return the decimal separator for the current locale. */
|
|
14
|
+
static get LocaleSpecificDecimalSeparator() {
|
|
15
|
+
if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)
|
|
16
|
+
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
17
|
+
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = ".";
|
|
18
|
+
const matches = (12345.6789).toLocaleString().match(/345(.*)67/);
|
|
19
|
+
if (matches && matches.length > 1)
|
|
20
|
+
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];
|
|
21
|
+
return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;
|
|
22
|
+
}
|
|
23
|
+
/** Return the thousand separator for the current locale. */
|
|
24
|
+
static get LocaleSpecificThousandSeparator() {
|
|
25
|
+
if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)
|
|
26
|
+
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
27
|
+
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = ",";
|
|
28
|
+
const matches = (12345.6789).toLocaleString().match(/12(.*)345/);
|
|
29
|
+
if (matches && matches.length > 0)
|
|
30
|
+
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];
|
|
31
|
+
return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
QuantityConstants.CHAR_COMMA = 44;
|
|
35
|
+
QuantityConstants.CHAR_SPACE = 32;
|
|
36
|
+
QuantityConstants.CHAR_NUMBER = 35;
|
|
37
|
+
QuantityConstants.CHAR_PLUS = 43;
|
|
38
|
+
QuantityConstants.CHAR_MINUS = 45;
|
|
39
|
+
QuantityConstants.CHAR_PERIOD = 46;
|
|
40
|
+
QuantityConstants.CHAR_SLASH = 47;
|
|
41
|
+
QuantityConstants.CHAR_DIVISION_SLASH = 8725;
|
|
42
|
+
QuantityConstants.CHAR_FRACTION_SLASH = 8260;
|
|
43
|
+
QuantityConstants.CHAR_ONE_QUARTER = 188;
|
|
44
|
+
QuantityConstants.CHAR_ONE_HALF = 189;
|
|
45
|
+
QuantityConstants.CHAR_THREE_QUARTER = 190;
|
|
46
|
+
QuantityConstants.CHAR_DIGIT_ZERO = 48;
|
|
47
|
+
QuantityConstants.CHAR_DIGIT_NINE = 57;
|
|
48
|
+
QuantityConstants.CHAR_UPPER_E = 69;
|
|
49
|
+
QuantityConstants.CHAR_LOWER_E = 101;
|
|
50
|
+
QuantityConstants._LOCALE_DECIMAL_SEPARATOR = "";
|
|
51
|
+
QuantityConstants._LOCALE_THOUSAND_SEPARATOR = "";
|
|
52
|
+
exports.QuantityConstants = QuantityConstants;
|
|
53
53
|
//# sourceMappingURL=Constants.js.map
|
package/lib/cjs/Constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,yDAAyD;AAEzD;;GAEG;AACH,MAAa,iBAAiB;IAoB5B,2DAA2D;IACpD,MAAM,KAAK,8BAA8B;QAC9C,IAAI,iBAAiB,CAAC,yBAAyB,CAAC,MAAM,GAAG,CAAC;YACxD,OAAO,iBAAiB,CAAC,yBAAyB,CAAC;QAErD,iBAAiB,CAAC,yBAAyB,GAAG,GAAG,CAAC;QAClD,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC/B,iBAAiB,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAE3D,OAAO,iBAAiB,CAAC,yBAAyB,CAAC;IACrD,CAAC;IAED,4DAA4D;IACrD,MAAM,KAAK,+BAA+B;QAC/C,IAAI,iBAAiB,CAAC,0BAA0B,CAAC,MAAM,GAAG,CAAC;YACzD,OAAO,iBAAiB,CAAC,0BAA0B,CAAC;QAEtD,iBAAiB,CAAC,0BAA0B,GAAG,GAAG,CAAC;QACnD,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC/B,iBAAiB,CAAC,0BAA0B,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAE5D,OAAO,iBAAiB,CAAC,0BAA0B,CAAC;IACtD,CAAC;;
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,yDAAyD;AAEzD;;GAEG;AACH,MAAa,iBAAiB;IAoB5B,2DAA2D;IACpD,MAAM,KAAK,8BAA8B;QAC9C,IAAI,iBAAiB,CAAC,yBAAyB,CAAC,MAAM,GAAG,CAAC;YACxD,OAAO,iBAAiB,CAAC,yBAAyB,CAAC;QAErD,iBAAiB,CAAC,yBAAyB,GAAG,GAAG,CAAC;QAClD,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC/B,iBAAiB,CAAC,yBAAyB,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAE3D,OAAO,iBAAiB,CAAC,yBAAyB,CAAC;IACrD,CAAC;IAED,4DAA4D;IACrD,MAAM,KAAK,+BAA+B;QAC/C,IAAI,iBAAiB,CAAC,0BAA0B,CAAC,MAAM,GAAG,CAAC;YACzD,OAAO,iBAAiB,CAAC,0BAA0B,CAAC;QAEtD,iBAAiB,CAAC,0BAA0B,GAAG,GAAG,CAAC;QACnD,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,cAAc,EAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAClE,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAC/B,iBAAiB,CAAC,0BAA0B,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAE5D,OAAO,iBAAiB,CAAC,0BAA0B,CAAC;IACtD,CAAC;;AA3CsB,4BAAU,GAAG,EAAE,CAAC;AAChB,4BAAU,GAAG,EAAE,CAAC;AAChB,6BAAW,GAAG,EAAE,CAAC;AACjB,2BAAS,GAAG,EAAE,CAAC;AACf,4BAAU,GAAG,EAAE,CAAC;AAChB,6BAAW,GAAG,EAAE,CAAC;AACjB,4BAAU,GAAG,EAAE,CAAC;AAChB,qCAAmB,GAAG,IAAI,CAAC;AAC3B,qCAAmB,GAAG,IAAI,CAAC;AAC3B,kCAAgB,GAAG,GAAG,CAAC;AACvB,+BAAa,GAAG,GAAG,CAAC;AACpB,oCAAkB,GAAG,GAAG,CAAC;AACzB,iCAAe,GAAG,EAAE,CAAC;AACrB,iCAAe,GAAG,EAAE,CAAC;AACrB,8BAAY,GAAG,EAAE,CAAC;AAClB,8BAAY,GAAG,GAAG,CAAC;AAC3B,2CAAyB,GAAG,EAAE,CAAC;AAC/B,4CAA0B,GAAG,EAAE,CAAC;AAlBpC,8CAAiB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/** Constants used internally for both formatting and parsing.\n * @internal\n */\nexport class QuantityConstants {\n public static readonly CHAR_COMMA = 44;\n public static readonly CHAR_SPACE = 32;\n public static readonly CHAR_NUMBER = 35;\n public static readonly CHAR_PLUS = 43;\n public static readonly CHAR_MINUS = 45;\n public static readonly CHAR_PERIOD = 46;\n public static readonly CHAR_SLASH = 47;\n public static readonly CHAR_DIVISION_SLASH = 8725;\n public static readonly CHAR_FRACTION_SLASH = 8260;\n public static readonly CHAR_ONE_QUARTER = 188;\n public static readonly CHAR_ONE_HALF = 189;\n public static readonly CHAR_THREE_QUARTER = 190;\n public static readonly CHAR_DIGIT_ZERO = 48;\n public static readonly CHAR_DIGIT_NINE = 57;\n public static readonly CHAR_UPPER_E = 69;\n public static readonly CHAR_LOWER_E = 101;\n private static _LOCALE_DECIMAL_SEPARATOR = \"\";\n private static _LOCALE_THOUSAND_SEPARATOR = \"\";\n\n /** Return the decimal separator for the current locale. */\n public static get LocaleSpecificDecimalSeparator(): string {\n if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\n\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = \".\";\n const matches = (12345.6789).toLocaleString()!.match(/345(.*)67/);\n if (matches && matches.length > 1)\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];\n\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\n }\n\n /** Return the thousand separator for the current locale. */\n public static get LocaleSpecificThousandSeparator(): string {\n if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\n\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = \",\";\n const matches = (12345.6789).toLocaleString()!.match(/12(.*)345/);\n if (matches && matches.length > 0)\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];\n\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\n }\n}\n"]}
|
package/lib/cjs/Exception.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Quantity
|
|
3
|
-
*/
|
|
4
|
-
import { BentleyError } from "@itwin/core-bentley";
|
|
5
|
-
/**
|
|
6
|
-
* Status codes used during Quantity parsing and formatting processing.
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
export declare enum QuantityStatus {
|
|
10
|
-
QUANTITY_ERROR_BASE = 35039,
|
|
11
|
-
Success = 0,
|
|
12
|
-
InvalidJson = 35040,
|
|
13
|
-
InvalidCompositeFormat = 35041,
|
|
14
|
-
UnableToGenerateParseTokens = 35042,
|
|
15
|
-
NoValueOrUnitFoundInString = 35043,
|
|
16
|
-
UnitLabelSuppliedButNotMatched = 35044,
|
|
17
|
-
UnknownUnit = 35045,
|
|
18
|
-
UnableToConvertParseTokensToQuantity = 35046
|
|
19
|
-
}
|
|
20
|
-
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
21
|
-
* @beta
|
|
22
|
-
*/
|
|
23
|
-
export declare class QuantityError extends BentleyError {
|
|
24
|
-
readonly errorNumber: number;
|
|
25
|
-
constructor(errorNumber: number, message?: string);
|
|
26
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Quantity
|
|
3
|
+
*/
|
|
4
|
+
import { BentleyError } from "@itwin/core-bentley";
|
|
5
|
+
/**
|
|
6
|
+
* Status codes used during Quantity parsing and formatting processing.
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare enum QuantityStatus {
|
|
10
|
+
QUANTITY_ERROR_BASE = 35039,
|
|
11
|
+
Success = 0,
|
|
12
|
+
InvalidJson = 35040,
|
|
13
|
+
InvalidCompositeFormat = 35041,
|
|
14
|
+
UnableToGenerateParseTokens = 35042,
|
|
15
|
+
NoValueOrUnitFoundInString = 35043,
|
|
16
|
+
UnitLabelSuppliedButNotMatched = 35044,
|
|
17
|
+
UnknownUnit = 35045,
|
|
18
|
+
UnableToConvertParseTokensToQuantity = 35046
|
|
19
|
+
}
|
|
20
|
+
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
export declare class QuantityError extends BentleyError {
|
|
24
|
+
readonly errorNumber: number;
|
|
25
|
+
constructor(errorNumber: number, message?: string);
|
|
26
|
+
}
|
|
27
27
|
//# sourceMappingURL=Exception.d.ts.map
|
package/lib/cjs/Exception.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Quantity
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.QuantityError = exports.QuantityStatus = void 0;
|
|
11
|
-
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
-
/**
|
|
13
|
-
* Status codes used during Quantity parsing and formatting processing.
|
|
14
|
-
* @beta
|
|
15
|
-
*/
|
|
16
|
-
var QuantityStatus;
|
|
17
|
-
(function (QuantityStatus) {
|
|
18
|
-
QuantityStatus[QuantityStatus["QUANTITY_ERROR_BASE"] = 35039] = "QUANTITY_ERROR_BASE";
|
|
19
|
-
QuantityStatus[QuantityStatus["Success"] = 0] = "Success";
|
|
20
|
-
QuantityStatus[QuantityStatus["InvalidJson"] = 35040] = "InvalidJson";
|
|
21
|
-
QuantityStatus[QuantityStatus["InvalidCompositeFormat"] = 35041] = "InvalidCompositeFormat";
|
|
22
|
-
QuantityStatus[QuantityStatus["UnableToGenerateParseTokens"] = 35042] = "UnableToGenerateParseTokens";
|
|
23
|
-
QuantityStatus[QuantityStatus["NoValueOrUnitFoundInString"] = 35043] = "NoValueOrUnitFoundInString";
|
|
24
|
-
QuantityStatus[QuantityStatus["UnitLabelSuppliedButNotMatched"] = 35044] = "UnitLabelSuppliedButNotMatched";
|
|
25
|
-
QuantityStatus[QuantityStatus["UnknownUnit"] = 35045] = "UnknownUnit";
|
|
26
|
-
QuantityStatus[QuantityStatus["UnableToConvertParseTokensToQuantity"] = 35046] = "UnableToConvertParseTokensToQuantity";
|
|
27
|
-
})(QuantityStatus = exports.QuantityStatus || (exports.QuantityStatus = {}));
|
|
28
|
-
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
29
|
-
* @beta
|
|
30
|
-
*/
|
|
31
|
-
class QuantityError extends core_bentley_1.BentleyError {
|
|
32
|
-
constructor(errorNumber, message) {
|
|
33
|
-
super(errorNumber, message);
|
|
34
|
-
this.errorNumber = errorNumber;
|
|
35
|
-
(0, core_bentley_1.assert)(errorNumber !== QuantityStatus.Success, message);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.QuantityError = QuantityError;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Quantity
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.QuantityError = exports.QuantityStatus = void 0;
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
|
+
/**
|
|
13
|
+
* Status codes used during Quantity parsing and formatting processing.
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
var QuantityStatus;
|
|
17
|
+
(function (QuantityStatus) {
|
|
18
|
+
QuantityStatus[QuantityStatus["QUANTITY_ERROR_BASE"] = 35039] = "QUANTITY_ERROR_BASE";
|
|
19
|
+
QuantityStatus[QuantityStatus["Success"] = 0] = "Success";
|
|
20
|
+
QuantityStatus[QuantityStatus["InvalidJson"] = 35040] = "InvalidJson";
|
|
21
|
+
QuantityStatus[QuantityStatus["InvalidCompositeFormat"] = 35041] = "InvalidCompositeFormat";
|
|
22
|
+
QuantityStatus[QuantityStatus["UnableToGenerateParseTokens"] = 35042] = "UnableToGenerateParseTokens";
|
|
23
|
+
QuantityStatus[QuantityStatus["NoValueOrUnitFoundInString"] = 35043] = "NoValueOrUnitFoundInString";
|
|
24
|
+
QuantityStatus[QuantityStatus["UnitLabelSuppliedButNotMatched"] = 35044] = "UnitLabelSuppliedButNotMatched";
|
|
25
|
+
QuantityStatus[QuantityStatus["UnknownUnit"] = 35045] = "UnknownUnit";
|
|
26
|
+
QuantityStatus[QuantityStatus["UnableToConvertParseTokensToQuantity"] = 35046] = "UnableToConvertParseTokensToQuantity";
|
|
27
|
+
})(QuantityStatus = exports.QuantityStatus || (exports.QuantityStatus = {}));
|
|
28
|
+
/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.
|
|
29
|
+
* @beta
|
|
30
|
+
*/
|
|
31
|
+
class QuantityError extends core_bentley_1.BentleyError {
|
|
32
|
+
constructor(errorNumber, message) {
|
|
33
|
+
super(errorNumber, message);
|
|
34
|
+
this.errorNumber = errorNumber;
|
|
35
|
+
(0, core_bentley_1.assert)(errorNumber !== QuantityStatus.Success, message);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.QuantityError = QuantityError;
|
|
39
39
|
//# sourceMappingURL=Exception.js.map
|
package/lib/cjs/Exception.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../src/Exception.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAE3D;;;GAGG;AACH,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,qFAA4B,CAAA;IAC5B,yDAAW,CAAA;IACX,qEAAqC,CAAA;IACrC,2FAAgD,CAAA;IAChD,qGAAqD,CAAA;IACrD,mGAAoD,CAAA;IACpD,2GAAwD,CAAA;IACxD,qEAAqC,CAAA;IACrC,uHAA8D,CAAA;AAChE,CAAC,EAVW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAUzB;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,2BAAY;IAC7C,YAA4C,WAAmB,EAAE,OAAgB;QAC/E,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QADc,gBAAW,GAAX,WAAW,CAAQ;QAE7D,IAAA,qBAAM,EAAC,WAAW,KAAK,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AALD,sCAKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../src/Exception.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA2D;AAE3D;;;GAGG;AACH,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,qFAA4B,CAAA;IAC5B,yDAAW,CAAA;IACX,qEAAqC,CAAA;IACrC,2FAAgD,CAAA;IAChD,qGAAqD,CAAA;IACrD,mGAAoD,CAAA;IACpD,2GAAwD,CAAA;IACxD,qEAAqC,CAAA;IACrC,uHAA8D,CAAA;AAChE,CAAC,EAVW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAUzB;AAED;;GAEG;AACH,MAAa,aAAc,SAAQ,2BAAY;IAC7C,YAA4C,WAAmB,EAAE,OAAgB;QAC/E,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QADc,gBAAW,GAAX,WAAW,CAAQ;QAE7D,IAAA,qBAAM,EAAC,WAAW,KAAK,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AALD,sCAKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Quantity\n */\n\nimport { assert, BentleyError } from \"@itwin/core-bentley\";\n\n/**\n * Status codes used during Quantity parsing and formatting processing.\n * @beta\n */\nexport enum QuantityStatus {\n QUANTITY_ERROR_BASE = 0x88DF,\n Success = 0,\n InvalidJson = QUANTITY_ERROR_BASE + 1,\n InvalidCompositeFormat = QUANTITY_ERROR_BASE + 2,\n UnableToGenerateParseTokens = QUANTITY_ERROR_BASE + 3,\n NoValueOrUnitFoundInString = QUANTITY_ERROR_BASE + 4,\n UnitLabelSuppliedButNotMatched = QUANTITY_ERROR_BASE + 5,\n UnknownUnit = QUANTITY_ERROR_BASE + 6,\n UnableToConvertParseTokensToQuantity = QUANTITY_ERROR_BASE + 7,\n}\n\n/** The error type thrown by this module. See [[QuantityStatus]] for `errorNumber` values.\n * @beta\n */\nexport class QuantityError extends BentleyError {\n public constructor(public override readonly errorNumber: number, message?: string) {\n super(errorNumber, message);\n assert(errorNumber !== QuantityStatus.Success, message);\n }\n}\n"]}
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Quantity
|
|
3
|
-
*/
|
|
4
|
-
import { UnitProps, UnitsProvider } from "../Interfaces";
|
|
5
|
-
import { DecimalPrecision, FormatTraits, FormatType, FractionalPrecision, ScientificType, ShowSignOption } from "./FormatEnums";
|
|
6
|
-
import { CloneOptions, FormatProps } from "./Interfaces";
|
|
7
|
-
/** A base Format class with shared properties and functionality between quantity and ecschema-metadata Format classes
|
|
8
|
-
* @beta
|
|
9
|
-
*/
|
|
10
|
-
export declare class BaseFormat {
|
|
11
|
-
private _name;
|
|
12
|
-
protected _roundFactor: number;
|
|
13
|
-
protected _type: FormatType;
|
|
14
|
-
protected _precision: number;
|
|
15
|
-
protected _showSignOption: ShowSignOption;
|
|
16
|
-
protected _decimalSeparator: string;
|
|
17
|
-
protected _thousandSeparator: string;
|
|
18
|
-
protected _uomSeparator: string;
|
|
19
|
-
protected _stationSeparator: string;
|
|
20
|
-
protected _formatTraits: FormatTraits;
|
|
21
|
-
protected _spacer: string;
|
|
22
|
-
protected _includeZero: boolean;
|
|
23
|
-
protected _minWidth?: number;
|
|
24
|
-
protected _scientificType?: ScientificType;
|
|
25
|
-
protected _stationOffsetSize?: number;
|
|
26
|
-
constructor(name: string);
|
|
27
|
-
get name(): string;
|
|
28
|
-
get roundFactor(): number;
|
|
29
|
-
set roundFactor(roundFactor: number);
|
|
30
|
-
get type(): FormatType;
|
|
31
|
-
set type(formatType: FormatType);
|
|
32
|
-
get precision(): DecimalPrecision | FractionalPrecision;
|
|
33
|
-
set precision(precision: DecimalPrecision | FractionalPrecision);
|
|
34
|
-
get minWidth(): number | undefined;
|
|
35
|
-
set minWidth(minWidth: number | undefined);
|
|
36
|
-
get scientificType(): ScientificType | undefined;
|
|
37
|
-
set scientificType(scientificType: ScientificType | undefined);
|
|
38
|
-
get showSignOption(): ShowSignOption;
|
|
39
|
-
set showSignOption(showSignOption: ShowSignOption);
|
|
40
|
-
get decimalSeparator(): string;
|
|
41
|
-
set decimalSeparator(decimalSeparator: string);
|
|
42
|
-
get thousandSeparator(): string;
|
|
43
|
-
set thousandSeparator(thousandSeparator: string);
|
|
44
|
-
get uomSeparator(): string;
|
|
45
|
-
set uomSeparator(uomSeparator: string);
|
|
46
|
-
get stationSeparator(): string;
|
|
47
|
-
set stationSeparator(stationSeparator: string);
|
|
48
|
-
get stationOffsetSize(): number | undefined;
|
|
49
|
-
set stationOffsetSize(stationOffsetSize: number | undefined);
|
|
50
|
-
get formatTraits(): FormatTraits;
|
|
51
|
-
set formatTraits(formatTraits: FormatTraits);
|
|
52
|
-
get spacer(): string | undefined;
|
|
53
|
-
set spacer(spacer: string | undefined);
|
|
54
|
-
get includeZero(): boolean | undefined;
|
|
55
|
-
set includeZero(includeZero: boolean | undefined);
|
|
56
|
-
/** This method parses input string that is typically extracted for persisted JSON data and validates that the string is a valid FormatType. Throws exception if not valid. */
|
|
57
|
-
parseFormatTraits(formatTraitsFromJson: string | string[]): void;
|
|
58
|
-
/** This method returns true if the formatTrait is set in this Format object. */
|
|
59
|
-
hasFormatTraitSet(formatTrait: FormatTraits): boolean;
|
|
60
|
-
loadFormatProperties(formatProps: FormatProps): void;
|
|
61
|
-
}
|
|
62
|
-
/** A class used to define the specifications for formatting quantity values. This class is typically loaded by reading [[FormatProps]].
|
|
63
|
-
* @beta
|
|
64
|
-
*/
|
|
65
|
-
export declare class Format extends BaseFormat {
|
|
66
|
-
protected _units?: Array<[UnitProps, string | undefined]>;
|
|
67
|
-
protected _customProps?: any;
|
|
68
|
-
/** Constructor
|
|
69
|
-
* @param name The name of a format specification. TODO: make optional or remove
|
|
70
|
-
*/
|
|
71
|
-
constructor(name: string);
|
|
72
|
-
get units(): Array<[UnitProps, string | undefined]> | undefined;
|
|
73
|
-
get hasUnits(): boolean;
|
|
74
|
-
get customProps(): any;
|
|
75
|
-
static isFormatTraitSetInProps(formatProps: FormatProps, trait: FormatTraits): boolean;
|
|
76
|
-
private createUnit;
|
|
77
|
-
/**
|
|
78
|
-
* Clone Format
|
|
79
|
-
*/
|
|
80
|
-
clone(options?: CloneOptions): Format;
|
|
81
|
-
/**
|
|
82
|
-
* Populates this Format with the values from the provided.
|
|
83
|
-
*/
|
|
84
|
-
fromJSON(unitsProvider: UnitsProvider, jsonObj: FormatProps): Promise<void>;
|
|
85
|
-
/** Create a Format from FormatProps */
|
|
86
|
-
static createFromJSON(name: string, unitsProvider: UnitsProvider, formatProps: FormatProps): Promise<Format>;
|
|
87
|
-
/**
|
|
88
|
-
* Returns a JSON object that contain the specification for this Format.
|
|
89
|
-
*/
|
|
90
|
-
toJSON(): FormatProps;
|
|
91
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Quantity
|
|
3
|
+
*/
|
|
4
|
+
import { UnitProps, UnitsProvider } from "../Interfaces";
|
|
5
|
+
import { DecimalPrecision, FormatTraits, FormatType, FractionalPrecision, ScientificType, ShowSignOption } from "./FormatEnums";
|
|
6
|
+
import { CloneOptions, FormatProps } from "./Interfaces";
|
|
7
|
+
/** A base Format class with shared properties and functionality between quantity and ecschema-metadata Format classes
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class BaseFormat {
|
|
11
|
+
private _name;
|
|
12
|
+
protected _roundFactor: number;
|
|
13
|
+
protected _type: FormatType;
|
|
14
|
+
protected _precision: number;
|
|
15
|
+
protected _showSignOption: ShowSignOption;
|
|
16
|
+
protected _decimalSeparator: string;
|
|
17
|
+
protected _thousandSeparator: string;
|
|
18
|
+
protected _uomSeparator: string;
|
|
19
|
+
protected _stationSeparator: string;
|
|
20
|
+
protected _formatTraits: FormatTraits;
|
|
21
|
+
protected _spacer: string;
|
|
22
|
+
protected _includeZero: boolean;
|
|
23
|
+
protected _minWidth?: number;
|
|
24
|
+
protected _scientificType?: ScientificType;
|
|
25
|
+
protected _stationOffsetSize?: number;
|
|
26
|
+
constructor(name: string);
|
|
27
|
+
get name(): string;
|
|
28
|
+
get roundFactor(): number;
|
|
29
|
+
set roundFactor(roundFactor: number);
|
|
30
|
+
get type(): FormatType;
|
|
31
|
+
set type(formatType: FormatType);
|
|
32
|
+
get precision(): DecimalPrecision | FractionalPrecision;
|
|
33
|
+
set precision(precision: DecimalPrecision | FractionalPrecision);
|
|
34
|
+
get minWidth(): number | undefined;
|
|
35
|
+
set minWidth(minWidth: number | undefined);
|
|
36
|
+
get scientificType(): ScientificType | undefined;
|
|
37
|
+
set scientificType(scientificType: ScientificType | undefined);
|
|
38
|
+
get showSignOption(): ShowSignOption;
|
|
39
|
+
set showSignOption(showSignOption: ShowSignOption);
|
|
40
|
+
get decimalSeparator(): string;
|
|
41
|
+
set decimalSeparator(decimalSeparator: string);
|
|
42
|
+
get thousandSeparator(): string;
|
|
43
|
+
set thousandSeparator(thousandSeparator: string);
|
|
44
|
+
get uomSeparator(): string;
|
|
45
|
+
set uomSeparator(uomSeparator: string);
|
|
46
|
+
get stationSeparator(): string;
|
|
47
|
+
set stationSeparator(stationSeparator: string);
|
|
48
|
+
get stationOffsetSize(): number | undefined;
|
|
49
|
+
set stationOffsetSize(stationOffsetSize: number | undefined);
|
|
50
|
+
get formatTraits(): FormatTraits;
|
|
51
|
+
set formatTraits(formatTraits: FormatTraits);
|
|
52
|
+
get spacer(): string | undefined;
|
|
53
|
+
set spacer(spacer: string | undefined);
|
|
54
|
+
get includeZero(): boolean | undefined;
|
|
55
|
+
set includeZero(includeZero: boolean | undefined);
|
|
56
|
+
/** This method parses input string that is typically extracted for persisted JSON data and validates that the string is a valid FormatType. Throws exception if not valid. */
|
|
57
|
+
parseFormatTraits(formatTraitsFromJson: string | string[]): void;
|
|
58
|
+
/** This method returns true if the formatTrait is set in this Format object. */
|
|
59
|
+
hasFormatTraitSet(formatTrait: FormatTraits): boolean;
|
|
60
|
+
loadFormatProperties(formatProps: FormatProps): void;
|
|
61
|
+
}
|
|
62
|
+
/** A class used to define the specifications for formatting quantity values. This class is typically loaded by reading [[FormatProps]].
|
|
63
|
+
* @beta
|
|
64
|
+
*/
|
|
65
|
+
export declare class Format extends BaseFormat {
|
|
66
|
+
protected _units?: Array<[UnitProps, string | undefined]>;
|
|
67
|
+
protected _customProps?: any;
|
|
68
|
+
/** Constructor
|
|
69
|
+
* @param name The name of a format specification. TODO: make optional or remove
|
|
70
|
+
*/
|
|
71
|
+
constructor(name: string);
|
|
72
|
+
get units(): Array<[UnitProps, string | undefined]> | undefined;
|
|
73
|
+
get hasUnits(): boolean;
|
|
74
|
+
get customProps(): any;
|
|
75
|
+
static isFormatTraitSetInProps(formatProps: FormatProps, trait: FormatTraits): boolean;
|
|
76
|
+
private createUnit;
|
|
77
|
+
/**
|
|
78
|
+
* Clone Format
|
|
79
|
+
*/
|
|
80
|
+
clone(options?: CloneOptions): Format;
|
|
81
|
+
/**
|
|
82
|
+
* Populates this Format with the values from the provided.
|
|
83
|
+
*/
|
|
84
|
+
fromJSON(unitsProvider: UnitsProvider, jsonObj: FormatProps): Promise<void>;
|
|
85
|
+
/** Create a Format from FormatProps */
|
|
86
|
+
static createFromJSON(name: string, unitsProvider: UnitsProvider, formatProps: FormatProps): Promise<Format>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns a JSON object that contain the specification for this Format.
|
|
89
|
+
*/
|
|
90
|
+
toJSON(): FormatProps;
|
|
91
|
+
}
|
|
92
92
|
//# sourceMappingURL=Format.d.ts.map
|