@itwin/presentation-common 5.0.0-dev.56 → 5.0.0-dev.58
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 +3 -258
- package/lib/cjs/presentation-common/AsyncTasks.js +1 -3
- package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/cjs/presentation-common/EC.d.ts +5 -80
- package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
- package/lib/cjs/presentation-common/EC.js +1 -97
- package/lib/cjs/presentation-common/EC.js.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js +16 -9
- package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.d.ts +2 -2
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +9 -11
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +3 -0
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.d.ts +0 -48
- package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js +1 -44
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +1 -0
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +7 -9
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +21 -17
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js +3 -0
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +7 -7
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +6 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
- package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +2 -79
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +1 -104
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.d.ts +7 -0
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +23 -0
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.d.ts +0 -7
- package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js +5 -10
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +20 -12
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.d.ts +2 -31
- package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.js +50 -15
- package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.d.ts +4 -10
- package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js +77 -35
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.d.ts +5 -31
- package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js +24 -48
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.d.ts +2 -12
- package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js +0 -18
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +3 -0
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/content/Value.d.ts +0 -106
- package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Value.js +1 -215
- package/lib/cjs/presentation-common/content/Value.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts +0 -83
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +6 -24
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts +2 -106
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.d.ts +0 -14
- package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common.d.ts +1 -5
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +2 -5
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.js +1 -3
- package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/esm/presentation-common/EC.d.ts +5 -80
- package/lib/esm/presentation-common/EC.d.ts.map +1 -1
- package/lib/esm/presentation-common/EC.js +0 -96
- package/lib/esm/presentation-common/EC.js.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js +16 -9
- package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +2 -2
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +9 -11
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +3 -0
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.d.ts +0 -48
- package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js +0 -43
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +1 -0
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +7 -9
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +21 -17
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js +3 -0
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +7 -7
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +6 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
- package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +2 -79
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +0 -103
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.d.ts +7 -0
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +22 -0
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.d.ts +0 -7
- package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Content.js +5 -10
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +20 -12
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.d.ts +2 -31
- package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.js +50 -15
- package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/esm/presentation-common/content/Fields.d.ts +4 -10
- package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js +77 -35
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.d.ts +5 -31
- package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Item.js +24 -48
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.d.ts +2 -12
- package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Property.js +0 -18
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +3 -0
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/content/Value.d.ts +0 -106
- package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Value.js +0 -214
- package/lib/esm/presentation-common/content/Value.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts +0 -83
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +6 -24
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts +2 -106
- package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.d.ts +0 -14
- package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
- package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common.d.ts +1 -5
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +1 -5
- package/lib/esm/presentation-common.js.map +1 -1
- package/package.json +10 -10
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
- package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
- package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAiB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,WAAW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,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAE7C;;;;;;;;;;;OAWG;gBAED,WAAW,EAAE,WAAW,EAAE,EAC1B,KAAK,EAAE,MAAM,GAAG,eAAe,EAC/B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAC/B,aAAa,EAAE,gBAAgB,CAAC,YAAY,CAAC,EAC7C,gBAAgB,EAAE,MAAM,EAAE,EAC1B,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;gBAEpB,KAAK,EAAE,SAAS;IAqCnC;;OAEG;IACI,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIhD,oCAAoC;IAC7B,MAAM,IAAI,QAAQ;IAQzB,qCAAqC;WACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;CAe9E"}
|
|
@@ -10,12 +10,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.Item = void 0;
|
|
11
11
|
const LabelDefinition_1 = require("../LabelDefinition");
|
|
12
12
|
const Utils_1 = require("../Utils");
|
|
13
|
-
const Value_1 = require("./Value");
|
|
14
13
|
/**
|
|
15
14
|
* A data structure that represents a single content record.
|
|
16
15
|
* @public
|
|
17
16
|
*/
|
|
18
17
|
class Item {
|
|
18
|
+
/**
|
|
19
|
+
* Keys of input instances that caused this item to be included in content. Only set if the content is
|
|
20
|
+
* created with [[ContentFlags.IncludeInputKeys]] flag.
|
|
21
|
+
*/
|
|
22
|
+
inputKeys;
|
|
23
|
+
/** Keys of instances whose data is contained in this item */
|
|
24
|
+
primaryKeys;
|
|
25
|
+
/** Display label of the item */
|
|
26
|
+
label;
|
|
27
|
+
/** For cases when item consists only of same class instances, information about the ECClass */
|
|
28
|
+
classInfo;
|
|
29
|
+
/** Raw values dictionary */
|
|
30
|
+
values;
|
|
31
|
+
/** Display values dictionary */
|
|
32
|
+
displayValues;
|
|
33
|
+
/** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */
|
|
34
|
+
mergedFieldNames;
|
|
35
|
+
/** Extended data injected into this content item */
|
|
36
|
+
extendedData;
|
|
19
37
|
constructor(primaryKeysOrProps, label, imageId, classInfo, values, displayValues, mergedFieldNames, extendedData) {
|
|
20
38
|
/* istanbul ignore next */
|
|
21
39
|
const props = Array.isArray(primaryKeysOrProps)
|
|
@@ -34,8 +52,6 @@ class Item {
|
|
|
34
52
|
this.inputKeys = props.inputKeys;
|
|
35
53
|
}
|
|
36
54
|
this.primaryKeys = props.primaryKeys;
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
38
|
-
this.imageId = "imageId" in props ? props.imageId : "";
|
|
39
55
|
this.classInfo = props.classInfo;
|
|
40
56
|
this.values = props.values;
|
|
41
57
|
this.displayValues = props.displayValues;
|
|
@@ -51,15 +67,10 @@ class Item {
|
|
|
51
67
|
}
|
|
52
68
|
/** Serialize this object to JSON */
|
|
53
69
|
toJSON() {
|
|
54
|
-
const { label,
|
|
70
|
+
const { label, ...baseItem } = this;
|
|
55
71
|
return (0, Utils_1.omitUndefined)({
|
|
56
72
|
...baseItem,
|
|
57
|
-
|
|
58
|
-
values: Value_1.Value.toJSON(values),
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
60
|
-
displayValues: Value_1.DisplayValue.toJSON(displayValues),
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
62
|
-
labelDefinition: LabelDefinition_1.LabelDefinition.toJSON(label),
|
|
73
|
+
labelDefinition: label,
|
|
63
74
|
});
|
|
64
75
|
}
|
|
65
76
|
/** Deserialize [[Item]] from JSON */
|
|
@@ -68,49 +79,14 @@ class Item {
|
|
|
68
79
|
return undefined;
|
|
69
80
|
}
|
|
70
81
|
if (typeof json === "string") {
|
|
71
|
-
return JSON.parse(json
|
|
82
|
+
return Item.fromJSON(JSON.parse(json));
|
|
72
83
|
}
|
|
73
|
-
const { labelDefinition,
|
|
84
|
+
const { labelDefinition, ...baseJson } = json;
|
|
74
85
|
return new Item({
|
|
75
86
|
...baseJson,
|
|
76
|
-
|
|
77
|
-
values: Value_1.Value.fromJSON(values),
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
79
|
-
displayValues: Value_1.DisplayValue.fromJSON(displayValues),
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
81
|
-
label: LabelDefinition_1.LabelDefinition.fromJSON(labelDefinition),
|
|
87
|
+
label: labelDefinition,
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
|
-
/**
|
|
85
|
-
* Reviver function that can be used as a second argument for
|
|
86
|
-
* `JSON.parse` method when parsing Item objects.
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
|
-
static reviver(key, value) {
|
|
90
|
-
return key === "" ? Item.fromJSON(value) : value;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Deserialize items list from JSON
|
|
94
|
-
* @param json JSON or JSON serialized to string to deserialize from
|
|
95
|
-
* @returns Deserialized items list
|
|
96
|
-
* @internal
|
|
97
|
-
*/
|
|
98
|
-
static listFromJSON(json) {
|
|
99
|
-
if (typeof json === "string") {
|
|
100
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
101
|
-
return JSON.parse(json, Item.listReviver);
|
|
102
|
-
}
|
|
103
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
104
|
-
return json.map(Item.fromJSON).filter((item) => !!item);
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Reviver function that can be used as a second argument for
|
|
108
|
-
* `JSON.parse` method when parsing [[Item]][] objects.
|
|
109
|
-
* @internal
|
|
110
|
-
*/
|
|
111
|
-
static listReviver(key, value) {
|
|
112
|
-
return key === "" ? Item.listFromJSON(value) : value;
|
|
113
|
-
}
|
|
114
90
|
}
|
|
115
91
|
exports.Item = Item;
|
|
116
92
|
//# sourceMappingURL=Item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,wDAA0E;AAC1E,oCAA2D;AAC3D,mCAA6I;AAsC7I;;;GAGG;AACH,MAAa,IAAI;IAiDf,YACE,kBAA6C,EAC7C,KAAgC,EAChC,OAAgB,EAChB,SAAiC,EACjC,MAAgC,EAChC,aAA8C,EAC9C,gBAA2B,EAC3B,YAAqC;QAErC,0BAA0B;QAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAC7C,CAAC,CAAC;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,iCAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAM;gBAClF,OAAO,EAAE,OAAQ;gBACjB,SAAS;gBACT,MAAM,EAAE,MAAO;gBACf,aAAa,EAAE,aAAc;gBAC7B,gBAAgB,EAAE,gBAAiB;gBACnC,YAAY;aACb;YACH,CAAC,CAAC,kBAAkB,CAAC;QAEvB,IAAI,WAAW,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACnC,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,4DAA4D;QAC5D,IAAI,CAAC,OAAO,GAAG,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,KA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QAErE,OAAO,IAAI,IAAI,CAAC;YACd,GAAG,QAAQ;YACX,4DAA4D;YAC5D,MAAM,EAAE,aAAK,CAAC,QAAQ,CAAC,MAAM,CAAc;YAC3C,4DAA4D;YAC5D,aAAa,EAAE,oBAAY,CAAC,QAAQ,CAAC,aAAa,CAAqB;YACvE,4DAA4D;YAC5D,KAAK,EAAE,iCAAe,CAAC,QAAQ,CAAC,eAAe,CAAC;SACjD,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,GAAW,EAAE,KAAU;QAC3C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,YAAY,CAAC,IAAyB;QAClD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,6DAA6D;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;QACD,6DAA6D;QAC7D,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAU;QAC/C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,CAAC;CACF;AAjKD,oBAiKC","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 { ClassInfo, InstanceKey } from \"../EC\";\nimport { LabelDefinition, LabelDefinitionJSON } from \"../LabelDefinition\";\nimport { omitUndefined, ValuesDictionary } from \"../Utils\";\nimport { DisplayValue, DisplayValueJSON, DisplayValuesMap, DisplayValuesMapJSON, Value, ValueJSON, ValuesMap, ValuesMapJSON } from \"./Value\";\n\n/**\n * Serialized [[Item]] JSON representation.\n * @public\n */\nexport interface ItemJSON {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n // TODO: rename to `label`\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n labelDefinition: LabelDefinitionJSON;\n /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */\n imageId: string;\n classInfo?: ClassInfo;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n values: ValuesDictionary<ValueJSON>;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n displayValues: ValuesDictionary<DisplayValueJSON>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * Props for creating [[Item]].\n * @public\n */\ninterface ItemProps {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n label: LabelDefinition;\n classInfo?: ClassInfo;\n values: ValuesDictionary<Value>;\n displayValues: ValuesDictionary<DisplayValue>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * A data structure that represents a single content record.\n * @public\n */\nexport class Item {\n /**\n * Keys of input instances that caused this item to be included in content. Only set if the content is\n * created with [[ContentFlags.IncludeInputKeys]] flag.\n */\n public inputKeys?: InstanceKey[];\n /** Keys of instances whose data is contained in this item */\n public primaryKeys: InstanceKey[];\n /** Display label of the item */\n public label: LabelDefinition;\n /**\n * ID of the image associated with this item\n * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\n */\n public imageId: string;\n /** For cases when item consists only of same class instances, information about the ECClass */\n public classInfo?: ClassInfo;\n /** Raw values dictionary */\n public values: ValuesDictionary<Value>;\n /** Display values dictionary */\n public displayValues: ValuesDictionary<DisplayValue>;\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\n public mergedFieldNames: string[];\n /** Extended data injected into this content item */\n public extendedData?: { [key: string]: any };\n\n /**\n * Creates an instance of Item.\n * @param primaryKeys Keys of instances whose data is contained in this item\n * @param label Display label of the item\n * @param imageId ID of the image associated with this item\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\n * @param values Raw values dictionary\n * @param displayValues Display values dictionary\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\n * @param extendedData Extended data injected into this content item\n * @deprecated in 5.0. Use an overload with `ItemProps` instead.\n */\n public constructor(\n primaryKeys: InstanceKey[],\n label: string | LabelDefinition,\n imageId: string,\n classInfo: ClassInfo | undefined,\n values: ValuesDictionary<Value>,\n displayValues: ValuesDictionary<DisplayValue>,\n mergedFieldNames: string[],\n extendedData?: { [key: string]: any },\n );\n public constructor(props: ItemProps);\n public constructor(\n primaryKeysOrProps: ItemProps | InstanceKey[],\n label?: string | LabelDefinition,\n imageId?: string,\n classInfo?: ClassInfo | undefined,\n values?: ValuesDictionary<Value>,\n displayValues?: ValuesDictionary<DisplayValue>,\n mergedFieldNames?: string[],\n extendedData?: { [key: string]: any },\n ) {\n /* istanbul ignore next */\n const props = Array.isArray(primaryKeysOrProps)\n ? {\n primaryKeys: primaryKeysOrProps,\n label: typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label!,\n imageId: imageId!,\n classInfo,\n values: values!,\n displayValues: displayValues!,\n mergedFieldNames: mergedFieldNames!,\n extendedData,\n }\n : primaryKeysOrProps;\n\n if (\"inputKeys\" in props) {\n this.inputKeys = props.inputKeys;\n }\n this.primaryKeys = props.primaryKeys;\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n this.imageId = \"imageId\" in props ? props.imageId : \"\";\n this.classInfo = props.classInfo;\n this.values = props.values;\n this.displayValues = props.displayValues;\n this.mergedFieldNames = props.mergedFieldNames;\n this.extendedData = props.extendedData;\n this.label = props.label;\n }\n\n /**\n * Is value of field with the specified name merged in this record.\n */\n public isFieldMerged(fieldName: string): boolean {\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\n }\n\n /** Serialize this object to JSON */\n public toJSON(): ItemJSON {\n const { label, values, displayValues, ...baseItem } = this;\n return omitUndefined({\n ...baseItem,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n values: Value.toJSON(values) as ValuesMapJSON,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n displayValues: DisplayValue.toJSON(displayValues) as DisplayValuesMapJSON,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n labelDefinition: LabelDefinition.toJSON(label),\n });\n }\n\n /** Deserialize [[Item]] from JSON */\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\n if (!json) {\n return undefined;\n }\n if (typeof json === \"string\") {\n return JSON.parse(json, (key, value) => Item.reviver(key, value));\n }\n const { labelDefinition, values, displayValues, ...baseJson } = json;\n\n return new Item({\n ...baseJson,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n values: Value.fromJSON(values) as ValuesMap,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n displayValues: DisplayValue.fromJSON(displayValues) as DisplayValuesMap,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n label: LabelDefinition.fromJSON(labelDefinition),\n });\n }\n\n /**\n * Reviver function that can be used as a second argument for\n * `JSON.parse` method when parsing Item objects.\n * @internal\n */\n public static reviver(key: string, value: any): any {\n return key === \"\" ? Item.fromJSON(value) : value;\n }\n\n /**\n * Deserialize items list from JSON\n * @param json JSON or JSON serialized to string to deserialize from\n * @returns Deserialized items list\n * @internal\n */\n public static listFromJSON(json: ItemJSON[] | string): Item[] {\n if (typeof json === \"string\") {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return JSON.parse(json, Item.listReviver);\n }\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return json.map(Item.fromJSON).filter((item): item is Item => !!item);\n }\n\n /**\n * Reviver function that can be used as a second argument for\n * `JSON.parse` method when parsing [[Item]][] objects.\n * @internal\n */\n public static listReviver(key: string, value: any): any {\n return key === \"\" ? Item.listFromJSON(value) : value;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,wDAAqD;AACrD,oCAA2D;AAkC3D;;;GAGG;AACH,MAAa,IAAI;IACf;;;OAGG;IACI,SAAS,CAAiB;IACjC,6DAA6D;IACtD,WAAW,CAAgB;IAClC,gCAAgC;IACzB,KAAK,CAAkB;IAC9B,+FAA+F;IACxF,SAAS,CAAa;IAC7B,4BAA4B;IACrB,MAAM,CAA0B;IACvC,gCAAgC;IACzB,aAAa,CAAiC;IACrD,+HAA+H;IACxH,gBAAgB,CAAW;IAClC,oDAAoD;IAC7C,YAAY,CAA0B;IAyB7C,YACE,kBAA6C,EAC7C,KAAgC,EAChC,OAAgB,EAChB,SAAiC,EACjC,MAAgC,EAChC,aAA8C,EAC9C,gBAA2B,EAC3B,YAAqC;QAErC,0BAA0B;QAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAC7C,CAAC,CAAC;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,iCAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAM;gBAClF,OAAO,EAAE,OAAQ;gBACjB,SAAS;gBACT,MAAM,EAAE,MAAO;gBACf,aAAa,EAAE,aAAc;gBAC7B,gBAAgB,EAAE,gBAAiB;gBACnC,YAAY;aACb;YACH,CAAC,CAAC,kBAAkB,CAAC;QAEvB,IAAI,WAAW,IAAI,KAAK,EAAE,CAAC;Y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ACF;AAhHD,oBAgHC","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 { ClassInfo, InstanceKey } from \"../EC\";\nimport { LabelDefinition } from \"../LabelDefinition\";\nimport { omitUndefined, ValuesDictionary } from \"../Utils\";\nimport { DisplayValue, Value } from \"./Value\";\n\n/**\n * Serialized [[Item]] JSON representation.\n * @public\n */\nexport interface ItemJSON {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n // TODO: rename to `label`\n labelDefinition: LabelDefinition;\n classInfo?: ClassInfo;\n values: ValuesDictionary<Value>;\n displayValues: ValuesDictionary<DisplayValue>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * Props for creating [[Item]].\n * @public\n */\ninterface ItemProps {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n label: LabelDefinition;\n classInfo?: ClassInfo;\n values: ValuesDictionary<Value>;\n displayValues: ValuesDictionary<DisplayValue>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * A data structure that represents a single content record.\n * @public\n */\nexport class Item {\n /**\n * Keys of input instances that caused this item to be included in content. Only set if the content is\n * created with [[ContentFlags.IncludeInputKeys]] flag.\n */\n public inputKeys?: InstanceKey[];\n /** Keys of instances whose data is contained in this item */\n public primaryKeys: InstanceKey[];\n /** Display label of the item */\n public label: LabelDefinition;\n /** For cases when item consists only of same class instances, information about the ECClass */\n public classInfo?: ClassInfo;\n /** Raw values dictionary */\n public values: ValuesDictionary<Value>;\n /** Display values dictionary */\n public displayValues: ValuesDictionary<DisplayValue>;\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\n public mergedFieldNames: string[];\n /** Extended data injected into this content item */\n public extendedData?: { [key: string]: any };\n\n /**\n * Creates an instance of Item.\n * @param primaryKeys Keys of instances whose data is contained in this item\n * @param label Display label of the item\n * @param imageId ID of the image associated with this item\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\n * @param values Raw values dictionary\n * @param displayValues Display values dictionary\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\n * @param extendedData Extended data injected into this content item\n * @deprecated in 5.0. Use an overload with `ItemProps` instead.\n */\n public constructor(\n primaryKeys: InstanceKey[],\n label: string | LabelDefinition,\n imageId: string,\n classInfo: ClassInfo | undefined,\n values: ValuesDictionary<Value>,\n displayValues: ValuesDictionary<DisplayValue>,\n mergedFieldNames: string[],\n extendedData?: { [key: string]: any },\n );\n public constructor(props: ItemProps);\n public constructor(\n primaryKeysOrProps: ItemProps | InstanceKey[],\n label?: string | LabelDefinition,\n imageId?: string,\n classInfo?: ClassInfo | undefined,\n values?: ValuesDictionary<Value>,\n displayValues?: ValuesDictionary<DisplayValue>,\n mergedFieldNames?: string[],\n extendedData?: { [key: string]: any },\n ) {\n /* istanbul ignore next */\n const props = Array.isArray(primaryKeysOrProps)\n ? {\n primaryKeys: primaryKeysOrProps,\n label: typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label!,\n imageId: imageId!,\n classInfo,\n values: values!,\n displayValues: displayValues!,\n mergedFieldNames: mergedFieldNames!,\n extendedData,\n }\n : primaryKeysOrProps;\n\n if (\"inputKeys\" in props) {\n this.inputKeys = props.inputKeys;\n }\n this.primaryKeys = props.primaryKeys;\n this.classInfo = props.classInfo;\n this.values = props.values;\n this.displayValues = props.displayValues;\n this.mergedFieldNames = props.mergedFieldNames;\n this.extendedData = props.extendedData;\n this.label = props.label;\n }\n\n /**\n * Is value of field with the specified name merged in this record.\n */\n public isFieldMerged(fieldName: string): boolean {\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\n }\n\n /** Serialize this object to JSON */\n public toJSON(): ItemJSON {\n const { label, ...baseItem } = this;\n return omitUndefined({\n ...baseItem,\n labelDefinition: label,\n });\n }\n\n /** Deserialize [[Item]] from JSON */\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\n if (!json) {\n return undefined;\n }\n\n if (typeof json === \"string\") {\n return Item.fromJSON(JSON.parse(json));\n }\n\n const { labelDefinition, ...baseJson } = json;\n return new Item({\n ...baseJson,\n label: labelDefinition,\n });\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Content
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { ClassInfo, CompressedClassInfoJSON, PropertyInfo, PropertyInfoJSON } from "../EC";
|
|
5
5
|
/**
|
|
6
6
|
* Data structure that describes one step of property
|
|
7
7
|
* accessor path.
|
|
@@ -33,26 +33,16 @@ export interface Property {
|
|
|
33
33
|
}
|
|
34
34
|
/** @public */
|
|
35
35
|
export declare namespace Property {
|
|
36
|
-
/**
|
|
37
|
-
* Serialize [[Property]] to JSON
|
|
38
|
-
* @deprecated in 3.x. Use [[toCompressedJSON]]
|
|
39
|
-
*/
|
|
40
|
-
function toJSON(prop: Property): PropertyJSON;
|
|
41
36
|
/** Serialize [[Property]] to compressed JSON */
|
|
42
37
|
function toCompressedJSON(prop: Property, classesMap: {
|
|
43
38
|
[id: string]: CompressedClassInfoJSON;
|
|
44
39
|
}): PropertyJSON<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Deserializes [[Property]] from JSON
|
|
47
|
-
* @deprecated in 3.x. Use [[Property]]
|
|
48
|
-
*/
|
|
49
|
-
function fromJSON(json: PropertyJSON): Property;
|
|
50
40
|
}
|
|
51
41
|
/**
|
|
52
42
|
* JSON representation of [[Property]]
|
|
53
43
|
* @public
|
|
54
44
|
*/
|
|
55
|
-
export interface PropertyJSON<TClassInfoJSON =
|
|
45
|
+
export interface PropertyJSON<TClassInfoJSON = ClassInfo> {
|
|
56
46
|
property: PropertyInfoJSON<TClassInfoJSON>;
|
|
57
47
|
}
|
|
58
48
|
//# sourceMappingURL=Property.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,EAAE,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,6BAA6B;IAC7B,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,cAAc;AACd,yBAAiB,QAAQ,CAAC;IACxB,gDAAgD;IAChD,SAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,uBAAuB,CAAA;KAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAI5H;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,cAAc,GAAG,SAAS;IACtD,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAC5C"}
|
|
@@ -12,15 +12,6 @@ const EC_1 = require("../EC");
|
|
|
12
12
|
/** @public */
|
|
13
13
|
var Property;
|
|
14
14
|
(function (Property) {
|
|
15
|
-
/**
|
|
16
|
-
* Serialize [[Property]] to JSON
|
|
17
|
-
* @deprecated in 3.x. Use [[toCompressedJSON]]
|
|
18
|
-
*/
|
|
19
|
-
// istanbul ignore next
|
|
20
|
-
function toJSON(prop) {
|
|
21
|
-
return { ...prop };
|
|
22
|
-
}
|
|
23
|
-
Property.toJSON = toJSON;
|
|
24
15
|
/** Serialize [[Property]] to compressed JSON */
|
|
25
16
|
function toCompressedJSON(prop, classesMap) {
|
|
26
17
|
return {
|
|
@@ -28,14 +19,5 @@ var Property;
|
|
|
28
19
|
};
|
|
29
20
|
}
|
|
30
21
|
Property.toCompressedJSON = toCompressedJSON;
|
|
31
|
-
/**
|
|
32
|
-
* Deserializes [[Property]] from JSON
|
|
33
|
-
* @deprecated in 3.x. Use [[Property]]
|
|
34
|
-
*/
|
|
35
|
-
// istanbul ignore next
|
|
36
|
-
function fromJSON(json) {
|
|
37
|
-
return { ...json };
|
|
38
|
-
}
|
|
39
|
-
Property.fromJSON = fromJSON;
|
|
40
22
|
})(Property || (exports.Property = Property = {}));
|
|
41
23
|
//# sourceMappingURL=Property.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,8BAA2F;AAkC3F,cAAc;AACd,IAAiB,QAAQ,CAOxB;AAPD,WAAiB,QAAQ;IACvB,gDAAgD;IAChD,SAAgB,gBAAgB,CAAC,IAAc,EAAE,UAAqD;QACpG,OAAO;YACL,QAAQ,EAAE,iBAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;SACnE,CAAC;IACJ,CAAC;IAJe,yBAAgB,mBAI/B,CAAA;AACH,CAAC,EAPgB,QAAQ,wBAAR,QAAQ,QAOxB","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 { ClassInfo, CompressedClassInfoJSON, PropertyInfo, PropertyInfoJSON } from \"../EC\";\n\n/**\n * Data structure that describes one step of property\n * accessor path.\n *\n * @public\n */\nexport interface PropertyAccessor {\n /** Name of ECProperty */\n propertyName: string;\n /** If the property is an array, array index. Otherwise undefined. */\n arrayIndex?: number;\n}\n\n/**\n * Describes path to a property.\n * @public\n */\nexport type PropertyAccessorPath = PropertyAccessor[];\n\n/**\n * Data structure that describes a single ECProperty that's\n * included in a [[PropertiesField]].\n *\n * TODO: Remove?\n *\n * @public\n */\nexport interface Property {\n /** ECProperty information */\n property: PropertyInfo;\n}\n\n/** @public */\nexport namespace Property {\n /** Serialize [[Property]] to compressed JSON */\n export function toCompressedJSON(prop: Property, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyJSON<string> {\n return {\n property: PropertyInfo.toCompressedJSON(prop.property, classesMap),\n };\n }\n}\n\n/**\n * JSON representation of [[Property]]\n * @public\n */\nexport interface PropertyJSON<TClassInfoJSON = ClassInfo> {\n property: PropertyInfoJSON<TClassInfoJSON>;\n}\n"]}
|
|
@@ -13,6 +13,8 @@ const Content_1 = require("./Content");
|
|
|
13
13
|
const Value_1 = require("./Value");
|
|
14
14
|
/** @internal */
|
|
15
15
|
class ContentFormatter {
|
|
16
|
+
_propertyValueFormatter;
|
|
17
|
+
_unitSystem;
|
|
16
18
|
constructor(_propertyValueFormatter, _unitSystem) {
|
|
17
19
|
this._propertyValueFormatter = _propertyValueFormatter;
|
|
18
20
|
this._unitSystem = _unitSystem;
|
|
@@ -83,6 +85,7 @@ class ContentFormatter {
|
|
|
83
85
|
exports.ContentFormatter = ContentFormatter;
|
|
84
86
|
/** @internal */
|
|
85
87
|
class ContentPropertyValueFormatter {
|
|
88
|
+
_koqValueFormatter;
|
|
86
89
|
constructor(_koqValueFormatter) {
|
|
87
90
|
this._koqValueFormatter = _koqValueFormatter;
|
|
88
91
|
}
|
|
@@ -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,uCAAoC;AAIpC,mCAA4G;AAE5G,gBAAgB;AAChB,MAAa,gBAAgB;IAC3B,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,iBAAO,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,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,MAA+B,EAAE,aAA6C,EAAE,MAAe,EAAE,YAAsB;QAChJ,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAEjC,wCAAwC;YACxC,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI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AAC,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\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter\";\nimport { ValuesDictionary } from \"../Utils\";\nimport { Content } from \"./Content\";\nimport { Descriptor } from \"./Descriptor\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields\";\nimport { Item } from \"./Item\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value\";\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 displayValues[memberField.name] = await this.formatPropertyValue(memberValues[memberField.name], 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,sDAA6C;AAK7C,uCAAoC;AAIpC,mCAA4G;AAE5G,gBAAgB;AAChB,MAAa,gBAAgB;IAEjB;IACA;IAFV,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAA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C;QACpF,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,KAA2B,EAAE,KAAY;QACtE,IAAI,CAAC,aAAK,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;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\";\nimport { KoqPropertyValueFormatter } from \"../KoqPropertyValueFormatter\";\nimport { ValuesDictionary } from \"../Utils\";\nimport { Content } from \"./Content\";\nimport { Descriptor } from \"./Descriptor\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields\";\nimport { Item } from \"./Item\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value\";\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 displayValues[memberField.name] = await this.formatPropertyValue(memberValues[memberField.name], 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"]}
|
|
@@ -21,16 +21,6 @@ export declare namespace Value {
|
|
|
21
21
|
function isNestedContent(value: Value): value is NestedContentValue[];
|
|
22
22
|
/** Is the value a navigation value */
|
|
23
23
|
function isNavigationValue(value: Value): value is NavigationPropertyValue;
|
|
24
|
-
/**
|
|
25
|
-
* Serialize [[Value]] to JSON
|
|
26
|
-
* @deprecated in 3.x. Use [[Value]]
|
|
27
|
-
*/
|
|
28
|
-
function fromJSON(json: ValueJSON): Value;
|
|
29
|
-
/**
|
|
30
|
-
* Deserialize [[Value]] from JSON
|
|
31
|
-
* @deprecated in 3.x. Use [[Value]]
|
|
32
|
-
*/
|
|
33
|
-
function toJSON(value: Value): ValueJSON;
|
|
34
24
|
}
|
|
35
25
|
/**
|
|
36
26
|
* A map of raw values
|
|
@@ -57,16 +47,6 @@ export declare namespace DisplayValue {
|
|
|
57
47
|
function isArray(value: DisplayValue): value is DisplayValuesArray;
|
|
58
48
|
/** Is the value a map / struct */
|
|
59
49
|
function isMap(value: DisplayValue): value is DisplayValuesMap;
|
|
60
|
-
/**
|
|
61
|
-
* Serialize [[DisplayValue]] to JSON
|
|
62
|
-
* @deprecated in 3.x. Use [[DisplayValue]]
|
|
63
|
-
*/
|
|
64
|
-
function fromJSON(json: DisplayValueJSON): DisplayValue;
|
|
65
|
-
/**
|
|
66
|
-
* Deserialize [[DisplayValue]] from JSON
|
|
67
|
-
* @deprecated in 3.x. Use [[DisplayValue]]
|
|
68
|
-
*/
|
|
69
|
-
function toJSON(value: DisplayValue): DisplayValueJSON;
|
|
70
50
|
}
|
|
71
51
|
/**
|
|
72
52
|
* A map of display values
|
|
@@ -108,70 +88,6 @@ export interface NavigationPropertyValue {
|
|
|
108
88
|
/** Id of target instance. */
|
|
109
89
|
id: InstanceId;
|
|
110
90
|
}
|
|
111
|
-
/** @public */
|
|
112
|
-
export declare namespace NestedContentValue {
|
|
113
|
-
/**
|
|
114
|
-
* Serialize [[NestedContentValue]] to JSON
|
|
115
|
-
* @deprecated in 3.x. Use [[NestedContentValue]]
|
|
116
|
-
*/
|
|
117
|
-
function toJSON(value: NestedContentValue): NestedContentValueJSON;
|
|
118
|
-
/**
|
|
119
|
-
* Deserialize [[NestedContentValue]] from JSON
|
|
120
|
-
* @deprecated in 3.x. Use [[NestedContentValue]]
|
|
121
|
-
*/
|
|
122
|
-
function fromJSON(json: NestedContentValueJSON): NestedContentValue;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* JSON representation of [[Value]]
|
|
126
|
-
* @public
|
|
127
|
-
* @deprecated in 3.x. Use [[Value]]
|
|
128
|
-
*/
|
|
129
|
-
export type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NavigationPropertyValue | NestedContentValueJSON[];
|
|
130
|
-
/**
|
|
131
|
-
* JSON representation of [[ValuesMap]]
|
|
132
|
-
* @public
|
|
133
|
-
* @deprecated in 3.x. Use [[ValuesMap]]
|
|
134
|
-
*/
|
|
135
|
-
export interface ValuesMapJSON extends ValuesDictionary<ValueJSON> {
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* JSON representation of [[ValuesArray]]
|
|
139
|
-
* @public
|
|
140
|
-
* @deprecated in 3.x. Use [[ValuesArray]]
|
|
141
|
-
*/
|
|
142
|
-
export interface ValuesArrayJSON extends Array<ValueJSON> {
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* JSON representation of [[DisplayValue]]
|
|
146
|
-
* @public
|
|
147
|
-
* @deprecated in 3.x. Use [[DisplayValue]]
|
|
148
|
-
*/
|
|
149
|
-
export type DisplayValueJSON = string | null | DisplayValuesMapJSON | DisplayValuesArrayJSON;
|
|
150
|
-
/**
|
|
151
|
-
* JSON representation of [[DisplayValuesMap]]
|
|
152
|
-
* @public
|
|
153
|
-
* @deprecated in 3.x. Use [[DisplayValuesMap]]
|
|
154
|
-
*/
|
|
155
|
-
export interface DisplayValuesMapJSON extends ValuesDictionary<DisplayValueJSON> {
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* JSON representation of [[DisplayValuesArray]]
|
|
159
|
-
* @public
|
|
160
|
-
* @deprecated in 3.x. Use [[DisplayValuesArray]]
|
|
161
|
-
*/
|
|
162
|
-
export interface DisplayValuesArrayJSON extends Array<DisplayValueJSON> {
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* JSON representation of [[NestedContentValue]]
|
|
166
|
-
* @public
|
|
167
|
-
* @deprecated in 3.x. Use [[NestedContentValue]]
|
|
168
|
-
*/
|
|
169
|
-
export interface NestedContentValueJSON {
|
|
170
|
-
primaryKeys: InstanceKey[];
|
|
171
|
-
values: ValuesDictionary<ValueJSON>;
|
|
172
|
-
displayValues: ValuesDictionary<DisplayValueJSON>;
|
|
173
|
-
mergedFieldNames: string[];
|
|
174
|
-
}
|
|
175
91
|
/**
|
|
176
92
|
* A group of raw values and their common display value.
|
|
177
93
|
* @public
|
|
@@ -182,26 +98,4 @@ export interface DisplayValueGroup {
|
|
|
182
98
|
/** A list of grouped raw values */
|
|
183
99
|
groupedRawValues: Value[];
|
|
184
100
|
}
|
|
185
|
-
/**
|
|
186
|
-
* JSON representation of [[DisplayValueGroup]].
|
|
187
|
-
* @public
|
|
188
|
-
* @deprecated in 3.x. Use [[DisplayValueGroup]]
|
|
189
|
-
*/
|
|
190
|
-
export interface DisplayValueGroupJSON {
|
|
191
|
-
displayValue: DisplayValueJSON;
|
|
192
|
-
groupedRawValues: ValueJSON[];
|
|
193
|
-
}
|
|
194
|
-
/** @public */
|
|
195
|
-
export declare namespace DisplayValueGroup {
|
|
196
|
-
/**
|
|
197
|
-
* Serialize [[DisplayValueGroup]] to JSON
|
|
198
|
-
* @deprecated in 3.x. Use [[DisplayValueGroup]]
|
|
199
|
-
*/
|
|
200
|
-
function toJSON(group: DisplayValueGroup): DisplayValueGroupJSON;
|
|
201
|
-
/**
|
|
202
|
-
* Deserialize [[DisplayValueGroup]] from JSON
|
|
203
|
-
* @deprecated in 3.x. Use [[DisplayValueGroup]]
|
|
204
|
-
*/
|
|
205
|
-
function fromJSON(json: DisplayValueGroupJSON): DisplayValueGroup;
|
|
206
|
-
}
|
|
207
101
|
//# sourceMappingURL=Value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Value.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,uBAAuB,GAAG,kBAAkB,EAAE,CAAC;AAErI,cAAc;AAEd,yBAAiB,KAAK,CAAC;IACrB,+BAA+B;IAC/B,SAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,MA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