@itwin/presentation-common 5.0.0-dev.7 → 5.0.0-dev.70
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/assets/locales/en/Presentation.json +19 -19
- 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/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-common/Diagnostics.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/InstanceFilterDefinition.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/PresentationIpcInterface.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/RulesetsFactory.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/Category.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/DisplayTypes.js.map +1 -1
- package/lib/cjs/presentation-common/content/Editor.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/Renderer.js.map +1 -1
- package/lib/cjs/presentation-common/content/TypeDescription.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/ClassSpecifications.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.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/Ruleset.js.map +1 -1
- package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRule.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/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.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/ExtendedDataRule.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/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.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/CustomQueryInstanceNodesSpecification.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/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.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/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-common/Diagnostics.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/InstanceFilterDefinition.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/PresentationIpcInterface.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/RulesetsFactory.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/Category.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/DisplayTypes.js.map +1 -1
- package/lib/esm/presentation-common/content/Editor.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/Renderer.js.map +1 -1
- package/lib/esm/presentation-common/content/TypeDescription.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/ClassSpecifications.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.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/Ruleset.js.map +1 -1
- package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRule.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/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.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/ExtendedDataRule.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/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.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/CustomQueryInstanceNodesSpecification.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/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.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/lib/public/locales/en/Presentation.json +19 -19
- 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
|
@@ -9,6 +9,7 @@ import { assert } from "@itwin/core-bentley";
|
|
|
9
9
|
import { RelatedClassInfo, RelatedClassInfoWithOptionalRelationship, } from "../EC";
|
|
10
10
|
import { CategoryDescription } from "./Category";
|
|
11
11
|
import { Field, getFieldByDescriptor, getFieldByName } from "./Fields";
|
|
12
|
+
import { omitUndefined } from "../Utils";
|
|
12
13
|
/** @public */
|
|
13
14
|
export var SelectClassInfo;
|
|
14
15
|
(function (SelectClassInfo) {
|
|
@@ -83,11 +84,6 @@ export var ContentFlags;
|
|
|
83
84
|
(function (ContentFlags) {
|
|
84
85
|
/** Each content record only has [[InstanceKey]] and no data */
|
|
85
86
|
ContentFlags[ContentFlags["KeysOnly"] = 1] = "KeysOnly";
|
|
86
|
-
/**
|
|
87
|
-
* Each content record additionally has an image id
|
|
88
|
-
* @deprecated in 3.x. Use [[ExtendedDataRule]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
|
|
89
|
-
*/
|
|
90
|
-
ContentFlags[ContentFlags["ShowImages"] = 2] = "ShowImages";
|
|
91
87
|
/** Each content record additionally has a display label */
|
|
92
88
|
ContentFlags[ContentFlags["ShowLabels"] = 4] = "ShowLabels";
|
|
93
89
|
/** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */
|
|
@@ -124,6 +120,53 @@ export var SortDirection;
|
|
|
124
120
|
* @public
|
|
125
121
|
*/
|
|
126
122
|
export class Descriptor {
|
|
123
|
+
/** Id of the connection used to create the descriptor */
|
|
124
|
+
connectionId;
|
|
125
|
+
/** Hash of the input keys used to create the descriptor */
|
|
126
|
+
inputKeysHash;
|
|
127
|
+
/** Selection info used to create the descriptor */
|
|
128
|
+
selectionInfo;
|
|
129
|
+
/** Display type used to create the descriptor */
|
|
130
|
+
displayType;
|
|
131
|
+
/** A list of classes that will be selected when creating content with this descriptor */
|
|
132
|
+
selectClasses;
|
|
133
|
+
/** A list of content field categories used in this descriptor */
|
|
134
|
+
categories;
|
|
135
|
+
/** A list of fields contained in the descriptor */
|
|
136
|
+
fields;
|
|
137
|
+
/** [[ContentFlags]] used to create the descriptor */
|
|
138
|
+
contentFlags;
|
|
139
|
+
/**
|
|
140
|
+
* A ruleset used to create this descriptor.
|
|
141
|
+
* Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.
|
|
142
|
+
*/
|
|
143
|
+
ruleset;
|
|
144
|
+
/** Field used to sort the content */
|
|
145
|
+
sortingField;
|
|
146
|
+
/** Sorting direction */
|
|
147
|
+
sortDirection;
|
|
148
|
+
/**
|
|
149
|
+
* [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by
|
|
150
|
+
* select fields.
|
|
151
|
+
*
|
|
152
|
+
* This is different from [[instanceFilter]] as filtering is applied on the union of all selects,
|
|
153
|
+
* which removes access to content instance property values. Instead of referencing properties
|
|
154
|
+
* through `this.PropertyName` alias, the expression should reference them by field names. In cases
|
|
155
|
+
* when properties field merges multiple properties, this allows applying the filter on all of them
|
|
156
|
+
* at once. This is useful for filtering table rows by column value, when content is displayed in
|
|
157
|
+
* table format.
|
|
158
|
+
*/
|
|
159
|
+
fieldsFilterExpression;
|
|
160
|
+
/**
|
|
161
|
+
* Instances filter that allows filtering content by class, properties of specific class
|
|
162
|
+
* or properties of instances related to the content instance.
|
|
163
|
+
*
|
|
164
|
+
* This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on
|
|
165
|
+
* specific select class rather than a union of multiple select classes. This means the filter has
|
|
166
|
+
* access to properties of that class and they can be referenced using symbols like `this.Property`.
|
|
167
|
+
* This is useful for filtering instances of specific class.
|
|
168
|
+
*/
|
|
169
|
+
instanceFilter;
|
|
127
170
|
/** Construct a new Descriptor using a [[DescriptorSource]] */
|
|
128
171
|
constructor(source) {
|
|
129
172
|
this.connectionId = source.connectionId;
|
|
@@ -136,8 +179,7 @@ export class Descriptor {
|
|
|
136
179
|
this.fields = [...source.fields];
|
|
137
180
|
this.sortingField = source.sortingField;
|
|
138
181
|
this.sortDirection = source.sortDirection;
|
|
139
|
-
this.
|
|
140
|
-
this.fieldsFilterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
182
|
+
this.fieldsFilterExpression = source.fieldsFilterExpression;
|
|
141
183
|
this.instanceFilter = source.instanceFilter;
|
|
142
184
|
this.ruleset = source.ruleset;
|
|
143
185
|
}
|
|
@@ -146,34 +188,40 @@ export class Descriptor {
|
|
|
146
188
|
const classesMap = {};
|
|
147
189
|
const selectClasses = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));
|
|
148
190
|
const fields = this.fields.map((field) => field.toCompressedJSON(classesMap));
|
|
149
|
-
return
|
|
191
|
+
return omitUndefined({
|
|
150
192
|
displayType: this.displayType,
|
|
151
193
|
contentFlags: this.contentFlags,
|
|
152
194
|
categories: this.categories.map(CategoryDescription.toJSON),
|
|
153
195
|
fields,
|
|
154
196
|
selectClasses,
|
|
155
197
|
classesMap,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
198
|
+
connectionId: this.connectionId ?? "",
|
|
199
|
+
inputKeysHash: this.inputKeysHash ?? "",
|
|
200
|
+
sortingFieldName: this.sortingField?.name,
|
|
201
|
+
sortDirection: this.sortDirection,
|
|
202
|
+
fieldsFilterExpression: this.fieldsFilterExpression,
|
|
203
|
+
instanceFilter: this.instanceFilter,
|
|
204
|
+
selectionInfo: this.selectionInfo,
|
|
205
|
+
ruleset: this.ruleset,
|
|
206
|
+
});
|
|
161
207
|
}
|
|
162
208
|
/** Deserialize [[Descriptor]] from JSON */
|
|
163
209
|
static fromJSON(json) {
|
|
164
210
|
if (!json) {
|
|
165
211
|
return undefined;
|
|
166
212
|
}
|
|
167
|
-
const { classesMap, ...leftOverJson } = json;
|
|
168
|
-
const categories = CategoryDescription.listFromJSON(
|
|
169
|
-
const selectClasses = SelectClassInfo.listFromCompressedJSON(
|
|
170
|
-
const fields = this.getFieldsFromJSON(
|
|
213
|
+
const { categories: jsonCategories, selectClasses: jsonSelectClasses, fields: jsonFields, connectionId, inputKeysHash, classesMap, sortingFieldName, ...leftOverJson } = json;
|
|
214
|
+
const categories = CategoryDescription.listFromJSON(jsonCategories);
|
|
215
|
+
const selectClasses = SelectClassInfo.listFromCompressedJSON(jsonSelectClasses, classesMap);
|
|
216
|
+
const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));
|
|
171
217
|
return new Descriptor({
|
|
172
218
|
...leftOverJson,
|
|
219
|
+
...(connectionId ? /* istanbul ignore next */ { connectionId } : undefined),
|
|
220
|
+
...(inputKeysHash ? /* istanbul ignore next */ { inputKeysHash } : undefined),
|
|
173
221
|
selectClasses,
|
|
174
222
|
categories,
|
|
175
223
|
fields,
|
|
176
|
-
sortingField: getFieldByName(fields,
|
|
224
|
+
sortingField: getFieldByName(fields, sortingFieldName, true),
|
|
177
225
|
});
|
|
178
226
|
}
|
|
179
227
|
static getFieldsFromJSON(json, factory) {
|
|
@@ -213,10 +261,8 @@ export class Descriptor {
|
|
|
213
261
|
if (this.contentFlags !== 0) {
|
|
214
262
|
overrides.contentFlags = this.contentFlags;
|
|
215
263
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
219
|
-
overrides.fieldsFilterExpression = this.fieldsFilterExpression ?? this.filterExpression;
|
|
264
|
+
if (this.fieldsFilterExpression) {
|
|
265
|
+
overrides.fieldsFilterExpression = this.fieldsFilterExpression;
|
|
220
266
|
}
|
|
221
267
|
if (this.instanceFilter) {
|
|
222
268
|
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,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAIL,gBAAgB,EAEhB,wCAAwC,GAIzC,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,mBAAmB,EA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ent":["/*---------------------------------------------------------------------------------------------\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,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAGL,gBAAgB,EAEhB,wCAAwC,GAIzC,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,mBAAmB,EAA2B,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,KAAK,EAA8B,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAuCzC,cAAc;AACd,MAAM,KAAW,eAAe,CAsE/B;AAtED,WAAiB,eAAe;IAC9B,2DAA2D;IAC3D,SAAgB,kBAAkB,CAAC,IAAiC,EAAE,UAAqD;QACzH,MAAM,CAAC,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,CAA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AC,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,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAChC,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACjE,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","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, Id64String } from \"@itwin/core-bentley\";\nimport {\n ClassInfo,\n CompressedClassInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n} from \"../EC\";\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition\";\nimport { Ruleset } from \"../rules/Ruleset\";\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category\";\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields\";\nimport { omitUndefined } from \"../Utils\";\n\n/**\n * Data structure that describes an ECClass in content [[Descriptor]].\n * @public\n */\nexport interface SelectClassInfo {\n /** Information about the ECClass */\n selectClassInfo: ClassInfo;\n\n /** Is the class handled polymorphically */\n isSelectPolymorphic: boolean;\n\n /** Relationship path from input class to the select class. */\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\n\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\n relatedPropertyPaths?: RelationshipPath[];\n\n /** Relationship paths to navigation property classes */\n navigationPropertyClasses?: RelatedClassInfo[];\n\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\n relatedInstancePaths?: RelationshipPath[];\n}\n\n/**\n * Serialized [[SelectClassInfo]] JSON representation\n * @public\n */\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfo> {\n selectClassInfo: TClassInfoJSON;\n isSelectPolymorphic: boolean;\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\n}\n\n/** @public */\nexport namespace SelectClassInfo {\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\n return {\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\n isSelectPolymorphic: json.isSelectPolymorphic,\n ...(json.navigationPropertyClasses\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\n : undefined),\n ...(json.relatedInstancePaths\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n ...(json.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(json.relatedPropertyPaths\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n };\n }\n\n /** Serialize [[SelectClassInfo]] to compressed JSON */\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\n classesMap[id] = leftOverClassInfo;\n return {\n selectClassInfo: id,\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\n ...(selectClass.relatedInstancePaths\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\n : undefined),\n ...(selectClass.navigationPropertyClasses\n ? {\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.relatedPropertyPaths\n ? {\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\n ),\n }\n : undefined),\n };\n }\n\n /**\n * Deserialize [[SelectClassInfo]] list from JSON\n * @param json JSON or JSON serialized to string to deserialize from\n * @returns Deserialized [[SelectClassInfo]] objects list\n *\n * @internal\n */\n export function listFromCompressedJSON(json: SelectClassInfoJSON<Id64String>[], classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo[] {\n return json.map((sci) => fromCompressedJSON(sci, classesMap));\n }\n}\n\n/**\n * Flags that control content format.\n * @public\n */\nexport enum ContentFlags {\n /** Each content record only has [[InstanceKey]] and no data */\n KeysOnly = 1 << 0,\n\n /** Each content record additionally has a display label */\n ShowLabels = 1 << 2,\n\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\n MergeResults = 1 << 3,\n\n /** Content has only distinct values */\n DistinctValues = 1 << 4,\n\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\n NoFields = 1 << 5,\n\n /**\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\n * given input key at the cost of performance creating those items.\n */\n IncludeInputKeys = 1 << 8,\n\n /**\n * Produce content descriptor that is not intended for querying content. Allows the implementation to omit certain\n * operations to make obtaining content descriptor faster.\n * @internal\n */\n DescriptorOnly = 1 << 9,\n}\n\n/**\n * Data sorting direction\n * @public\n */\nexport enum SortDirection {\n Ascending,\n Descending,\n}\n\n/**\n * Data structure that contains selection information. Used\n * for cases when requesting content after a selection change.\n *\n * @public\n */\nexport interface SelectionInfo {\n /** Name of selection provider which cause the selection change */\n providerName: string;\n /** Level of selection that changed */\n level?: number;\n}\n\n/**\n * Serialized [[Descriptor]] JSON representation.\n * @public\n */\nexport interface DescriptorJSON {\n classesMap: { [id: string]: CompressedClassInfoJSON };\n connectionId: string;\n inputKeysHash: string;\n selectionInfo?: SelectionInfo;\n displayType: string;\n selectClasses: SelectClassInfoJSON<Id64String>[];\n categories: CategoryDescriptionJSON[];\n fields: FieldJSON<Id64String>[];\n sortingFieldName?: string;\n sortDirection?: SortDirection;\n contentFlags: number;\n fieldsFilterExpression?: string;\n instanceFilter?: InstanceFilterDefinition;\n ruleset?: Ruleset;\n}\n\n/**\n * Descriptor overrides that can be used to customize content\n * @public\n */\nexport interface DescriptorOverrides {\n /**\n * Content display type. Can be accessed in presentation rules and used\n * to modify content in various ways. Defaults to empty string.\n */\n displayType?: string;\n\n /** Content flags used for content customization. See [[ContentFlags]] */\n contentFlags?: number;\n\n /** Fields selector that allows excluding or including only specified fields. */\n fieldsSelector?: {\n /** Should the specified fields be included or excluded */\n type: \"include\" | \"exclude\";\n /** A list of field descriptors that identify fields to include / exclude */\n fields: FieldDescriptor[];\n };\n\n /** Specification for sorting data. */\n sorting?: {\n /** Identifier of the field to use for sorting */\n field: FieldDescriptor;\n /** Sort direction */\n direction: SortDirection;\n };\n\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Descriptor properties\n * @public\n */\nexport interface DescriptorSource {\n /** Id of the connection used to create the descriptor */\n readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n readonly displayType: string;\n /** A list of classes that will be selected from when creating content with this descriptor */\n readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n readonly contentFlags: number;\n /** Field used to sort the content */\n readonly sortingField?: Field;\n /** Sorting direction */\n readonly sortDirection?: SortDirection;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n readonly ruleset?: Ruleset;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Data structure that describes content: fields, sorting, filtering, format, etc.\n * Descriptor may be changed to control how content is created.\n *\n * @public\n */\nexport class Descriptor implements DescriptorSource {\n /** Id of the connection used to create the descriptor */\n public readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n public readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n public readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n public readonly displayType: string;\n /** A list of classes that will be selected when creating content with this descriptor */\n public readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n public readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n public readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n public readonly contentFlags: number;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n public readonly ruleset?: Ruleset;\n /** Field used to sort the content */\n public sortingField?: Field;\n /** Sorting direction */\n public sortDirection?: SortDirection;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n public fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n public instanceFilter?: InstanceFilterDefinition;\n\n /** Construct a new Descriptor using a [[DescriptorSource]] */\n public constructor(source: DescriptorSource) {\n this.connectionId = source.connectionId;\n this.inputKeysHash = source.inputKeysHash;\n this.selectionInfo = source.selectionInfo;\n this.displayType = source.displayType;\n this.contentFlags = source.contentFlags;\n this.selectClasses = [...source.selectClasses];\n this.categories = [...source.categories];\n this.fields = [...source.fields];\n this.sortingField = source.sortingField;\n this.sortDirection = source.sortDirection;\n this.fieldsFilterExpression = source.fieldsFilterExpression;\n this.instanceFilter = source.instanceFilter;\n this.ruleset = source.ruleset;\n }\n\n /** Serialize [[Descriptor]] to JSON */\n public toJSON(): DescriptorJSON {\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\n return omitUndefined({\n displayType: this.displayType,\n contentFlags: this.contentFlags,\n categories: this.categories.map(CategoryDescription.toJSON),\n fields,\n selectClasses,\n classesMap,\n connectionId: this.connectionId ?? \"\",\n inputKeysHash: this.inputKeysHash ?? \"\",\n sortingFieldName: this.sortingField?.name,\n sortDirection: this.sortDirection,\n fieldsFilterExpression: this.fieldsFilterExpression,\n instanceFilter: this.instanceFilter,\n selectionInfo: this.selectionInfo,\n ruleset: this.ruleset,\n });\n }\n\n /** Deserialize [[Descriptor]] from JSON */\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\n if (!json) {\n return undefined;\n }\n\n const {\n categories: jsonCategories,\n selectClasses: jsonSelectClasses,\n fields: jsonFields,\n connectionId,\n inputKeysHash,\n classesMap,\n sortingFieldName,\n ...leftOverJson\n } = json;\n const categories = CategoryDescription.listFromJSON(jsonCategories);\n const selectClasses = SelectClassInfo.listFromCompressedJSON(jsonSelectClasses, classesMap);\n const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\n return new Descriptor({\n ...leftOverJson,\n ...(connectionId ? /* istanbul ignore next */ { connectionId } : undefined),\n ...(inputKeysHash ? /* istanbul ignore next */ { inputKeysHash } : undefined),\n selectClasses,\n categories,\n fields,\n sortingField: getFieldByName(fields, sortingFieldName, true),\n });\n }\n\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\n return json\n .map((fieldJson: FieldJSON) => {\n const field = factory(fieldJson);\n if (field) {\n field.rebuildParentship();\n }\n return field;\n })\n .filter((field): field is Field => !!field);\n }\n\n /**\n * Get field by its name\n * @param name Name of the field to find\n * @param recurse Recurse into nested fields\n */\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\n return getFieldByName(this.fields, name, recurse);\n }\n\n /**\n * Get field by its descriptor.\n */\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\n }\n\n /**\n * Create descriptor overrides object from this descriptor.\n * @public\n */\n public createDescriptorOverrides(): DescriptorOverrides {\n const overrides: DescriptorOverrides = {};\n if (this.displayType) {\n overrides.displayType = this.displayType;\n }\n if (this.contentFlags !== 0) {\n overrides.contentFlags = this.contentFlags;\n }\n if (this.fieldsFilterExpression) {\n overrides.fieldsFilterExpression = this.fieldsFilterExpression;\n }\n if (this.instanceFilter) {\n overrides.instanceFilter = this.instanceFilter;\n }\n if (this.sortingField) {\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\n }\n return overrides;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayTypes.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/DisplayTypes.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC,4BAA4B;IAC5B,qDAAuB,CAAA;IAEvB,yFAAyF;IACzF,2CAAa,CAAA;IAEb,sFAAsF;IACtF,2DAA6B,CAAA;IAE7B,yGAAyG;IACzG,2CAAa,CAAA;IAEb,6EAA6E;IAC7E,mDAAqB,CAAA;AACvB,CAAC,EAfW,0BAA0B,KAA1B,0BAA0B,QAerC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"DisplayTypes.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/DisplayTypes.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC,4BAA4B;IAC5B,qDAAuB,CAAA;IAEvB,yFAAyF;IACzF,2CAAa,CAAA;IAEb,sFAAsF;IACtF,2DAA6B,CAAA;IAE7B,yGAAyG;IACzG,2CAAa,CAAA;IAEb,6EAA6E;IAC7E,mDAAqB,CAAA;AACvB,CAAC,EAfW,0BAA0B,KAA1B,0BAA0B,QAerC","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\n/**\n * Displayed content types. Affects how the content is formatted, e.g.\n * the [[ContentFlags]].\n *\n * @public\n */\nexport enum DefaultContentDisplayTypes {\n /** Unknown content type. */\n Undefined = \"Undefined\", // eslint-disable-line id-denylist\n\n /** Grid or table view content type. By default adds [[ContentFlags.ShowLabels]] flag. */\n Grid = \"Grid\",\n\n /** Property pane content type. By default adds [[ContentFlags.MergeResults]] flag. */\n PropertyPane = \"PropertyPane\",\n\n /** List content type. By default adds [[ContentFlags.NoFields]] and [[ContentFlags.ShowLabels]] flags */\n List = \"List\",\n\n /** Viewport content type. By default adds [[ContentFlags.KeysOnly]] flag. */\n Viewport = \"Graphics\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Editor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Editor.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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\n/**\n * A data structure which describes property editor used\n * for a content [[Field]].\n *\n * @public\n */\nexport interface EditorDescription {\n /** Unique name */\n name: string;\n /** Editor-specific parameters */\n params?: any;\n}\n"]}
|