@itwin/core-frontend 5.1.0-dev.15 → 5.1.0-dev.17
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/lib/cjs/IModelApp.d.ts.map +1 -1
- package/lib/cjs/IModelApp.js +1 -0
- package/lib/cjs/IModelApp.js.map +1 -1
- package/lib/cjs/Viewport.d.ts +2 -0
- package/lib/cjs/Viewport.d.ts.map +1 -1
- package/lib/cjs/Viewport.js +4 -0
- package/lib/cjs/Viewport.js.map +1 -1
- package/lib/cjs/properties/AngleDescription.d.ts +4 -1
- package/lib/cjs/properties/AngleDescription.d.ts.map +1 -1
- package/lib/cjs/properties/AngleDescription.js +10 -2
- package/lib/cjs/properties/AngleDescription.js.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts +11 -1
- package/lib/cjs/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/cjs/properties/FormattedQuantityDescription.js +8 -2
- package/lib/cjs/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/cjs/properties/LengthDescription.d.ts +12 -3
- package/lib/cjs/properties/LengthDescription.d.ts.map +1 -1
- package/lib/cjs/properties/LengthDescription.js +30 -6
- package/lib/cjs/properties/LengthDescription.js.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts +27 -0
- package/lib/cjs/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/cjs/quantity-formatting/QuantityFormatter.js +86 -0
- package/lib/cjs/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/cjs/tools/ViewTool.d.ts +1 -2
- package/lib/cjs/tools/ViewTool.d.ts.map +1 -1
- package/lib/cjs/tools/ViewTool.js +8 -42
- package/lib/cjs/tools/ViewTool.js.map +1 -1
- package/lib/esm/IModelApp.d.ts.map +1 -1
- package/lib/esm/IModelApp.js +1 -0
- package/lib/esm/IModelApp.js.map +1 -1
- package/lib/esm/Viewport.d.ts +2 -0
- package/lib/esm/Viewport.d.ts.map +1 -1
- package/lib/esm/Viewport.js +4 -0
- package/lib/esm/Viewport.js.map +1 -1
- package/lib/esm/properties/AngleDescription.d.ts +4 -1
- package/lib/esm/properties/AngleDescription.d.ts.map +1 -1
- package/lib/esm/properties/AngleDescription.js +10 -2
- package/lib/esm/properties/AngleDescription.js.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts +11 -1
- package/lib/esm/properties/FormattedQuantityDescription.d.ts.map +1 -1
- package/lib/esm/properties/FormattedQuantityDescription.js +8 -2
- package/lib/esm/properties/FormattedQuantityDescription.js.map +1 -1
- package/lib/esm/properties/LengthDescription.d.ts +12 -3
- package/lib/esm/properties/LengthDescription.d.ts.map +1 -1
- package/lib/esm/properties/LengthDescription.js +30 -6
- package/lib/esm/properties/LengthDescription.js.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts +27 -0
- package/lib/esm/quantity-formatting/QuantityFormatter.d.ts.map +1 -1
- package/lib/esm/quantity-formatting/QuantityFormatter.js +86 -0
- package/lib/esm/quantity-formatting/QuantityFormatter.js.map +1 -1
- package/lib/esm/tools/ViewTool.d.ts +1 -2
- package/lib/esm/tools/ViewTool.d.ts.map +1 -1
- package/lib/esm/tools/ViewTool.js +8 -42
- package/lib/esm/tools/ViewTool.js.map +1 -1
- package/package.json +20 -20
|
@@ -8,8 +8,11 @@ import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
|
8
8
|
* @beta
|
|
9
9
|
*/
|
|
10
10
|
export declare class AngleDescription extends FormattedQuantityDescription {
|
|
11
|
-
constructor(name?: string, displayLabel?: string, iconSpec?: string);
|
|
11
|
+
constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string);
|
|
12
12
|
get formatterQuantityType(): QuantityType;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
15
|
+
*/
|
|
13
16
|
get quantityType(): string;
|
|
14
17
|
get parseError(): string;
|
|
15
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,4BAA4B;gBACpD,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"AngleDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,4BAA4B;gBACpD,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAUhG,IAAW,qBAAqB,IAAI,YAAY,CAA+B;IAC/E;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAAoB;IAErD,IAAW,UAAU,IAAI,MAAM,CAAgG;CAChI"}
|
|
@@ -16,11 +16,19 @@ const FormattedQuantityDescription_1 = require("./FormattedQuantityDescription")
|
|
|
16
16
|
* @beta
|
|
17
17
|
*/
|
|
18
18
|
class AngleDescription extends FormattedQuantityDescription_1.FormattedQuantityDescription {
|
|
19
|
-
constructor(name, displayLabel, iconSpec) {
|
|
19
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
20
20
|
const defaultName = "angle";
|
|
21
|
-
super(
|
|
21
|
+
super({
|
|
22
|
+
name: name ? name : defaultName,
|
|
23
|
+
displayLabel: displayLabel ? displayLabel : IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.Angle"),
|
|
24
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.ANGLE",
|
|
25
|
+
iconSpec
|
|
26
|
+
});
|
|
22
27
|
}
|
|
23
28
|
get formatterQuantityType() { return QuantityFormatter_1.QuantityType.Angle; }
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
31
|
+
*/
|
|
24
32
|
get quantityType() { return "Angle"; }
|
|
25
33
|
get parseError() { return IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseAngle"); }
|
|
26
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleDescription.js","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAAyC;AACzC,gFAAwE;AACxE,iFAA8E;AAE9E;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,2DAA4B;IAChE,YAAY,IAAa,EAAE,YAAqB,EAAE,QAAiB;
|
|
1
|
+
{"version":3,"file":"AngleDescription.js","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAAyC;AACzC,gFAAwE;AACxE,iFAA8E;AAE9E;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,2DAA4B;IAChE,YAAY,IAAa,EAAE,YAAqB,EAAE,QAAiB,EAAE,kBAA2B;QAC9F,MAAM,WAAW,GAAG,OAAO,CAAC;QAC5B,KAAK,CAAC;YACJ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW;YAC/B,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,2BAA2B,CAAC;YAClH,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,gBAAgB;YAC9E,QAAQ;SACT,CAAC,CAAA;IACJ,CAAC;IAED,IAAW,qBAAqB,KAAmB,OAAO,gCAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/E;;OAEG;IACH,IAAW,YAAY,KAAa,OAAO,OAAO,CAAC,CAAC,CAAC;IAErD,IAAW,UAAU,KAAa,OAAO,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,CAAC,CAAC,CAAC;CAChI;AAlBD,4CAkBC","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 Properties\n */\n\nimport { IModelApp } from \"../IModelApp\";\nimport { QuantityType } from \"../quantity-formatting/QuantityFormatter\";\nimport { FormattedQuantityDescription } from \"./FormattedQuantityDescription\";\n\n/**\n * Angle Property Description\n * @beta\n */\nexport class AngleDescription extends FormattedQuantityDescription {\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\n const defaultName = \"angle\";\n super({\n name: name ? name : defaultName,\n displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Angle\"),\n kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : \"AecUnits.ANGLE\",\n iconSpec\n })\n }\n\n public get formatterQuantityType(): QuantityType { return QuantityType.Angle; }\n /**\n * @deprecated in 5.0. Use the `kindOfQuantityName` property instead.\n */\n public get quantityType(): string { return \"Angle\"; }\n\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseAngle\"); }\n}\n"]}
|
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
import { FormatterSpec, ParserSpec } from "@itwin/core-quantity";
|
|
5
5
|
import { BaseQuantityDescription, ParseResults } from "@itwin/appui-abstract";
|
|
6
6
|
import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
7
|
+
/**
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export interface FormattedQuantityDescriptionArgs {
|
|
11
|
+
name: string;
|
|
12
|
+
displayLabel: string;
|
|
13
|
+
iconSpec?: string;
|
|
14
|
+
kindOfQuantityName?: string;
|
|
15
|
+
}
|
|
7
16
|
/**
|
|
8
17
|
* Base Quantity Property Description
|
|
9
18
|
* @beta
|
|
@@ -11,7 +20,8 @@ import { QuantityType } from "../quantity-formatting/QuantityFormatter";
|
|
|
11
20
|
export declare abstract class FormattedQuantityDescription extends BaseQuantityDescription {
|
|
12
21
|
private _formatterSpec?;
|
|
13
22
|
private _parserSpec?;
|
|
14
|
-
constructor(
|
|
23
|
+
constructor(args: FormattedQuantityDescriptionArgs);
|
|
24
|
+
constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string);
|
|
15
25
|
protected formatValue(numberValue: number): string;
|
|
16
26
|
protected parseString(userInput: string): ParseResults;
|
|
17
27
|
get formatterSpec(): FormatterSpec | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedQuantityDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAU,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE;;;GAGG;AACH,8BAAsB,4BAA6B,SAAQ,uBAAuB;IAChF,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,WAAW,CAAC,CAAa;gBAErB,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"FormattedQuantityDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAU,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,8BAAsB,4BAA6B,SAAQ,uBAAuB;IAChF,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,OAAO,CAAC,WAAW,CAAC,CAAa;gBAErB,IAAI,EAAE,gCAAgC;gBACtC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAS9F,SAAS,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAOlD,SAAS,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAYtD,IAAW,aAAa,IAAI,aAAa,GAAG,SAAS,CAWpD;IAED,IAAW,UAAU,IAAI,UAAU,GAAG,SAAS,CAW9C;IAED,aAAoB,qBAAqB,IAAI,YAAY,CAAC;IAE1D,aAA6B,UAAU,IAAI,MAAM,CAAC;CACnD"}
|
|
@@ -18,8 +18,14 @@ const IModelApp_1 = require("../IModelApp");
|
|
|
18
18
|
class FormattedQuantityDescription extends appui_abstract_1.BaseQuantityDescription {
|
|
19
19
|
_formatterSpec;
|
|
20
20
|
_parserSpec;
|
|
21
|
-
constructor(
|
|
22
|
-
|
|
21
|
+
constructor(argsOrName, displayLabel, iconSpec, kindOfQuantityName) {
|
|
22
|
+
if (typeof argsOrName === "string") {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
24
|
+
super(argsOrName, displayLabel, iconSpec, kindOfQuantityName);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
super(argsOrName.name, argsOrName.displayLabel, argsOrName.iconSpec, argsOrName.kindOfQuantityName);
|
|
28
|
+
}
|
|
23
29
|
}
|
|
24
30
|
formatValue(numberValue) {
|
|
25
31
|
if (this.formatterSpec) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormattedQuantityDescription.js","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAyE;AACzE,0DAA8E;AAC9E,4CAAyC;
|
|
1
|
+
{"version":3,"file":"FormattedQuantityDescription.js","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAyE;AACzE,0DAA8E;AAC9E,4CAAyC;AAazC;;;GAGG;AACH,MAAsB,4BAA6B,SAAQ,wCAAuB;IACxE,cAAc,CAAiB;IAC/B,WAAW,CAAc;IAIjC,YAAY,UAAqD,EAAE,YAAqB,EAAE,QAAiB,EAAE,kBAA2B;QACtI,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACnC,4EAA4E;YAC5E,KAAK,CAAC,UAAU,EAAE,YAAa,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;QACtG,CAAC;IACH,CA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,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CAKF;AA9DD,oEA8DC","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 Properties\n */\n\nimport { FormatterSpec, Parser, ParserSpec } from \"@itwin/core-quantity\";\nimport { BaseQuantityDescription, ParseResults } from \"@itwin/appui-abstract\";\nimport { IModelApp } from \"../IModelApp\";\nimport { QuantityType } from \"../quantity-formatting/QuantityFormatter\";\n\n/**\n * @beta\n */\nexport interface FormattedQuantityDescriptionArgs {\n name: string;\n displayLabel: string;\n iconSpec?: string;\n kindOfQuantityName?: string;\n}\n\n/**\n * Base Quantity Property Description\n * @beta\n */\nexport abstract class FormattedQuantityDescription extends BaseQuantityDescription {\n private _formatterSpec?: FormatterSpec;\n private _parserSpec?: ParserSpec;\n\n constructor(args: FormattedQuantityDescriptionArgs);\n constructor(name: string, displayLabel: string, iconSpec?: string, kindOfQuantityName?: string);\n constructor(argsOrName: FormattedQuantityDescriptionArgs | string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\n if (typeof argsOrName === \"string\") {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n super(argsOrName, displayLabel!, iconSpec, kindOfQuantityName);\n } else {\n super(argsOrName.name, argsOrName.displayLabel, argsOrName.iconSpec, argsOrName.kindOfQuantityName);\n }\n }\n protected formatValue(numberValue: number): string {\n if (this.formatterSpec) {\n return IModelApp.quantityFormatter.formatQuantity(numberValue, this.formatterSpec);\n }\n return numberValue.toFixed(2);\n }\n\n protected parseString(userInput: string): ParseResults {\n if (this.parserSpec) {\n const parseResult = IModelApp.quantityFormatter.parseToQuantityValue(userInput, this.parserSpec);\n if (Parser.isParsedQuantity(parseResult)) {\n return { value: parseResult.value };\n } else {\n return { parseError: this.parseError };\n }\n }\n return { parseError: \"no parser defined\" };\n }\n\n public get formatterSpec(): FormatterSpec | undefined {\n if (this._formatterSpec)\n return this._formatterSpec;\n\n const formatterSpec = IModelApp.quantityFormatter.findFormatterSpecByQuantityType(this.formatterQuantityType);\n if (formatterSpec) {\n this._formatterSpec = formatterSpec;\n return formatterSpec;\n }\n\n return undefined;\n }\n\n public get parserSpec(): ParserSpec | undefined {\n if (this._parserSpec)\n return this._parserSpec;\n\n const parserSpec = IModelApp.quantityFormatter.findParserSpecByQuantityType(this.formatterQuantityType);\n if (parserSpec) {\n this._parserSpec = parserSpec;\n return parserSpec;\n }\n\n return undefined;\n }\n\n public abstract get formatterQuantityType(): QuantityType;\n\n public abstract override get parseError(): string;\n}\n"]}
|
|
@@ -8,8 +8,11 @@ import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
|
8
8
|
* @beta
|
|
9
9
|
*/
|
|
10
10
|
export declare class LengthDescription extends FormattedQuantityDescription {
|
|
11
|
-
constructor(name?: string, displayLabel?: string, iconSpec?: string);
|
|
11
|
+
constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string);
|
|
12
12
|
get formatterQuantityType(): QuantityType;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
15
|
+
*/
|
|
13
16
|
get quantityType(): string;
|
|
14
17
|
get parseError(): string;
|
|
15
18
|
}
|
|
@@ -18,8 +21,11 @@ export declare class LengthDescription extends FormattedQuantityDescription {
|
|
|
18
21
|
* @beta
|
|
19
22
|
*/
|
|
20
23
|
export declare class SurveyLengthDescription extends FormattedQuantityDescription {
|
|
21
|
-
constructor(name?: string, displayLabel?: string, iconSpec?: string);
|
|
24
|
+
constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string);
|
|
22
25
|
get formatterQuantityType(): QuantityType;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
28
|
+
*/
|
|
23
29
|
get quantityType(): string;
|
|
24
30
|
get parseError(): string;
|
|
25
31
|
}
|
|
@@ -28,8 +34,11 @@ export declare class SurveyLengthDescription extends FormattedQuantityDescriptio
|
|
|
28
34
|
* @beta
|
|
29
35
|
*/
|
|
30
36
|
export declare class EngineeringLengthDescription extends FormattedQuantityDescription {
|
|
31
|
-
constructor(name?: string, displayLabel?: string, iconSpec?: string);
|
|
37
|
+
constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string);
|
|
32
38
|
get formatterQuantityType(): QuantityType;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
41
|
+
*/
|
|
33
42
|
get quantityType(): string;
|
|
34
43
|
get parseError(): string;
|
|
35
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LengthDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,4BAA4B;gBACrD,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"LengthDescription.d.ts","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,4BAA4B;gBACrD,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAUhG,IAAW,qBAAqB,IAAI,YAAY,CAAgC;IAChF;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAAqB;IAEtD,IAAW,UAAU,IAAI,MAAM,CAAiG;CACjI;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,4BAA4B;gBAC3D,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAUhG,IAAW,qBAAqB,IAAI,YAAY,CAAsC;IACtF;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAA2B;IAE5D,IAAW,UAAU,IAAI,MAAM,CAAiG;CACjI;AAED;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,4BAA4B;gBAEhE,IAAI,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM;IAUhG,IAAW,qBAAqB,IAAI,YAAY,CAA2C;IAC3F;;OAEG;IACH,IAAW,YAAY,IAAI,MAAM,CAAgC;IAEjE,IAAW,UAAU,IAAI,MAAM,CAAiG;CACjI"}
|
|
@@ -16,11 +16,19 @@ const FormattedQuantityDescription_1 = require("./FormattedQuantityDescription")
|
|
|
16
16
|
* @beta
|
|
17
17
|
*/
|
|
18
18
|
class LengthDescription extends FormattedQuantityDescription_1.FormattedQuantityDescription {
|
|
19
|
-
constructor(name, displayLabel, iconSpec) {
|
|
19
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
20
20
|
const defaultName = "length";
|
|
21
|
-
super(
|
|
21
|
+
super({
|
|
22
|
+
name: name ? name : defaultName,
|
|
23
|
+
displayLabel: displayLabel ? displayLabel : IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
24
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
25
|
+
iconSpec,
|
|
26
|
+
});
|
|
22
27
|
}
|
|
23
28
|
get formatterQuantityType() { return QuantityFormatter_1.QuantityType.Length; }
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
31
|
+
*/
|
|
24
32
|
get quantityType() { return "Length"; }
|
|
25
33
|
get parseError() { return IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
26
34
|
}
|
|
@@ -30,11 +38,19 @@ exports.LengthDescription = LengthDescription;
|
|
|
30
38
|
* @beta
|
|
31
39
|
*/
|
|
32
40
|
class SurveyLengthDescription extends FormattedQuantityDescription_1.FormattedQuantityDescription {
|
|
33
|
-
constructor(name, displayLabel, iconSpec) {
|
|
41
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
34
42
|
const defaultName = "surveyLength";
|
|
35
|
-
super(
|
|
43
|
+
super({
|
|
44
|
+
name: name ? name : defaultName,
|
|
45
|
+
displayLabel: displayLabel ? displayLabel : IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
46
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
47
|
+
iconSpec,
|
|
48
|
+
});
|
|
36
49
|
}
|
|
37
50
|
get formatterQuantityType() { return QuantityFormatter_1.QuantityType.LengthSurvey; }
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
53
|
+
*/
|
|
38
54
|
get quantityType() { return "LengthSurvey"; }
|
|
39
55
|
get parseError() { return IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
40
56
|
}
|
|
@@ -44,11 +60,19 @@ exports.SurveyLengthDescription = SurveyLengthDescription;
|
|
|
44
60
|
* @beta
|
|
45
61
|
*/
|
|
46
62
|
class EngineeringLengthDescription extends FormattedQuantityDescription_1.FormattedQuantityDescription {
|
|
47
|
-
constructor(name, displayLabel, iconSpec) {
|
|
63
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
48
64
|
const defaultName = "engineeringLength";
|
|
49
|
-
super(
|
|
65
|
+
super({
|
|
66
|
+
name: name ? name : defaultName,
|
|
67
|
+
displayLabel: displayLabel ? displayLabel : IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
68
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
69
|
+
iconSpec,
|
|
70
|
+
});
|
|
50
71
|
}
|
|
51
72
|
get formatterQuantityType() { return QuantityFormatter_1.QuantityType.LengthEngineering; }
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
75
|
+
*/
|
|
52
76
|
get quantityType() { return "LengthEngineering"; }
|
|
53
77
|
get parseError() { return IModelApp_1.IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
54
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LengthDescription.js","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAAyC;AACzC,gFAAwE;AACxE,iFAA8E;AAE9E;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,2DAA4B;IACjE,YAAY,IAAa,EAAE,YAAqB,EAAE,QAAiB;
|
|
1
|
+
{"version":3,"file":"LengthDescription.js","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAAyC;AACzC,gFAAwE;AACxE,iFAA8E;AAE9E;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,2DAA4B;IACjE,YA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CAAC;IACtF;;OAEG;IACH,IAAW,YAAY,KAAa,OAAO,cAAc,CAAC,CAAC,CAAC;IAE5D,IAAW,UAAU,KAAa,OAAO,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,yCAAyC,CAAC,CAAC,CAAC,CAAC;CACjI;AAlBD,0DAkBC;AAED;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,2DAA4B;IAE5E,YAAY,IAAa,EAAE,YAAqB,EAAE,QAAiB,EAAE,kBAA2B;QAC9F,MAAM,WAAW,GAAG,mBAAmB,CAAC;QACxC,KAAK,CAAC;YACJ,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW;YAC/B,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,4BAA4B,CAAC;YACnH,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB;YAC/E,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,IAAW,qBAAqB,KAAmB,OAAO,gCAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC3F;;OAEG;IACH,IAAW,YAAY,KAAa,OAAO,mBAAmB,CAAC,CAAC,CAAC;IAEjE,IAAW,UAAU,KAAa,OAAO,qBAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,yCAAyC,CAAC,CAAC,CAAC,CAAC;CACjI;AAnBD,oEAmBC","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 Properties\n */\n\nimport { IModelApp } from \"../IModelApp\";\nimport { QuantityType } from \"../quantity-formatting/QuantityFormatter\";\nimport { FormattedQuantityDescription } from \"./FormattedQuantityDescription\";\n\n/**\n * Length Property Description\n * @beta\n */\nexport class LengthDescription extends FormattedQuantityDescription {\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\n const defaultName = \"length\";\n super({\n name: name ? name : defaultName,\n displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Length\"),\n kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : \"AecUnits.LENGTH\",\n iconSpec,\n });\n }\n\n public get formatterQuantityType(): QuantityType { return QuantityType.Length; }\n /**\n * @deprecated in 5.0. Use the `kindOfQuantityName` property instead.\n */\n public get quantityType(): string { return \"Length\"; }\n\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseLength\"); }\n}\n\n/**\n * Survey Length Property Description\n * @beta\n */\nexport class SurveyLengthDescription extends FormattedQuantityDescription {\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\n const defaultName = \"surveyLength\";\n super({\n name: name ? name : defaultName,\n displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Length\"),\n kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : \"AecUnits.LENGTH\",\n iconSpec,\n });\n }\n\n public get formatterQuantityType(): QuantityType { return QuantityType.LengthSurvey; }\n /**\n * @deprecated in 5.0. Use the `kindOfQuantityName` property instead.\n */\n public get quantityType(): string { return \"LengthSurvey\"; }\n\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseLength\"); }\n}\n\n/**\n * Engineering Length Property Description\n * @beta\n */\nexport class EngineeringLengthDescription extends FormattedQuantityDescription {\n\n constructor(name?: string, displayLabel?: string, iconSpec?: string, kindOfQuantityName?: string) {\n const defaultName = \"engineeringLength\";\n super({\n name: name ? name : defaultName,\n displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString(\"iModelJs:Properties.Length\"),\n kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : \"AecUnits.LENGTH\",\n iconSpec,\n });\n }\n\n public get formatterQuantityType(): QuantityType { return QuantityType.LengthEngineering; }\n /**\n * @deprecated in 5.0. Use the `kindOfQuantityName` property instead.\n */\n public get quantityType(): string { return \"LengthEngineering\"; }\n\n public get parseError(): string { return IModelApp.localization.getLocalizedString(\"iModelJs:Properties.UnableToParseLength\"); }\n}\n"]}
|
|
@@ -128,6 +128,14 @@ export interface OverrideFormatEntry {
|
|
|
128
128
|
/** Override format for "usSurvey" unit system */
|
|
129
129
|
usSurvey?: FormatProps;
|
|
130
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Entries returned when looking up specs from the [[QuantityFormatter._formatSpecsRegistry]]
|
|
133
|
+
* @beta
|
|
134
|
+
*/
|
|
135
|
+
export interface FormattingSpecEntry {
|
|
136
|
+
formatterSpec: FormatterSpec;
|
|
137
|
+
parserSpec: ParserSpec;
|
|
138
|
+
}
|
|
131
139
|
/** Interface that defines the functions required to be implemented to provide custom formatting and parsing of a custom quantity type.
|
|
132
140
|
* @public
|
|
133
141
|
*/
|
|
@@ -234,6 +242,10 @@ export declare class QuantityFormatter implements UnitsProvider {
|
|
|
234
242
|
private _alternateUnitLabelsRegistry;
|
|
235
243
|
/** Registry containing available quantity type definitions. */
|
|
236
244
|
protected _quantityTypeRegistry: Map<QuantityTypeKey, QuantityTypeDefinition>;
|
|
245
|
+
/** Registry containing available FormatterSpec and ParserSpec, mapped by keys.
|
|
246
|
+
* @beta
|
|
247
|
+
*/
|
|
248
|
+
protected _formatSpecsRegistry: Map<string, FormattingSpecEntry>;
|
|
237
249
|
/** Active UnitSystem key - must be one of "imperial", "metric", "usCustomary", or "usSurvey". */
|
|
238
250
|
protected _activeUnitSystem: UnitSystemKey;
|
|
239
251
|
/** Map of FormatSpecs for all available QuantityTypes and the active Unit System */
|
|
@@ -256,12 +268,14 @@ export declare class QuantityFormatter implements UnitsProvider {
|
|
|
256
268
|
readonly onQuantityFormatsChanged: BeUiEvent<QuantityFormatsChangedArgs>;
|
|
257
269
|
/** Fired when the active UnitsProvider is updated. This will allow cached Formatter and Parser specs to be updated if necessary. */
|
|
258
270
|
readonly onUnitsProviderChanged: BeUiEvent<void>;
|
|
271
|
+
private _removeFormatsProviderListener?;
|
|
259
272
|
/**
|
|
260
273
|
* constructor
|
|
261
274
|
* @param showMetricOrUnitSystem - Pass in `true` to show Metric formatted quantity values. Defaults to Imperial. To explicitly
|
|
262
275
|
* set it to a specific unit system pass a UnitSystemKey.
|
|
263
276
|
*/
|
|
264
277
|
constructor(showMetricOrUnitSystem?: boolean | UnitSystemKey);
|
|
278
|
+
[Symbol.dispose](): void;
|
|
265
279
|
private getOverrideFormatPropsByQuantityType;
|
|
266
280
|
/** Method used to register all QuantityTypes defined in QuantityType enum. */
|
|
267
281
|
protected initializeQuantityTypesRegistry(): Promise<void>;
|
|
@@ -414,5 +428,18 @@ export declare class QuantityFormatter implements UnitsProvider {
|
|
|
414
428
|
* @param props - A [[CreateFormattingSpecProps]] object.
|
|
415
429
|
*/
|
|
416
430
|
createParserSpec(props: CreateFormattingSpecProps): Promise<ParserSpec>;
|
|
431
|
+
/**
|
|
432
|
+
* @beta
|
|
433
|
+
* Returns a [[FormattingSpecEntry]] for a given name, typically a KindOfQuantity full name.
|
|
434
|
+
*/
|
|
435
|
+
getSpecsByName(name: string): FormattingSpecEntry | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
|
|
438
|
+
* @beta
|
|
439
|
+
* @param name The key used to identify the formatter and parser spec
|
|
440
|
+
* @param persistenceUnitName The name of the persistence unit
|
|
441
|
+
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
|
|
442
|
+
*/
|
|
443
|
+
addFormattingSpecsToRegistry(name: string, persistenceUnitName: string, formatProps?: FormatProps): Promise<void>;
|
|
417
444
|
}
|
|
418
445
|
//# sourceMappingURL=QuantityFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuantityFormatter.d.ts","sourceRoot":"","sources":["../../../src/quantity-formatting/QuantityFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAgB,SAAS,EAAU,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EACL,2BAA2B,EAAU,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,aAAa,EAAc,UAAU,EAAE,mBAAmB,EACnK,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAC7D,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE;;;GAGG;AACH,oBAAY,YAAY;IACtB,6HAA6H;IAC7H,MAAM,IAAI;IACV,8IAA8I;IAC9I,KAAK,IAAI;IACT,wIAAwI;IACxI,IAAI,IAAI;IACR,8IAA8I;IAC9I,MAAM,IAAI;IACV,4JAA4J;IAC5J,OAAO,IAAI;IACX,yIAAyI;IACzI,UAAU,IAAI;IACd,wIAAwI;IACxI,UAAU,IAAI;IACd,kJAAkJ;IAClJ,YAAY,IAAI;IAChB,gJAAgJ;IAChJ,iBAAiB,IAAI;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,MAAM,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,WAAW,EAAE,WAAW,CAAC;IACzB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,qBAAa,2BAA4B,YAAW,2BAA2B;IAC7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,CAAC,IAAI,EAAE,eAAe,EAAE,yBAAyB,CAAC,EAAE,OAAO,GAAG,OAAO;IAiB7F;;OAEG;IACI,4BAA4B,CAAC,YAAY,EAAE,eAAe,EAAE,eAAe,CAAC,EAAE,aAAa,EAAE,eAAe,CAAC,EAAE,OAAO;IAQ7H,iDAAiD;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI3H,0EAA0E;IAC7D,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAIvE,gDAAgD;IACnC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIjE,kGAAkG;IACrF,aAAa,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIhG;;;;OAIG;IACU,mBAAmB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO1F;;;;OAIG;IACU,gBAAgB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,UAAU,CAAC;IAOpF;;;OAGG;IACI,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAIlE;;;;;;KAMC;IACU,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAoB/H"}
|
|
@@ -213,6 +213,10 @@ class QuantityFormatter {
|
|
|
213
213
|
_alternateUnitLabelsRegistry = new AlternateUnitLabelsRegistry((0, BasicUnitsProvider_1.getDefaultAlternateUnitLabels)());
|
|
214
214
|
/** Registry containing available quantity type definitions. */
|
|
215
215
|
_quantityTypeRegistry = new Map();
|
|
216
|
+
/** Registry containing available FormatterSpec and ParserSpec, mapped by keys.
|
|
217
|
+
* @beta
|
|
218
|
+
*/
|
|
219
|
+
_formatSpecsRegistry = new Map();
|
|
216
220
|
/** Active UnitSystem key - must be one of "imperial", "metric", "usCustomary", or "usSurvey". */
|
|
217
221
|
_activeUnitSystem = "imperial";
|
|
218
222
|
/** Map of FormatSpecs for all available QuantityTypes and the active Unit System */
|
|
@@ -239,6 +243,7 @@ class QuantityFormatter {
|
|
|
239
243
|
onQuantityFormatsChanged = new core_bentley_1.BeUiEvent();
|
|
240
244
|
/** Fired when the active UnitsProvider is updated. This will allow cached Formatter and Parser specs to be updated if necessary. */
|
|
241
245
|
onUnitsProviderChanged = new core_bentley_1.BeUiEvent();
|
|
246
|
+
_removeFormatsProviderListener;
|
|
242
247
|
/**
|
|
243
248
|
* constructor
|
|
244
249
|
* @param showMetricOrUnitSystem - Pass in `true` to show Metric formatted quantity values. Defaults to Imperial. To explicitly
|
|
@@ -252,6 +257,12 @@ class QuantityFormatter {
|
|
|
252
257
|
this._activeUnitSystem = showMetricOrUnitSystem;
|
|
253
258
|
}
|
|
254
259
|
}
|
|
260
|
+
[Symbol.dispose]() {
|
|
261
|
+
if (this._removeFormatsProviderListener) {
|
|
262
|
+
this._removeFormatsProviderListener();
|
|
263
|
+
this._removeFormatsProviderListener = undefined;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
255
266
|
getOverrideFormatPropsByQuantityType(quantityTypeKey, unitSystem) {
|
|
256
267
|
const requestedUnitSystem = unitSystem ?? this.activeUnitSystem;
|
|
257
268
|
const overrideMap = this._overrideFormatPropsByUnitSystem.get(requestedUnitSystem);
|
|
@@ -377,6 +388,46 @@ class QuantityFormatter {
|
|
|
377
388
|
*/
|
|
378
389
|
async onInitialized() {
|
|
379
390
|
await this.initializeQuantityTypesRegistry();
|
|
391
|
+
const initialKoQs = [["AecUnits.LENGTH", "Units.M"], ["AecUnits.ANGLE", "Units.RAD"], ["AecUnits.AREA", "Units.SQ_M"], ["AecUnits.VOLUME", "Units.CUB_M"], ["RoadRailUnits.STATION", "Units.M"], ["RoadRailUnits.LENGTH", "Units.M"]];
|
|
392
|
+
for (const entry of initialKoQs) {
|
|
393
|
+
try {
|
|
394
|
+
await this.addFormattingSpecsToRegistry(entry[0], entry[1]);
|
|
395
|
+
}
|
|
396
|
+
catch (err) {
|
|
397
|
+
core_bentley_1.Logger.logWarning(`${FrontendLoggerCategory_1.FrontendLoggerCategory.Package}.QuantityFormatter`, err.toString());
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
this._removeFormatsProviderListener = IModelApp_1.IModelApp.formatsProvider.onFormatsChanged.addListener(async (args) => {
|
|
401
|
+
if (args.formatsChanged === "all") {
|
|
402
|
+
for (const [name, entry] of this._formatSpecsRegistry.entries()) {
|
|
403
|
+
const formatProps = await IModelApp_1.IModelApp.formatsProvider.getFormat(name);
|
|
404
|
+
if (formatProps) {
|
|
405
|
+
const persistenceUnitName = entry.formatterSpec.persistenceUnit.name;
|
|
406
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
this._formatSpecsRegistry.delete(name); // clear the specs if format was removed, or no longer exists.
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
for (const name of args.formatsChanged) {
|
|
415
|
+
if (this._formatSpecsRegistry.has(name)) {
|
|
416
|
+
const formatProps = await IModelApp_1.IModelApp.formatsProvider.getFormat(name);
|
|
417
|
+
if (formatProps) {
|
|
418
|
+
const existingEntry = this._formatSpecsRegistry.get(name);
|
|
419
|
+
if (existingEntry) {
|
|
420
|
+
const persistenceUnitName = existingEntry.formatterSpec.persistenceUnit.name;
|
|
421
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
this._formatSpecsRegistry.delete(name);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
});
|
|
380
431
|
// initialize default format and parsing specs
|
|
381
432
|
await this.loadFormatAndParsingMapsForSystem();
|
|
382
433
|
}
|
|
@@ -742,6 +793,41 @@ class QuantityFormatter {
|
|
|
742
793
|
const format = await core_quantity_1.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
|
|
743
794
|
return core_quantity_1.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
|
|
744
795
|
}
|
|
796
|
+
/**
|
|
797
|
+
* @beta
|
|
798
|
+
* Returns a [[FormattingSpecEntry]] for a given name, typically a KindOfQuantity full name.
|
|
799
|
+
*/
|
|
800
|
+
getSpecsByName(name) {
|
|
801
|
+
return this._formatSpecsRegistry.get(name);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
|
|
805
|
+
* @beta
|
|
806
|
+
* @param name The key used to identify the formatter and parser spec
|
|
807
|
+
* @param persistenceUnitName The name of the persistence unit
|
|
808
|
+
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
|
|
809
|
+
*/
|
|
810
|
+
async addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps) {
|
|
811
|
+
if (!formatProps) {
|
|
812
|
+
formatProps = await IModelApp_1.IModelApp.formatsProvider.getFormat(name);
|
|
813
|
+
}
|
|
814
|
+
if (formatProps) {
|
|
815
|
+
const formatterSpec = await this.createFormatterSpec({
|
|
816
|
+
persistenceUnitName,
|
|
817
|
+
formatProps,
|
|
818
|
+
formatName: name,
|
|
819
|
+
});
|
|
820
|
+
const parserSpec = await this.createParserSpec({
|
|
821
|
+
persistenceUnitName,
|
|
822
|
+
formatProps,
|
|
823
|
+
formatName: name,
|
|
824
|
+
});
|
|
825
|
+
this._formatSpecsRegistry.set(name, { formatterSpec, parserSpec });
|
|
826
|
+
}
|
|
827
|
+
else {
|
|
828
|
+
throw new Error(`Unable to find format properties for ${name} with persistence unit ${persistenceUnitName}`);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
745
831
|
}
|
|
746
832
|
exports.QuantityFormatter = QuantityFormatter;
|
|
747
833
|
// ========================================================================================================================================
|