@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 { NavigationPropertyInfo, RelatedClassInfo, RelationshipPath, } from "../EC";
|
|
10
10
|
import { PresentationError, PresentationStatus } from "../Error";
|
|
11
11
|
import { RelationshipMeaning } from "../rules/content/modifiers/RelatedPropertiesSpecification";
|
|
12
|
+
import { omitUndefined } from "../Utils";
|
|
12
13
|
import { Property } from "./Property";
|
|
13
14
|
function isPropertiesField(field) {
|
|
14
15
|
return !!field.properties;
|
|
@@ -29,28 +30,50 @@ function isNestedContentField(field) {
|
|
|
29
30
|
* @public
|
|
30
31
|
*/
|
|
31
32
|
export class Field {
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
33
|
+
/** Category information */
|
|
34
|
+
category;
|
|
35
|
+
/** Unique name */
|
|
36
|
+
name;
|
|
37
|
+
/** Display label */
|
|
38
|
+
label;
|
|
39
|
+
/** Description of this field's values data type */
|
|
40
|
+
type;
|
|
41
|
+
/** Are values in this field read-only */
|
|
42
|
+
isReadonly;
|
|
43
|
+
/** Priority of the field. Higher priority fields should appear first in the UI */
|
|
44
|
+
priority;
|
|
45
|
+
/** Property renderer used to render values of this field */
|
|
46
|
+
renderer;
|
|
47
|
+
/** Property editor used to edit values of this field */
|
|
48
|
+
editor;
|
|
49
|
+
/** Extended data associated with this field */
|
|
50
|
+
extendedData;
|
|
51
|
+
/** Parent field */
|
|
52
|
+
_parent;
|
|
53
|
+
constructor(categoryOrProps, name, label, type, isReadonly, priority, editor, renderer, extendedData) {
|
|
54
|
+
/* istanbul ignore next */
|
|
55
|
+
const props = "category" in categoryOrProps
|
|
56
|
+
? categoryOrProps
|
|
57
|
+
: {
|
|
58
|
+
category: categoryOrProps,
|
|
59
|
+
name: name,
|
|
60
|
+
label: label,
|
|
61
|
+
type: type,
|
|
62
|
+
isReadonly: isReadonly,
|
|
63
|
+
priority: priority,
|
|
64
|
+
editor,
|
|
65
|
+
renderer,
|
|
66
|
+
extendedData,
|
|
67
|
+
};
|
|
68
|
+
this.category = props.category;
|
|
69
|
+
this.name = props.name;
|
|
70
|
+
this.label = props.label;
|
|
71
|
+
this.type = props.type;
|
|
72
|
+
this.isReadonly = props.isReadonly;
|
|
73
|
+
this.priority = props.priority;
|
|
74
|
+
this.editor = props.editor;
|
|
75
|
+
this.renderer = props.renderer;
|
|
76
|
+
this.extendedData = props.extendedData;
|
|
54
77
|
}
|
|
55
78
|
/**
|
|
56
79
|
* Is this a [[PropertiesField]]
|
|
@@ -71,13 +94,20 @@ export class Field {
|
|
|
71
94
|
return this._parent;
|
|
72
95
|
}
|
|
73
96
|
clone() {
|
|
74
|
-
const clone = new Field(this
|
|
97
|
+
const clone = new Field(this);
|
|
75
98
|
clone.rebuildParentship(this.parent);
|
|
76
99
|
return clone;
|
|
77
100
|
}
|
|
78
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Serialize this object to JSON.
|
|
103
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
104
|
+
*/
|
|
79
105
|
toJSON() {
|
|
80
|
-
return {
|
|
106
|
+
return this.toCompressedJSON({});
|
|
107
|
+
}
|
|
108
|
+
/** Serialize this object to compressed JSON */
|
|
109
|
+
toCompressedJSON(_classesMap) {
|
|
110
|
+
return omitUndefined({
|
|
81
111
|
category: this.category.name,
|
|
82
112
|
name: this.name,
|
|
83
113
|
label: this.label,
|
|
@@ -86,28 +116,34 @@ export class Field {
|
|
|
86
116
|
priority: this.priority,
|
|
87
117
|
renderer: this.renderer,
|
|
88
118
|
editor: this.editor,
|
|
89
|
-
extendedData: this.extendedData
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/** Serialize this object to compressed JSON */
|
|
93
|
-
toCompressedJSON(_classesMap) {
|
|
94
|
-
return this.toJSON();
|
|
119
|
+
extendedData: this.extendedData,
|
|
120
|
+
});
|
|
95
121
|
}
|
|
96
|
-
/**
|
|
122
|
+
/**
|
|
123
|
+
* Deserialize [[Field]] from JSON.
|
|
124
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
125
|
+
*/
|
|
97
126
|
static fromJSON(json, categories) {
|
|
98
127
|
if (!json) {
|
|
99
128
|
return undefined;
|
|
100
129
|
}
|
|
101
130
|
if (isPropertiesField(json)) {
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
102
132
|
return PropertiesField.fromJSON(json, categories);
|
|
103
133
|
}
|
|
104
134
|
if (isNestedContentField(json)) {
|
|
105
|
-
|
|
106
|
-
|
|
135
|
+
return new NestedContentField({
|
|
136
|
+
...json,
|
|
137
|
+
...fromNestedContentFieldJSON(json, categories),
|
|
138
|
+
nestedFields: json.nestedFields
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
140
|
+
.map((nestedFieldJson) => Field.fromJSON(nestedFieldJson, categories))
|
|
141
|
+
.filter((nestedField) => !!nestedField),
|
|
142
|
+
});
|
|
107
143
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
category:
|
|
144
|
+
return new Field({
|
|
145
|
+
...json,
|
|
146
|
+
category: this.getCategoryFromFieldJson(json, categories),
|
|
111
147
|
});
|
|
112
148
|
}
|
|
113
149
|
/** Deserialize a [[Field]] from compressed JSON. */
|
|
@@ -121,17 +157,13 @@ export class Field {
|
|
|
121
157
|
if (isNestedContentField(json)) {
|
|
122
158
|
return NestedContentField.fromCompressedJSON(json, classesMap, categories);
|
|
123
159
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
category:
|
|
160
|
+
return new Field({
|
|
161
|
+
...json,
|
|
162
|
+
category: this.getCategoryFromFieldJson(json, categories),
|
|
127
163
|
});
|
|
128
164
|
}
|
|
129
165
|
static getCategoryFromFieldJson(fieldJson, categories) {
|
|
130
|
-
|
|
131
|
-
if (!category) {
|
|
132
|
-
throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);
|
|
133
|
-
}
|
|
134
|
-
return category;
|
|
166
|
+
return getCategoryFromFieldJson(fieldJson, categories);
|
|
135
167
|
}
|
|
136
168
|
/** Resets field's parent. */
|
|
137
169
|
resetParentship() {
|
|
@@ -166,21 +198,25 @@ export class Field {
|
|
|
166
198
|
* @public
|
|
167
199
|
*/
|
|
168
200
|
export class PropertiesField extends Field {
|
|
169
|
-
/**
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
201
|
+
/** A list of properties this field is created from */
|
|
202
|
+
properties;
|
|
203
|
+
constructor(categoryOrProps, name, label, type, isReadonly, priority, properties, editor, renderer) {
|
|
204
|
+
/* istanbul ignore next */
|
|
205
|
+
const props = "category" in categoryOrProps
|
|
206
|
+
? categoryOrProps
|
|
207
|
+
: {
|
|
208
|
+
category: categoryOrProps,
|
|
209
|
+
name: name,
|
|
210
|
+
label: label,
|
|
211
|
+
type: type,
|
|
212
|
+
isReadonly: isReadonly,
|
|
213
|
+
priority: priority,
|
|
214
|
+
editor,
|
|
215
|
+
renderer,
|
|
216
|
+
properties: properties,
|
|
217
|
+
};
|
|
218
|
+
super(props);
|
|
219
|
+
this.properties = props.properties;
|
|
184
220
|
}
|
|
185
221
|
/** Is this a an array property field */
|
|
186
222
|
isArrayPropertiesField() {
|
|
@@ -191,13 +227,17 @@ export class PropertiesField extends Field {
|
|
|
191
227
|
return false;
|
|
192
228
|
}
|
|
193
229
|
clone() {
|
|
194
|
-
const clone = new PropertiesField(this
|
|
230
|
+
const clone = new PropertiesField(this);
|
|
195
231
|
clone.rebuildParentship(this.parent);
|
|
196
232
|
return clone;
|
|
197
233
|
}
|
|
198
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Serialize this object to JSON
|
|
236
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
237
|
+
*/
|
|
199
238
|
toJSON() {
|
|
200
239
|
return {
|
|
240
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
201
241
|
...super.toJSON(),
|
|
202
242
|
properties: this.properties,
|
|
203
243
|
};
|
|
@@ -209,19 +249,24 @@ export class PropertiesField extends Field {
|
|
|
209
249
|
properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),
|
|
210
250
|
};
|
|
211
251
|
}
|
|
212
|
-
/**
|
|
252
|
+
/**
|
|
253
|
+
* Deserialize [[PropertiesField]] from JSON.
|
|
254
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
255
|
+
*/
|
|
213
256
|
static fromJSON(json, categories) {
|
|
214
257
|
if (!json) {
|
|
215
258
|
return undefined;
|
|
216
259
|
}
|
|
217
260
|
if (isArrayPropertiesField(json)) {
|
|
261
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
218
262
|
return ArrayPropertiesField.fromJSON(json, categories);
|
|
219
263
|
}
|
|
220
264
|
if (isStructPropertiesField(json)) {
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
221
266
|
return StructPropertiesField.fromJSON(json, categories);
|
|
222
267
|
}
|
|
223
|
-
|
|
224
|
-
|
|
268
|
+
return new PropertiesField({
|
|
269
|
+
...json,
|
|
225
270
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
226
271
|
});
|
|
227
272
|
}
|
|
@@ -236,8 +281,8 @@ export class PropertiesField extends Field {
|
|
|
236
281
|
if (isStructPropertiesField(json)) {
|
|
237
282
|
return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);
|
|
238
283
|
}
|
|
239
|
-
|
|
240
|
-
|
|
284
|
+
return new PropertiesField({
|
|
285
|
+
...json,
|
|
241
286
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
242
287
|
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
243
288
|
});
|
|
@@ -298,22 +343,43 @@ export class PropertiesField extends Field {
|
|
|
298
343
|
* @public
|
|
299
344
|
*/
|
|
300
345
|
export class ArrayPropertiesField extends PropertiesField {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
346
|
+
itemsField;
|
|
347
|
+
constructor(categoryOrProps, name, label, type, itemsField, isReadonly, priority, properties, editor, renderer) {
|
|
348
|
+
/* istanbul ignore next */
|
|
349
|
+
const props = "category" in categoryOrProps
|
|
350
|
+
? categoryOrProps
|
|
351
|
+
: {
|
|
352
|
+
category: categoryOrProps,
|
|
353
|
+
name: name,
|
|
354
|
+
label: label,
|
|
355
|
+
type: type,
|
|
356
|
+
isReadonly: isReadonly,
|
|
357
|
+
priority: priority,
|
|
358
|
+
editor,
|
|
359
|
+
renderer,
|
|
360
|
+
properties: properties,
|
|
361
|
+
itemsField: itemsField,
|
|
362
|
+
};
|
|
363
|
+
super(props);
|
|
364
|
+
this.itemsField = props.itemsField;
|
|
304
365
|
}
|
|
305
366
|
isArrayPropertiesField() {
|
|
306
367
|
return true;
|
|
307
368
|
}
|
|
308
369
|
clone() {
|
|
309
|
-
const clone = new ArrayPropertiesField(this
|
|
370
|
+
const clone = new ArrayPropertiesField(this);
|
|
310
371
|
clone.rebuildParentship(this.parent);
|
|
311
372
|
return clone;
|
|
312
373
|
}
|
|
313
|
-
/**
|
|
374
|
+
/**
|
|
375
|
+
* Serialize this object to JSON.
|
|
376
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
377
|
+
*/
|
|
314
378
|
toJSON() {
|
|
315
379
|
return {
|
|
380
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
316
381
|
...super.toJSON(),
|
|
382
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
317
383
|
itemsField: this.itemsField.toJSON(),
|
|
318
384
|
};
|
|
319
385
|
}
|
|
@@ -324,11 +390,15 @@ export class ArrayPropertiesField extends PropertiesField {
|
|
|
324
390
|
itemsField: this.itemsField.toCompressedJSON(classesMap),
|
|
325
391
|
};
|
|
326
392
|
}
|
|
327
|
-
/**
|
|
393
|
+
/**
|
|
394
|
+
* Deserialize [[ArrayPropertiesField]] from JSON.
|
|
395
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
396
|
+
*/
|
|
328
397
|
static fromJSON(json, categories) {
|
|
329
|
-
|
|
330
|
-
|
|
398
|
+
return new ArrayPropertiesField({
|
|
399
|
+
...json,
|
|
331
400
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
401
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
332
402
|
itemsField: PropertiesField.fromJSON(json.itemsField, categories),
|
|
333
403
|
});
|
|
334
404
|
}
|
|
@@ -337,8 +407,8 @@ export class ArrayPropertiesField extends PropertiesField {
|
|
|
337
407
|
* @public
|
|
338
408
|
*/
|
|
339
409
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
340
|
-
|
|
341
|
-
|
|
410
|
+
return new ArrayPropertiesField({
|
|
411
|
+
...json,
|
|
342
412
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
343
413
|
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
344
414
|
itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),
|
|
@@ -350,22 +420,43 @@ export class ArrayPropertiesField extends PropertiesField {
|
|
|
350
420
|
* @public
|
|
351
421
|
*/
|
|
352
422
|
export class StructPropertiesField extends PropertiesField {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
423
|
+
memberFields;
|
|
424
|
+
constructor(categoryOrProps, name, label, type, memberFields, isReadonly, priority, properties, editor, renderer) {
|
|
425
|
+
/* istanbul ignore next */
|
|
426
|
+
const props = "category" in categoryOrProps
|
|
427
|
+
? categoryOrProps
|
|
428
|
+
: {
|
|
429
|
+
category: categoryOrProps,
|
|
430
|
+
name: name,
|
|
431
|
+
label: label,
|
|
432
|
+
type: type,
|
|
433
|
+
isReadonly: isReadonly,
|
|
434
|
+
priority: priority,
|
|
435
|
+
editor,
|
|
436
|
+
renderer,
|
|
437
|
+
properties: properties,
|
|
438
|
+
memberFields: memberFields,
|
|
439
|
+
};
|
|
440
|
+
super(props);
|
|
441
|
+
this.memberFields = props.memberFields;
|
|
356
442
|
}
|
|
357
443
|
isStructPropertiesField() {
|
|
358
444
|
return true;
|
|
359
445
|
}
|
|
360
446
|
clone() {
|
|
361
|
-
const clone = new StructPropertiesField(this
|
|
447
|
+
const clone = new StructPropertiesField(this);
|
|
362
448
|
clone.rebuildParentship(this.parent);
|
|
363
449
|
return clone;
|
|
364
450
|
}
|
|
365
|
-
/**
|
|
451
|
+
/**
|
|
452
|
+
* Serialize this object to JSON.
|
|
453
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
454
|
+
*/
|
|
366
455
|
toJSON() {
|
|
367
456
|
return {
|
|
457
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
368
458
|
...super.toJSON(),
|
|
459
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
369
460
|
memberFields: this.memberFields.map((m) => m.toJSON()),
|
|
370
461
|
};
|
|
371
462
|
}
|
|
@@ -376,11 +467,15 @@ export class StructPropertiesField extends PropertiesField {
|
|
|
376
467
|
memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),
|
|
377
468
|
};
|
|
378
469
|
}
|
|
379
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Deserialize [[StructPropertiesField]] from JSON.
|
|
472
|
+
* @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
|
|
473
|
+
*/
|
|
380
474
|
static fromJSON(json, categories) {
|
|
381
|
-
|
|
382
|
-
|
|
475
|
+
return new StructPropertiesField({
|
|
476
|
+
...json,
|
|
383
477
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
478
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
384
479
|
memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),
|
|
385
480
|
});
|
|
386
481
|
}
|
|
@@ -389,8 +484,8 @@ export class StructPropertiesField extends PropertiesField {
|
|
|
389
484
|
* @public
|
|
390
485
|
*/
|
|
391
486
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
392
|
-
|
|
393
|
-
|
|
487
|
+
return new StructPropertiesField({
|
|
488
|
+
...json,
|
|
394
489
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
395
490
|
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
396
491
|
memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),
|
|
@@ -403,35 +498,64 @@ export class StructPropertiesField extends PropertiesField {
|
|
|
403
498
|
* @public
|
|
404
499
|
*/
|
|
405
500
|
export class NestedContentField extends Field {
|
|
501
|
+
/** Information about an ECClass whose properties are nested inside this field */
|
|
502
|
+
contentClassInfo;
|
|
503
|
+
/** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */
|
|
504
|
+
pathToPrimaryClass;
|
|
505
|
+
/**
|
|
506
|
+
* Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)
|
|
507
|
+
* and content class of this field.
|
|
508
|
+
*
|
|
509
|
+
* The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up
|
|
510
|
+
* presentation rules for creating the content.
|
|
511
|
+
*/
|
|
512
|
+
relationshipMeaning;
|
|
406
513
|
/**
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
* @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)
|
|
416
|
-
* @param nestedFields Contained nested fields
|
|
417
|
-
* @param editor Property editor used to edit values of this field
|
|
418
|
-
* @param autoExpand Flag specifying whether field should be expanded
|
|
419
|
-
* @param relationshipMeaning RelationshipMeaning of the field
|
|
420
|
-
* @param renderer Property renderer used to render values of this field
|
|
514
|
+
* When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes
|
|
515
|
+
* has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is
|
|
516
|
+
* here to help.
|
|
517
|
+
*
|
|
518
|
+
* **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`.
|
|
519
|
+
* When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,
|
|
520
|
+
* class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute
|
|
521
|
+
* will contain ID of class `B`, identifying that only this specific class has the relationship.
|
|
421
522
|
*/
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
523
|
+
actualPrimaryClassIds;
|
|
524
|
+
/** Contained nested fields */
|
|
525
|
+
nestedFields;
|
|
526
|
+
/** Flag specifying whether field should be expanded */
|
|
527
|
+
autoExpand;
|
|
528
|
+
constructor(categoryOrProps, name, label, type, isReadonly, priority, contentClassInfo, pathToPrimaryClass, nestedFields, editor, autoExpand, renderer) {
|
|
529
|
+
/* istanbul ignore next */
|
|
530
|
+
const props = "category" in categoryOrProps
|
|
531
|
+
? categoryOrProps
|
|
532
|
+
: {
|
|
533
|
+
category: categoryOrProps,
|
|
534
|
+
name: name,
|
|
535
|
+
label: label,
|
|
536
|
+
type: type,
|
|
537
|
+
isReadonly: isReadonly,
|
|
538
|
+
priority: priority,
|
|
539
|
+
editor,
|
|
540
|
+
renderer,
|
|
541
|
+
contentClassInfo: contentClassInfo,
|
|
542
|
+
pathToPrimaryClass: pathToPrimaryClass,
|
|
543
|
+
nestedFields: nestedFields,
|
|
544
|
+
autoExpand,
|
|
545
|
+
};
|
|
546
|
+
super(props);
|
|
547
|
+
this.contentClassInfo = props.contentClassInfo;
|
|
548
|
+
this.pathToPrimaryClass = props.pathToPrimaryClass;
|
|
549
|
+
this.relationshipMeaning = props.relationshipMeaning ?? RelationshipMeaning.RelatedInstance;
|
|
550
|
+
this.nestedFields = props.nestedFields;
|
|
551
|
+
this.autoExpand = props.autoExpand;
|
|
552
|
+
this.actualPrimaryClassIds = props.actualPrimaryClassIds ?? [];
|
|
430
553
|
}
|
|
431
554
|
clone() {
|
|
432
|
-
const clone = new NestedContentField(
|
|
433
|
-
|
|
434
|
-
|
|
555
|
+
const clone = new NestedContentField({
|
|
556
|
+
...this,
|
|
557
|
+
nestedFields: this.nestedFields.map((n) => n.clone()),
|
|
558
|
+
});
|
|
435
559
|
clone.rebuildParentship(this.parent);
|
|
436
560
|
return clone;
|
|
437
561
|
}
|
|
@@ -443,16 +567,21 @@ export class NestedContentField extends Field {
|
|
|
443
567
|
getFieldByName(name, recurse) {
|
|
444
568
|
return getFieldByName(this.nestedFields, name, recurse);
|
|
445
569
|
}
|
|
446
|
-
/**
|
|
570
|
+
/**
|
|
571
|
+
* Serialize this object to JSON.
|
|
572
|
+
* @deprecated in 5.x. Use [[toCompressedJSON]] instead.
|
|
573
|
+
*/
|
|
447
574
|
toJSON() {
|
|
448
575
|
return {
|
|
576
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
449
577
|
...super.toJSON(),
|
|
450
578
|
contentClassInfo: this.contentClassInfo,
|
|
451
579
|
pathToPrimaryClass: this.pathToPrimaryClass,
|
|
452
580
|
relationshipMeaning: this.relationshipMeaning,
|
|
453
581
|
actualPrimaryClassIds: this.actualPrimaryClassIds,
|
|
582
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
454
583
|
nestedFields: this.nestedFields.map((field) => field.toJSON()),
|
|
455
|
-
autoExpand:
|
|
584
|
+
...(this.autoExpand ? { autoExpand: true } : undefined),
|
|
456
585
|
};
|
|
457
586
|
}
|
|
458
587
|
/** Serialize this object to compressed JSON */
|
|
@@ -462,30 +591,19 @@ export class NestedContentField extends Field {
|
|
|
462
591
|
return {
|
|
463
592
|
...super.toCompressedJSON(classesMap),
|
|
464
593
|
contentClassInfo: id,
|
|
594
|
+
relationshipMeaning: this.relationshipMeaning,
|
|
595
|
+
actualPrimaryClassIds: this.actualPrimaryClassIds,
|
|
465
596
|
pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),
|
|
466
597
|
nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),
|
|
598
|
+
...(this.autoExpand ? { autoExpand: true } : undefined),
|
|
467
599
|
};
|
|
468
600
|
}
|
|
469
|
-
/**
|
|
470
|
-
* Deserialize [[NestedContentField]] from JSON
|
|
471
|
-
* @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]
|
|
472
|
-
*/
|
|
473
|
-
static fromJSON(json, categories) {
|
|
474
|
-
if (!json) {
|
|
475
|
-
return undefined;
|
|
476
|
-
}
|
|
477
|
-
const field = Object.create(NestedContentField.prototype);
|
|
478
|
-
return Object.assign(field, json, this.fromCommonJSON(json, categories), {
|
|
479
|
-
nestedFields: json.nestedFields
|
|
480
|
-
.map((nestedFieldJson) => Field.fromJSON(nestedFieldJson, categories))
|
|
481
|
-
.filter((nestedField) => !!nestedField),
|
|
482
|
-
});
|
|
483
|
-
}
|
|
484
601
|
/** Deserialize a [[NestedContentField]] from compressed JSON. */
|
|
485
602
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
486
603
|
assert(classesMap.hasOwnProperty(json.contentClassInfo));
|
|
487
|
-
|
|
488
|
-
|
|
604
|
+
return new NestedContentField({
|
|
605
|
+
...json,
|
|
606
|
+
...fromNestedContentFieldJSON(json, categories),
|
|
489
607
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
490
608
|
nestedFields: json.nestedFields
|
|
491
609
|
.map((nestedFieldJson) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))
|
|
@@ -494,15 +612,6 @@ export class NestedContentField extends Field {
|
|
|
494
612
|
pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),
|
|
495
613
|
});
|
|
496
614
|
}
|
|
497
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
498
|
-
static fromCommonJSON(json, categories) {
|
|
499
|
-
return {
|
|
500
|
-
category: this.getCategoryFromFieldJson(json, categories),
|
|
501
|
-
relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,
|
|
502
|
-
actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],
|
|
503
|
-
autoExpand: json.autoExpand,
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
615
|
/** Resets parent of this field and all nested fields. */
|
|
507
616
|
resetParentship() {
|
|
508
617
|
super.resetParentship();
|
|
@@ -591,4 +700,19 @@ function fromCompressedPropertyInfoJSON(compressedPropertyJSON, classesMap) {
|
|
|
591
700
|
...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),
|
|
592
701
|
};
|
|
593
702
|
}
|
|
703
|
+
function getCategoryFromFieldJson(fieldJson, categories) {
|
|
704
|
+
const category = categories.find((c) => c.name === fieldJson.category);
|
|
705
|
+
if (!category) {
|
|
706
|
+
throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);
|
|
707
|
+
}
|
|
708
|
+
return category;
|
|
709
|
+
}
|
|
710
|
+
function fromNestedContentFieldJSON(json, categories) {
|
|
711
|
+
return {
|
|
712
|
+
category: getCategoryFromFieldJson(json, categories),
|
|
713
|
+
relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,
|
|
714
|
+
actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],
|
|
715
|
+
autoExpand: json.autoExpand,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
594
718
|
//# sourceMappingURL=Fields.js.map
|