@itwin/presentation-common 4.0.0-dev.80 → 4.0.0-dev.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Ruleset.schema.json +4 -0
- package/lib/cjs/assets/locales/en/Presentation.json +4 -0
- package/lib/cjs/assets/locales/en-PSEUDO/Presentation.json +4 -0
- package/lib/cjs/presentation-common/{PropertyFormatter.d.ts → KoqPropertyValueFormatter.d.ts} +3 -14
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
- package/lib/cjs/presentation-common/{PropertyFormatter.js → KoqPropertyValueFormatter.js} +5 -48
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +3 -0
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +0 -13
- package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +6 -0
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +1 -64
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +1 -113
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +139 -0
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -0
- package/lib/cjs/presentation-common/content/Value.d.ts +18 -3
- package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Value.js +8 -0
- package/lib/cjs/presentation-common/content/Value.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +7 -0
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/cjs/presentation-common.d.ts +2 -1
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +2 -1
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/{PropertyFormatter.d.ts → KoqPropertyValueFormatter.d.ts} +3 -14
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
- package/lib/esm/presentation-common/{PropertyFormatter.js → KoqPropertyValueFormatter.js} +3 -45
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
- package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +3 -0
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +0 -13
- package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +6 -0
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +1 -64
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +0 -112
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +134 -0
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -0
- package/lib/esm/presentation-common/content/Value.d.ts +18 -3
- package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Value.js +8 -0
- package/lib/esm/presentation-common/content/Value.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +7 -0
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/esm/presentation-common.d.ts +2 -1
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +2 -1
- package/lib/esm/presentation-common.js.map +1 -1
- package/lib/public/locales/en/Presentation.json +4 -0
- package/package.json +10 -10
- package/lib/cjs/presentation-common/PropertyFormatter.d.ts.map +0 -1
- package/lib/cjs/presentation-common/PropertyFormatter.js.map +0 -1
- package/lib/esm/presentation-common/PropertyFormatter.d.ts.map +0 -1
- package/lib/esm/presentation-common/PropertyFormatter.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,mEAAiD;AACjD,oEAAkD;AAClD,2DAAyC;AACzC,8DAA4C;AAC5C,+DAA6C;AAC7C,wEAAsD;AACtD,mFAAiE;AACjE,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,+DAA6C;AAC7C,8DAA4C;AAC5C,iFAA+D;AAC/D,2EAAyD;AACzD,iFAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;+FAG+F;AAC/F;;;;;GAKG;AACH,mEAAiD;AACjD,oEAAkD;AAClD,2DAAyC;AACzC,8DAA4C;AAC5C,+DAA6C;AAC7C,wEAAsD;AACtD,mFAAiE;AACjE,0EAAwD;AACxD,yEAAuD;AACvD,wEAAsD;AACtD,+DAA6C;AAC7C,8DAA4C;AAC5C,iFAA+D;AAC/D,2EAAyD;AACzD,iFAA+D;AAC/D,kFAAgE;AAEhE;;;;;;GAMG;AACH,iFAA+D;AAC/D,2EAAyD;AACzD,0EAAwD;AAExD;;;;;GAKG;AACH,iFAA+D;AAE/D;;;;;GAKG;AACH,yEAAuD;AACvD,wEAAsD;AACtD,2EAAyD;AACzD,6EAA2D;AAC3D,uEAAqD;AACrD,uEAAqD;AACrD,qEAAmD;AACnD,yEAAuD;AACvD,yEAAuD;AACvD,gFAA8D;AAC9D,sEAAoD;AACpD,iFAA+D;AAC/D,uFAAqE;AAErE;;;;;GAKG;AACH,iFAA+D;AAC/D,sEAAoD;AACpD,uEAAqD;AACrD,kFAAgE;AAEhE;;;;;GAKG;AACH,sFAAoE;AACpE,+FAA6E;AAC7E,gGAA8E;AAC9E,8GAA4F;AAC5F,oHAAkG;AAClG,uFAAqE;AACrE,0FAAwE;AACxE,0GAAwF;AACxF,qFAAmE;AACnE,qFAAmE;AACnE,yFAAuE;AACvE,8FAA4E;AAC5E,6FAA2E;AAC3E,yFAAuE;AACvE,4FAA0E;AAC1E,kGAAgF;AAChF,0FAAwE;AACxE,wFAAsE;AACtE,0FAAwE;AACxE,qHAAmG;AACnG,2GAAyF;AACzF,kFAAgE;AAChE,2FAAyE;AACzE,4FAA0E;AAC1E,yGAAuF;AACvF,sGAAoF;AACpF,kHAAgG;AAChG,gGAA8E;AAC9E,8GAA4F;AAC5F,6GAA2F;AAC3F,4GAA0F;AAC1F,+GAA6F;AAC7F,kFAAgE;AAChE,2FAAyE;AACzE,oFAAkE;AAClE,4FAA0E;AAC1E,mEAAiD;AACjD,sEAAoD;AACpD,mFAAiE;AACjE,wEAAsD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/**\r\n * @module Core\r\n *\r\n * @docs-group-description Core\r\n * Common types used all across Presentation packages.\r\n */\r\nexport * from \"./presentation-common/AsyncTasks\";\r\nexport * from \"./presentation-common/Diagnostics\";\r\nexport * from \"./presentation-common/EC\";\r\nexport * from \"./presentation-common/Error\";\r\nexport * from \"./presentation-common/KeySet\";\r\nexport * from \"./presentation-common/LabelDefinition\";\r\nexport * from \"./presentation-common/PresentationManagerOptions\";\r\nexport * from \"./presentation-common/RegisteredRuleset\";\r\nexport * from \"./presentation-common/RulesetVariables\";\r\nexport * from \"./presentation-common/RulesetsFactory\";\r\nexport * from \"./presentation-common/Update\";\r\nexport * from \"./presentation-common/Utils\";\r\nexport * from \"./presentation-common/PresentationIpcInterface\";\r\nexport * from \"./presentation-common/LocalizationHelper\";\r\nexport * from \"./presentation-common/InstanceFilterDefinition\";\r\nexport * from \"./presentation-common/KoqPropertyValueFormatter\";\r\n\r\n/**\r\n * @module RPC\r\n *\r\n * @docs-group-description RPC\r\n * Types used for RPC communication between frontend and backend. Generally should\r\n * only be used internally by presentation packages.\r\n */\r\nexport * from \"./presentation-common/PresentationRpcInterface\";\r\nexport * from \"./presentation-common/RpcRequestsHandler\";\r\nexport * from \"./presentation-common/ElementProperties\";\r\n\r\n/**\r\n * @module UnifiedSelection\r\n *\r\n * @docs-group-description UnifiedSelection\r\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\r\n */\r\nexport * from \"./presentation-common/selection/SelectionScope\";\r\n\r\n/**\r\n * @module Content\r\n *\r\n * @docs-group-description Content\r\n * Types related to presentation [content]($docs/presentation/content/index.md).\r\n */\r\nexport * from \"./presentation-common/content/Category\";\r\nexport * from \"./presentation-common/content/Content\";\r\nexport * from \"./presentation-common/content/Descriptor\";\r\nexport * from \"./presentation-common/content/DisplayTypes\";\r\nexport * from \"./presentation-common/content/Editor\";\r\nexport * from \"./presentation-common/content/Fields\";\r\nexport * from \"./presentation-common/content/Item\";\r\nexport * from \"./presentation-common/content/Property\";\r\nexport * from \"./presentation-common/content/Renderer\";\r\nexport * from \"./presentation-common/content/TypeDescription\";\r\nexport * from \"./presentation-common/content/Value\";\r\nexport * from \"./presentation-common/content/ContentTraverser\";\r\nexport * from \"./presentation-common/content/PropertyValueFormatter\";\r\n\r\n/**\r\n * @module Hierarchies\r\n *\r\n * @docs-group-description Hierarchies\r\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\r\n */\r\nexport * from \"./presentation-common/hierarchy/HierarchyLevel\";\r\nexport * from \"./presentation-common/hierarchy/Key\";\r\nexport * from \"./presentation-common/hierarchy/Node\";\r\nexport * from \"./presentation-common/hierarchy/NodePathElement\";\r\n\r\n/**\r\n * @module PresentationRules\r\n *\r\n * @docs-group-description PresentationRules\r\n * Types for defining the presentation ruleset.\r\n */\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification\";\r\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule\";\r\nexport * from \"./presentation-common/rules/hierarchy/SubCondition\";\r\nexport * from \"./presentation-common/rules/customization/CheckBoxRule\";\r\nexport * from \"./presentation-common/rules/customization/CustomizationRule\";\r\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule\";\r\nexport * from \"./presentation-common/rules/customization/GroupingRule\";\r\nexport * from \"./presentation-common/rules/customization/ImageIdOverride\";\r\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride\";\r\nexport * from \"./presentation-common/rules/customization/LabelOverride\";\r\nexport * from \"./presentation-common/rules/customization/SortingRule\";\r\nexport * from \"./presentation-common/rules/customization/StyleOverride\";\r\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification\";\r\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification\";\r\nexport * from \"./presentation-common/rules/content/ContentRule\";\r\nexport * from \"./presentation-common/rules/content/ContentSpecification\";\r\nexport * from \"./presentation-common/rules/content/PropertySpecification\";\r\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification\";\r\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification\";\r\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification\";\r\nexport * from \"./presentation-common/rules/ClassSpecifications\";\r\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification\";\r\nexport * from \"./presentation-common/rules/RelationshipDirection\";\r\nexport * from \"./presentation-common/rules/RelationshipPathSpecification\";\r\nexport * from \"./presentation-common/rules/Rule\";\r\nexport * from \"./presentation-common/rules/Ruleset\";\r\nexport * from \"./presentation-common/rules/SchemasSpecification\";\r\nexport * from \"./presentation-common/rules/Variables\";\r\n"]}
|
package/lib/esm/presentation-common/{PropertyFormatter.d.ts → KoqPropertyValueFormatter.d.ts}
RENAMED
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { FormatterSpec, ParserSpec, UnitSystemKey } from "@itwin/core-quantity";
|
|
5
5
|
import { SchemaContext } from "@itwin/ecschema-metadata";
|
|
6
|
-
import { Content } from "./content/Content";
|
|
7
6
|
/** @alpha */
|
|
8
7
|
export interface FormatOptions {
|
|
9
8
|
koqName: string;
|
|
10
|
-
unitSystem
|
|
9
|
+
unitSystem?: UnitSystemKey;
|
|
11
10
|
}
|
|
12
11
|
/** @alpha */
|
|
13
|
-
export declare class
|
|
12
|
+
export declare class KoqPropertyValueFormatter {
|
|
14
13
|
private _schemaContext;
|
|
15
14
|
private _unitsProvider;
|
|
16
15
|
constructor(_schemaContext: SchemaContext);
|
|
@@ -18,14 +17,4 @@ export declare class PropertyValueFormatter {
|
|
|
18
17
|
getFormatterSpec(options: FormatOptions): Promise<FormatterSpec | undefined>;
|
|
19
18
|
getParserSpec(options: FormatOptions): Promise<ParserSpec | undefined>;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
export declare class ContentPropertyValueFormatter {
|
|
23
|
-
private _propertyValueFormatter;
|
|
24
|
-
private _unitSystem;
|
|
25
|
-
constructor(_propertyValueFormatter: PropertyValueFormatter, _unitSystem: UnitSystemKey);
|
|
26
|
-
formatContent(content: Content): Promise<Content>;
|
|
27
|
-
private formatValues;
|
|
28
|
-
private formatNestedContentDisplayValues;
|
|
29
|
-
private isFormattable;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=PropertyFormatter.d.ts.map
|
|
20
|
+
//# sourceMappingURL=KoqPropertyValueFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KoqPropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAuB,aAAa,EAAE,UAAU,EAAiB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EAC6E,aAAa,EAEhG,MAAM,0BAA0B,CAAC;AAElC,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,aAAa;AACb,qBAAa,yBAAyB;IAGxB,OAAO,CAAC,cAAc;IAFlC,OAAO,CAAC,cAAc,CAAgB;gBAElB,cAAc,EAAE,aAAa;IAIpC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAO5C,gBAAgB,CAAC,OAAO,EAAE,aAAa;IAUvC,aAAa,CAAC,OAAO,EAAE,aAAa;CASlD"}
|
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Core
|
|
7
7
|
*/
|
|
8
|
-
import { assert } from "@itwin/core-bentley";
|
|
9
8
|
import { Format, FormatterSpec, ParserSpec } from "@itwin/core-quantity";
|
|
10
9
|
import { OverrideFormat, SchemaKey, SchemaMatchType, SchemaUnitProvider, } from "@itwin/ecschema-metadata";
|
|
11
|
-
import { Value } from "./content/Value";
|
|
12
10
|
/** @alpha */
|
|
13
|
-
export class
|
|
11
|
+
export class KoqPropertyValueFormatter {
|
|
14
12
|
constructor(_schemaContext) {
|
|
15
13
|
this._schemaContext = _schemaContext;
|
|
16
14
|
this._unitsProvider = new SchemaUnitProvider(_schemaContext);
|
|
@@ -40,47 +38,6 @@ export class PropertyValueFormatter {
|
|
|
40
38
|
return ParserSpec.create(format, this._unitsProvider, persistenceUnit);
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
|
-
/** @alpha */
|
|
44
|
-
export class ContentPropertyValueFormatter {
|
|
45
|
-
constructor(_propertyValueFormatter, _unitSystem) {
|
|
46
|
-
this._propertyValueFormatter = _propertyValueFormatter;
|
|
47
|
-
this._unitSystem = _unitSystem;
|
|
48
|
-
}
|
|
49
|
-
async formatContent(content) {
|
|
50
|
-
const descriptor = content.descriptor;
|
|
51
|
-
for (const item of content.contentSet) {
|
|
52
|
-
await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);
|
|
53
|
-
}
|
|
54
|
-
return content;
|
|
55
|
-
}
|
|
56
|
-
async formatValues(values, displayValues, fields, mergedFields) {
|
|
57
|
-
for (const field of fields) {
|
|
58
|
-
const value = values[field.name];
|
|
59
|
-
if (field.isNestedContentField() && !mergedFields.includes(field.name)) {
|
|
60
|
-
assert(Value.isNestedContent(value));
|
|
61
|
-
await this.formatNestedContentDisplayValues(value, field.nestedFields);
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
if (!this.isFormattable(field) || typeof value !== "number")
|
|
65
|
-
continue;
|
|
66
|
-
const koq = field.properties[0].property.kindOfQuantity;
|
|
67
|
-
const formattedValue = await this._propertyValueFormatter.format(value, { koqName: koq.name, unitSystem: this._unitSystem });
|
|
68
|
-
if (!formattedValue)
|
|
69
|
-
continue;
|
|
70
|
-
displayValues[field.name] = formattedValue;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async formatNestedContentDisplayValues(nestedValues, fields) {
|
|
74
|
-
for (const nestedValue of nestedValues) {
|
|
75
|
-
await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
isFormattable(field) {
|
|
79
|
-
return field.isPropertiesField()
|
|
80
|
-
&& field.properties.length > 0
|
|
81
|
-
&& field.properties[0].property.kindOfQuantity !== undefined;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
41
|
async function getFormattingProps(schemaLocater, options) {
|
|
85
42
|
const { koqName, unitSystem } = options;
|
|
86
43
|
const koq = await getKoq(schemaLocater, koqName);
|
|
@@ -190,5 +147,6 @@ function getUnitSystemGroupNames(unitSystem) {
|
|
|
190
147
|
case "usSurvey":
|
|
191
148
|
return ["USSURVEY", "USCUSTOM", "INTERNATIONAL", "FINANCE"];
|
|
192
149
|
}
|
|
150
|
+
return [];
|
|
193
151
|
}
|
|
194
|
-
//# sourceMappingURL=
|
|
152
|
+
//# sourceMappingURL=KoqPropertyValueFormatter.js.map
|
|
@@ -0,0 +1 @@
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C;YACD,CAAC,CAAC,0BAA0B,CAAC,SAAS;KACzC,CAAC;AACJ,CAAC;AAED,SAAS,6BAA6B,CAAC,eAAoC;IACzE,oDAAoD;IACpD,OAAO;QACL,YAAY,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,CAAC;QACrE,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,GAAG;QACjB,gBAAgB,EAAE,GAAG;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,CAAC;oBACN,IAAI,EAAE,eAAe,CAAC,QAAQ;oBAC9B,KAAK,EAAE,eAAe,CAAC,KAAK;iBAC7B,CAAC;SACH;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,UAA0B;IACzD,QAAQ,UAAU,EAAE;QAClB,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAC9D,KAAK,QAAQ;YACX,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QACtD,KAAK,aAAa;YAChB,OAAO,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAClD,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;KAC/D;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { Format, FormatProps, FormatterSpec, ParserSpec, UnitsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport {\r\n Format as ECFormat, InvertedUnit, ISchemaLocater, KindOfQuantity, OverrideFormat, SchemaContext, SchemaKey, SchemaMatchType, SchemaUnitProvider,\r\n Unit,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/** @alpha */\r\nexport interface FormatOptions {\r\n koqName: string;\r\n unitSystem?: UnitSystemKey;\r\n}\r\n\r\n/** @alpha */\r\nexport class KoqPropertyValueFormatter {\r\n private _unitsProvider: UnitsProvider;\r\n\r\n constructor(private _schemaContext: SchemaContext) {\r\n this._unitsProvider = new SchemaUnitProvider(_schemaContext);\r\n }\r\n\r\n public async format(value: number, options: FormatOptions) {\r\n const formatterSpec = await this.getFormatterSpec(options);\r\n if (!formatterSpec)\r\n return undefined;\r\n return formatterSpec.applyFormatting(value);\r\n }\r\n\r\n public async getFormatterSpec(options: FormatOptions) {\r\n const formattingProps = await getFormattingProps(this._schemaContext, options);\r\n if (!formattingProps)\r\n return undefined;\r\n const { formatProps, persistenceUnitName } = formattingProps;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\r\n }\r\n\r\n public async getParserSpec(options: FormatOptions) {\r\n const formattingProps = await getFormattingProps(this._schemaContext, options);\r\n if (!formattingProps)\r\n return undefined;\r\n const { formatProps, persistenceUnitName } = formattingProps;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\r\n }\r\n}\r\n\r\ninterface FormattingProps {\r\n formatProps: FormatProps;\r\n persistenceUnitName: string;\r\n}\r\n\r\nasync function getFormattingProps(schemaLocater: ISchemaLocater, options: FormatOptions): Promise<FormattingProps | undefined> {\r\n const { koqName, unitSystem } = options;\r\n\r\n const koq = await getKoq(schemaLocater, koqName);\r\n if (!koq)\r\n return undefined;\r\n\r\n const persistenceUnit = await koq.persistenceUnit;\r\n // istanbul ignore if\r\n if (!persistenceUnit)\r\n return undefined;\r\n\r\n const formatProps = await getKoqFormatProps(koq, persistenceUnit, unitSystem);\r\n if (!formatProps)\r\n return undefined;\r\n\r\n return { formatProps, persistenceUnitName: persistenceUnit.fullName };\r\n}\r\n\r\nasync function getKoq(schemaLocater: ISchemaLocater, fullName: string) {\r\n const [schemaName, propKoqName] = fullName.split(\":\");\r\n const schema = await schemaLocater.getSchema(new SchemaKey(schemaName), SchemaMatchType.Latest);\r\n if (!schema)\r\n return undefined;\r\n\r\n return schema.getItem<KindOfQuantity>(propKoqName);\r\n}\r\n\r\nasync function getKoqFormatProps(koq: KindOfQuantity, persistenceUnit: Unit | InvertedUnit, unitSystem?: UnitSystemKey) {\r\n const unitSystems = getUnitSystemGroupNames(unitSystem);\r\n // use one of KOQ presentation format that matches requested unit system\r\n const presentationFormat = await getKoqPresentationFormat(koq, unitSystems);\r\n if (presentationFormat)\r\n return formatToFormatProps(presentationFormat);\r\n\r\n // use persistence unit format if it matches requested unit system and matching presentation format was not found\r\n const persistenceUnitSystem = await persistenceUnit.unitSystem;\r\n if (persistenceUnitSystem && unitSystems.includes(persistenceUnitSystem.name.toUpperCase()))\r\n return getPersistenceUnitFormatProps(persistenceUnit);\r\n\r\n // use default presentation format if persistence unit does not match requested unit system\r\n if (koq.defaultPresentationFormat)\r\n return formatToFormatProps(koq.defaultPresentationFormat);\r\n\r\n return undefined;\r\n}\r\n\r\nasync function getKoqPresentationFormat(koq: KindOfQuantity, unitSystems: string[]) {\r\n const presentationFormats = koq.presentationFormats;\r\n for (const system of unitSystems) {\r\n for (const format of presentationFormats) {\r\n const unit = format.units && format.units[0][0];\r\n // istanbul ignore if\r\n if (!unit)\r\n continue;\r\n\r\n const currentUnitSystem = await unit.unitSystem;\r\n if (currentUnitSystem && currentUnitSystem.name.toUpperCase() === system)\r\n return format;\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction formatToFormatProps(format: ECFormat | OverrideFormat): FormatProps {\r\n // istanbul ignore if\r\n if (OverrideFormat.isOverrideFormat(format)) {\r\n const baseFormat = baseFormatToFormatProps(format.parent);\r\n return {\r\n ...baseFormat,\r\n composite: format.units\r\n ? {\r\n ...baseFormat.composite,\r\n units: format.units.map(([unit, _]) => ({ name: unit.fullName, label: unit.label })),\r\n spacer: format.spacer,\r\n includeZero: format.includeZero,\r\n }\r\n : baseFormat.composite,\r\n };\r\n }\r\n return baseFormatToFormatProps(format);\r\n}\r\n\r\nfunction baseFormatToFormatProps(format: ECFormat): FormatProps {\r\n const json = format.toJSON();\r\n return {\r\n ...json,\r\n composite: json.composite\r\n ? {\r\n ...json.composite,\r\n spacer: format.spacer,\r\n includeZero: format.includeZero,\r\n }\r\n : /* istanbul ignore next */ undefined,\r\n };\r\n}\r\n\r\nfunction getPersistenceUnitFormatProps(persistenceUnit: Unit | InvertedUnit): FormatProps {\r\n // Same as Format \"DefaultRealU\" in Formats ecschema\r\n return {\r\n formatTraits: [\"keepSingleZero\", \"keepDecimalPoint\", \"showUnitLabel\"],\r\n precision: 6,\r\n type: \"Decimal\",\r\n uomSeparator: \" \",\r\n decimalSeparator: \".\",\r\n composite: {\r\n units: [{\r\n name: persistenceUnit.fullName,\r\n label: persistenceUnit.label,\r\n }],\r\n },\r\n };\r\n}\r\n\r\nfunction getUnitSystemGroupNames(unitSystem?: UnitSystemKey) {\r\n switch (unitSystem) {\r\n case \"imperial\":\r\n return [\"IMPERIAL\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"];\r\n case \"metric\":\r\n return [\"SI\", \"METRIC\", \"INTERNATIONAL\", \"FINANCE\"];\r\n case \"usCustomary\":\r\n return [\"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"];\r\n case \"usSurvey\":\r\n return [\"USSURVEY\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"];\r\n }\r\n return [];\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED,gBAAgB;AAChB,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,mBAAmB,CAA0B;gBAEzC,KAAK,EAAE,uBAAuB;IAInC,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAI/B,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE;IAMxC,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,eAAe;IAK9E,4BAA4B,CAAC,gBAAgB,EAAE,eAAe,EAAE;IAKhE,mBAAmB,CAAC,OAAO,EAAE,OAAO;IAOpC,6BAA6B,CAAC,IAAI,EAAE,iBAAiB;IAK5D,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,gCAAgC;IAQxC,OAAO,CAAC,yBAAyB;
|
|
1
|
+
{"version":3,"file":"LocalizationHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAED,gBAAgB;AAChB,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,mBAAmB,CAA0B;gBAEzC,KAAK,EAAE,uBAAuB;IAInC,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAI/B,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE;IAMxC,2BAA2B,CAAC,eAAe,EAAE,eAAe,GAAG,eAAe;IAK9E,4BAA4B,CAAC,gBAAgB,EAAE,eAAe,EAAE;IAKhE,mBAAmB,CAAC,OAAO,EAAE,OAAO;IAOpC,6BAA6B,CAAC,IAAI,EAAE,iBAAiB;IAK5D,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,gCAAgC;IAQxC,OAAO,CAAC,yBAAyB;IAsBjC,OAAO,CAAC,+BAA+B;IAIvC,OAAO,CAAC,kCAAkC;IAK1C,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,wBAAwB;CAYjC"}
|
|
@@ -63,6 +63,9 @@ export class LocalizationHelper {
|
|
|
63
63
|
if (typeof value === "string") {
|
|
64
64
|
value = this.getLocalizedString(value);
|
|
65
65
|
}
|
|
66
|
+
else if (Value.isNavigationValue(value)) {
|
|
67
|
+
this.translateLabelDefinition(value.label);
|
|
68
|
+
}
|
|
66
69
|
else if (Value.isNestedContent(value)) {
|
|
67
70
|
for (const nestedValue of value) {
|
|
68
71
|
for (const key in nestedValue.values) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationHelper.js","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAKH,OAAO,EAAuB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAgB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKtD,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAOlD,gBAAgB;AAChB,MAAM,OAAO,kBAAkB;IAG7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AAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzD,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IACvE,CAAC;IAEO,aAAa,CAAC,IAAU;QAC9B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,uBAAuB;QACvB,IAAI,IAAI,CAAC,WAAW;YAClB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjE,CAAC;IAEO,wBAAwB,CAAC,eAAgC;QAC/D,MAAM,kBAAkB,GAAG,CAAC,cAAmC,EAAE,EAAE;YACjE,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7E,CAAC,CAAC;QAEF,IAAI,eAAe,CAAC,QAAQ,KAAK,eAAe,CAAC,6BAA6B;YAC5E,kBAAkB,CAAC,eAAe,CAAC,QAA+B,CAAC,CAAC;aACjE,IAAI,eAAe,CAAC,QAAQ,KAAK,QAAQ,EAAE;YAC9C,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,QAAkB,CAAC,CAAC;YACvF,eAAe,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;SACtF;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { Node } from \"./hierarchy/Node\";\r\nimport { Content } from \"./content/Content\";\r\nimport { Item } from \"./content/Item\";\r\nimport { LabelCompositeValue, LabelDefinition } from \"./LabelDefinition\";\r\nimport { DisplayValue, Value } from \"./content/Value\";\r\nimport { Field } from \"./content/Fields\";\r\nimport { CategoryDescription } from \"./content/Category\";\r\nimport { ElementProperties } from \"./ElementProperties\";\r\n\r\nconst KEY_PATTERN = /@[\\w\\d\\-_]+:[\\w\\d\\-\\._]+?@/g;\r\n\r\n/** @internal */\r\nexport interface LocalizationHelperProps {\r\n getLocalizedString: (key: string) => string;\r\n}\r\n\r\n/** @internal */\r\nexport class LocalizationHelper {\r\n private _getLocalizedString: (key: string) => string;\r\n\r\n constructor(props: LocalizationHelperProps) {\r\n this._getLocalizedString = props.getLocalizedString;\r\n }\r\n\r\n public getLocalizedString(text: string) {\r\n return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, \"\")));\r\n }\r\n\r\n public getLocalizedNodes(nodes: Node[]): Node[] {\r\n for (const node of nodes)\r\n this.translateNode(node);\r\n return nodes;\r\n }\r\n\r\n public getLocalizedLabelDefinition(labelDefinition: LabelDefinition): LabelDefinition {\r\n this.translateLabelDefinition(labelDefinition);\r\n return labelDefinition;\r\n }\r\n\r\n public getLocalizedLabelDefinitions(labelDefinitions: LabelDefinition[]) {\r\n labelDefinitions.forEach((labelDefinition) => this.translateLabelDefinition(labelDefinition));\r\n return labelDefinitions;\r\n }\r\n\r\n public getLocalizedContent(content: Content) {\r\n content.contentSet.forEach((item) => this.translateContentItem(item));\r\n content.descriptor.fields.forEach((field) => this.translateContentDescriptorField(field));\r\n content.descriptor.categories.forEach((category) => this.translateContentDescriptorCategory(category));\r\n return content;\r\n }\r\n\r\n public getLocalizedElementProperties(elem: ElementProperties) {\r\n elem.label = this.getLocalizedString(elem.label);\r\n return elem;\r\n }\r\n\r\n private translateContentItem(item: Item) {\r\n for (const key in item.displayValues) {\r\n // istanbul ignore else\r\n if (key)\r\n item.displayValues[key] = this.translateContentItemDisplayValue(item.displayValues[key]);\r\n }\r\n for (const key in item.values) {\r\n // istanbul ignore else\r\n if (key)\r\n item.values[key] = this.translateContentItemValue(item.values[key]);\r\n }\r\n this.translateLabelDefinition(item.label);\r\n }\r\n\r\n private translateContentItemDisplayValue(value: DisplayValue): DisplayValue {\r\n // istanbul ignore else\r\n if (typeof value === \"string\") {\r\n value = this.getLocalizedString(value);\r\n }\r\n return value;\r\n }\r\n\r\n private translateContentItemValue(value: Value): Value {\r\n if (typeof value === \"string\") {\r\n value = this.getLocalizedString(value);\r\n } else if (Value.isNavigationValue(value)) {\r\n this.translateLabelDefinition(value.label);\r\n } else if (Value.isNestedContent(value)) {\r\n for (const nestedValue of value) {\r\n for (const key in nestedValue.values) {\r\n // istanbul ignore else\r\n if (key)\r\n nestedValue.values[key] = this.translateContentItemValue(nestedValue.values[key]);\r\n }\r\n for (const key in nestedValue.displayValues) {\r\n // istanbul ignore else\r\n if (key)\r\n nestedValue.displayValues[key] = this.translateContentItemDisplayValue(nestedValue.displayValues[key]);\r\n }\r\n }\r\n }\r\n return value;\r\n }\r\n\r\n private translateContentDescriptorField(field: Field) {\r\n field.label = this.getLocalizedString(field.label);\r\n }\r\n\r\n private translateContentDescriptorCategory(category: CategoryDescription) {\r\n category.label = this.getLocalizedString(category.label);\r\n category.description = this.getLocalizedString(category.description);\r\n }\r\n\r\n private translateNode(node: Node) {\r\n this.translateLabelDefinition(node.label);\r\n // istanbul ignore else\r\n if (node.description)\r\n node.description = this.getLocalizedString(node.description);\r\n }\r\n\r\n private translateLabelDefinition(labelDefinition: LabelDefinition) {\r\n const translateComposite = (compositeValue: LabelCompositeValue) => {\r\n compositeValue.values.map((value) => this.translateLabelDefinition(value));\r\n };\r\n\r\n if (labelDefinition.typeName === LabelDefinition.COMPOSITE_DEFINITION_TYPENAME)\r\n translateComposite(labelDefinition.rawValue as LabelCompositeValue);\r\n else if (labelDefinition.typeName === \"string\") {\r\n labelDefinition.rawValue = this.getLocalizedString(labelDefinition.rawValue as string);\r\n labelDefinition.displayValue = this.getLocalizedString(labelDefinition.displayValue);\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Core
|
|
3
3
|
*/
|
|
4
|
-
import { NodeKey } from "./hierarchy/Key";
|
|
5
4
|
import { RulesetVariableJSON } from "./RulesetVariables";
|
|
6
5
|
/** @internal */
|
|
7
6
|
export declare const PRESENTATION_IPC_CHANNEL_NAME = "presentation-ipc-interface";
|
|
@@ -20,22 +19,10 @@ export interface UnsetRulesetVariableParams extends CommonIpcParams {
|
|
|
20
19
|
variableId: string;
|
|
21
20
|
}
|
|
22
21
|
/** @internal */
|
|
23
|
-
export interface UpdateHierarchyStateParams<TNodeKey> extends CommonIpcParams {
|
|
24
|
-
rulesetId: string;
|
|
25
|
-
imodelKey: string;
|
|
26
|
-
stateChanges: Array<{
|
|
27
|
-
nodeKey: TNodeKey | undefined;
|
|
28
|
-
isExpanded?: boolean;
|
|
29
|
-
instanceFilters?: string[];
|
|
30
|
-
}>;
|
|
31
|
-
}
|
|
32
|
-
/** @internal */
|
|
33
22
|
export interface PresentationIpcInterface {
|
|
34
23
|
/** Sets ruleset variable value. */
|
|
35
24
|
setRulesetVariable(params: SetRulesetVariableParams<RulesetVariableJSON>): Promise<void>;
|
|
36
25
|
/** Unsets ruleset variable value. */
|
|
37
26
|
unsetRulesetVariable(params: UnsetRulesetVariableParams): Promise<void>;
|
|
38
|
-
/** Updates hierarchy state saved on the backend. Hierarchy state is used when performing updates after iModel data changes */
|
|
39
|
-
updateHierarchyState(params: UpdateHierarchyStateParams<NodeKey>): Promise<void>;
|
|
40
27
|
}
|
|
41
28
|
//# sourceMappingURL=PresentationIpcInterface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationIpcInterface.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PresentationIpcInterface.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAE1E,gBAAgB;AAChB,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAwB,CAAC,SAAS,CAAE,SAAQ,eAAe;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAwB;IACvC,mCAAmC;IACnC,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzF,qCAAqC;IACrC,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationIpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;
|
|
1
|
+
{"version":3,"file":"PresentationIpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAIH,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAAG,4BAA4B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { RulesetVariableJSON } from \"./RulesetVariables\";\r\n\r\n/** @internal */\r\nexport const PRESENTATION_IPC_CHANNEL_NAME = \"presentation-ipc-interface\";\r\n\r\n/** @internal */\r\nexport interface CommonIpcParams {\r\n clientId: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface SetRulesetVariableParams<TVariable> extends CommonIpcParams {\r\n rulesetId: string;\r\n variable: TVariable;\r\n}\r\n\r\n/** @internal */\r\nexport interface UnsetRulesetVariableParams extends CommonIpcParams {\r\n rulesetId: string;\r\n variableId: string;\r\n}\r\n\r\n/** @internal */\r\nexport interface PresentationIpcInterface {\r\n /** Sets ruleset variable value. */\r\n setRulesetVariable(params: SetRulesetVariableParams<RulesetVariableJSON>): Promise<void>;\r\n\r\n /** Unsets ruleset variable value. */\r\n unsetRulesetVariable(params: UnsetRulesetVariableParams): Promise<void>;\r\n}\r\n"]}
|
|
@@ -133,6 +133,12 @@ export interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVa
|
|
|
133
133
|
descriptor: TDescriptor;
|
|
134
134
|
/** Input keys for getting the content */
|
|
135
135
|
keys: TKeySet;
|
|
136
|
+
/**
|
|
137
|
+
* Flag that specifies whether value formatting should be emitted or not.
|
|
138
|
+
* Content is returned without `displayValues` when this is set to `true`.
|
|
139
|
+
* @alpha
|
|
140
|
+
*/
|
|
141
|
+
omitFormattedValues?: boolean;
|
|
136
142
|
}
|
|
137
143
|
/**
|
|
138
144
|
* Request type for distinct values' requests.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManagerOptions.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,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AyC;IACzC,IAAI,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PresentationManagerOptions.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,OAAO;IACrC,kCAAkC;IAClC,MAAM,EAAE,OAAO,CAAC;IAEhB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,CAAC;IAE3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAAE,SAAQ,cAAc,CAAC,OAAO,CAAC;IACrH,+DAA+D;IAC/D,WAAW,EAAE,OAAO,GAAG,MAAM,CAAC;IAE9B,oDAAoD;IACpD,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,GAAG,eAAe,CAAE,SAAQ,yBA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AC1B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,KAAK,CAAC,QAAQ,SAAS,EAAE,IAAI,QAAQ,GAAG;IAClD,iCAAiC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,QAAQ,SAAS,EAAE,IAAI,QAAQ,GAAG;IACxD,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,uCAAuC,CAAC,OAAO,EAAE,OAAO,EAAE,+BAA+B,CAAC,OAAO,CAAC,GAAG,OAAO,IAAI,qCAAqC,CAAC,OAAO,CAAC,CAE7K;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,EAAE,IAAI,QAAQ,GAAG;IAC5D,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;CACnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationManagerOptions.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AA+OH,gBAAgB;AAChB,MAAM,UAAU,gCAAgC,CAAU,OAAwF;IAChJ,OAAO,CAAC,CAAE,OAAmD,CAAC,UAAU,CAAC;AAC3E,CAAC;AAgDD;;;GAGG;AACH,MAAM,UAAU,uCAAuC,CAAU,OAAiD;IAChH,OAAQ,OAA0D,CAAC,SAAS,KAAK,SAAS,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { BeEvent, Id64String } from \"@itwin/core-bentley\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { SelectionInfo } from \"./content/Descriptor\";\r\nimport { FieldDescriptor } from \"./content/Fields\";\r\nimport { InstanceKey } from \"./EC\";\r\nimport { InstanceFilterDefinition } from \"./InstanceFilterDefinition\";\r\nimport { Ruleset } from \"./rules/Ruleset\";\r\nimport { RulesetVariable } from \"./RulesetVariables\";\r\nimport { SelectionScopeProps } from \"./selection/SelectionScope\";\r\n\r\n/**\r\n * A generic request options type used for both hierarchy and content requests.\r\n * @public\r\n */\r\nexport interface RequestOptions<TIModel> {\r\n /** iModel to request data from */\r\n imodel: TIModel;\r\n\r\n /** Optional locale to use when formatting / localizing data */\r\n locale?: string;\r\n\r\n /**\r\n * Unit system to use when formatting property values with units. Default presentation\r\n * unit is used if unit system is not specified.\r\n */\r\n unitSystem?: UnitSystemKey;\r\n\r\n /**\r\n * Expected form of response. This property is set automatically on newer frontends.\r\n * `unparsed-json` — deliver response from native addon without parsing it.\r\n * @internal\r\n */\r\n transport?: \"unparsed-json\";\r\n}\r\n\r\n/**\r\n * Options for requests that require presentation ruleset. Not\r\n * meant to be used directly, see one of the subclasses.\r\n *\r\n * @public\r\n */\r\nexport interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptions<TIModel> {\r\n /** Ruleset or id of the ruleset to use when requesting data */\r\n rulesetOrId: Ruleset | string;\r\n\r\n /** Ruleset variables to use when requesting data */\r\n rulesetVariables?: TRulesetVariable[];\r\n}\r\n\r\n/**\r\n * Request type for hierarchy requests.\r\n * @public\r\n */\r\nexport interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Key of the parent node to get children for */\r\n parentKey?: TNodeKey;\r\n\r\n /**\r\n * An instance filter that should be applied for this hierarchy level.\r\n *\r\n * **Note:** May only be used on hierarchy levels that support filtering - check [[NavNode.supportsFiltering]] before\r\n * requesting filtered children.\r\n *\r\n * @beta\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n\r\n /**\r\n * A limit to how many instances at most should be loaded for a hierarchy level. If the limit is exceeded,\r\n * the request fails with [[PresentationError]] having [[PresentationStatus.ResultSetTooLarge]] error number.\r\n *\r\n * Specifying the limit is useful when creating unlimited size result sets is not meaningful - this allows the library\r\n * to return early as soon as the limit is reached, instead of creating a very large result that's possibly too large to\r\n * be useful to be displayed to end users.\r\n *\r\n * @see [Hierarchies' filtering and limiting]($docs/presentation/hierarchies/FilteringLimiting.md)\r\n * @beta\r\n */\r\n sizeLimit?: number;\r\n}\r\n\r\n/**\r\n * Params for hierarchy level descriptor requests.\r\n * @beta\r\n */\r\nexport interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Key of the parent node to get hierarchy level descriptor for. */\r\n parentKey?: TNodeKey;\r\n}\r\n\r\n/**\r\n * Request type of filtering hierarchies by given ECInstance paths.\r\n * @public\r\n */\r\nexport interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** A list of paths from root ECInstance to target ECInstance. */\r\n instancePaths: InstanceKey[][];\r\n\r\n /**\r\n * An optional index (`0 <= markedIndex < instancePaths.length`) to mark one of the instance paths. The\r\n * path is marked using `NodePathElement.isMarked` flag in the result.\r\n */\r\n markedIndex?: number;\r\n}\r\n\r\n/**\r\n * Request type of filtering hierarchies by given text.\r\n * @public\r\n */\r\nexport interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Text to filter the hierarchy by. */\r\n filterText: string;\r\n}\r\n\r\n/**\r\n * Request type for content sources requests.\r\n * @public\r\n */\r\nexport interface ContentSourcesRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n /** Full names of classes to get content sources for. Format for a full class name: `SchemaName:ClassName`. */\r\n classes: string[];\r\n}\r\n\r\n/**\r\n * Request type for content descriptor requests.\r\n * @public\r\n */\r\nexport interface ContentDescriptorRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /**\r\n * Content display type.\r\n * @see [[DefaultContentDisplayTypes]]\r\n */\r\n displayType: string;\r\n /** Input keys for getting the content */\r\n keys: TKeySet;\r\n /** Information about the selection event that was the cause of this content request */\r\n selection?: SelectionInfo;\r\n}\r\n\r\n/**\r\n * Request type for content requests.\r\n * @public\r\n */\r\nexport interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Content descriptor for customizing the returned content */\r\n descriptor: TDescriptor;\r\n /** Input keys for getting the content */\r\n keys: TKeySet;\r\n}\r\n\r\n/**\r\n * Request type for distinct values' requests.\r\n * @public\r\n */\r\nexport interface DistinctValuesRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable> extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\r\n /** Content descriptor for customizing the returned content */\r\n descriptor: TDescriptor;\r\n /** Input keys for getting the content */\r\n keys: TKeySet;\r\n /** Descriptor for a field distinct values are requested for */\r\n fieldDescriptor: FieldDescriptor;\r\n}\r\n\r\n/**\r\n * Request type for element properties requests\r\n * @public\r\n */\r\nexport type ElementPropertiesRequestOptions<TIModel> = SingleElementPropertiesRequestOptions<TIModel> | MultiElementPropertiesRequestOptions<TIModel>;\r\n\r\n/**\r\n * Request type for single element properties requests.\r\n * @public\r\n */\r\nexport interface SingleElementPropertiesRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n /** ID of the element to get properties for. */\r\n elementId: Id64String;\r\n}\r\n\r\n/**\r\n * Request type for multiple elements properties requests.\r\n * @public\r\n */\r\nexport interface MultiElementPropertiesRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n /**\r\n * Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes\r\n * are used. Classes should be specified in one of these formats: \"<schema name or alias>.<class_name>\" or\r\n * \"<schema name or alias>:<class_name>\".\r\n */\r\n elementClasses?: string[];\r\n}\r\n\r\n/**\r\n * Request type for content instance keys' requests.\r\n * @public\r\n */\r\nexport interface ContentInstanceKeysRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable> extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\r\n /**\r\n * Content display type.\r\n * @see [[DefaultContentDisplayTypes]]\r\n */\r\n displayType?: string;\r\n /** Input keys for getting the content. */\r\n keys: TKeySet;\r\n}\r\n\r\n/**\r\n * Request type for label requests\r\n * @public\r\n */\r\nexport interface DisplayLabelRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\r\n /** Key of ECInstance to get label for */\r\n key: TInstanceKey;\r\n}\r\n\r\n/**\r\n * Request type for labels requests\r\n * @public\r\n */\r\nexport interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\r\n /** Keys of ECInstances to get labels for */\r\n keys: TInstanceKey[];\r\n}\r\n\r\n/**\r\n * Request options used for selection scope related requests\r\n * @public\r\n */\r\nexport interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Request options used for calculating selection based on given instance keys and selection scope.\r\n * @public\r\n */\r\nexport interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n elementIds: Id64String[];\r\n scope: SelectionScopeProps;\r\n}\r\n/** @internal */\r\nexport function isComputeSelectionRequestOptions<TIModel>(options: ComputeSelectionRequestOptions<TIModel> | SelectionScopeRequestOptions<TIModel>): options is ComputeSelectionRequestOptions<TIModel> {\r\n return !!(options as ComputeSelectionRequestOptions<TIModel>).elementIds;\r\n}\r\n\r\n/**\r\n * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.\r\n * @public\r\n */\r\nexport interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n prev: {\r\n rulesetOrId?: Ruleset | string;\r\n rulesetVariables?: TRulesetVariable[];\r\n };\r\n expandedNodeKeys?: TNodeKey[];\r\n continuationToken?: {\r\n prevHierarchyNode: string;\r\n currHierarchyNode: string;\r\n };\r\n resultSetSize?: number;\r\n}\r\n\r\n/**\r\n * Paging options\r\n * @public\r\n */\r\nexport interface PageOptions {\r\n /** Inclusive start 0-based index of the page */\r\n start?: number;\r\n /** Maximum size of the page */\r\n size?: number;\r\n}\r\n\r\n/**\r\n * A wrapper type that injects [[PageOptions]] into supplied type\r\n * @public\r\n */\r\nexport type Paged<TOptions extends {}> = TOptions & {\r\n /** Optional paging parameters */\r\n paging?: PageOptions;\r\n};\r\n\r\n/**\r\n * A wrapper type that injects priority into supplied type.\r\n * @public\r\n */\r\nexport type Prioritized<TOptions extends {}> = TOptions & {\r\n /** Optional priority */\r\n priority?: number;\r\n};\r\n\r\n/**\r\n * Checks if supplied request options are for single or multiple element properties.\r\n * @internal\r\n */\r\nexport function isSingleElementPropertiesRequestOptions<TIModel>(options: ElementPropertiesRequestOptions<TIModel>): options is SingleElementPropertiesRequestOptions<TIModel> {\r\n return (options as SingleElementPropertiesRequestOptions<TIModel>).elementId !== undefined;\r\n}\r\n\r\n/**\r\n * A wrapper type that injects cancelEvent into supplied type.\r\n * @public\r\n */\r\nexport type WithCancelEvent<TOptions extends {}> = TOptions & {\r\n /** Event which is triggered when the request is canceled */\r\n cancelEvent?: BeEvent<() => void>;\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"PresentationManagerOptions.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationManagerOptions.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAqPH,gBAAgB;AAChB,MAAM,UAAU,gCAAgC,CAAU,OAAwF;IAChJ,OAAO,CAAC,CAAE,OAAmD,CAAC,UAAU,CAAC;AAC3E,CAAC;AAgDD;;;GAGG;AACH,MAAM,UAAU,uCAAuC,CAAU,OAAiD;IAChH,OAAQ,OAA0D,CAAC,SAAS,KAAK,SAAS,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { BeEvent, Id64String } from \"@itwin/core-bentley\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { SelectionInfo } from \"./content/Descriptor\";\r\nimport { FieldDescriptor } from \"./content/Fields\";\r\nimport { InstanceKey } from \"./EC\";\r\nimport { InstanceFilterDefinition } from \"./InstanceFilterDefinition\";\r\nimport { Ruleset } from \"./rules/Ruleset\";\r\nimport { RulesetVariable } from \"./RulesetVariables\";\r\nimport { SelectionScopeProps } from \"./selection/SelectionScope\";\r\n\r\n/**\r\n * A generic request options type used for both hierarchy and content requests.\r\n * @public\r\n */\r\nexport interface RequestOptions<TIModel> {\r\n /** iModel to request data from */\r\n imodel: TIModel;\r\n\r\n /** Optional locale to use when formatting / localizing data */\r\n locale?: string;\r\n\r\n /**\r\n * Unit system to use when formatting property values with units. Default presentation\r\n * unit is used if unit system is not specified.\r\n */\r\n unitSystem?: UnitSystemKey;\r\n\r\n /**\r\n * Expected form of response. This property is set automatically on newer frontends.\r\n * `unparsed-json` — deliver response from native addon without parsing it.\r\n * @internal\r\n */\r\n transport?: \"unparsed-json\";\r\n}\r\n\r\n/**\r\n * Options for requests that require presentation ruleset. Not\r\n * meant to be used directly, see one of the subclasses.\r\n *\r\n * @public\r\n */\r\nexport interface RequestOptionsWithRuleset<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptions<TIModel> {\r\n /** Ruleset or id of the ruleset to use when requesting data */\r\n rulesetOrId: Ruleset | string;\r\n\r\n /** Ruleset variables to use when requesting data */\r\n rulesetVariables?: TRulesetVariable[];\r\n}\r\n\r\n/**\r\n * Request type for hierarchy requests.\r\n * @public\r\n */\r\nexport interface HierarchyRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Key of the parent node to get children for */\r\n parentKey?: TNodeKey;\r\n\r\n /**\r\n * An instance filter that should be applied for this hierarchy level.\r\n *\r\n * **Note:** May only be used on hierarchy levels that support filtering - check [[NavNode.supportsFiltering]] before\r\n * requesting filtered children.\r\n *\r\n * @beta\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n\r\n /**\r\n * A limit to how many instances at most should be loaded for a hierarchy level. If the limit is exceeded,\r\n * the request fails with [[PresentationError]] having [[PresentationStatus.ResultSetTooLarge]] error number.\r\n *\r\n * Specifying the limit is useful when creating unlimited size result sets is not meaningful - this allows the library\r\n * to return early as soon as the limit is reached, instead of creating a very large result that's possibly too large to\r\n * be useful to be displayed to end users.\r\n *\r\n * @see [Hierarchies' filtering and limiting]($docs/presentation/hierarchies/FilteringLimiting.md)\r\n * @beta\r\n */\r\n sizeLimit?: number;\r\n}\r\n\r\n/**\r\n * Params for hierarchy level descriptor requests.\r\n * @beta\r\n */\r\nexport interface HierarchyLevelDescriptorRequestOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Key of the parent node to get hierarchy level descriptor for. */\r\n parentKey?: TNodeKey;\r\n}\r\n\r\n/**\r\n * Request type of filtering hierarchies by given ECInstance paths.\r\n * @public\r\n */\r\nexport interface FilterByInstancePathsHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** A list of paths from root ECInstance to target ECInstance. */\r\n instancePaths: InstanceKey[][];\r\n\r\n /**\r\n * An optional index (`0 <= markedIndex < instancePaths.length`) to mark one of the instance paths. The\r\n * path is marked using `NodePathElement.isMarked` flag in the result.\r\n */\r\n markedIndex?: number;\r\n}\r\n\r\n/**\r\n * Request type of filtering hierarchies by given text.\r\n * @public\r\n */\r\nexport interface FilterByTextHierarchyRequestOptions<TIModel, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Text to filter the hierarchy by. */\r\n filterText: string;\r\n}\r\n\r\n/**\r\n * Request type for content sources requests.\r\n * @public\r\n */\r\nexport interface ContentSourcesRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n /** Full names of classes to get content sources for. Format for a full class name: `SchemaName:ClassName`. */\r\n classes: string[];\r\n}\r\n\r\n/**\r\n * Request type for content descriptor requests.\r\n * @public\r\n */\r\nexport interface ContentDescriptorRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /**\r\n * Content display type.\r\n * @see [[DefaultContentDisplayTypes]]\r\n */\r\n displayType: string;\r\n /** Input keys for getting the content */\r\n keys: TKeySet;\r\n /** Information about the selection event that was the cause of this content request */\r\n selection?: SelectionInfo;\r\n}\r\n\r\n/**\r\n * Request type for content requests.\r\n * @public\r\n */\r\nexport interface ContentRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n /** Content descriptor for customizing the returned content */\r\n descriptor: TDescriptor;\r\n /** Input keys for getting the content */\r\n keys: TKeySet;\r\n /**\r\n * Flag that specifies whether value formatting should be emitted or not.\r\n * Content is returned without `displayValues` when this is set to `true`.\r\n * @alpha\r\n */\r\n omitFormattedValues?: boolean;\r\n}\r\n\r\n/**\r\n * Request type for distinct values' requests.\r\n * @public\r\n */\r\nexport interface DistinctValuesRequestOptions<TIModel, TDescriptor, TKeySet, TRulesetVariable = RulesetVariable> extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\r\n /** Content descriptor for customizing the returned content */\r\n descriptor: TDescriptor;\r\n /** Input keys for getting the content */\r\n keys: TKeySet;\r\n /** Descriptor for a field distinct values are requested for */\r\n fieldDescriptor: FieldDescriptor;\r\n}\r\n\r\n/**\r\n * Request type for element properties requests\r\n * @public\r\n */\r\nexport type ElementPropertiesRequestOptions<TIModel> = SingleElementPropertiesRequestOptions<TIModel> | MultiElementPropertiesRequestOptions<TIModel>;\r\n\r\n/**\r\n * Request type for single element properties requests.\r\n * @public\r\n */\r\nexport interface SingleElementPropertiesRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n /** ID of the element to get properties for. */\r\n elementId: Id64String;\r\n}\r\n\r\n/**\r\n * Request type for multiple elements properties requests.\r\n * @public\r\n */\r\nexport interface MultiElementPropertiesRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n /**\r\n * Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes\r\n * are used. Classes should be specified in one of these formats: \"<schema name or alias>.<class_name>\" or\r\n * \"<schema name or alias>:<class_name>\".\r\n */\r\n elementClasses?: string[];\r\n}\r\n\r\n/**\r\n * Request type for content instance keys' requests.\r\n * @public\r\n */\r\nexport interface ContentInstanceKeysRequestOptions<TIModel, TKeySet, TRulesetVariable = RulesetVariable> extends Paged<RequestOptionsWithRuleset<TIModel, TRulesetVariable>> {\r\n /**\r\n * Content display type.\r\n * @see [[DefaultContentDisplayTypes]]\r\n */\r\n displayType?: string;\r\n /** Input keys for getting the content. */\r\n keys: TKeySet;\r\n}\r\n\r\n/**\r\n * Request type for label requests\r\n * @public\r\n */\r\nexport interface DisplayLabelRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\r\n /** Key of ECInstance to get label for */\r\n key: TInstanceKey;\r\n}\r\n\r\n/**\r\n * Request type for labels requests\r\n * @public\r\n */\r\nexport interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends RequestOptions<TIModel> {\r\n /** Keys of ECInstances to get labels for */\r\n keys: TInstanceKey[];\r\n}\r\n\r\n/**\r\n * Request options used for selection scope related requests\r\n * @public\r\n */\r\nexport interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Request options used for calculating selection based on given instance keys and selection scope.\r\n * @public\r\n */\r\nexport interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {\r\n elementIds: Id64String[];\r\n scope: SelectionScopeProps;\r\n}\r\n/** @internal */\r\nexport function isComputeSelectionRequestOptions<TIModel>(options: ComputeSelectionRequestOptions<TIModel> | SelectionScopeRequestOptions<TIModel>): options is ComputeSelectionRequestOptions<TIModel> {\r\n return !!(options as ComputeSelectionRequestOptions<TIModel>).elementIds;\r\n}\r\n\r\n/**\r\n * Data structure for comparing a hierarchy after ruleset or ruleset variable changes.\r\n * @public\r\n */\r\nexport interface HierarchyCompareOptions<TIModel, TNodeKey, TRulesetVariable = RulesetVariable> extends RequestOptionsWithRuleset<TIModel, TRulesetVariable> {\r\n prev: {\r\n rulesetOrId?: Ruleset | string;\r\n rulesetVariables?: TRulesetVariable[];\r\n };\r\n expandedNodeKeys?: TNodeKey[];\r\n continuationToken?: {\r\n prevHierarchyNode: string;\r\n currHierarchyNode: string;\r\n };\r\n resultSetSize?: number;\r\n}\r\n\r\n/**\r\n * Paging options\r\n * @public\r\n */\r\nexport interface PageOptions {\r\n /** Inclusive start 0-based index of the page */\r\n start?: number;\r\n /** Maximum size of the page */\r\n size?: number;\r\n}\r\n\r\n/**\r\n * A wrapper type that injects [[PageOptions]] into supplied type\r\n * @public\r\n */\r\nexport type Paged<TOptions extends {}> = TOptions & {\r\n /** Optional paging parameters */\r\n paging?: PageOptions;\r\n};\r\n\r\n/**\r\n * A wrapper type that injects priority into supplied type.\r\n * @public\r\n */\r\nexport type Prioritized<TOptions extends {}> = TOptions & {\r\n /** Optional priority */\r\n priority?: number;\r\n};\r\n\r\n/**\r\n * Checks if supplied request options are for single or multiple element properties.\r\n * @internal\r\n */\r\nexport function isSingleElementPropertiesRequestOptions<TIModel>(options: ElementPropertiesRequestOptions<TIModel>): options is SingleElementPropertiesRequestOptions<TIModel> {\r\n return (options as SingleElementPropertiesRequestOptions<TIModel>).elementId !== undefined;\r\n}\r\n\r\n/**\r\n * A wrapper type that injects cancelEvent into supplied type.\r\n * @public\r\n */\r\nexport type WithCancelEvent<TOptions extends {}> = TOptions & {\r\n /** Event which is triggered when the request is canceled */\r\n cancelEvent?: BeEvent<() => void>;\r\n};\r\n"]}
|
|
@@ -6,15 +6,6 @@ import { Node, NodeJSON, PartialNode, PartialNodeJSON } from "./hierarchy/Node";
|
|
|
6
6
|
/** @alpha */
|
|
7
7
|
export declare const UPDATE_FULL = "FULL";
|
|
8
8
|
/** @alpha */
|
|
9
|
-
export interface UpdateInfoJSON {
|
|
10
|
-
[imodel: string]: {
|
|
11
|
-
[rulesetId: string]: {
|
|
12
|
-
hierarchy?: HierarchyUpdateInfoJSON;
|
|
13
|
-
content?: ContentUpdateInfo;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
/** @alpha */
|
|
18
9
|
export interface UpdateInfo {
|
|
19
10
|
[imodel: string]: {
|
|
20
11
|
[rulesetId: string]: {
|
|
@@ -24,61 +15,7 @@ export interface UpdateInfo {
|
|
|
24
15
|
};
|
|
25
16
|
}
|
|
26
17
|
/** @alpha */
|
|
27
|
-
export
|
|
28
|
-
/** Serialize given object to JSON. */
|
|
29
|
-
function toJSON(obj: UpdateInfo): UpdateInfoJSON;
|
|
30
|
-
/** Deserialize given object from JSON */
|
|
31
|
-
function fromJSON(json: UpdateInfoJSON): UpdateInfo;
|
|
32
|
-
}
|
|
33
|
-
/** @alpha */
|
|
34
|
-
export interface ExpandedNodeUpdateRecordJSON {
|
|
35
|
-
node: NodeJSON;
|
|
36
|
-
position: number;
|
|
37
|
-
}
|
|
38
|
-
/** @alpha */
|
|
39
|
-
export interface HierarchyUpdateRecordJSON {
|
|
40
|
-
parent?: NodeKeyJSON;
|
|
41
|
-
nodesCount: number;
|
|
42
|
-
expandedNodes?: ExpandedNodeUpdateRecordJSON[];
|
|
43
|
-
instanceFilter?: string;
|
|
44
|
-
}
|
|
45
|
-
/** @alpha */
|
|
46
|
-
export interface ExpandedNodeUpdateRecord {
|
|
47
|
-
node: Node;
|
|
48
|
-
position: number;
|
|
49
|
-
}
|
|
50
|
-
/** @alpha */
|
|
51
|
-
export interface HierarchyUpdateRecord {
|
|
52
|
-
parent?: NodeKey;
|
|
53
|
-
nodesCount: number;
|
|
54
|
-
expandedNodes?: ExpandedNodeUpdateRecord[];
|
|
55
|
-
instanceFilter?: string;
|
|
56
|
-
}
|
|
57
|
-
/** @alpha */
|
|
58
|
-
export declare namespace ExpandedNodeUpdateRecord {
|
|
59
|
-
/** Serialize given object to JSON. */
|
|
60
|
-
function toJSON(obj: ExpandedNodeUpdateRecord): ExpandedNodeUpdateRecordJSON;
|
|
61
|
-
/** Deserialize given object from JSON */
|
|
62
|
-
function fromJSON(json: ExpandedNodeUpdateRecordJSON): ExpandedNodeUpdateRecord;
|
|
63
|
-
}
|
|
64
|
-
/** @alpha */
|
|
65
|
-
export declare namespace HierarchyUpdateRecord {
|
|
66
|
-
/** Serialize given object to JSON. */
|
|
67
|
-
function toJSON(obj: HierarchyUpdateRecord): HierarchyUpdateRecordJSON;
|
|
68
|
-
/** Deserialize given object from JSON */
|
|
69
|
-
function fromJSON(json: HierarchyUpdateRecordJSON): HierarchyUpdateRecord;
|
|
70
|
-
}
|
|
71
|
-
/** @alpha */
|
|
72
|
-
export type HierarchyUpdateInfoJSON = typeof UPDATE_FULL | HierarchyUpdateRecordJSON[];
|
|
73
|
-
/** @alpha */
|
|
74
|
-
export type HierarchyUpdateInfo = typeof UPDATE_FULL | HierarchyUpdateRecord[];
|
|
75
|
-
/** @alpha */
|
|
76
|
-
export declare namespace HierarchyUpdateInfo {
|
|
77
|
-
/** Serialize given object to JSON. */
|
|
78
|
-
function toJSON(obj: HierarchyUpdateInfo): HierarchyUpdateInfoJSON;
|
|
79
|
-
/** Deserialize given object from JSON */
|
|
80
|
-
function fromJSON(json: HierarchyUpdateInfoJSON): HierarchyUpdateInfo;
|
|
81
|
-
}
|
|
18
|
+
export type HierarchyUpdateInfo = typeof UPDATE_FULL;
|
|
82
19
|
/** @alpha */
|
|
83
20
|
export type ContentUpdateInfo = typeof UPDATE_FULL;
|
|
84
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhF,aAAa;AACb,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC,aAAa;AACb,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Update.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/Update.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEhF,aAAa;AACb,eAAO,MAAM,WAAW,SAAS,CAAC;AAElC,aAAa;AACb,MAAM,WAAW,UAAU;IACzB,CAAC,MAAM,EAAE,MAAM,GAA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
12
|
-
/** @alpha */
|
|
13
|
-
export var UpdateInfo;
|
|
14
|
-
(function (UpdateInfo) {
|
|
15
|
-
/** Serialize given object to JSON. */
|
|
16
|
-
function toJSON(obj) {
|
|
17
|
-
const json = {};
|
|
18
|
-
for (const imodel in obj) {
|
|
19
|
-
// istanbul ignore if
|
|
20
|
-
if (!obj.hasOwnProperty(imodel))
|
|
21
|
-
continue;
|
|
22
|
-
json[imodel] = {};
|
|
23
|
-
const rulesetObj = obj[imodel];
|
|
24
|
-
for (const rulesetId in rulesetObj) {
|
|
25
|
-
// istanbul ignore if
|
|
26
|
-
if (!rulesetObj.hasOwnProperty(rulesetId))
|
|
27
|
-
continue;
|
|
28
|
-
json[imodel][rulesetId] = {
|
|
29
|
-
hierarchy: rulesetObj[rulesetId].hierarchy ? HierarchyUpdateInfo.toJSON(rulesetObj[rulesetId].hierarchy) : undefined,
|
|
30
|
-
content: rulesetObj[rulesetId].content,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return json;
|
|
35
|
-
}
|
|
36
|
-
UpdateInfo.toJSON = toJSON;
|
|
37
|
-
/** Deserialize given object from JSON */
|
|
38
|
-
function fromJSON(json) {
|
|
39
|
-
const obj = {};
|
|
40
|
-
for (const imodel in json) {
|
|
41
|
-
// istanbul ignore if
|
|
42
|
-
if (!json.hasOwnProperty(imodel))
|
|
43
|
-
continue;
|
|
44
|
-
obj[imodel] = {};
|
|
45
|
-
const rulesetJson = json[imodel];
|
|
46
|
-
for (const rulesetId in rulesetJson) {
|
|
47
|
-
// istanbul ignore if
|
|
48
|
-
if (!rulesetJson.hasOwnProperty(rulesetId))
|
|
49
|
-
continue;
|
|
50
|
-
obj[imodel][rulesetId] = {
|
|
51
|
-
hierarchy: rulesetJson[rulesetId].hierarchy ? HierarchyUpdateInfo.fromJSON(rulesetJson[rulesetId].hierarchy) : undefined,
|
|
52
|
-
content: rulesetJson[rulesetId].content,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return obj;
|
|
57
|
-
}
|
|
58
|
-
UpdateInfo.fromJSON = fromJSON;
|
|
59
|
-
})(UpdateInfo || (UpdateInfo = {}));
|
|
60
|
-
/** @alpha */
|
|
61
|
-
export var ExpandedNodeUpdateRecord;
|
|
62
|
-
(function (ExpandedNodeUpdateRecord) {
|
|
63
|
-
/** Serialize given object to JSON. */
|
|
64
|
-
function toJSON(obj) {
|
|
65
|
-
return {
|
|
66
|
-
...obj,
|
|
67
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
68
|
-
node: Node.toJSON(obj.node),
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
ExpandedNodeUpdateRecord.toJSON = toJSON;
|
|
72
|
-
/** Deserialize given object from JSON */
|
|
73
|
-
function fromJSON(json) {
|
|
74
|
-
return {
|
|
75
|
-
...json,
|
|
76
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
77
|
-
node: Node.fromJSON(json.node),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
ExpandedNodeUpdateRecord.fromJSON = fromJSON;
|
|
81
|
-
})(ExpandedNodeUpdateRecord || (ExpandedNodeUpdateRecord = {}));
|
|
82
|
-
/** @alpha */
|
|
83
|
-
export var HierarchyUpdateRecord;
|
|
84
|
-
(function (HierarchyUpdateRecord) {
|
|
85
|
-
/** Serialize given object to JSON. */
|
|
86
|
-
function toJSON(obj) {
|
|
87
|
-
return {
|
|
88
|
-
...obj,
|
|
89
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
90
|
-
parent: obj.parent ? NodeKey.toJSON(obj.parent) : undefined,
|
|
91
|
-
expandedNodes: obj.expandedNodes ? obj.expandedNodes.map(ExpandedNodeUpdateRecord.toJSON) : undefined,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
HierarchyUpdateRecord.toJSON = toJSON;
|
|
95
|
-
/** Deserialize given object from JSON */
|
|
96
|
-
function fromJSON(json) {
|
|
97
|
-
return {
|
|
98
|
-
...json,
|
|
99
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
100
|
-
parent: json.parent ? NodeKey.fromJSON(json.parent) : undefined,
|
|
101
|
-
expandedNodes: json.expandedNodes ? json.expandedNodes.map(ExpandedNodeUpdateRecord.fromJSON) : undefined,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
HierarchyUpdateRecord.fromJSON = fromJSON;
|
|
105
|
-
})(HierarchyUpdateRecord || (HierarchyUpdateRecord = {}));
|
|
106
|
-
/** @alpha */
|
|
107
|
-
export var HierarchyUpdateInfo;
|
|
108
|
-
(function (HierarchyUpdateInfo) {
|
|
109
|
-
/** Serialize given object to JSON. */
|
|
110
|
-
function toJSON(obj) {
|
|
111
|
-
if (typeof obj === "string")
|
|
112
|
-
return obj;
|
|
113
|
-
return obj.map(HierarchyUpdateRecord.toJSON);
|
|
114
|
-
}
|
|
115
|
-
HierarchyUpdateInfo.toJSON = toJSON;
|
|
116
|
-
/** Deserialize given object from JSON */
|
|
117
|
-
function fromJSON(json) {
|
|
118
|
-
if (typeof json === "string")
|
|
119
|
-
return json;
|
|
120
|
-
return json.map(HierarchyUpdateRecord.fromJSON);
|
|
121
|
-
}
|
|
122
|
-
HierarchyUpdateInfo.fromJSON = fromJSON;
|
|
123
|
-
})(HierarchyUpdateInfo || (HierarchyUpdateInfo = {}));
|
|
124
12
|
/** @public */
|
|
125
13
|
export var PartialHierarchyModification;
|
|
126
14
|
(function (PartialHierarchyModification) {
|