@itwin/presentation-common 5.0.0-dev.7 → 5.0.0-dev.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -1
- package/Ruleset.schema.json +3 -258
- package/lib/cjs/presentation-common/AsyncTasks.d.ts +4 -4
- package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
- package/lib/cjs/presentation-common/AsyncTasks.js +5 -6
- package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/cjs/presentation-common/EC.d.ts +36 -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/Error.d.ts +2 -0
- package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Error.js +2 -0
- package/lib/cjs/presentation-common/Error.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 +4 -1
- 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/PresentationManagerOptions.d.ts +31 -10
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js +0 -5
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +9 -9
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +36 -21
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +3 -2
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js +9 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +9 -12
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +37 -30
- 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 +21 -0
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +57 -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.d.ts +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +116 -28
- 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 +68 -22
- package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.d.ts +151 -27
- package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js +264 -140
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.d.ts +26 -31
- package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js +52 -67
- 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 +5 -107
- 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 +4 -107
- 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/selection/SelectionScope.d.ts +3 -0
- package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.js +1 -0
- package/lib/cjs/presentation-common/selection/SelectionScope.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 +6 -5
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.d.ts +4 -4
- package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.js +5 -6
- package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/esm/presentation-common/EC.d.ts +36 -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/Error.d.ts +2 -0
- package/lib/esm/presentation-common/Error.d.ts.map +1 -1
- package/lib/esm/presentation-common/Error.js +2 -0
- package/lib/esm/presentation-common/Error.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 +5 -2
- 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/PresentationManagerOptions.d.ts +31 -10
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js +0 -4
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +9 -9
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +38 -22
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts +3 -2
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js +9 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +9 -12
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +39 -32
- 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 +21 -0
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +54 -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.d.ts +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +117 -29
- 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 +68 -22
- package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/esm/presentation-common/content/Fields.d.ts +151 -27
- package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js +264 -140
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.d.ts +26 -31
- package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Item.js +52 -67
- 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 +5 -107
- 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 +4 -107
- 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/selection/SelectionScope.d.ts +3 -0
- package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.js +1 -0
- package/lib/esm/presentation-common/selection/SelectionScope.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 +12 -12
- 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
|
@@ -12,6 +12,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
|
|
|
12
12
|
const EC_1 = require("../EC");
|
|
13
13
|
const Category_1 = require("./Category");
|
|
14
14
|
const Fields_1 = require("./Fields");
|
|
15
|
+
const Utils_1 = require("../Utils");
|
|
15
16
|
/** @public */
|
|
16
17
|
var SelectClassInfo;
|
|
17
18
|
(function (SelectClassInfo) {
|
|
@@ -86,11 +87,6 @@ var ContentFlags;
|
|
|
86
87
|
(function (ContentFlags) {
|
|
87
88
|
/** Each content record only has [[InstanceKey]] and no data */
|
|
88
89
|
ContentFlags[ContentFlags["KeysOnly"] = 1] = "KeysOnly";
|
|
89
|
-
/**
|
|
90
|
-
* Each content record additionally has an image id
|
|
91
|
-
* @deprecated in 3.x. Use [[ExtendedDataRule]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
|
|
92
|
-
*/
|
|
93
|
-
ContentFlags[ContentFlags["ShowImages"] = 2] = "ShowImages";
|
|
94
90
|
/** Each content record additionally has a display label */
|
|
95
91
|
ContentFlags[ContentFlags["ShowLabels"] = 4] = "ShowLabels";
|
|
96
92
|
/** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */
|
|
@@ -127,6 +123,53 @@ var SortDirection;
|
|
|
127
123
|
* @public
|
|
128
124
|
*/
|
|
129
125
|
class Descriptor {
|
|
126
|
+
/** Id of the connection used to create the descriptor */
|
|
127
|
+
connectionId;
|
|
128
|
+
/** Hash of the input keys used to create the descriptor */
|
|
129
|
+
inputKeysHash;
|
|
130
|
+
/** Selection info used to create the descriptor */
|
|
131
|
+
selectionInfo;
|
|
132
|
+
/** Display type used to create the descriptor */
|
|
133
|
+
displayType;
|
|
134
|
+
/** A list of classes that will be selected when creating content with this descriptor */
|
|
135
|
+
selectClasses;
|
|
136
|
+
/** A list of content field categories used in this descriptor */
|
|
137
|
+
categories;
|
|
138
|
+
/** A list of fields contained in the descriptor */
|
|
139
|
+
fields;
|
|
140
|
+
/** [[ContentFlags]] used to create the descriptor */
|
|
141
|
+
contentFlags;
|
|
142
|
+
/**
|
|
143
|
+
* A ruleset used to create this descriptor.
|
|
144
|
+
* Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.
|
|
145
|
+
*/
|
|
146
|
+
ruleset;
|
|
147
|
+
/** Field used to sort the content */
|
|
148
|
+
sortingField;
|
|
149
|
+
/** Sorting direction */
|
|
150
|
+
sortDirection;
|
|
151
|
+
/**
|
|
152
|
+
* [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by
|
|
153
|
+
* select fields.
|
|
154
|
+
*
|
|
155
|
+
* This is different from [[instanceFilter]] as filtering is applied on the union of all selects,
|
|
156
|
+
* which removes access to content instance property values. Instead of referencing properties
|
|
157
|
+
* through `this.PropertyName` alias, the expression should reference them by field names. In cases
|
|
158
|
+
* when properties field merges multiple properties, this allows applying the filter on all of them
|
|
159
|
+
* at once. This is useful for filtering table rows by column value, when content is displayed in
|
|
160
|
+
* table format.
|
|
161
|
+
*/
|
|
162
|
+
fieldsFilterExpression;
|
|
163
|
+
/**
|
|
164
|
+
* Instances filter that allows filtering content by class, properties of specific class
|
|
165
|
+
* or properties of instances related to the content instance.
|
|
166
|
+
*
|
|
167
|
+
* This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on
|
|
168
|
+
* specific select class rather than a union of multiple select classes. This means the filter has
|
|
169
|
+
* access to properties of that class and they can be referenced using symbols like `this.Property`.
|
|
170
|
+
* This is useful for filtering instances of specific class.
|
|
171
|
+
*/
|
|
172
|
+
instanceFilter;
|
|
130
173
|
/** Construct a new Descriptor using a [[DescriptorSource]] */
|
|
131
174
|
constructor(source) {
|
|
132
175
|
this.connectionId = source.connectionId;
|
|
@@ -139,8 +182,7 @@ class Descriptor {
|
|
|
139
182
|
this.fields = [...source.fields];
|
|
140
183
|
this.sortingField = source.sortingField;
|
|
141
184
|
this.sortDirection = source.sortDirection;
|
|
142
|
-
this.
|
|
143
|
-
this.fieldsFilterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
185
|
+
this.fieldsFilterExpression = source.fieldsFilterExpression;
|
|
144
186
|
this.instanceFilter = source.instanceFilter;
|
|
145
187
|
this.ruleset = source.ruleset;
|
|
146
188
|
}
|
|
@@ -149,34 +191,40 @@ class Descriptor {
|
|
|
149
191
|
const classesMap = {};
|
|
150
192
|
const selectClasses = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));
|
|
151
193
|
const fields = this.fields.map((field) => field.toCompressedJSON(classesMap));
|
|
152
|
-
return
|
|
194
|
+
return (0, Utils_1.omitUndefined)({
|
|
153
195
|
displayType: this.displayType,
|
|
154
196
|
contentFlags: this.contentFlags,
|
|
155
197
|
categories: this.categories.map(Category_1.CategoryDescription.toJSON),
|
|
156
198
|
fields,
|
|
157
199
|
selectClasses,
|
|
158
200
|
classesMap,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
201
|
+
connectionId: this.connectionId ?? "",
|
|
202
|
+
inputKeysHash: this.inputKeysHash ?? "",
|
|
203
|
+
sortingFieldName: this.sortingField?.name,
|
|
204
|
+
sortDirection: this.sortDirection,
|
|
205
|
+
fieldsFilterExpression: this.fieldsFilterExpression,
|
|
206
|
+
instanceFilter: this.instanceFilter,
|
|
207
|
+
selectionInfo: this.selectionInfo,
|
|
208
|
+
ruleset: this.ruleset,
|
|
209
|
+
});
|
|
164
210
|
}
|
|
165
211
|
/** Deserialize [[Descriptor]] from JSON */
|
|
166
212
|
static fromJSON(json) {
|
|
167
213
|
if (!json) {
|
|
168
214
|
return undefined;
|
|
169
215
|
}
|
|
170
|
-
const { classesMap, ...leftOverJson } = json;
|
|
171
|
-
const categories = Category_1.CategoryDescription.listFromJSON(
|
|
172
|
-
const selectClasses = SelectClassInfo.listFromCompressedJSON(
|
|
173
|
-
const fields = this.getFieldsFromJSON(
|
|
216
|
+
const { categories: jsonCategories, selectClasses: jsonSelectClasses, fields: jsonFields, connectionId, inputKeysHash, classesMap, sortingFieldName, ...leftOverJson } = json;
|
|
217
|
+
const categories = Category_1.CategoryDescription.listFromJSON(jsonCategories);
|
|
218
|
+
const selectClasses = SelectClassInfo.listFromCompressedJSON(jsonSelectClasses, classesMap);
|
|
219
|
+
const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Fields_1.Field.fromCompressedJSON(fieldJson, classesMap, categories));
|
|
174
220
|
return new Descriptor({
|
|
175
221
|
...leftOverJson,
|
|
222
|
+
...(connectionId ? /* istanbul ignore next */ { connectionId } : undefined),
|
|
223
|
+
...(inputKeysHash ? /* istanbul ignore next */ { inputKeysHash } : undefined),
|
|
176
224
|
selectClasses,
|
|
177
225
|
categories,
|
|
178
226
|
fields,
|
|
179
|
-
sortingField: (0, Fields_1.getFieldByName)(fields,
|
|
227
|
+
sortingField: (0, Fields_1.getFieldByName)(fields, sortingFieldName, true),
|
|
180
228
|
});
|
|
181
229
|
}
|
|
182
230
|
static getFieldsFromJSON(json, factory) {
|
|
@@ -216,10 +264,8 @@ class Descriptor {
|
|
|
216
264
|
if (this.contentFlags !== 0) {
|
|
217
265
|
overrides.contentFlags = this.contentFlags;
|
|
218
266
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
222
|
-
overrides.fieldsFilterExpression = this.fieldsFilterExpression ?? this.filterExpression;
|
|
267
|
+
if (this.fieldsFilterExpression) {
|
|
268
|
+
overrides.fieldsFilterExpression = this.fieldsFilterExpression;
|
|
223
269
|
}
|
|
224
270
|
if (this.instanceFilter) {
|
|
225
271
|
overrides.instanceFilter = this.instanceFilter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Descriptor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Descriptor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,8BAUe;AAGf,yCAA0E;AAC1E,qCAAmG;AAwCnG,cAAc;AACd,IAAiB,eAAe,CAsE/B;AAtED,WAAiB,eAAe;IAC9B,2DAA2D;IAC3D,SAAgB,kBAAkB,CAAC,IAAiC,EAAE,UAAqD;QACzH,IAAA,qBAAM,EAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QACxD,OAAO;YACL,eAAe,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,UAAU,CAA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9B,MAAM,SAAS,GAAwB,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3C,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;YAC5B,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC7C,CAAC;QACD,4DAA4D;QAC5D,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACzD,4DAA4D;YAC5D,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,gBAAgB,CAAC;QAC1F,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAClI,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjLD,gCAiLC","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 Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n ClassInfoJSON,\r\n CompressedClassInfoJSON,\r\n RelatedClassInfo,\r\n RelatedClassInfoJSON,\r\n RelatedClassInfoWithOptionalRelationship,\r\n RelatedClassInfoWithOptionalRelationshipJSON,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n} from \"../EC\";\r\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition\";\r\nimport { Ruleset } from \"../rules/Ruleset\";\r\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category\";\r\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields\";\r\n\r\n/**\r\n * Data structure that describes an ECClass in content [[Descriptor]].\r\n * @public\r\n */\r\nexport interface SelectClassInfo {\r\n /** Information about the ECClass */\r\n selectClassInfo: ClassInfo;\r\n\r\n /** Is the class handled polymorphically */\r\n isSelectPolymorphic: boolean;\r\n\r\n /** Relationship path from input class to the select class. */\r\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\r\n\r\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\r\n relatedPropertyPaths?: RelationshipPath[];\r\n\r\n /** Relationship paths to navigation property classes */\r\n navigationPropertyClasses?: RelatedClassInfo[];\r\n\r\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\r\n relatedInstancePaths?: RelationshipPath[];\r\n}\r\n\r\n/**\r\n * Serialized [[SelectClassInfo]] JSON representation\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfoJSON> {\r\n selectClassInfo: TClassInfoJSON;\r\n isSelectPolymorphic: boolean;\r\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\r\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\r\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\r\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/** @public */\r\nexport namespace SelectClassInfo {\r\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\r\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\r\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\r\n return {\r\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\r\n isSelectPolymorphic: json.isSelectPolymorphic,\r\n ...(json.navigationPropertyClasses\r\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\r\n : undefined),\r\n ...(json.relatedInstancePaths\r\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n ...(json.pathFromInputToSelectClass\r\n ? {\r\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\r\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(json.relatedPropertyPaths\r\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n };\r\n }\r\n\r\n /** Serialize [[SelectClassInfo]] to compressed JSON */\r\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\r\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\r\n classesMap[id] = leftOverClassInfo;\r\n return {\r\n selectClassInfo: id,\r\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\r\n ...(selectClass.relatedInstancePaths\r\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n ...(selectClass.navigationPropertyClasses\r\n ? {\r\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\r\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(selectClass.pathFromInputToSelectClass\r\n ? {\r\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\r\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(selectClass.relatedPropertyPaths\r\n ? {\r\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\r\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\r\n ),\r\n }\r\n : undefined),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[SelectClassInfo]] list from JSON\r\n * @param json JSON or JSON serialized to string to deserialize from\r\n * @returns Deserialized [[SelectClassInfo]] objects list\r\n *\r\n * @internal\r\n */\r\n export function listFromCompressedJSON(json: SelectClassInfoJSON<Id64String>[], classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo[] {\r\n return json.map((sci) => fromCompressedJSON(sci, classesMap));\r\n }\r\n}\r\n\r\n/**\r\n * Flags that control content format.\r\n * @public\r\n */\r\nexport enum ContentFlags {\r\n /** Each content record only has [[InstanceKey]] and no data */\r\n KeysOnly = 1 << 0,\r\n\r\n /**\r\n * Each content record additionally has an image id\r\n * @deprecated in 3.x. Use [[ExtendedDataRule]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\r\n */\r\n ShowImages = 1 << 1,\r\n\r\n /** Each content record additionally has a display label */\r\n ShowLabels = 1 << 2,\r\n\r\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\r\n MergeResults = 1 << 3,\r\n\r\n /** Content has only distinct values */\r\n DistinctValues = 1 << 4,\r\n\r\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\r\n NoFields = 1 << 5,\r\n\r\n /**\r\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\r\n * given input key at the cost of performance creating those items.\r\n */\r\n IncludeInputKeys = 1 << 8,\r\n\r\n /**\r\n * Produce content descriptor that is not intended for querying content. Allows the implementation to omit certain\r\n * operations to make obtaining content descriptor faster.\r\n * @internal\r\n */\r\n DescriptorOnly = 1 << 9,\r\n}\r\n\r\n/**\r\n * Data sorting direction\r\n * @public\r\n */\r\nexport enum SortDirection {\r\n Ascending,\r\n Descending,\r\n}\r\n\r\n/**\r\n * Data structure that contains selection information. Used\r\n * for cases when requesting content after a selection change.\r\n *\r\n * @public\r\n */\r\nexport interface SelectionInfo {\r\n /** Name of selection provider which cause the selection change */\r\n providerName: string;\r\n /** Level of selection that changed */\r\n level?: number;\r\n}\r\n\r\n/**\r\n * Serialized [[Descriptor]] JSON representation.\r\n * @public\r\n */\r\nexport interface DescriptorJSON {\r\n classesMap: { [id: string]: CompressedClassInfoJSON };\r\n connectionId: string;\r\n inputKeysHash: string;\r\n /** @deprecated in 3.x. The attribute is not used anymore. */\r\n contentOptions: any;\r\n selectionInfo?: SelectionInfo;\r\n displayType: string;\r\n selectClasses: SelectClassInfoJSON<Id64String>[];\r\n categories: CategoryDescriptionJSON[];\r\n fields: FieldJSON<Id64String>[];\r\n sortingFieldName?: string;\r\n sortDirection?: SortDirection;\r\n contentFlags: number;\r\n /** @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]]. */\r\n filterExpression?: string;\r\n fieldsFilterExpression?: string;\r\n instanceFilter?: InstanceFilterDefinition;\r\n ruleset?: Ruleset;\r\n}\r\n\r\n/**\r\n * Descriptor overrides that can be used to customize content\r\n * @public\r\n */\r\nexport interface DescriptorOverrides {\r\n /**\r\n * Content display type. Can be accessed in presentation rules and used\r\n * to modify content in various ways. Defaults to empty string.\r\n */\r\n displayType?: string;\r\n\r\n /** Content flags used for content customization. See [[ContentFlags]] */\r\n contentFlags?: number;\r\n\r\n /** Fields selector that allows excluding or including only specified fields. */\r\n fieldsSelector?: {\r\n /** Should the specified fields be included or excluded */\r\n type: \"include\" | \"exclude\";\r\n /** A list of field descriptors that identify fields to include / exclude */\r\n fields: FieldDescriptor[];\r\n };\r\n\r\n /** Specification for sorting data. */\r\n sorting?: {\r\n /** Identifier of the field to use for sorting */\r\n field: FieldDescriptor;\r\n /** Sort direction */\r\n direction: SortDirection;\r\n };\r\n\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content\r\n * @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]].\r\n */\r\n filterExpression?: string;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n}\r\n\r\n/**\r\n * Descriptor properties\r\n * @public\r\n */\r\nexport interface DescriptorSource {\r\n /** Id of the connection used to create the descriptor */\r\n readonly connectionId?: string;\r\n /** Hash of the input keys used to create the descriptor */\r\n readonly inputKeysHash?: string;\r\n /** Selection info used to create the descriptor */\r\n readonly selectionInfo?: SelectionInfo;\r\n /** Display type used to create the descriptor */\r\n readonly displayType: string;\r\n /** A list of classes that will be selected from when creating content with this descriptor */\r\n readonly selectClasses: SelectClassInfo[];\r\n /** A list of content field categories used in this descriptor */\r\n readonly categories: CategoryDescription[];\r\n /** A list of fields contained in the descriptor */\r\n readonly fields: Field[];\r\n /** [[ContentFlags]] used to create the descriptor */\r\n readonly contentFlags: number;\r\n /** Field used to sort the content */\r\n readonly sortingField?: Field;\r\n /** Sorting direction */\r\n readonly sortDirection?: SortDirection;\r\n /**\r\n * A ruleset used to create this descriptor.\r\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\r\n */\r\n readonly ruleset?: Ruleset;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content\r\n * @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]].\r\n */\r\n filterExpression?: string;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n}\r\n\r\n/**\r\n * Data structure that describes content: fields, sorting, filtering, format, etc.\r\n * Descriptor may be changed to control how content is created.\r\n *\r\n * @public\r\n */\r\nexport class Descriptor implements DescriptorSource {\r\n /** Id of the connection used to create the descriptor */\r\n public readonly connectionId?: string;\r\n /** Hash of the input keys used to create the descriptor */\r\n public readonly inputKeysHash?: string;\r\n /**\r\n * Extended options used to create the descriptor.\r\n * @deprecated in 3.6. The attribute is not used anymore.\r\n */\r\n public readonly contentOptions: any;\r\n /** Selection info used to create the descriptor */\r\n public readonly selectionInfo?: SelectionInfo;\r\n /** Display type used to create the descriptor */\r\n public readonly displayType: string;\r\n /** A list of classes that will be selected when creating content with this descriptor */\r\n public readonly selectClasses: SelectClassInfo[];\r\n /** A list of content field categories used in this descriptor */\r\n public readonly categories: CategoryDescription[];\r\n /** A list of fields contained in the descriptor */\r\n public readonly fields: Field[];\r\n /** [[ContentFlags]] used to create the descriptor */\r\n public readonly contentFlags: number;\r\n /**\r\n * A ruleset used to create this descriptor.\r\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\r\n */\r\n public readonly ruleset?: Ruleset;\r\n /** Field used to sort the content */\r\n public sortingField?: Field;\r\n /** Sorting direction */\r\n public sortDirection?: SortDirection;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content\r\n * @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]].\r\n */\r\n public filterExpression?: string;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n public fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n public instanceFilter?: InstanceFilterDefinition;\r\n\r\n /** Construct a new Descriptor using a [[DescriptorSource]] */\r\n public constructor(source: DescriptorSource) {\r\n this.connectionId = source.connectionId;\r\n this.inputKeysHash = source.inputKeysHash;\r\n this.selectionInfo = source.selectionInfo;\r\n this.displayType = source.displayType;\r\n this.contentFlags = source.contentFlags;\r\n this.selectClasses = [...source.selectClasses];\r\n this.categories = [...source.categories];\r\n this.fields = [...source.fields];\r\n this.sortingField = source.sortingField;\r\n this.sortDirection = source.sortDirection;\r\n this.filterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated\r\n this.fieldsFilterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated\r\n this.instanceFilter = source.instanceFilter;\r\n this.ruleset = source.ruleset;\r\n }\r\n\r\n /** Serialize [[Descriptor]] to JSON */\r\n public toJSON(): DescriptorJSON {\r\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\r\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\r\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\r\n return Object.assign(\r\n {\r\n displayType: this.displayType,\r\n contentFlags: this.contentFlags,\r\n categories: this.categories.map(CategoryDescription.toJSON),\r\n fields,\r\n selectClasses,\r\n classesMap,\r\n },\r\n this.connectionId !== undefined && { connectionId: this.connectionId },\r\n this.inputKeysHash !== undefined && { inputKeysHash: this.inputKeysHash },\r\n // istanbul ignore next\r\n this.contentOptions !== undefined && { contentOptions: this.contentOptions }, // eslint-disable-line @typescript-eslint/no-deprecated\r\n this.sortingField !== undefined && { sortingFieldName: this.sortingField.name },\r\n this.sortDirection !== undefined && { sortDirection: this.sortDirection },\r\n this.filterExpression !== undefined && { filterExpression: this.filterExpression }, // eslint-disable-line @typescript-eslint/no-deprecated\r\n this.fieldsFilterExpression !== undefined && { fieldsFilterExpression: this.fieldsFilterExpression },\r\n this.instanceFilter !== undefined && { instanceFilter: this.instanceFilter },\r\n this.selectionInfo !== undefined && { selectionInfo: this.selectionInfo },\r\n this.ruleset !== undefined && { ruleset: this.ruleset },\r\n );\r\n }\r\n\r\n /** Deserialize [[Descriptor]] from JSON */\r\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n const { classesMap, ...leftOverJson } = json;\r\n const categories = CategoryDescription.listFromJSON(json.categories);\r\n const selectClasses = SelectClassInfo.listFromCompressedJSON(json.selectClasses, classesMap);\r\n const fields = this.getFieldsFromJSON(json.fields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\r\n return new Descriptor({\r\n ...leftOverJson,\r\n selectClasses,\r\n categories,\r\n fields,\r\n sortingField: getFieldByName(fields, json.sortingFieldName, true),\r\n });\r\n }\r\n\r\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\r\n return json\r\n .map((fieldJson: FieldJSON) => {\r\n const field = factory(fieldJson);\r\n if (field) {\r\n field.rebuildParentship();\r\n }\r\n return field;\r\n })\r\n .filter((field): field is Field => !!field);\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.fields, name, recurse);\r\n }\r\n\r\n /**\r\n * Get field by its descriptor.\r\n */\r\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\r\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\r\n }\r\n\r\n /**\r\n * Create descriptor overrides object from this descriptor.\r\n * @public\r\n */\r\n public createDescriptorOverrides(): DescriptorOverrides {\r\n const overrides: DescriptorOverrides = {};\r\n if (this.displayType) {\r\n overrides.displayType = this.displayType;\r\n }\r\n if (this.contentFlags !== 0) {\r\n overrides.contentFlags = this.contentFlags;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n if (this.filterExpression || this.fieldsFilterExpression) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n overrides.fieldsFilterExpression = this.fieldsFilterExpression ?? this.filterExpression;\r\n }\r\n if (this.instanceFilter) {\r\n overrides.instanceFilter = this.instanceFilter;\r\n }\r\n if (this.sortingField) {\r\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\r\n }\r\n return overrides;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Descriptor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Descriptor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,8BASe;AAGf,yCAA0E;AAC1E,qCAAmG;AACnG,oCAAyC;AAuCzC,cAAc;AACd,IAAiB,eAAe,CAsE/B;AAtED,WAAiB,eAAe;IAC9B,2DAA2D;IAC3D,SAAgB,kBAAkB,CAAC,IAAiC,EAAE,UAAqD;QACzH,IAAA,qBAAM,EAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QACxD,OAAO;YACL,eAAe,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE;YAClF,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,GAAG,CAAC,IAAI,CAAC,yBAAyB;gBAChC,CAAC,CAAC,EAAE,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAgB,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE;gBACpI,CAAC,CAAC,SAAS,CAAC;YACd,GAAG,CAAC,IAAI,CAAC,oBAAoB;gBAC3B,CAAC,CAAC,EAAE,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAgB,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE;gBAC5I,CAAC,CAAC,SAAS,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AAa,CAAC,SAAS,EAAE,CAAC;QAClI,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1KD,gCA0KC","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 Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n CompressedClassInfoJSON,\r\n RelatedClassInfo,\r\n RelatedClassInfoJSON,\r\n RelatedClassInfoWithOptionalRelationship,\r\n RelatedClassInfoWithOptionalRelationshipJSON,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n} from \"../EC\";\r\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition\";\r\nimport { Ruleset } from \"../rules/Ruleset\";\r\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category\";\r\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields\";\r\nimport { omitUndefined } from \"../Utils\";\r\n\r\n/**\r\n * Data structure that describes an ECClass in content [[Descriptor]].\r\n * @public\r\n */\r\nexport interface SelectClassInfo {\r\n /** Information about the ECClass */\r\n selectClassInfo: ClassInfo;\r\n\r\n /** Is the class handled polymorphically */\r\n isSelectPolymorphic: boolean;\r\n\r\n /** Relationship path from input class to the select class. */\r\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\r\n\r\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\r\n relatedPropertyPaths?: RelationshipPath[];\r\n\r\n /** Relationship paths to navigation property classes */\r\n navigationPropertyClasses?: RelatedClassInfo[];\r\n\r\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\r\n relatedInstancePaths?: RelationshipPath[];\r\n}\r\n\r\n/**\r\n * Serialized [[SelectClassInfo]] JSON representation\r\n * @public\r\n */\r\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfo> {\r\n selectClassInfo: TClassInfoJSON;\r\n isSelectPolymorphic: boolean;\r\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\r\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\r\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\r\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/** @public */\r\nexport namespace SelectClassInfo {\r\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\r\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\r\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\r\n return {\r\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\r\n isSelectPolymorphic: json.isSelectPolymorphic,\r\n ...(json.navigationPropertyClasses\r\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\r\n : undefined),\r\n ...(json.relatedInstancePaths\r\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n ...(json.pathFromInputToSelectClass\r\n ? {\r\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\r\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(json.relatedPropertyPaths\r\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n };\r\n }\r\n\r\n /** Serialize [[SelectClassInfo]] to compressed JSON */\r\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\r\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\r\n classesMap[id] = leftOverClassInfo;\r\n return {\r\n selectClassInfo: id,\r\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\r\n ...(selectClass.relatedInstancePaths\r\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n ...(selectClass.navigationPropertyClasses\r\n ? {\r\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\r\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(selectClass.pathFromInputToSelectClass\r\n ? {\r\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\r\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(selectClass.relatedPropertyPaths\r\n ? {\r\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\r\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\r\n ),\r\n }\r\n : undefined),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[SelectClassInfo]] list from JSON\r\n * @param json JSON or JSON serialized to string to deserialize from\r\n * @returns Deserialized [[SelectClassInfo]] objects list\r\n *\r\n * @internal\r\n */\r\n export function listFromCompressedJSON(json: SelectClassInfoJSON<Id64String>[], classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo[] {\r\n return json.map((sci) => fromCompressedJSON(sci, classesMap));\r\n }\r\n}\r\n\r\n/**\r\n * Flags that control content format.\r\n * @public\r\n */\r\nexport enum ContentFlags {\r\n /** Each content record only has [[InstanceKey]] and no data */\r\n KeysOnly = 1 << 0,\r\n\r\n /** Each content record additionally has a display label */\r\n ShowLabels = 1 << 2,\r\n\r\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\r\n MergeResults = 1 << 3,\r\n\r\n /** Content has only distinct values */\r\n DistinctValues = 1 << 4,\r\n\r\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\r\n NoFields = 1 << 5,\r\n\r\n /**\r\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\r\n * given input key at the cost of performance creating those items.\r\n */\r\n IncludeInputKeys = 1 << 8,\r\n\r\n /**\r\n * Produce content descriptor that is not intended for querying content. Allows the implementation to omit certain\r\n * operations to make obtaining content descriptor faster.\r\n * @internal\r\n */\r\n DescriptorOnly = 1 << 9,\r\n}\r\n\r\n/**\r\n * Data sorting direction\r\n * @public\r\n */\r\nexport enum SortDirection {\r\n Ascending,\r\n Descending,\r\n}\r\n\r\n/**\r\n * Data structure that contains selection information. Used\r\n * for cases when requesting content after a selection change.\r\n *\r\n * @public\r\n */\r\nexport interface SelectionInfo {\r\n /** Name of selection provider which cause the selection change */\r\n providerName: string;\r\n /** Level of selection that changed */\r\n level?: number;\r\n}\r\n\r\n/**\r\n * Serialized [[Descriptor]] JSON representation.\r\n * @public\r\n */\r\nexport interface DescriptorJSON {\r\n classesMap: { [id: string]: CompressedClassInfoJSON };\r\n connectionId: string;\r\n inputKeysHash: string;\r\n selectionInfo?: SelectionInfo;\r\n displayType: string;\r\n selectClasses: SelectClassInfoJSON<Id64String>[];\r\n categories: CategoryDescriptionJSON[];\r\n fields: FieldJSON<Id64String>[];\r\n sortingFieldName?: string;\r\n sortDirection?: SortDirection;\r\n contentFlags: number;\r\n fieldsFilterExpression?: string;\r\n instanceFilter?: InstanceFilterDefinition;\r\n ruleset?: Ruleset;\r\n}\r\n\r\n/**\r\n * Descriptor overrides that can be used to customize content\r\n * @public\r\n */\r\nexport interface DescriptorOverrides {\r\n /**\r\n * Content display type. Can be accessed in presentation rules and used\r\n * to modify content in various ways. Defaults to empty string.\r\n */\r\n displayType?: string;\r\n\r\n /** Content flags used for content customization. See [[ContentFlags]] */\r\n contentFlags?: number;\r\n\r\n /** Fields selector that allows excluding or including only specified fields. */\r\n fieldsSelector?: {\r\n /** Should the specified fields be included or excluded */\r\n type: \"include\" | \"exclude\";\r\n /** A list of field descriptors that identify fields to include / exclude */\r\n fields: FieldDescriptor[];\r\n };\r\n\r\n /** Specification for sorting data. */\r\n sorting?: {\r\n /** Identifier of the field to use for sorting */\r\n field: FieldDescriptor;\r\n /** Sort direction */\r\n direction: SortDirection;\r\n };\r\n\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n}\r\n\r\n/**\r\n * Descriptor properties\r\n * @public\r\n */\r\nexport interface DescriptorSource {\r\n /** Id of the connection used to create the descriptor */\r\n readonly connectionId?: string;\r\n /** Hash of the input keys used to create the descriptor */\r\n readonly inputKeysHash?: string;\r\n /** Selection info used to create the descriptor */\r\n readonly selectionInfo?: SelectionInfo;\r\n /** Display type used to create the descriptor */\r\n readonly displayType: string;\r\n /** A list of classes that will be selected from when creating content with this descriptor */\r\n readonly selectClasses: SelectClassInfo[];\r\n /** A list of content field categories used in this descriptor */\r\n readonly categories: CategoryDescription[];\r\n /** A list of fields contained in the descriptor */\r\n readonly fields: Field[];\r\n /** [[ContentFlags]] used to create the descriptor */\r\n readonly contentFlags: number;\r\n /** Field used to sort the content */\r\n readonly sortingField?: Field;\r\n /** Sorting direction */\r\n readonly sortDirection?: SortDirection;\r\n /**\r\n * A ruleset used to create this descriptor.\r\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\r\n */\r\n readonly ruleset?: Ruleset;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n}\r\n\r\n/**\r\n * Data structure that describes content: fields, sorting, filtering, format, etc.\r\n * Descriptor may be changed to control how content is created.\r\n *\r\n * @public\r\n */\r\nexport class Descriptor implements DescriptorSource {\r\n /** Id of the connection used to create the descriptor */\r\n public readonly connectionId?: string;\r\n /** Hash of the input keys used to create the descriptor */\r\n public readonly inputKeysHash?: string;\r\n /** Selection info used to create the descriptor */\r\n public readonly selectionInfo?: SelectionInfo;\r\n /** Display type used to create the descriptor */\r\n public readonly displayType: string;\r\n /** A list of classes that will be selected when creating content with this descriptor */\r\n public readonly selectClasses: SelectClassInfo[];\r\n /** A list of content field categories used in this descriptor */\r\n public readonly categories: CategoryDescription[];\r\n /** A list of fields contained in the descriptor */\r\n public readonly fields: Field[];\r\n /** [[ContentFlags]] used to create the descriptor */\r\n public readonly contentFlags: number;\r\n /**\r\n * A ruleset used to create this descriptor.\r\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\r\n */\r\n public readonly ruleset?: Ruleset;\r\n /** Field used to sort the content */\r\n public sortingField?: Field;\r\n /** Sorting direction */\r\n public sortDirection?: SortDirection;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n public fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n public instanceFilter?: InstanceFilterDefinition;\r\n\r\n /** Construct a new Descriptor using a [[DescriptorSource]] */\r\n public constructor(source: DescriptorSource) {\r\n this.connectionId = source.connectionId;\r\n this.inputKeysHash = source.inputKeysHash;\r\n this.selectionInfo = source.selectionInfo;\r\n this.displayType = source.displayType;\r\n this.contentFlags = source.contentFlags;\r\n this.selectClasses = [...source.selectClasses];\r\n this.categories = [...source.categories];\r\n this.fields = [...source.fields];\r\n this.sortingField = source.sortingField;\r\n this.sortDirection = source.sortDirection;\r\n this.fieldsFilterExpression = source.fieldsFilterExpression;\r\n this.instanceFilter = source.instanceFilter;\r\n this.ruleset = source.ruleset;\r\n }\r\n\r\n /** Serialize [[Descriptor]] to JSON */\r\n public toJSON(): DescriptorJSON {\r\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\r\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\r\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\r\n return omitUndefined({\r\n displayType: this.displayType,\r\n contentFlags: this.contentFlags,\r\n categories: this.categories.map(CategoryDescription.toJSON),\r\n fields,\r\n selectClasses,\r\n classesMap,\r\n connectionId: this.connectionId ?? \"\",\r\n inputKeysHash: this.inputKeysHash ?? \"\",\r\n sortingFieldName: this.sortingField?.name,\r\n sortDirection: this.sortDirection,\r\n fieldsFilterExpression: this.fieldsFilterExpression,\r\n instanceFilter: this.instanceFilter,\r\n selectionInfo: this.selectionInfo,\r\n ruleset: this.ruleset,\r\n });\r\n }\r\n\r\n /** Deserialize [[Descriptor]] from JSON */\r\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n const {\r\n categories: jsonCategories,\r\n selectClasses: jsonSelectClasses,\r\n fields: jsonFields,\r\n connectionId,\r\n inputKeysHash,\r\n classesMap,\r\n sortingFieldName,\r\n ...leftOverJson\r\n } = json;\r\n const categories = CategoryDescription.listFromJSON(jsonCategories);\r\n const selectClasses = SelectClassInfo.listFromCompressedJSON(jsonSelectClasses, classesMap);\r\n const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\r\n return new Descriptor({\r\n ...leftOverJson,\r\n ...(connectionId ? /* istanbul ignore next */ { connectionId } : undefined),\r\n ...(inputKeysHash ? /* istanbul ignore next */ { inputKeysHash } : undefined),\r\n selectClasses,\r\n categories,\r\n fields,\r\n sortingField: getFieldByName(fields, sortingFieldName, true),\r\n });\r\n }\r\n\r\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\r\n return json\r\n .map((fieldJson: FieldJSON) => {\r\n const field = factory(fieldJson);\r\n if (field) {\r\n field.rebuildParentship();\r\n }\r\n return field;\r\n })\r\n .filter((field): field is Field => !!field);\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.fields, name, recurse);\r\n }\r\n\r\n /**\r\n * Get field by its descriptor.\r\n */\r\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\r\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\r\n }\r\n\r\n /**\r\n * Create descriptor overrides object from this descriptor.\r\n * @public\r\n */\r\n public createDescriptorOverrides(): DescriptorOverrides {\r\n const overrides: DescriptorOverrides = {};\r\n if (this.displayType) {\r\n overrides.displayType = this.displayType;\r\n }\r\n if (this.contentFlags !== 0) {\r\n overrides.contentFlags = this.contentFlags;\r\n }\r\n if (this.fieldsFilterExpression) {\r\n overrides.fieldsFilterExpression = this.fieldsFilterExpression;\r\n }\r\n if (this.instanceFilter) {\r\n overrides.instanceFilter = this.instanceFilter;\r\n }\r\n if (this.sortingField) {\r\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\r\n }\r\n return overrides;\r\n }\r\n}\r\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module Content
|
|
3
3
|
*/
|
|
4
4
|
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { ClassInfo,
|
|
5
|
+
import { ClassInfo, CompressedClassInfoJSON, RelationshipPath, RelationshipPathJSON, StrippedRelationshipPath } from "../EC";
|
|
6
6
|
import { RelationshipMeaning } from "../rules/content/modifiers/RelatedPropertiesSpecification";
|
|
7
7
|
import { CategoryDescription } from "./Category";
|
|
8
8
|
import { EditorDescription } from "./Editor";
|
|
@@ -30,7 +30,7 @@ export interface BaseFieldJSON {
|
|
|
30
30
|
* Data structure for a [[PropertiesField]] serialized to JSON.
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
export interface PropertiesFieldJSON<TClassInfoJSON =
|
|
33
|
+
export interface PropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {
|
|
34
34
|
properties: PropertyJSON<TClassInfoJSON>[];
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -51,7 +51,7 @@ export interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends P
|
|
|
51
51
|
* Data structure for a [[NestedContentField]] serialized to JSON.
|
|
52
52
|
* @public
|
|
53
53
|
*/
|
|
54
|
-
export interface NestedContentFieldJSON<TClassInfoJSON =
|
|
54
|
+
export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {
|
|
55
55
|
contentClassInfo: TClassInfoJSON;
|
|
56
56
|
pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;
|
|
57
57
|
relationshipMeaning?: RelationshipMeaning;
|
|
@@ -63,7 +63,33 @@ export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends
|
|
|
63
63
|
* JSON representation of a [[Field]]
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
export type FieldJSON<TClassInfoJSON =
|
|
66
|
+
export type FieldJSON<TClassInfoJSON = ClassInfo> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | ArrayPropertiesFieldJSON<TClassInfoJSON> | StructPropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;
|
|
67
|
+
/**
|
|
68
|
+
* Props for creating [[Field]].
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
interface FieldProps {
|
|
72
|
+
/** Category information */
|
|
73
|
+
category: CategoryDescription;
|
|
74
|
+
/** Unique name */
|
|
75
|
+
name: string;
|
|
76
|
+
/** Display label */
|
|
77
|
+
label: string;
|
|
78
|
+
/** Description of this field's values data type */
|
|
79
|
+
type: TypeDescription;
|
|
80
|
+
/** Are values in this field read-only */
|
|
81
|
+
isReadonly: boolean;
|
|
82
|
+
/** Priority of the field */
|
|
83
|
+
priority: number;
|
|
84
|
+
/** Property editor used to edit values of this field */
|
|
85
|
+
editor?: EditorDescription;
|
|
86
|
+
/** Property renderer used to render values of this field */
|
|
87
|
+
renderer?: RendererDescription;
|
|
88
|
+
/** Extended data associated with this field */
|
|
89
|
+
extendedData?: {
|
|
90
|
+
[key: string]: unknown;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
67
93
|
/**
|
|
68
94
|
* Describes a single content field. A field is usually represented as a grid column
|
|
69
95
|
* or a property pane row.
|
|
@@ -94,7 +120,7 @@ export declare class Field {
|
|
|
94
120
|
/** Parent field */
|
|
95
121
|
private _parent?;
|
|
96
122
|
/**
|
|
97
|
-
* Creates an instance of Field.
|
|
123
|
+
* Creates an instance of [[Field]].
|
|
98
124
|
* @param category Category information
|
|
99
125
|
* @param name Unique name
|
|
100
126
|
* @param label Display label
|
|
@@ -104,10 +130,13 @@ export declare class Field {
|
|
|
104
130
|
* @param editor Property editor used to edit values of this field
|
|
105
131
|
* @param renderer Property renderer used to render values of this field
|
|
106
132
|
* @param extendedData Extended data associated with this field
|
|
133
|
+
* @deprecated in 5.0. Use an overload with `FieldProps` instead.
|
|
107
134
|
*/
|
|
108
135
|
constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, isReadonly: boolean, priority: number, editor?: EditorDescription, renderer?: RendererDescription, extendedData?: {
|
|
109
136
|
[key: string]: unknown;
|
|
110
137
|
});
|
|
138
|
+
/** Creates an instance of [[Field]]. */
|
|
139
|
+
constructor(props: FieldProps);
|
|
111
140
|
/**
|
|
112
141
|
* Is this a [[PropertiesField]]
|
|
113
142
|
*/
|
|
@@ -121,13 +150,19 @@ export declare class Field {
|
|
|
121
150
|
*/
|
|
122
151
|
get parent(): NestedContentField | undefined;
|
|
123
152
|
clone(): Field;
|
|
124
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* Serialize this object to JSON.
|
|
155
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
156
|
+
*/
|
|
125
157
|
toJSON(): FieldJSON;
|
|
126
158
|
/** Serialize this object to compressed JSON */
|
|
127
159
|
toCompressedJSON(_classesMap: {
|
|
128
160
|
[id: string]: CompressedClassInfoJSON;
|
|
129
161
|
}): FieldJSON<string>;
|
|
130
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* Deserialize [[Field]] from JSON.
|
|
164
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
165
|
+
*/
|
|
131
166
|
static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined;
|
|
132
167
|
/** Deserialize a [[Field]] from compressed JSON. */
|
|
133
168
|
static fromCompressedJSON(json: FieldJSON<string> | undefined, classesMap: {
|
|
@@ -149,6 +184,14 @@ export declare class Field {
|
|
|
149
184
|
*/
|
|
150
185
|
matchesDescriptor(descriptor: FieldDescriptor): boolean;
|
|
151
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Props for creating [[PropertiesField]].
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
191
|
+
interface PropertiesFieldProps extends FieldProps {
|
|
192
|
+
/** A list of properties this field is created from */
|
|
193
|
+
properties: Property[];
|
|
194
|
+
}
|
|
152
195
|
/**
|
|
153
196
|
* Describes a content field that's based on one or more similar
|
|
154
197
|
* EC properties.
|
|
@@ -159,7 +202,7 @@ export declare class PropertiesField extends Field {
|
|
|
159
202
|
/** A list of properties this field is created from */
|
|
160
203
|
properties: Property[];
|
|
161
204
|
/**
|
|
162
|
-
* Creates an instance of PropertiesField.
|
|
205
|
+
* Creates an instance of [[PropertiesField]].
|
|
163
206
|
* @param category Category information
|
|
164
207
|
* @param name Unique name
|
|
165
208
|
* @param label Display label
|
|
@@ -169,20 +212,29 @@ export declare class PropertiesField extends Field {
|
|
|
169
212
|
* @param properties A list of properties this field is created from
|
|
170
213
|
* @param editor Property editor used to edit values of this field
|
|
171
214
|
* @param renderer Property renderer used to render values of this field
|
|
215
|
+
* @deprecated in 5.0. Use an overload with `PropertiesFieldProps` instead.
|
|
172
216
|
*/
|
|
173
|
-
constructor(category: CategoryDescription, name: string, label: string,
|
|
217
|
+
constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
|
|
218
|
+
/** Creates an instance of [[PropertiesField]]. */
|
|
219
|
+
constructor(props: PropertiesFieldProps);
|
|
174
220
|
/** Is this a an array property field */
|
|
175
221
|
isArrayPropertiesField(): this is ArrayPropertiesField;
|
|
176
222
|
/** Is this a an struct property field */
|
|
177
223
|
isStructPropertiesField(): this is StructPropertiesField;
|
|
178
224
|
clone(): PropertiesField;
|
|
179
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Serialize this object to JSON
|
|
227
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
228
|
+
*/
|
|
180
229
|
toJSON(): PropertiesFieldJSON;
|
|
181
230
|
/** Serialize this object to compressed JSON */
|
|
182
231
|
toCompressedJSON(classesMap: {
|
|
183
232
|
[id: string]: CompressedClassInfoJSON;
|
|
184
233
|
}): PropertiesFieldJSON<string>;
|
|
185
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Deserialize [[PropertiesField]] from JSON.
|
|
236
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
237
|
+
*/
|
|
186
238
|
static fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined;
|
|
187
239
|
/**
|
|
188
240
|
* Deserialize a [[PropertiesField]] from compressed JSON.
|
|
@@ -202,22 +254,41 @@ export declare class PropertiesField extends Field {
|
|
|
202
254
|
*/
|
|
203
255
|
matchesDescriptor(descriptor: FieldDescriptor): boolean;
|
|
204
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Props for creating [[ArrayPropertiesField]].
|
|
259
|
+
* @public
|
|
260
|
+
*/
|
|
261
|
+
interface ArrayPropertiesFieldProps extends PropertiesFieldProps {
|
|
262
|
+
itemsField: PropertiesField;
|
|
263
|
+
}
|
|
205
264
|
/**
|
|
206
265
|
* Describes a content field that's based on one or more similar EC array properties.
|
|
207
266
|
* @public
|
|
208
267
|
*/
|
|
209
268
|
export declare class ArrayPropertiesField extends PropertiesField {
|
|
210
269
|
itemsField: PropertiesField;
|
|
211
|
-
|
|
270
|
+
/**
|
|
271
|
+
* Creates an instance of [[ArrayPropertiesField]].
|
|
272
|
+
* @deprecated in 5.0. Use an overload with `ArrayPropertiesFieldProps` instead.
|
|
273
|
+
*/
|
|
274
|
+
constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, itemsField: PropertiesField, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
|
|
275
|
+
/** Creates an instance of [[ArrayPropertiesField]]. */
|
|
276
|
+
constructor(props: ArrayPropertiesFieldProps);
|
|
212
277
|
isArrayPropertiesField(): this is ArrayPropertiesField;
|
|
213
278
|
clone(): ArrayPropertiesField;
|
|
214
|
-
/**
|
|
279
|
+
/**
|
|
280
|
+
* Serialize this object to JSON.
|
|
281
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
282
|
+
*/
|
|
215
283
|
toJSON(): ArrayPropertiesFieldJSON;
|
|
216
284
|
/** Serialize this object to compressed JSON */
|
|
217
285
|
toCompressedJSON(classesMap: {
|
|
218
286
|
[id: string]: CompressedClassInfoJSON;
|
|
219
287
|
}): ArrayPropertiesFieldJSON<string>;
|
|
220
|
-
/**
|
|
288
|
+
/**
|
|
289
|
+
* Deserialize [[ArrayPropertiesField]] from JSON.
|
|
290
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
291
|
+
*/
|
|
221
292
|
static fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField;
|
|
222
293
|
/**
|
|
223
294
|
* Deserialize an [[ArrayPropertiesField]] from compressed JSON.
|
|
@@ -227,22 +298,41 @@ export declare class ArrayPropertiesField extends PropertiesField {
|
|
|
227
298
|
[id: string]: CompressedClassInfoJSON;
|
|
228
299
|
}, categories: CategoryDescription[]): ArrayPropertiesField;
|
|
229
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Props for creating [[StructPropertiesField]].
|
|
303
|
+
* @public
|
|
304
|
+
*/
|
|
305
|
+
interface StructPropertiesFieldProps extends PropertiesFieldProps {
|
|
306
|
+
memberFields: PropertiesField[];
|
|
307
|
+
}
|
|
230
308
|
/**
|
|
231
309
|
* Describes a content field that's based on one or more similar EC struct properties.
|
|
232
310
|
* @public
|
|
233
311
|
*/
|
|
234
312
|
export declare class StructPropertiesField extends PropertiesField {
|
|
235
313
|
memberFields: PropertiesField[];
|
|
236
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Creates an instance of [[StructPropertiesField]].
|
|
316
|
+
* @deprecated in 5.0. Use an overload with `StructPropertiesFieldProps` instead.
|
|
317
|
+
*/
|
|
318
|
+
constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, memberFields: PropertiesField[], isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
|
|
319
|
+
/** Creates an instance of [[StructPropertiesField]]. */
|
|
320
|
+
constructor(props: StructPropertiesFieldProps);
|
|
237
321
|
isStructPropertiesField(): this is StructPropertiesField;
|
|
238
322
|
clone(): StructPropertiesField;
|
|
239
|
-
/**
|
|
323
|
+
/**
|
|
324
|
+
* Serialize this object to JSON.
|
|
325
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
326
|
+
*/
|
|
240
327
|
toJSON(): StructPropertiesFieldJSON;
|
|
241
328
|
/** Serialize this object to compressed JSON */
|
|
242
329
|
toCompressedJSON(classesMap: {
|
|
243
330
|
[id: string]: CompressedClassInfoJSON;
|
|
244
331
|
}): StructPropertiesFieldJSON<string>;
|
|
245
|
-
/**
|
|
332
|
+
/**
|
|
333
|
+
* Deserialize [[StructPropertiesField]] from JSON.
|
|
334
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
335
|
+
*/
|
|
246
336
|
static fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField;
|
|
247
337
|
/**
|
|
248
338
|
* Deserialize a [[StructPropertiesField]] from compressed JSON.
|
|
@@ -252,6 +342,39 @@ export declare class StructPropertiesField extends PropertiesField {
|
|
|
252
342
|
[id: string]: CompressedClassInfoJSON;
|
|
253
343
|
}, categories: CategoryDescription[]): StructPropertiesField;
|
|
254
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Props for creating [[NestedContentField]].
|
|
347
|
+
* @public
|
|
348
|
+
*/
|
|
349
|
+
interface NestedContentFieldProps extends FieldProps {
|
|
350
|
+
/** Information about an ECClass whose properties are nested inside this field */
|
|
351
|
+
contentClassInfo: ClassInfo;
|
|
352
|
+
/** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */
|
|
353
|
+
pathToPrimaryClass: RelationshipPath;
|
|
354
|
+
/**
|
|
355
|
+
* Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)
|
|
356
|
+
* and content class of this field.
|
|
357
|
+
*
|
|
358
|
+
* The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up
|
|
359
|
+
* presentation rules for creating the content.
|
|
360
|
+
*/
|
|
361
|
+
relationshipMeaning?: RelationshipMeaning;
|
|
362
|
+
/**
|
|
363
|
+
* When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes
|
|
364
|
+
* has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is
|
|
365
|
+
* here to help.
|
|
366
|
+
*
|
|
367
|
+
* **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.
|
|
368
|
+
* When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,
|
|
369
|
+
* class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute
|
|
370
|
+
* will contain ID of class `B`, identifying that only this specific class has the relationship.
|
|
371
|
+
*/
|
|
372
|
+
actualPrimaryClassIds?: Id64String[];
|
|
373
|
+
/** Contained nested fields */
|
|
374
|
+
nestedFields: Field[];
|
|
375
|
+
/** Flag specifying whether field should be expanded */
|
|
376
|
+
autoExpand?: boolean;
|
|
377
|
+
}
|
|
255
378
|
/**
|
|
256
379
|
* Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).
|
|
257
380
|
*
|
|
@@ -286,7 +409,7 @@ export declare class NestedContentField extends Field {
|
|
|
286
409
|
/** Flag specifying whether field should be expanded */
|
|
287
410
|
autoExpand?: boolean;
|
|
288
411
|
/**
|
|
289
|
-
* Creates an instance of NestedContentField.
|
|
412
|
+
* Creates an instance of [[NestedContentField]].
|
|
290
413
|
* @param category Category information
|
|
291
414
|
* @param name Unique name
|
|
292
415
|
* @param label Display label
|
|
@@ -300,8 +423,11 @@ export declare class NestedContentField extends Field {
|
|
|
300
423
|
* @param autoExpand Flag specifying whether field should be expanded
|
|
301
424
|
* @param relationshipMeaning RelationshipMeaning of the field
|
|
302
425
|
* @param renderer Property renderer used to render values of this field
|
|
426
|
+
* @deprecated in 5.0. Use an overload with `NestedContentFieldProps` instead.
|
|
303
427
|
*/
|
|
304
|
-
constructor(category: CategoryDescription, name: string, label: string,
|
|
428
|
+
constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, isReadonly: boolean, priority: number, contentClassInfo: ClassInfo, pathToPrimaryClass: RelationshipPath, nestedFields: Field[], editor?: EditorDescription, autoExpand?: boolean, renderer?: RendererDescription);
|
|
429
|
+
/** Creates an instance of [[NestedContentField]]. */
|
|
430
|
+
constructor(props: NestedContentFieldProps);
|
|
305
431
|
clone(): NestedContentField;
|
|
306
432
|
/**
|
|
307
433
|
* Get field by its name
|
|
@@ -309,22 +435,19 @@ export declare class NestedContentField extends Field {
|
|
|
309
435
|
* @param recurse Recurse into nested fields
|
|
310
436
|
*/
|
|
311
437
|
getFieldByName(name: string, recurse?: boolean): Field | undefined;
|
|
312
|
-
/**
|
|
438
|
+
/**
|
|
439
|
+
* Serialize this object to JSON.
|
|
440
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
441
|
+
*/
|
|
313
442
|
toJSON(): NestedContentFieldJSON;
|
|
314
443
|
/** Serialize this object to compressed JSON */
|
|
315
444
|
toCompressedJSON(classesMap: {
|
|
316
445
|
[id: string]: CompressedClassInfoJSON;
|
|
317
446
|
}): NestedContentFieldJSON<string>;
|
|
318
|
-
/**
|
|
319
|
-
* Deserialize [[NestedContentField]] from JSON
|
|
320
|
-
* @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]
|
|
321
|
-
*/
|
|
322
|
-
static fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined;
|
|
323
447
|
/** Deserialize a [[NestedContentField]] from compressed JSON. */
|
|
324
448
|
static fromCompressedJSON(json: NestedContentFieldJSON<Id64String>, classesMap: {
|
|
325
449
|
[id: string]: CompressedClassInfoJSON;
|
|
326
|
-
}, categories: CategoryDescription[]):
|
|
327
|
-
private static fromCommonJSON;
|
|
450
|
+
}, categories: CategoryDescription[]): NestedContentField;
|
|
328
451
|
/** Resets parent of this field and all nested fields. */
|
|
329
452
|
resetParentship(): void;
|
|
330
453
|
/**
|
|
@@ -391,4 +514,5 @@ export interface PropertiesFieldDescriptor extends FieldDescriptorBase {
|
|
|
391
514
|
name: string;
|
|
392
515
|
}>;
|
|
393
516
|
}
|
|
517
|
+
export {};
|
|
394
518
|
//# sourceMappingURL=Fields.d.ts.map
|