@itwin/presentation-common 5.3.0-dev.23 → 5.3.0-dev.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +35 -6
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +16 -9
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common-internal.d.ts +0 -1
- package/lib/cjs/presentation-common-internal.d.ts.map +1 -1
- package/lib/cjs/presentation-common-internal.js +1 -4
- package/lib/cjs/presentation-common-internal.js.map +1 -1
- package/lib/cjs/presentation-common.d.ts +1 -0
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +3 -1
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +35 -6
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +13 -7
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common-internal.d.ts +0 -1
- package/lib/esm/presentation-common-internal.d.ts.map +1 -1
- package/lib/esm/presentation-common-internal.js +0 -1
- package/lib/esm/presentation-common-internal.js.map +1 -1
- package/lib/esm/presentation-common.d.ts +1 -0
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +1 -0
- package/lib/esm/presentation-common.js.map +1 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/presentation-common
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 24 Oct 2025 16:22:32 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.2.4
|
|
6
|
+
Fri, 24 Oct 2025 16:20:38 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 5.2.3
|
|
6
11
|
Thu, 16 Oct 2025 23:00:32 GMT
|
|
@@ -2,14 +2,43 @@
|
|
|
2
2
|
* @module Content
|
|
3
3
|
*/
|
|
4
4
|
import { UnitSystemKey } from "@itwin/core-quantity";
|
|
5
|
-
import {
|
|
5
|
+
import { FormatOptions } from "../KoqPropertyValueFormatter.js";
|
|
6
6
|
import { Content } from "./Content.js";
|
|
7
7
|
import { Descriptor } from "./Descriptor.js";
|
|
8
8
|
import { Field } from "./Fields.js";
|
|
9
9
|
import { Item } from "./Item.js";
|
|
10
10
|
import { DisplayValue, Value } from "./Value.js";
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* An interface for something that can format `Content` and its `Item`s.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
interface ContentFormatter {
|
|
16
|
+
/** Format content in place and return it. */
|
|
17
|
+
formatContent(content: Content): Promise<Content>;
|
|
18
|
+
/** Format content `Item`s in place and return them. */
|
|
19
|
+
formatContentItems(items: Item[], descriptor: Descriptor): Promise<Item[]>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Props for `createContentFormatter`.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
interface ContentFormatterProps {
|
|
26
|
+
/**
|
|
27
|
+
* An interface for something that knows how to format a single numeric value using
|
|
28
|
+
* a given kind-of-quantity (contained within the options object argument).
|
|
29
|
+
*/
|
|
30
|
+
propertyValueFormatter: {
|
|
31
|
+
format(value: number, options: FormatOptions): Promise<string | undefined>;
|
|
32
|
+
};
|
|
33
|
+
/** An optional unit system to format content in. */
|
|
34
|
+
unitSystem?: UnitSystemKey;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare function createContentFormatter(props: ContentFormatterProps): ContentFormatter;
|
|
41
|
+
export declare class ContentFormatterImpl implements ContentFormatter {
|
|
13
42
|
private _propertyValueFormatter;
|
|
14
43
|
private _unitSystem?;
|
|
15
44
|
constructor(_propertyValueFormatter: {
|
|
@@ -23,14 +52,14 @@ export declare class ContentFormatter {
|
|
|
23
52
|
private formatArrayItems;
|
|
24
53
|
private formatStructMembers;
|
|
25
54
|
}
|
|
26
|
-
/** @internal */
|
|
27
55
|
export declare class ContentPropertyValueFormatter {
|
|
28
|
-
private
|
|
29
|
-
constructor(
|
|
56
|
+
private _propertyValueFormatter;
|
|
57
|
+
constructor(_propertyValueFormatter: ContentFormatterProps["propertyValueFormatter"]);
|
|
30
58
|
formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue>;
|
|
31
59
|
private formatValue;
|
|
32
60
|
private formatPrimitiveValue;
|
|
33
61
|
private formatStructValue;
|
|
34
62
|
private formatArrayValue;
|
|
35
63
|
}
|
|
64
|
+
export {};
|
|
36
65
|
//# sourceMappingURL=PropertyValueFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,U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AgB;YAIhB,mBAAmB;CAclC;AAED,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,uBAAuB;gBAAvB,uBAAuB,EAAE,qBAAqB,CAAC,wBAAwB,CAAC;IAE/E,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;YAejG,WAAW;YAcX,oBAAoB;YA6CpB,iBAAiB;YAYjB,gBAAgB;CAW/B"}
|
|
@@ -7,12 +7,20 @@
|
|
|
7
7
|
* @module Content
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ContentPropertyValueFormatter = exports.
|
|
10
|
+
exports.ContentPropertyValueFormatter = exports.ContentFormatterImpl = void 0;
|
|
11
|
+
exports.createContentFormatter = createContentFormatter;
|
|
11
12
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
13
|
const Content_js_1 = require("./Content.js");
|
|
13
14
|
const Value_js_1 = require("./Value.js");
|
|
14
|
-
/**
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
function createContentFormatter(props) {
|
|
20
|
+
const propertyValueFormatter = new ContentPropertyValueFormatter(props.propertyValueFormatter);
|
|
21
|
+
return new ContentFormatterImpl(propertyValueFormatter, props.unitSystem);
|
|
22
|
+
}
|
|
23
|
+
class ContentFormatterImpl {
|
|
16
24
|
_propertyValueFormatter;
|
|
17
25
|
_unitSystem;
|
|
18
26
|
constructor(_propertyValueFormatter, _unitSystem) {
|
|
@@ -87,18 +95,17 @@ class ContentFormatter {
|
|
|
87
95
|
return displayValues;
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
|
-
exports.
|
|
91
|
-
/** @internal */
|
|
98
|
+
exports.ContentFormatterImpl = ContentFormatterImpl;
|
|
92
99
|
class ContentPropertyValueFormatter {
|
|
93
|
-
|
|
94
|
-
constructor(
|
|
95
|
-
this.
|
|
100
|
+
_propertyValueFormatter;
|
|
101
|
+
constructor(_propertyValueFormatter) {
|
|
102
|
+
this._propertyValueFormatter = _propertyValueFormatter;
|
|
96
103
|
}
|
|
97
104
|
async formatPropertyValue(field, value, unitSystem) {
|
|
98
105
|
const doubleFormatter = isFieldWithKoq(field)
|
|
99
106
|
? async (rawValue) => {
|
|
100
107
|
const koq = field.properties[0].property.kindOfQuantity;
|
|
101
|
-
const formattedValue = await this.
|
|
108
|
+
const formattedValue = await this._propertyValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });
|
|
102
109
|
if (formattedValue !== undefined) {
|
|
103
110
|
return formattedValue;
|
|
104
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAA6C;AAK7C,6CAAuC;AAIvC,yCAA+G;AAE/G,gBAAgB;AAChB,MAAa,gBAAgB;IAEjB;IACA;IAFV,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAAX,WAAW,CAAgB;IAClC,CAAC;IAEG,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7F,OAAO,IAAI,oBAAO,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,KAAa,EAAE,UAAsB;QACnE,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,MAA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,EAAE;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AApGD,sEAoGC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAYD,SAAS,cAAc,CAAC,KAAY;IAClC,OAAO,KAAK,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/H,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC","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 Content\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC.js\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\n\n/** @internal */\nexport class ContentFormatter {\n constructor(\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\n private _unitSystem?: UnitSystemKey,\n ) {}\n\n public async formatContent(content: Content) {\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\n return new Content(content.descriptor, formattedItems);\n }\n\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\n return Promise.all(\n items.map(async (item) => {\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\n return item;\n }),\n );\n }\n\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\n for (const field of fields) {\n const value = values[field.name];\n\n // format display value of merged values\n if (mergedFields.includes(field.name)) {\n displayValues[field.name] = \"@Presentation:label.varies@\";\n continue;\n }\n\n // do not add undefined value to display values\n if (value === undefined) {\n continue;\n }\n\n // format display values of nested content field\n if (field.isNestedContentField()) {\n assert(Value.isNestedContent(value));\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\n continue;\n }\n\n // format property items\n if (field.isPropertiesField()) {\n displayValues[field.name] = await this.formatPropertyValue(value, field);\n continue;\n }\n\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n }\n\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\n for (const nestedValue of nestedValues) {\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\n }\n }\n\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\n if (field.isArrayPropertiesField()) {\n assert(Value.isArray(value));\n return this.formatArrayItems(value, field);\n }\n if (field.isStructPropertiesField()) {\n assert(Value.isMap(value));\n return this.formatStructMembers(value, field);\n }\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\n }\n\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\n const displayValues: DisplayValuesMap = {};\n await Promise.all(\n field.memberFields.map(async (memberField) => {\n const memberValue = memberValues[memberField.name];\n // do not add undefined value to display values\n if (memberValue === undefined) {\n return;\n }\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, memberField);\n }),\n );\n return displayValues;\n }\n}\n\n/** @internal */\nexport class ContentPropertyValueFormatter {\n constructor(private _koqValueFormatter: KoqPropertyValueFormatter) {}\n\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\n const doubleFormatter = isFieldWithKoq(field)\n ? async (rawValue: number) => {\n const koq = field.properties[0].property.kindOfQuantity;\n const formattedValue = await this._koqValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\n if (formattedValue !== undefined) {\n return formattedValue;\n }\n return formatDouble(rawValue);\n }\n : async (rawValue: number) => formatDouble(rawValue);\n\n return this.formatValue(field, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\n if (value === undefined) {\n return \"\";\n }\n\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\n\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\n }\n if (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\n }\n}\n\nfunction formatDouble(value: number) {\n return value.toFixed(2);\n}\n\ntype FieldWithKoq = PropertiesField & {\n properties: [\n {\n property: PropertyInfo & {\n kindOfQuantity: KindOfQuantityInfo;\n };\n },\n ];\n};\n\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\n}\n\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\n}\n\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\n return isPoint2d(obj) && isNumber((obj as any).z);\n}\n\nfunction isNumber(obj: Value): obj is number {\n return !isNaN(Number(obj));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA4CH,wDAGC;AA7CD,sDAA6C;AAK7C,6CAAuC;AAIvC,yCAA+G;AA6B/G;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,KAA4B;IACjE,MAAM,sBAAsB,GAAG,IAAI,6BAA6B,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC/F,OAAO,IAAI,oBAAoB,CAAC,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;AAC5E,CAAC;AAED,MAAa,oBAAoB;IAErB;IACA;IAFV,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAAX,WAAW,CAAgB;IAClC,CAAC;IAEG,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7F,OAAO,IAAI,oBAAO,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,KAAa,EAAE,UAAsB;QACnE,OAAO,OAAO,CAAC,GAAG,CACh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AChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AApGD,sEAoGC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAYD,SAAS,cAAc,CAAC,KAAY;IAClC,OAAO,KAAK,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/H,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC","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 Content\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC.js\";\nimport { FormatOptions } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\n\n/**\n * An interface for something that can format `Content` and its `Item`s.\n * @public\n */\ninterface ContentFormatter {\n /** Format content in place and return it. */\n formatContent(content: Content): Promise<Content>;\n /** Format content `Item`s in place and return them. */\n formatContentItems(items: Item[], descriptor: Descriptor): Promise<Item[]>;\n}\n\n/**\n * Props for `createContentFormatter`.\n * @public\n */\ninterface ContentFormatterProps {\n /**\n * An interface for something that knows how to format a single numeric value using\n * a given kind-of-quantity (contained within the options object argument).\n */\n propertyValueFormatter: {\n format(value: number, options: FormatOptions): Promise<string | undefined>;\n };\n /** An optional unit system to format content in. */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.\n * @public\n */\nexport function createContentFormatter(props: ContentFormatterProps): ContentFormatter {\n const propertyValueFormatter = new ContentPropertyValueFormatter(props.propertyValueFormatter);\n return new ContentFormatterImpl(propertyValueFormatter, props.unitSystem);\n}\n\nexport class ContentFormatterImpl implements ContentFormatter {\n constructor(\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\n private _unitSystem?: UnitSystemKey,\n ) {}\n\n public async formatContent(content: Content) {\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\n return new Content(content.descriptor, formattedItems);\n }\n\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\n return Promise.all(\n items.map(async (item) => {\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\n return item;\n }),\n );\n }\n\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\n for (const field of fields) {\n const value = values[field.name];\n\n // format display value of merged values\n if (mergedFields.includes(field.name)) {\n displayValues[field.name] = \"@Presentation:label.varies@\";\n continue;\n }\n\n // do not add undefined value to display values\n if (value === undefined) {\n continue;\n }\n\n // format display values of nested content field\n if (field.isNestedContentField()) {\n assert(Value.isNestedContent(value));\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\n continue;\n }\n\n // format property items\n if (field.isPropertiesField()) {\n displayValues[field.name] = await this.formatPropertyValue(value, field);\n continue;\n }\n\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n }\n\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\n for (const nestedValue of nestedValues) {\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\n }\n }\n\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\n if (field.isArrayPropertiesField()) {\n assert(Value.isArray(value));\n return this.formatArrayItems(value, field);\n }\n if (field.isStructPropertiesField()) {\n assert(Value.isMap(value));\n return this.formatStructMembers(value, field);\n }\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\n }\n\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\n const displayValues: DisplayValuesMap = {};\n await Promise.all(\n field.memberFields.map(async (memberField) => {\n const memberValue = memberValues[memberField.name];\n // do not add undefined value to display values\n if (memberValue === undefined) {\n return;\n }\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, memberField);\n }),\n );\n return displayValues;\n }\n}\n\nexport class ContentPropertyValueFormatter {\n constructor(private _propertyValueFormatter: ContentFormatterProps[\"propertyValueFormatter\"]) {}\n\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\n const doubleFormatter = isFieldWithKoq(field)\n ? async (rawValue: number) => {\n const koq = field.properties[0].property.kindOfQuantity;\n const formattedValue = await this._propertyValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\n if (formattedValue !== undefined) {\n return formattedValue;\n }\n return formatDouble(rawValue);\n }\n : async (rawValue: number) => formatDouble(rawValue);\n\n return this.formatValue(field, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\n if (value === undefined) {\n return \"\";\n }\n\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\n\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\n }\n if (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\n }\n}\n\nfunction formatDouble(value: number) {\n return value.toFixed(2);\n}\n\ntype FieldWithKoq = PropertiesField & {\n properties: [\n {\n property: PropertyInfo & {\n kindOfQuantity: KindOfQuantityInfo;\n };\n },\n ];\n};\n\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\n}\n\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\n}\n\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\n return isPoint2d(obj) && isNumber((obj as any).z);\n}\n\nfunction isNumber(obj: Value): obj is number {\n return !isNaN(Number(obj));\n}\n"]}
|
|
@@ -4,7 +4,6 @@ export { buildElementProperties } from "./presentation-common/ElementProperties.
|
|
|
4
4
|
export { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from "./presentation-common/Utils.js";
|
|
5
5
|
export { LocalizationHelper } from "./presentation-common/LocalizationHelper.js";
|
|
6
6
|
export { isSingleElementPropertiesRequestOptions } from "./presentation-common/PresentationManagerOptions.js";
|
|
7
|
-
export { ContentFormatter, ContentPropertyValueFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
|
|
8
7
|
export { RpcRequestsHandler } from "./presentation-common/RpcRequestsHandler.js";
|
|
9
8
|
export { AsyncTasksTracker } from "./presentation-common/AsyncTasks.js";
|
|
10
9
|
//# sourceMappingURL=presentation-common-internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common-internal.d.ts","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"presentation-common-internal.d.ts","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.AsyncTasksTracker = exports.RpcRequestsHandler = exports.
|
|
7
|
+
exports.AsyncTasksTracker = exports.RpcRequestsHandler = exports.isSingleElementPropertiesRequestOptions = exports.LocalizationHelper = exports.deepReplaceNullsToUndefined = exports.createCancellableTimeoutPromise = exports.buildElementProperties = exports.compareDiagnosticsSeverities = exports.combineDiagnosticsSeverities = exports.PresentationIpcEvents = exports.PRESENTATION_IPC_CHANNEL_NAME = void 0;
|
|
8
8
|
// WARNING: This barrel file exports internal APIs only for use by `@itwin/presentation-backend` and `@itwin/presentation-frontend` packages.
|
|
9
9
|
// They should not be used outside of these packages. These APIs may be broken or removed at any time without notice.
|
|
10
10
|
var PresentationIpcInterface_js_1 = require("./presentation-common/PresentationIpcInterface.js");
|
|
@@ -22,9 +22,6 @@ var LocalizationHelper_js_1 = require("./presentation-common/LocalizationHelper.
|
|
|
22
22
|
Object.defineProperty(exports, "LocalizationHelper", { enumerable: true, get: function () { return LocalizationHelper_js_1.LocalizationHelper; } });
|
|
23
23
|
var PresentationManagerOptions_js_1 = require("./presentation-common/PresentationManagerOptions.js");
|
|
24
24
|
Object.defineProperty(exports, "isSingleElementPropertiesRequestOptions", { enumerable: true, get: function () { return PresentationManagerOptions_js_1.isSingleElementPropertiesRequestOptions; } });
|
|
25
|
-
var PropertyValueFormatter_js_1 = require("./presentation-common/content/PropertyValueFormatter.js");
|
|
26
|
-
Object.defineProperty(exports, "ContentFormatter", { enumerable: true, get: function () { return PropertyValueFormatter_js_1.ContentFormatter; } });
|
|
27
|
-
Object.defineProperty(exports, "ContentPropertyValueFormatter", { enumerable: true, get: function () { return PropertyValueFormatter_js_1.ContentPropertyValueFormatter; } });
|
|
28
25
|
var RpcRequestsHandler_js_1 = require("./presentation-common/RpcRequestsHandler.js");
|
|
29
26
|
Object.defineProperty(exports, "RpcRequestsHandler", { enumerable: true, get: function () { return RpcRequestsHandler_js_1.RpcRequestsHandler; } });
|
|
30
27
|
var AsyncTasks_js_1 = require("./presentation-common/AsyncTasks.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common-internal.js","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,6IAA6I;AAC7I,qHAAqH;AAErH,iGAAmJ;AAA1I,4IAAA,6BAA6B,OAAA;AAAE,oIAAA,qBAAqB,OAAA;AAC7D,uEAAkH;AAAzG,8HAAA,4BAA4B,OAAA;AAAE,8HAAA,4BAA4B,OAAA;AACnE,mFAAoF;AAA3E,8HAAA,sBAAsB,OAAA;AAC/B,2DAA8G;AAArG,2HAAA,+BAA+B,OAAA;AAAE,uHAAA,2BAA2B,OAAA;AACrE,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qGAA8G;AAArG,wJAAA,uCAAuC,OAAA;AAChD,
|
|
1
|
+
{"version":3,"file":"presentation-common-internal.js","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,6IAA6I;AAC7I,qHAAqH;AAErH,iGAAmJ;AAA1I,4IAAA,6BAA6B,OAAA;AAAE,oIAAA,qBAAqB,OAAA;AAC7D,uEAAkH;AAAzG,8HAAA,4BAA4B,OAAA;AAAE,8HAAA,4BAA4B,OAAA;AACnE,mFAAoF;AAA3E,8HAAA,sBAAsB,OAAA;AAC/B,2DAA8G;AAArG,2HAAA,+BAA+B,OAAA;AAAE,uHAAA,2BAA2B,OAAA;AACrE,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qGAA8G;AAArG,wJAAA,uCAAuC,OAAA;AAChD,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qEAAwE;AAA/D,kHAAA,iBAAiB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// WARNING: This barrel file exports internal APIs only for use by `@itwin/presentation-backend` and `@itwin/presentation-frontend` packages.\n// They should not be used outside of these packages. These APIs may be broken or removed at any time without notice.\n\nexport { PRESENTATION_IPC_CHANNEL_NAME, PresentationIpcEvents, PresentationIpcInterface } from \"./presentation-common/PresentationIpcInterface.js\";\nexport { combineDiagnosticsSeverities, compareDiagnosticsSeverities } from \"./presentation-common/Diagnostics.js\";\nexport { buildElementProperties } from \"./presentation-common/ElementProperties.js\";\nexport { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from \"./presentation-common/Utils.js\";\nexport { LocalizationHelper } from \"./presentation-common/LocalizationHelper.js\";\nexport { isSingleElementPropertiesRequestOptions } from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RpcRequestsHandler } from \"./presentation-common/RpcRequestsHandler.js\";\nexport { AsyncTasksTracker } from \"./presentation-common/AsyncTasks.js\";\n"]}
|
|
@@ -50,6 +50,7 @@ export { RendererDescription } from "./presentation-common/content/Renderer.js";
|
|
|
50
50
|
export { PropertyValueFormat, PrimitiveTypeDescription, ArrayTypeDescription, StructFieldMemberDescription, StructTypeDescription, TypeDescription, } from "./presentation-common/content/TypeDescription.js";
|
|
51
51
|
export { Value, ValuesMap, ValuesArray, DisplayValue, DisplayValuesMap, DisplayValuesArray, NestedContentValue, NavigationPropertyValue, DisplayValueGroup, } from "./presentation-common/content/Value.js";
|
|
52
52
|
export { FieldHierarchy, StartContentProps, ProcessFieldHierarchiesProps, StartItemProps, StartCategoryProps, StartFieldProps, StartStructProps, StartArrayProps, ProcessMergedValueProps, ProcessPrimitiveValueProps, IContentVisitor, traverseFieldHierarchy, traverseContent, traverseContentItem, createFieldHierarchies, addFieldHierarchy, combineFieldNames, parseCombinedFieldNames, } from "./presentation-common/content/ContentTraverser.js";
|
|
53
|
+
export { createContentFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
|
|
53
54
|
export { ElementProperties, ElementPropertiesCategoryItem, ElementPropertiesPrimitivePropertyItem, ElementPropertiesPrimitiveArrayPropertyItem, ElementPropertiesStructArrayPropertyItem, ElementPropertiesArrayPropertyItem, ElementPropertiesStructPropertyItem, ElementPropertiesPropertyValueType, ElementPropertiesPropertyItem, ElementPropertiesItem, } from "./presentation-common/ElementProperties.js";
|
|
54
55
|
/**
|
|
55
56
|
* @module Hierarchies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,wCAAwC,EACxC,4CAA4C,EAC5C,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,C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cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,wEAAwE,CAAC;AACvF,cAAc,oFAAoF,CAAC;AACnG,cAAc,kEAAkE,CAAC;AACjF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,+EAA+E,CAAC;AAC9F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iFAAiF,CAAC;AAChG,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC"}
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NodeKey = exports.StandardNodeTypes = exports.parseCombinedFieldNames = exports.combineFieldNames = exports.addFieldHierarchy = exports.createFieldHierarchies = exports.traverseContentItem = exports.traverseContent = exports.traverseFieldHierarchy = exports.DisplayValue = exports.Value = exports.PropertyValueFormat = exports.Property = exports.Item = exports.FieldDescriptor = exports.FieldDescriptorType = exports.NestedContentField = exports.StructPropertiesField = exports.ArrayPropertiesField = exports.PropertiesField = exports.Field = exports.DefaultContentDisplayTypes = exports.Descriptor = exports.SortDirection = exports.ContentFlags = exports.SelectClassInfo = exports.Content = exports.CategoryDescription = exports.PresentationRpcInterface = exports.KoqPropertyValueFormatter = exports.getInstancesCount = exports.DEFAULT_KEYS_BATCH_SIZE = exports.UPDATE_FULL = exports.RulesetsFactory = exports.RulesetVariable = exports.VariableValueTypes = exports.RegisteredRuleset = exports.LabelDefinition = exports.KeySet = exports.Key = exports.PresentationError = exports.PresentationStatus = exports.RelationshipPath = exports.RelatedClassInfoWithOptionalRelationship = exports.RelatedClassInfo = exports.PropertyInfo = exports.NavigationPropertyInfo = exports.InstanceKey = exports.DiagnosticsLogEntry = void 0;
|
|
17
|
+
exports.NodeKey = exports.StandardNodeTypes = exports.createContentFormatter = exports.parseCombinedFieldNames = exports.combineFieldNames = exports.addFieldHierarchy = exports.createFieldHierarchies = exports.traverseContentItem = exports.traverseContent = exports.traverseFieldHierarchy = exports.DisplayValue = exports.Value = exports.PropertyValueFormat = exports.Property = exports.Item = exports.FieldDescriptor = exports.FieldDescriptorType = exports.NestedContentField = exports.StructPropertiesField = exports.ArrayPropertiesField = exports.PropertiesField = exports.Field = exports.DefaultContentDisplayTypes = exports.Descriptor = exports.SortDirection = exports.ContentFlags = exports.SelectClassInfo = exports.Content = exports.CategoryDescription = exports.PresentationRpcInterface = exports.KoqPropertyValueFormatter = exports.getInstancesCount = exports.DEFAULT_KEYS_BATCH_SIZE = exports.UPDATE_FULL = exports.RulesetsFactory = exports.RulesetVariable = exports.VariableValueTypes = exports.RegisteredRuleset = exports.LabelDefinition = exports.KeySet = exports.Key = exports.PresentationError = exports.PresentationStatus = exports.RelationshipPath = exports.RelatedClassInfoWithOptionalRelationship = exports.RelatedClassInfo = exports.PropertyInfo = exports.NavigationPropertyInfo = exports.InstanceKey = exports.DiagnosticsLogEntry = void 0;
|
|
18
18
|
/*---------------------------------------------------------------------------------------------
|
|
19
19
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
20
20
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -107,6 +107,8 @@ Object.defineProperty(exports, "createFieldHierarchies", { enumerable: true, get
|
|
|
107
107
|
Object.defineProperty(exports, "addFieldHierarchy", { enumerable: true, get: function () { return ContentTraverser_js_1.addFieldHierarchy; } });
|
|
108
108
|
Object.defineProperty(exports, "combineFieldNames", { enumerable: true, get: function () { return ContentTraverser_js_1.combineFieldNames; } });
|
|
109
109
|
Object.defineProperty(exports, "parseCombinedFieldNames", { enumerable: true, get: function () { return ContentTraverser_js_1.parseCombinedFieldNames; } });
|
|
110
|
+
var PropertyValueFormatter_js_1 = require("./presentation-common/content/PropertyValueFormatter.js");
|
|
111
|
+
Object.defineProperty(exports, "createContentFormatter", { enumerable: true, get: function () { return PropertyValueFormatter_js_1.createContentFormatter; } });
|
|
110
112
|
var Key_js_1 = require("./presentation-common/hierarchy/Key.js");
|
|
111
113
|
Object.defineProperty(exports, "StandardNodeTypes", { enumerable: true, get: function () { return Key_js_1.StandardNodeTypes; } });
|
|
112
114
|
Object.defineProperty(exports, "NodeKey", { enumerable: true, get: function () { return Key_js_1.NodeKey; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,uEAW8C;AAD5C,qHAAA,mBAAmB,OAAA;AAErB,qDAyBqC;AAtBnC,oGAAA,WAAW,OAAA;AAMX,+GAAA,sBAAsB,OAAA;AAEtB,qGAAA,YAAY,OAAA;AAMZ,yGAAA,gBAAgB,OAAA;AAEhB,iIAAA,wCAAwC,OAAA;AAExC,yGAAA,gBAAgB,OAAA;AAKlB,2DAAuF;AAA9E,8GAAA,kBAAkB,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAC9C,6DAAgF;AAAvE,gGAAA,GAAG,OAAA;AAAoB,mGAAA,MAAM,OAAA;AACtC,+EAA+G;AAAlE,qHAAA,eAAe,OAAA;AA4B5D,mFAA+E;AAAtE,yHAAA,iBAAiB,OAAA;AAC1B,iFAamD;AAZjD,yHAAA,kBAAkB,OAAA;AASlB,sHAAA,eAAe,OAAA;AAIjB,+EAAgI;AAAvH,qHAAA,eAAe,OAAA;AACxB,6DAUyC;AATvC,wGAAA,WAAW,OAAA;AAUb,2D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E,6FAA2E;AAC3E,6GAA2F;AAC3F,wFAAsE;AACtE,wFAAsE;AACtE,iGAA+E;AAC/E,gGAA8E;AAC9E,4FAA0E;AAC1E,qGAAmF;AACnF,2FAAyE;AACzE,wHAAsG;AACtG,8GAA4F;AAC5F,qFAAmE;AACnE,8FAA4E;AAC5E,+FAA6E;AAC7E,4GAA0F;AAC1F,yGAAuF;AACvF,qHAAmG;AACnG,mGAAiF;AACjF,iHAA+F;AAC/F,gHAA8F;AAC9F,+GAA6F;AAC7F,kHAAgG;AAChG,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,+FAA6E;AAC7E,sEAAoD;AACpD,yEAAuD;AACvD,sFAAoE;AACpE,2EAAyD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,uEAW8C;AAD5C,q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,iEAAuE;AAApD,+FAAA,IAAI,OAAA;AACvB,yEAA2H;AAA1E,uGAAA,QAAQ,OAAA;AAEzD,uFAO0D;AANxD,yHAAA,mBAAmB,OAAA;AAOrB,mEAUgD;AAT9C,iGAAA,KAAK,OAAA;AAGL,wGAAA,YAAY,OAAA;AAOd,yFAmB2D;AAPzD,6HAAA,sBAAsB,OAAA;AACtB,sHAAA,eAAe,OAAA;AACf,0HAAA,mBAAmB,OAAA;AACnB,6HAAA,sBAAsB,OAAA;AACtB,wHAAA,iBAAiB,OAAA;AACjB,wHAAA,iBAAiB,OAAA;AACjB,8HAAA,uBAAuB,OAAA;AAEzB,qGAAiG;AAAxF,mIAAA,sBAAsB,OAAA;AAqB/B,iEAgBgD;AAf9C,2GAAA,iBAAiB,OAAA;AACjB,iGAAA,OAAO,OAAA;AAkBT;;;;;GAKG;AACH,kFAAkF;AAClF,yFAAuE;AACvE,kGAAgF;AAChF,mGAAiF;AACjF,iHAA+F;AAC/F,uHAAqG;AACrG,0FAAwE;AACxE,6FAA2E;AAC3E,6GAA2F;AAC3F,wFAAsE;AACtE,wFAAsE;AACtE,iGAA+E;AAC/E,gGAA8E;AAC9E,4FAA0E;AAC1E,qGAAmF;AACnF,2FAAyE;AACzE,wHAAsG;AACtG,8GAA4F;AAC5F,qFAAmE;AACnE,8FAA4E;AAC5E,+FAA6E;AAC7E,4GAA0F;AAC1F,yGAAuF;AACvF,qHAAmG;AACnG,mGAAiF;AACjF,iHAA+F;AAC/F,gHAA8F;AAC9F,+GAA6F;AAC7F,kHAAgG;AAChG,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,+FAA6E;AAC7E,sEAAoD;AACpD,yEAAuD;AACvD,sFAAoE;AACpE,2EAAyD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport { createContentFormatter } from \"./presentation-common/content/PropertyValueFormatter.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
|
|
@@ -2,14 +2,43 @@
|
|
|
2
2
|
* @module Content
|
|
3
3
|
*/
|
|
4
4
|
import { UnitSystemKey } from "@itwin/core-quantity";
|
|
5
|
-
import {
|
|
5
|
+
import { FormatOptions } from "../KoqPropertyValueFormatter.js";
|
|
6
6
|
import { Content } from "./Content.js";
|
|
7
7
|
import { Descriptor } from "./Descriptor.js";
|
|
8
8
|
import { Field } from "./Fields.js";
|
|
9
9
|
import { Item } from "./Item.js";
|
|
10
10
|
import { DisplayValue, Value } from "./Value.js";
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* An interface for something that can format `Content` and its `Item`s.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
interface ContentFormatter {
|
|
16
|
+
/** Format content in place and return it. */
|
|
17
|
+
formatContent(content: Content): Promise<Content>;
|
|
18
|
+
/** Format content `Item`s in place and return them. */
|
|
19
|
+
formatContentItems(items: Item[], descriptor: Descriptor): Promise<Item[]>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Props for `createContentFormatter`.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
interface ContentFormatterProps {
|
|
26
|
+
/**
|
|
27
|
+
* An interface for something that knows how to format a single numeric value using
|
|
28
|
+
* a given kind-of-quantity (contained within the options object argument).
|
|
29
|
+
*/
|
|
30
|
+
propertyValueFormatter: {
|
|
31
|
+
format(value: number, options: FormatOptions): Promise<string | undefined>;
|
|
32
|
+
};
|
|
33
|
+
/** An optional unit system to format content in. */
|
|
34
|
+
unitSystem?: UnitSystemKey;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare function createContentFormatter(props: ContentFormatterProps): ContentFormatter;
|
|
41
|
+
export declare class ContentFormatterImpl implements ContentFormatter {
|
|
13
42
|
private _propertyValueFormatter;
|
|
14
43
|
private _unitSystem?;
|
|
15
44
|
constructor(_propertyValueFormatter: {
|
|
@@ -23,14 +52,14 @@ export declare class ContentFormatter {
|
|
|
23
52
|
private formatArrayItems;
|
|
24
53
|
private formatStructMembers;
|
|
25
54
|
}
|
|
26
|
-
/** @internal */
|
|
27
55
|
export declare class ContentPropertyValueFormatter {
|
|
28
|
-
private
|
|
29
|
-
constructor(
|
|
56
|
+
private _propertyValueFormatter;
|
|
57
|
+
constructor(_propertyValueFormatter: ContentFormatterProps["propertyValueFormatter"]);
|
|
30
58
|
formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue>;
|
|
31
59
|
private formatValue;
|
|
32
60
|
private formatPrimitiveValue;
|
|
33
61
|
private formatStructValue;
|
|
34
62
|
private formatArrayValue;
|
|
35
63
|
}
|
|
64
|
+
export {};
|
|
36
65
|
//# sourceMappingURL=PropertyValueFormatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAwB,KAAK,EAA0C,MAAM,aAAa,CAAC;AAClG,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAwC,KAAK,EAA0B,MAAM,YAAY,CAAC;AAE/G;;;GAGG;AACH,UAAU,gBAAgB;IACxB,6CAA6C;IAC7C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,uDAAuD;IACvD,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;CAC5E;AAED;;;GAGG;AACH,UAAU,qBAAqB;IAC7B;;;OAGG;IACH,sBAAsB,EAAE;QACtB,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;KAC5E,CAAC;IACF,oDAAoD;IACpD,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,GAAG,gBAAgB,CAGrF;AAED,qBAAa,oBAAqB,YAAW,gBAAgB;IAEzD,OAAO,CAAC,uBAAuB;IAC/B,OAAO,CAAC,WAAW,CAAC;gBADZ,uBAAuB,EAAE;QAAE,mBAAmB,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;KAAE,EACnI,WAAW,CAAC,EAAE,aAAa,YAAA;IAGxB,aAAa,CAAC,OAAO,EAAE,OAAO;IAK9B,kBAAkB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,UAAU;YASvD,YAAY;YAgCZ,gCAAgC;YAMhC,mBAAmB;YAYnB,gBAAgB;YAIhB,mBAAmB;CAclC;AAED,qBAAa,6BAA6B;IAC5B,OAAO,CAAC,uBAAuB;gBAAvB,uBAAuB,EAAE,qBAAqB,CAAC,wBAAwB,CAAC;IAE/E,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;YAejG,WAAW;YAcX,oBAAoB;YA6CpB,iBAAiB;YAYjB,gBAAgB;CAW/B"}
|
|
@@ -8,8 +8,15 @@
|
|
|
8
8
|
import { assert } from "@itwin/core-bentley";
|
|
9
9
|
import { Content } from "./Content.js";
|
|
10
10
|
import { Value } from "./Value.js";
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export function createContentFormatter(props) {
|
|
16
|
+
const propertyValueFormatter = new ContentPropertyValueFormatter(props.propertyValueFormatter);
|
|
17
|
+
return new ContentFormatterImpl(propertyValueFormatter, props.unitSystem);
|
|
18
|
+
}
|
|
19
|
+
export class ContentFormatterImpl {
|
|
13
20
|
_propertyValueFormatter;
|
|
14
21
|
_unitSystem;
|
|
15
22
|
constructor(_propertyValueFormatter, _unitSystem) {
|
|
@@ -84,17 +91,16 @@ export class ContentFormatter {
|
|
|
84
91
|
return displayValues;
|
|
85
92
|
}
|
|
86
93
|
}
|
|
87
|
-
/** @internal */
|
|
88
94
|
export class ContentPropertyValueFormatter {
|
|
89
|
-
|
|
90
|
-
constructor(
|
|
91
|
-
this.
|
|
95
|
+
_propertyValueFormatter;
|
|
96
|
+
constructor(_propertyValueFormatter) {
|
|
97
|
+
this._propertyValueFormatter = _propertyValueFormatter;
|
|
92
98
|
}
|
|
93
99
|
async formatPropertyValue(field, value, unitSystem) {
|
|
94
100
|
const doubleFormatter = isFieldWithKoq(field)
|
|
95
101
|
? async (rawValue) => {
|
|
96
102
|
const koq = field.properties[0].property.kindOfQuantity;
|
|
97
|
-
const formattedValue = await this.
|
|
103
|
+
const formattedValue = await this._propertyValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });
|
|
98
104
|
if (formattedValue !== undefined) {
|
|
99
105
|
return formattedValue;
|
|
100
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAK7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,OAAO,EAAsD,KAAK,EAA0B,MAAM,YAAY,CAAC;AAE/G,gBAAgB;AAChB,MAAM,OAAO,gBAAgB;IAEjB;IACA;IAFV,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAAX,WAAW,CAAgB;IAClC,CAAC;IAEG,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7F,OAAO,IAAI,OAAO,CAAC,OAAO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CAAC;YAC1B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAYD,SAAS,cAAc,CAAC,KAAY;IAClC,OAAO,KAAK,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/H,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC","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 Content\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC.js\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\n\n/** @internal */\nexport class ContentFormatter {\n constructor(\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\n private _unitSystem?: UnitSystemKey,\n ) {}\n\n public async formatContent(content: Content) {\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\n return new Content(content.descriptor, formattedItems);\n }\n\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\n return Promise.all(\n items.map(async (item) => {\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\n return item;\n }),\n );\n }\n\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\n for (const field of fields) {\n const value = values[field.name];\n\n // format display value of merged values\n if (mergedFields.includes(field.name)) {\n displayValues[field.name] = \"@Presentation:label.varies@\";\n continue;\n }\n\n // do not add undefined value to display values\n if (value === undefined) {\n continue;\n }\n\n // format display values of nested content field\n if (field.isNestedContentField()) {\n assert(Value.isNestedContent(value));\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\n continue;\n }\n\n // format property items\n if (field.isPropertiesField()) {\n displayValues[field.name] = await this.formatPropertyValue(value, field);\n continue;\n }\n\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n }\n\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\n for (const nestedValue of nestedValues) {\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\n }\n }\n\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\n if (field.isArrayPropertiesField()) {\n assert(Value.isArray(value));\n return this.formatArrayItems(value, field);\n }\n if (field.isStructPropertiesField()) {\n assert(Value.isMap(value));\n return this.formatStructMembers(value, field);\n }\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\n }\n\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\n const displayValues: DisplayValuesMap = {};\n await Promise.all(\n field.memberFields.map(async (memberField) => {\n const memberValue = memberValues[memberField.name];\n // do not add undefined value to display values\n if (memberValue === undefined) {\n return;\n }\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, memberField);\n }),\n );\n return displayValues;\n }\n}\n\n/** @internal */\nexport class ContentPropertyValueFormatter {\n constructor(private _koqValueFormatter: KoqPropertyValueFormatter) {}\n\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\n const doubleFormatter = isFieldWithKoq(field)\n ? async (rawValue: number) => {\n const koq = field.properties[0].property.kindOfQuantity;\n const formattedValue = await this._koqValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\n if (formattedValue !== undefined) {\n return formattedValue;\n }\n return formatDouble(rawValue);\n }\n : async (rawValue: number) => formatDouble(rawValue);\n\n return this.formatValue(field, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\n if (value === undefined) {\n return \"\";\n }\n\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\n\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\n }\n if (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\n }\n}\n\nfunction formatDouble(value: number) {\n return value.toFixed(2);\n}\n\ntype FieldWithKoq = PropertiesField & {\n properties: [\n {\n property: PropertyInfo & {\n kindOfQuantity: KindOfQuantityInfo;\n };\n },\n ];\n};\n\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\n}\n\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\n}\n\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\n return isPoint2d(obj) && isNumber((obj as any).z);\n}\n\nfunction isNumber(obj: Value): obj is number {\n return !isNaN(Number(obj));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAK7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAIvC,OAAO,EAAsD,KAAK,EAA0B,MAAM,YAAY,CAAC;AA6B/G;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA4B;IACjE,MAAM,sBAAsB,GAAG,IAAI,6BAA6B,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC/F,OAAO,IAAI,oBAAoB,CAAC,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,OAAO,oBAAoB;IAErB;IACA;IAFV,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAAX,WAAW,CAAgB;IAClC,CAAC;IAEG,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAA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;QACtE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAYD,SAAS,cAAc,CAAC,KAAY;IAClC,OAAO,KAAK,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/H,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,CAAC","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 Content\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC.js\";\nimport { FormatOptions } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\n\n/**\n * An interface for something that can format `Content` and its `Item`s.\n * @public\n */\ninterface ContentFormatter {\n /** Format content in place and return it. */\n formatContent(content: Content): Promise<Content>;\n /** Format content `Item`s in place and return them. */\n formatContentItems(items: Item[], descriptor: Descriptor): Promise<Item[]>;\n}\n\n/**\n * Props for `createContentFormatter`.\n * @public\n */\ninterface ContentFormatterProps {\n /**\n * An interface for something that knows how to format a single numeric value using\n * a given kind-of-quantity (contained within the options object argument).\n */\n propertyValueFormatter: {\n format(value: number, options: FormatOptions): Promise<string | undefined>;\n };\n /** An optional unit system to format content in. */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.\n * @public\n */\nexport function createContentFormatter(props: ContentFormatterProps): ContentFormatter {\n const propertyValueFormatter = new ContentPropertyValueFormatter(props.propertyValueFormatter);\n return new ContentFormatterImpl(propertyValueFormatter, props.unitSystem);\n}\n\nexport class ContentFormatterImpl implements ContentFormatter {\n constructor(\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\n private _unitSystem?: UnitSystemKey,\n ) {}\n\n public async formatContent(content: Content) {\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\n return new Content(content.descriptor, formattedItems);\n }\n\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\n return Promise.all(\n items.map(async (item) => {\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\n return item;\n }),\n );\n }\n\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\n for (const field of fields) {\n const value = values[field.name];\n\n // format display value of merged values\n if (mergedFields.includes(field.name)) {\n displayValues[field.name] = \"@Presentation:label.varies@\";\n continue;\n }\n\n // do not add undefined value to display values\n if (value === undefined) {\n continue;\n }\n\n // format display values of nested content field\n if (field.isNestedContentField()) {\n assert(Value.isNestedContent(value));\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\n continue;\n }\n\n // format property items\n if (field.isPropertiesField()) {\n displayValues[field.name] = await this.formatPropertyValue(value, field);\n continue;\n }\n\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n }\n\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\n for (const nestedValue of nestedValues) {\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\n }\n }\n\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\n if (field.isArrayPropertiesField()) {\n assert(Value.isArray(value));\n return this.formatArrayItems(value, field);\n }\n if (field.isStructPropertiesField()) {\n assert(Value.isMap(value));\n return this.formatStructMembers(value, field);\n }\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\n }\n\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\n const displayValues: DisplayValuesMap = {};\n await Promise.all(\n field.memberFields.map(async (memberField) => {\n const memberValue = memberValues[memberField.name];\n // do not add undefined value to display values\n if (memberValue === undefined) {\n return;\n }\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, memberField);\n }),\n );\n return displayValues;\n }\n}\n\nexport class ContentPropertyValueFormatter {\n constructor(private _propertyValueFormatter: ContentFormatterProps[\"propertyValueFormatter\"]) {}\n\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\n const doubleFormatter = isFieldWithKoq(field)\n ? async (rawValue: number) => {\n const koq = field.properties[0].property.kindOfQuantity;\n const formattedValue = await this._propertyValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\n if (formattedValue !== undefined) {\n return formattedValue;\n }\n return formatDouble(rawValue);\n }\n : async (rawValue: number) => formatDouble(rawValue);\n\n return this.formatValue(field, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\n if (value === undefined) {\n return \"\";\n }\n\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\n\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\n }\n if (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\n }\n}\n\nfunction formatDouble(value: number) {\n return value.toFixed(2);\n}\n\ntype FieldWithKoq = PropertiesField & {\n properties: [\n {\n property: PropertyInfo & {\n kindOfQuantity: KindOfQuantityInfo;\n };\n },\n ];\n};\n\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\n}\n\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\n}\n\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\n return isPoint2d(obj) && isNumber((obj as any).z);\n}\n\nfunction isNumber(obj: Value): obj is number {\n return !isNaN(Number(obj));\n}\n"]}
|
|
@@ -4,7 +4,6 @@ export { buildElementProperties } from "./presentation-common/ElementProperties.
|
|
|
4
4
|
export { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from "./presentation-common/Utils.js";
|
|
5
5
|
export { LocalizationHelper } from "./presentation-common/LocalizationHelper.js";
|
|
6
6
|
export { isSingleElementPropertiesRequestOptions } from "./presentation-common/PresentationManagerOptions.js";
|
|
7
|
-
export { ContentFormatter, ContentPropertyValueFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
|
|
8
7
|
export { RpcRequestsHandler } from "./presentation-common/RpcRequestsHandler.js";
|
|
9
8
|
export { AsyncTasksTracker } from "./presentation-common/AsyncTasks.js";
|
|
10
9
|
//# sourceMappingURL=presentation-common-internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common-internal.d.ts","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"presentation-common-internal.d.ts","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -10,7 +10,6 @@ export { buildElementProperties } from "./presentation-common/ElementProperties.
|
|
|
10
10
|
export { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from "./presentation-common/Utils.js";
|
|
11
11
|
export { LocalizationHelper } from "./presentation-common/LocalizationHelper.js";
|
|
12
12
|
export { isSingleElementPropertiesRequestOptions } from "./presentation-common/PresentationManagerOptions.js";
|
|
13
|
-
export { ContentFormatter, ContentPropertyValueFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
|
|
14
13
|
export { RpcRequestsHandler } from "./presentation-common/RpcRequestsHandler.js";
|
|
15
14
|
export { AsyncTasksTracker } from "./presentation-common/AsyncTasks.js";
|
|
16
15
|
//# sourceMappingURL=presentation-common-internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common-internal.js","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,6IAA6I;AAC7I,qHAAqH;AAErH,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAA4B,MAAM,mDAAmD,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"presentation-common-internal.js","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,6IAA6I;AAC7I,qHAAqH;AAErH,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAA4B,MAAM,mDAAmD,CAAC;AACnJ,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,uCAAuC,EAAE,MAAM,qDAAqD,CAAC;AAC9G,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n// WARNING: This barrel file exports internal APIs only for use by `@itwin/presentation-backend` and `@itwin/presentation-frontend` packages.\n// They should not be used outside of these packages. These APIs may be broken or removed at any time without notice.\n\nexport { PRESENTATION_IPC_CHANNEL_NAME, PresentationIpcEvents, PresentationIpcInterface } from \"./presentation-common/PresentationIpcInterface.js\";\nexport { combineDiagnosticsSeverities, compareDiagnosticsSeverities } from \"./presentation-common/Diagnostics.js\";\nexport { buildElementProperties } from \"./presentation-common/ElementProperties.js\";\nexport { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from \"./presentation-common/Utils.js\";\nexport { LocalizationHelper } from \"./presentation-common/LocalizationHelper.js\";\nexport { isSingleElementPropertiesRequestOptions } from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RpcRequestsHandler } from \"./presentation-common/RpcRequestsHandler.js\";\nexport { AsyncTasksTracker } from \"./presentation-common/AsyncTasks.js\";\n"]}
|
|
@@ -50,6 +50,7 @@ export { RendererDescription } from "./presentation-common/content/Renderer.js";
|
|
|
50
50
|
export { PropertyValueFormat, PrimitiveTypeDescription, ArrayTypeDescription, StructFieldMemberDescription, StructTypeDescription, TypeDescription, } from "./presentation-common/content/TypeDescription.js";
|
|
51
51
|
export { Value, ValuesMap, ValuesArray, DisplayValue, DisplayValuesMap, DisplayValuesArray, NestedContentValue, NavigationPropertyValue, DisplayValueGroup, } from "./presentation-common/content/Value.js";
|
|
52
52
|
export { FieldHierarchy, StartContentProps, ProcessFieldHierarchiesProps, StartItemProps, StartCategoryProps, StartFieldProps, StartStructProps, StartArrayProps, ProcessMergedValueProps, ProcessPrimitiveValueProps, IContentVisitor, traverseFieldHierarchy, traverseContent, traverseContentItem, createFieldHierarchies, addFieldHierarchy, combineFieldNames, parseCombinedFieldNames, } from "./presentation-common/content/ContentTraverser.js";
|
|
53
|
+
export { createContentFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
|
|
53
54
|
export { ElementProperties, ElementPropertiesCategoryItem, ElementPropertiesPrimitivePropertyItem, ElementPropertiesPrimitiveArrayPropertyItem, ElementPropertiesStructArrayPropertyItem, ElementPropertiesArrayPropertyItem, ElementPropertiesStructPropertyItem, ElementPropertiesPropertyValueType, ElementPropertiesPropertyItem, ElementPropertiesItem, } from "./presentation-common/ElementProperties.js";
|
|
54
55
|
/**
|
|
55
56
|
* @module Hierarchies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,UAAU,EAC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AAgF,CAAC;AAC/F,cAAc,+EAA+E,CAAC;AAC9F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iFAAiF,CAAC;AAChG,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC"}
|
|
1
|
+
{"version":3,"file":"presentation-common.d.ts","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,OAAO,EACL,yBAAyB,EACzB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,0BAA0B,EAC1B,YAAY,EACZ,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,wCAAwC,EACxC,4CAA4C,EAC5C,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC/G,OAAO,EACL,cAAc,EACd,yBAAyB,EACz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AAE5G;;;;;GAKG;AAEH,cAAc,wDAAwD,CAAC;AACvE,cAAc,iEAAiE,CAAC;AAChF,cAAc,kEAAkE,CAAC;AACjF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,sFAAsF,CAAC;AACrG,cAAc,yDAAyD,CAAC;AACxE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4EAA4E,CAAC;AAC3F,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,+DAA+D,CAAC;AAC9E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,oEAAoE,CAAC;AACnF,cAAc,0DAA0D,CAAC;AACzE,cAAc,uFAAuF,CAAC;AACtG,cAAc,6EAA6E,CAAC;AAC5F,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,wEAAwE,CAAC;AACvF,cAAc,oFAAoF,CAAC;AACnG,cAAc,kEAAkE,CAAC;AACjF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,+EAA+E,CAAC;AAC9F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iFAAiF,CAAC;AAChG,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC"}
|
|
@@ -43,6 +43,7 @@ export { Property } from "./presentation-common/content/Property.js";
|
|
|
43
43
|
export { PropertyValueFormat, } from "./presentation-common/content/TypeDescription.js";
|
|
44
44
|
export { Value, DisplayValue, } from "./presentation-common/content/Value.js";
|
|
45
45
|
export { traverseFieldHierarchy, traverseContent, traverseContentItem, createFieldHierarchies, addFieldHierarchy, combineFieldNames, parseCombinedFieldNames, } from "./presentation-common/content/ContentTraverser.js";
|
|
46
|
+
export { createContentFormatter } from "./presentation-common/content/PropertyValueFormatter.js";
|
|
46
47
|
export { StandardNodeTypes, NodeKey, } from "./presentation-common/hierarchy/Key.js";
|
|
47
48
|
/**
|
|
48
49
|
* @module PresentationRules
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,OAAO,EAUL,mBAAmB,GACpB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,WAAW,EAMX,sBAAsB,EAEtB,YAAY,EAMZ,gBAAgB,EAEhB,wCAAwC,EAExC,gBAAgB,GAIjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAE,GAAG,EAAoB,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAsC,eAAe,EAAE,MAAM,0CAA0C,CAAC;AA4B/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EACL,kBAAkB,EASlB,eAAe,GAGhB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,eAAe,EAAuD,MAAM,0CAA0C,CAAC;AAChI,OAAO,EACL,WAAW,GASZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAA8D,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAQxJ,OAAO,EAA+C,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAE5I;;;;;;GAMG;AACH,OAAO,EAoBL,wBAAwB,GACzB,MAAM,mDAAmD,CAAC;AAU3D;;;;;GAKG;AACH,OAAO,EAAE,mBAAmB,EAA2B,MAAM,2CAA2C,CAAC;AACzG,OAAO,EAAe,OAAO,EAAE,MAAM,0CAA0C,CAAC;AAChF,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5E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,wEAAwE,CAAC;AACvF,cAAc,oFAAoF,CAAC;AACnG,cAAc,kEAAkE,CAAC;AACjF,cAAc,gFAAgF,CAAC;AAC/F,cAAc,+EAA+E,CAAC;AAC9F,cAAc,8EAA8E,CAAC;AAC7F,cAAc,iFAAiF,CAAC;AAChG,cAAc,oDAAoD,CAAC;AACnE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,OAAO,EAUL,mBAAmB,GACpB,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,cAAc,sDAAsD,CAAC;AACrE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport { createContentFormatter } from \"./presentation-common/content/PropertyValueFormatter.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/presentation-common",
|
|
3
|
-
"version": "5.3.0-dev.
|
|
3
|
+
"version": "5.3.0-dev.25",
|
|
4
4
|
"description": "Common pieces for iModel.js presentation packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@itwin/presentation-shared": "^1.2.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@itwin/core-bentley": "5.3.0-dev.
|
|
50
|
-
"@itwin/
|
|
51
|
-
"@itwin/
|
|
52
|
-
"@itwin/core-
|
|
49
|
+
"@itwin/core-bentley": "5.3.0-dev.25",
|
|
50
|
+
"@itwin/core-common": "5.3.0-dev.25",
|
|
51
|
+
"@itwin/ecschema-metadata": "5.3.0-dev.25",
|
|
52
|
+
"@itwin/core-quantity": "5.3.0-dev.25"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@itwin/eslint-plugin": "5.2.2-dev.2",
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
"typescript": "~5.6.2",
|
|
82
82
|
"typescript-json-schema": "^0.55.0",
|
|
83
83
|
"yargs": "^17.4.0",
|
|
84
|
-
"@itwin/build-tools": "5.3.0-dev.
|
|
85
|
-
"
|
|
86
|
-
"@itwin/
|
|
87
|
-
"@itwin/
|
|
88
|
-
"@itwin/core-
|
|
89
|
-
"
|
|
84
|
+
"@itwin/build-tools": "5.3.0-dev.25",
|
|
85
|
+
"internal-tools": "3.0.0-dev.69",
|
|
86
|
+
"@itwin/ecschema-metadata": "5.3.0-dev.25",
|
|
87
|
+
"@itwin/core-common": "5.3.0-dev.25",
|
|
88
|
+
"@itwin/core-bentley": "5.3.0-dev.25",
|
|
89
|
+
"@itwin/core-quantity": "5.3.0-dev.25"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "npm run -s ruleset-json-schema && npm run -s build:assets && npm run -s build:public && npm run -s build:cjs && npm run -s build:esm",
|