@itwin/core-quantity 4.0.0-dev.8 → 4.0.0-dev.80

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +43 -1
  2. package/lib/cjs/Constants.d.ts +27 -27
  3. package/lib/cjs/Constants.js +52 -52
  4. package/lib/cjs/Constants.js.map +1 -1
  5. package/lib/cjs/Exception.d.ts +26 -26
  6. package/lib/cjs/Exception.js +38 -38
  7. package/lib/cjs/Formatter/Format.d.ts +91 -91
  8. package/lib/cjs/Formatter/Format.js +328 -329
  9. package/lib/cjs/Formatter/Format.js.map +1 -1
  10. package/lib/cjs/Formatter/FormatEnums.d.ts +133 -133
  11. package/lib/cjs/Formatter/FormatEnums.js +318 -318
  12. package/lib/cjs/Formatter/Formatter.d.ts +44 -44
  13. package/lib/cjs/Formatter/Formatter.js +371 -371
  14. package/lib/cjs/Formatter/Formatter.js.map +1 -1
  15. package/lib/cjs/Formatter/FormatterSpec.d.ts +39 -39
  16. package/lib/cjs/Formatter/FormatterSpec.js +101 -101
  17. package/lib/cjs/Formatter/Interfaces.d.ts +62 -62
  18. package/lib/cjs/Formatter/Interfaces.js +17 -17
  19. package/lib/cjs/Interfaces.d.ts +86 -86
  20. package/lib/cjs/Interfaces.d.ts.map +1 -1
  21. package/lib/cjs/Interfaces.js +9 -9
  22. package/lib/cjs/Parser.d.ts +93 -93
  23. package/lib/cjs/Parser.d.ts.map +1 -1
  24. package/lib/cjs/Parser.js +592 -592
  25. package/lib/cjs/Parser.js.map +1 -1
  26. package/lib/cjs/ParserSpec.d.ts +34 -34
  27. package/lib/cjs/ParserSpec.js +47 -47
  28. package/lib/cjs/Quantity.d.ts +27 -27
  29. package/lib/cjs/Quantity.js +46 -46
  30. package/lib/cjs/Quantity.js.map +1 -1
  31. package/lib/cjs/Unit.d.ts +25 -25
  32. package/lib/cjs/Unit.js +44 -44
  33. package/lib/cjs/core-quantity.d.ts +19 -19
  34. package/lib/cjs/core-quantity.js +39 -35
  35. package/lib/cjs/core-quantity.js.map +1 -1
  36. package/lib/esm/Constants.d.ts +27 -27
  37. package/lib/esm/Constants.js +49 -48
  38. package/lib/esm/Constants.js.map +1 -1
  39. package/lib/esm/Exception.d.ts +26 -26
  40. package/lib/esm/Exception.js +34 -34
  41. package/lib/esm/Formatter/Format.d.ts +91 -91
  42. package/lib/esm/Formatter/Format.js +323 -324
  43. package/lib/esm/Formatter/Format.js.map +1 -1
  44. package/lib/esm/Formatter/FormatEnums.d.ts +133 -133
  45. package/lib/esm/Formatter/FormatEnums.js +302 -302
  46. package/lib/esm/Formatter/Formatter.d.ts +44 -44
  47. package/lib/esm/Formatter/Formatter.js +368 -367
  48. package/lib/esm/Formatter/Formatter.js.map +1 -1
  49. package/lib/esm/Formatter/FormatterSpec.d.ts +39 -39
  50. package/lib/esm/Formatter/FormatterSpec.js +97 -97
  51. package/lib/esm/Formatter/Interfaces.d.ts +62 -62
  52. package/lib/esm/Formatter/Interfaces.js +13 -13
  53. package/lib/esm/Interfaces.d.ts +86 -86
  54. package/lib/esm/Interfaces.d.ts.map +1 -1
  55. package/lib/esm/Interfaces.js +8 -8
  56. package/lib/esm/Parser.d.ts +93 -93
  57. package/lib/esm/Parser.d.ts.map +1 -1
  58. package/lib/esm/Parser.js +589 -588
  59. package/lib/esm/Parser.js.map +1 -1
  60. package/lib/esm/ParserSpec.d.ts +34 -34
  61. package/lib/esm/ParserSpec.js +43 -43
  62. package/lib/esm/Quantity.d.ts +27 -27
  63. package/lib/esm/Quantity.js +42 -42
  64. package/lib/esm/Quantity.js.map +1 -1
  65. package/lib/esm/Unit.d.ts +25 -25
  66. package/lib/esm/Unit.js +39 -39
  67. package/lib/esm/core-quantity.d.ts +19 -19
  68. package/lib/esm/core-quantity.js +23 -23
  69. 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 Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
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
@@ -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
@@ -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
- exports.QuantityConstants = QuantityConstants;
35
- QuantityConstants.CHAR_COMMA = 44;
36
- QuantityConstants.CHAR_SPACE = 32;
37
- QuantityConstants.CHAR_NUMBER = 35;
38
- QuantityConstants.CHAR_PLUS = 43;
39
- QuantityConstants.CHAR_MINUS = 45;
40
- QuantityConstants.CHAR_PERIOD = 46;
41
- QuantityConstants.CHAR_SLASH = 47;
42
- QuantityConstants.CHAR_DIVISION_SLASH = 8725;
43
- QuantityConstants.CHAR_FRACTION_SLASH = 8260;
44
- QuantityConstants.CHAR_ONE_QUARTER = 188;
45
- QuantityConstants.CHAR_ONE_HALF = 189;
46
- QuantityConstants.CHAR_THREE_QUARTER = 190;
47
- QuantityConstants.CHAR_DIGIT_ZERO = 48;
48
- QuantityConstants.CHAR_DIGIT_NINE = 57;
49
- QuantityConstants.CHAR_UPPER_E = 69;
50
- QuantityConstants.CHAR_LOWER_E = 101;
51
- QuantityConstants._LOCALE_DECIMAL_SEPARATOR = "";
52
- QuantityConstants._LOCALE_THOUSAND_SEPARATOR = "";
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
@@ -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;;AA5CH,8CA6CC;AA5CwB,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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/** Constants used internally for both formatting and parsing.\r\n * @internal\r\n */\r\nexport class QuantityConstants {\r\n public static readonly CHAR_COMMA = 44;\r\n public static readonly CHAR_SPACE = 32;\r\n public static readonly CHAR_NUMBER = 35;\r\n public static readonly CHAR_PLUS = 43;\r\n public static readonly CHAR_MINUS = 45;\r\n public static readonly CHAR_PERIOD = 46;\r\n public static readonly CHAR_SLASH = 47;\r\n public static readonly CHAR_DIVISION_SLASH = 8725;\r\n public static readonly CHAR_FRACTION_SLASH = 8260;\r\n public static readonly CHAR_ONE_QUARTER = 188;\r\n public static readonly CHAR_ONE_HALF = 189;\r\n public static readonly CHAR_THREE_QUARTER = 190;\r\n public static readonly CHAR_DIGIT_ZERO = 48;\r\n public static readonly CHAR_DIGIT_NINE = 57;\r\n public static readonly CHAR_UPPER_E = 69;\r\n public static readonly CHAR_LOWER_E = 101;\r\n private static _LOCALE_DECIMAL_SEPARATOR = \"\";\r\n private static _LOCALE_THOUSAND_SEPARATOR = \"\";\r\n\r\n /** Return the decimal separator for the current locale. */\r\n public static get LocaleSpecificDecimalSeparator(): string {\r\n if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)\r\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\r\n\r\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = \".\";\r\n const matches = (12345.6789).toLocaleString()!.match(/345(.*)67/);\r\n if (matches && matches.length > 1)\r\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];\r\n\r\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\r\n }\r\n\r\n /** Return the thousand separator for the current locale. */\r\n public static get LocaleSpecificThousandSeparator(): string {\r\n if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)\r\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\r\n\r\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = \",\";\r\n const matches = (12345.6789).toLocaleString()!.match(/12(.*)345/);\r\n if (matches && matches.length > 0)\r\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];\r\n\r\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\r\n }\r\n}\r\n"]}
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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\n/** Constants used internally for both formatting and parsing.\r\n * @internal\r\n */\r\nexport class QuantityConstants {\r\n public static readonly CHAR_COMMA = 44;\r\n public static readonly CHAR_SPACE = 32;\r\n public static readonly CHAR_NUMBER = 35;\r\n public static readonly CHAR_PLUS = 43;\r\n public static readonly CHAR_MINUS = 45;\r\n public static readonly CHAR_PERIOD = 46;\r\n public static readonly CHAR_SLASH = 47;\r\n public static readonly CHAR_DIVISION_SLASH = 8725;\r\n public static readonly CHAR_FRACTION_SLASH = 8260;\r\n public static readonly CHAR_ONE_QUARTER = 188;\r\n public static readonly CHAR_ONE_HALF = 189;\r\n public static readonly CHAR_THREE_QUARTER = 190;\r\n public static readonly CHAR_DIGIT_ZERO = 48;\r\n public static readonly CHAR_DIGIT_NINE = 57;\r\n public static readonly CHAR_UPPER_E = 69;\r\n public static readonly CHAR_LOWER_E = 101;\r\n private static _LOCALE_DECIMAL_SEPARATOR = \"\";\r\n private static _LOCALE_THOUSAND_SEPARATOR = \"\";\r\n\r\n /** Return the decimal separator for the current locale. */\r\n public static get LocaleSpecificDecimalSeparator(): string {\r\n if (QuantityConstants._LOCALE_DECIMAL_SEPARATOR.length > 0)\r\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\r\n\r\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = \".\";\r\n const matches = (12345.6789).toLocaleString()!.match(/345(.*)67/);\r\n if (matches && matches.length > 1)\r\n QuantityConstants._LOCALE_DECIMAL_SEPARATOR = matches[1];\r\n\r\n return QuantityConstants._LOCALE_DECIMAL_SEPARATOR;\r\n }\r\n\r\n /** Return the thousand separator for the current locale. */\r\n public static get LocaleSpecificThousandSeparator(): string {\r\n if (QuantityConstants._LOCALE_THOUSAND_SEPARATOR.length > 0)\r\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\r\n\r\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = \",\";\r\n const matches = (12345.6789).toLocaleString()!.match(/12(.*)345/);\r\n if (matches && matches.length > 0)\r\n QuantityConstants._LOCALE_THOUSAND_SEPARATOR = matches[1];\r\n\r\n return QuantityConstants._LOCALE_THOUSAND_SEPARATOR;\r\n }\r\n}\r\n"]}
@@ -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
@@ -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
@@ -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