@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"}
|
|
@@ -13,11 +13,19 @@ import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
|
13
13
|
* @beta
|
|
14
14
|
*/
|
|
15
15
|
export class AngleDescription extends FormattedQuantityDescription {
|
|
16
|
-
constructor(name, displayLabel, iconSpec) {
|
|
16
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
17
17
|
const defaultName = "angle";
|
|
18
|
-
super(
|
|
18
|
+
super({
|
|
19
|
+
name: name ? name : defaultName,
|
|
20
|
+
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Angle"),
|
|
21
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.ANGLE",
|
|
22
|
+
iconSpec
|
|
23
|
+
});
|
|
19
24
|
}
|
|
20
25
|
get formatterQuantityType() { return QuantityType.Angle; }
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
28
|
+
*/
|
|
21
29
|
get quantityType() { return "Angle"; }
|
|
22
30
|
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseAngle"); }
|
|
23
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AngleDescription.js","sourceRoot":"","sources":["../../../src/properties/AngleDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,4BAA4B;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,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,4BAA4B;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,SAAS,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,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/E;;OAEG;IACH,IAAW,YAAY,KAAa,OAAO,OAAO,CAAC,CAAC,CAAC;IAErD,IAAW,UAAU,KAAa,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,wCAAwC,CAAC,CAAC,CAAC,CAAC;CAChI","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"}
|
|
@@ -15,8 +15,14 @@ import { IModelApp } from "../IModelApp";
|
|
|
15
15
|
export class FormattedQuantityDescription extends BaseQuantityDescription {
|
|
16
16
|
_formatterSpec;
|
|
17
17
|
_parserSpec;
|
|
18
|
-
constructor(
|
|
19
|
-
|
|
18
|
+
constructor(argsOrName, displayLabel, iconSpec, kindOfQuantityName) {
|
|
19
|
+
if (typeof argsOrName === "string") {
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
21
|
+
super(argsOrName, displayLabel, iconSpec, kindOfQuantityName);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
super(argsOrName.name, argsOrName.displayLabel, argsOrName.iconSpec, argsOrName.kindOfQuantityName);
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
27
|
formatValue(numberValue) {
|
|
22
28
|
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,OAAO,EAAiB,MAAM,EAAc,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAgB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FormattedQuantityDescription.js","sourceRoot":"","sources":["../../../src/properties/FormattedQuantityDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAiB,MAAM,EAAc,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAgB,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAazC;;;GAGG;AACH,MAAM,OAAgB,4BAA6B,SAAQ,uBAAuB;IACxE,cAAc,CAAiB;IAC/B,WAAW,CAAc;IAI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,qBAAqB,CAAC,CAAC;QAC9G,IAAI,aAAa,EAAE,CAAC;YAClB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;YACpC,OAAO,aAAa,CAAC;QACvB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAW,UAAU;QACnB,IAAI,IAAI,CAAC,WAAW;YAClB,OAAO,IAAI,CAAC,WAAW,CAAC;QAE1B,MAAM,UAAU,GAAG,SAAS,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACxG,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;YAC9B,OAAO,UAAU,CAAC;QACpB,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CAKF","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"}
|
|
@@ -13,11 +13,19 @@ import { FormattedQuantityDescription } from "./FormattedQuantityDescription";
|
|
|
13
13
|
* @beta
|
|
14
14
|
*/
|
|
15
15
|
export class LengthDescription extends FormattedQuantityDescription {
|
|
16
|
-
constructor(name, displayLabel, iconSpec) {
|
|
16
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
17
17
|
const defaultName = "length";
|
|
18
|
-
super(
|
|
18
|
+
super({
|
|
19
|
+
name: name ? name : defaultName,
|
|
20
|
+
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
21
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
22
|
+
iconSpec,
|
|
23
|
+
});
|
|
19
24
|
}
|
|
20
25
|
get formatterQuantityType() { return QuantityType.Length; }
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
28
|
+
*/
|
|
21
29
|
get quantityType() { return "Length"; }
|
|
22
30
|
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
23
31
|
}
|
|
@@ -26,11 +34,19 @@ export class LengthDescription extends FormattedQuantityDescription {
|
|
|
26
34
|
* @beta
|
|
27
35
|
*/
|
|
28
36
|
export class SurveyLengthDescription extends FormattedQuantityDescription {
|
|
29
|
-
constructor(name, displayLabel, iconSpec) {
|
|
37
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
30
38
|
const defaultName = "surveyLength";
|
|
31
|
-
super(
|
|
39
|
+
super({
|
|
40
|
+
name: name ? name : defaultName,
|
|
41
|
+
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
42
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
43
|
+
iconSpec,
|
|
44
|
+
});
|
|
32
45
|
}
|
|
33
46
|
get formatterQuantityType() { return QuantityType.LengthSurvey; }
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
49
|
+
*/
|
|
34
50
|
get quantityType() { return "LengthSurvey"; }
|
|
35
51
|
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
36
52
|
}
|
|
@@ -39,11 +55,19 @@ export class SurveyLengthDescription extends FormattedQuantityDescription {
|
|
|
39
55
|
* @beta
|
|
40
56
|
*/
|
|
41
57
|
export class EngineeringLengthDescription extends FormattedQuantityDescription {
|
|
42
|
-
constructor(name, displayLabel, iconSpec) {
|
|
58
|
+
constructor(name, displayLabel, iconSpec, kindOfQuantityName) {
|
|
43
59
|
const defaultName = "engineeringLength";
|
|
44
|
-
super(
|
|
60
|
+
super({
|
|
61
|
+
name: name ? name : defaultName,
|
|
62
|
+
displayLabel: displayLabel ? displayLabel : IModelApp.localization.getLocalizedString("iModelJs:Properties.Length"),
|
|
63
|
+
kindOfQuantityName: kindOfQuantityName ? kindOfQuantityName : "AecUnits.LENGTH",
|
|
64
|
+
iconSpec,
|
|
65
|
+
});
|
|
45
66
|
}
|
|
46
67
|
get formatterQuantityType() { return QuantityType.LengthEngineering; }
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated in 5.0. Use the `kindOfQuantityName` property instead.
|
|
70
|
+
*/
|
|
47
71
|
get quantityType() { return "LengthEngineering"; }
|
|
48
72
|
get parseError() { return IModelApp.localization.getLocalizedString("iModelJs:Properties.UnableToParseLength"); }
|
|
49
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LengthDescription.js","sourceRoot":"","sources":["../../../src/properties/LengthDescription.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E;;;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W,UAAU,KAAa,OAAO,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC,yCAAyC,CAAC,CAAC,CAAC,CAAC;CACjI","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,GA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I,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"}
|
|
@@ -205,6 +205,10 @@ export class QuantityFormatter {
|
|
|
205
205
|
_alternateUnitLabelsRegistry = new AlternateUnitLabelsRegistry(getDefaultAlternateUnitLabels());
|
|
206
206
|
/** Registry containing available quantity type definitions. */
|
|
207
207
|
_quantityTypeRegistry = new Map();
|
|
208
|
+
/** Registry containing available FormatterSpec and ParserSpec, mapped by keys.
|
|
209
|
+
* @beta
|
|
210
|
+
*/
|
|
211
|
+
_formatSpecsRegistry = new Map();
|
|
208
212
|
/** Active UnitSystem key - must be one of "imperial", "metric", "usCustomary", or "usSurvey". */
|
|
209
213
|
_activeUnitSystem = "imperial";
|
|
210
214
|
/** Map of FormatSpecs for all available QuantityTypes and the active Unit System */
|
|
@@ -231,6 +235,7 @@ export class QuantityFormatter {
|
|
|
231
235
|
onQuantityFormatsChanged = new BeUiEvent();
|
|
232
236
|
/** Fired when the active UnitsProvider is updated. This will allow cached Formatter and Parser specs to be updated if necessary. */
|
|
233
237
|
onUnitsProviderChanged = new BeUiEvent();
|
|
238
|
+
_removeFormatsProviderListener;
|
|
234
239
|
/**
|
|
235
240
|
* constructor
|
|
236
241
|
* @param showMetricOrUnitSystem - Pass in `true` to show Metric formatted quantity values. Defaults to Imperial. To explicitly
|
|
@@ -244,6 +249,12 @@ export class QuantityFormatter {
|
|
|
244
249
|
this._activeUnitSystem = showMetricOrUnitSystem;
|
|
245
250
|
}
|
|
246
251
|
}
|
|
252
|
+
[Symbol.dispose]() {
|
|
253
|
+
if (this._removeFormatsProviderListener) {
|
|
254
|
+
this._removeFormatsProviderListener();
|
|
255
|
+
this._removeFormatsProviderListener = undefined;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
247
258
|
getOverrideFormatPropsByQuantityType(quantityTypeKey, unitSystem) {
|
|
248
259
|
const requestedUnitSystem = unitSystem ?? this.activeUnitSystem;
|
|
249
260
|
const overrideMap = this._overrideFormatPropsByUnitSystem.get(requestedUnitSystem);
|
|
@@ -369,6 +380,46 @@ export class QuantityFormatter {
|
|
|
369
380
|
*/
|
|
370
381
|
async onInitialized() {
|
|
371
382
|
await this.initializeQuantityTypesRegistry();
|
|
383
|
+
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"]];
|
|
384
|
+
for (const entry of initialKoQs) {
|
|
385
|
+
try {
|
|
386
|
+
await this.addFormattingSpecsToRegistry(entry[0], entry[1]);
|
|
387
|
+
}
|
|
388
|
+
catch (err) {
|
|
389
|
+
Logger.logWarning(`${FrontendLoggerCategory.Package}.QuantityFormatter`, err.toString());
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
this._removeFormatsProviderListener = IModelApp.formatsProvider.onFormatsChanged.addListener(async (args) => {
|
|
393
|
+
if (args.formatsChanged === "all") {
|
|
394
|
+
for (const [name, entry] of this._formatSpecsRegistry.entries()) {
|
|
395
|
+
const formatProps = await IModelApp.formatsProvider.getFormat(name);
|
|
396
|
+
if (formatProps) {
|
|
397
|
+
const persistenceUnitName = entry.formatterSpec.persistenceUnit.name;
|
|
398
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
this._formatSpecsRegistry.delete(name); // clear the specs if format was removed, or no longer exists.
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
for (const name of args.formatsChanged) {
|
|
407
|
+
if (this._formatSpecsRegistry.has(name)) {
|
|
408
|
+
const formatProps = await IModelApp.formatsProvider.getFormat(name);
|
|
409
|
+
if (formatProps) {
|
|
410
|
+
const existingEntry = this._formatSpecsRegistry.get(name);
|
|
411
|
+
if (existingEntry) {
|
|
412
|
+
const persistenceUnitName = existingEntry.formatterSpec.persistenceUnit.name;
|
|
413
|
+
await this.addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
this._formatSpecsRegistry.delete(name);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
});
|
|
372
423
|
// initialize default format and parsing specs
|
|
373
424
|
await this.loadFormatAndParsingMapsForSystem();
|
|
374
425
|
}
|
|
@@ -734,6 +785,41 @@ export class QuantityFormatter {
|
|
|
734
785
|
const format = await Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
|
|
735
786
|
return ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
|
|
736
787
|
}
|
|
788
|
+
/**
|
|
789
|
+
* @beta
|
|
790
|
+
* Returns a [[FormattingSpecEntry]] for a given name, typically a KindOfQuantity full name.
|
|
791
|
+
*/
|
|
792
|
+
getSpecsByName(name) {
|
|
793
|
+
return this._formatSpecsRegistry.get(name);
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Populates the registry with a new FormatterSpec and ParserSpec entry for the given format name.
|
|
797
|
+
* @beta
|
|
798
|
+
* @param name The key used to identify the formatter and parser spec
|
|
799
|
+
* @param persistenceUnitName The name of the persistence unit
|
|
800
|
+
* @param formatProps If not supplied, tries to retrieve the [[FormatProps]] from [[IModelApp.formatsProvider]]
|
|
801
|
+
*/
|
|
802
|
+
async addFormattingSpecsToRegistry(name, persistenceUnitName, formatProps) {
|
|
803
|
+
if (!formatProps) {
|
|
804
|
+
formatProps = await IModelApp.formatsProvider.getFormat(name);
|
|
805
|
+
}
|
|
806
|
+
if (formatProps) {
|
|
807
|
+
const formatterSpec = await this.createFormatterSpec({
|
|
808
|
+
persistenceUnitName,
|
|
809
|
+
formatProps,
|
|
810
|
+
formatName: name,
|
|
811
|
+
});
|
|
812
|
+
const parserSpec = await this.createParserSpec({
|
|
813
|
+
persistenceUnitName,
|
|
814
|
+
formatProps,
|
|
815
|
+
formatName: name,
|
|
816
|
+
});
|
|
817
|
+
this._formatSpecsRegistry.set(name, { formatterSpec, parserSpec });
|
|
818
|
+
}
|
|
819
|
+
else {
|
|
820
|
+
throw new Error(`Unable to find format properties for ${name} with persistence unit ${persistenceUnitName}`);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
737
823
|
}
|
|
738
824
|
// ========================================================================================================================================
|
|
739
825
|
// Default Data
|