@itwin/presentation-common 4.5.0-dev.4 → 4.5.0-dev.40
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 +58 -1
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/Ruleset.schema.json +72 -19
- package/lib/cjs/assets/locales/en/Presentation.json +19 -19
- package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
- package/lib/cjs/presentation-common/AsyncTasks.js +6 -4
- package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/cjs/presentation-common/CommonLoggerCategory.js +3 -3
- package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/presentation-common/Diagnostics.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Diagnostics.js +27 -15
- package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
- package/lib/cjs/presentation-common/EC.d.ts +7 -4
- package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
- package/lib/cjs/presentation-common/EC.js +22 -17
- package/lib/cjs/presentation-common/EC.js.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js +3 -3
- package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
- package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Error.js +5 -4
- package/lib/cjs/presentation-common/Error.js.map +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.js +3 -3
- package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +80 -46
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js +5 -4
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +18 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js +3 -3
- package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.js +3 -3
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +53 -21
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js +21 -9
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +19 -15
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.js +7 -5
- package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetsFactory.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RulesetsFactory.js +42 -26
- package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Update.js +4 -3
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +3 -3
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Category.js +3 -3
- package/lib/cjs/presentation-common/content/Category.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js +10 -9
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +47 -25
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.js +56 -21
- package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/cjs/presentation-common/content/DisplayTypes.js +3 -3
- package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
- package/lib/cjs/presentation-common/content/Editor.js +3 -3
- package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.d.ts +78 -2
- package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js +201 -45
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js +8 -6
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.d.ts +1 -1
- package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js +4 -4
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +6 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +39 -11
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/content/Renderer.js +3 -3
- package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
- package/lib/cjs/presentation-common/content/TypeDescription.js +3 -3
- package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
- package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Value.js +46 -30
- package/lib/cjs/presentation-common/content/Value.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +3 -3
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +14 -8
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js +7 -5
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +11 -7
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/ClassSpecifications.js +3 -3
- package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts +39 -11
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipDirection.js +3 -3
- package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js +3 -3
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Ruleset.js +3 -3
- package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/cjs/presentation-common/rules/SchemasSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Variables.js +3 -3
- package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRule.js +3 -3
- package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +3 -3
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.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 +3 -3
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +3 -3
- package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +3 -3
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.js +3 -3
- package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/cjs/presentation-common.js +3 -3
- package/lib/cjs/presentation-common.js.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
- package/lib/esm/presentation-common/AsyncTasks.js +6 -4
- package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
- package/lib/esm/presentation-common/CommonLoggerCategory.js +3 -3
- package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/presentation-common/Diagnostics.d.ts.map +1 -1
- package/lib/esm/presentation-common/Diagnostics.js +27 -15
- package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
- package/lib/esm/presentation-common/EC.d.ts +7 -4
- package/lib/esm/presentation-common/EC.d.ts.map +1 -1
- package/lib/esm/presentation-common/EC.js +22 -17
- package/lib/esm/presentation-common/EC.js.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js +3 -3
- package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
- package/lib/esm/presentation-common/Error.d.ts.map +1 -1
- package/lib/esm/presentation-common/Error.js +5 -4
- package/lib/esm/presentation-common/Error.js.map +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.js +3 -3
- package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +80 -46
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js +5 -4
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +19 -2
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.js +3 -3
- package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.js +3 -3
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +53 -21
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js +21 -9
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +20 -16
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.js +7 -5
- package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/esm/presentation-common/RulesetsFactory.d.ts.map +1 -1
- package/lib/esm/presentation-common/RulesetsFactory.js +42 -26
- package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts.map +1 -1
- package/lib/esm/presentation-common/Update.js +4 -3
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.js +3 -3
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Category.js +3 -3
- package/lib/esm/presentation-common/content/Category.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Content.js +10 -9
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +47 -25
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.js +56 -21
- package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
- package/lib/esm/presentation-common/content/DisplayTypes.js +3 -3
- package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
- package/lib/esm/presentation-common/content/Editor.js +3 -3
- package/lib/esm/presentation-common/content/Editor.js.map +1 -1
- package/lib/esm/presentation-common/content/Fields.d.ts +78 -2
- package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js +198 -44
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Item.js +8 -6
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.d.ts +1 -1
- package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Property.js +4 -4
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +6 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +39 -11
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/content/Renderer.js +3 -3
- package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
- package/lib/esm/presentation-common/content/TypeDescription.js +3 -3
- package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
- package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Value.js +46 -30
- package/lib/esm/presentation-common/content/Value.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +3 -3
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +14 -8
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js +7 -5
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js +11 -7
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/ClassSpecifications.js +3 -3
- package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts +39 -11
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipDirection.js +3 -3
- package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js +3 -3
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/Ruleset.js +3 -3
- package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/esm/presentation-common/rules/SchemasSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Variables.js +3 -3
- package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRule.js +3 -3
- package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +3 -3
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +3 -3
- package/lib/esm/presentation-common/rules/customization/CheckBoxRule.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 +3 -3
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js +3 -3
- package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +3 -3
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +3 -3
- package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js +3 -3
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js +3 -3
- package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js +3 -3
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js +3 -3
- package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +3 -3
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.js +3 -3
- package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/esm/presentation-common.js +3 -3
- package/lib/esm/presentation-common.js.map +1 -1
- package/lib/public/locales/en/Presentation.json +19 -19
- package/package.json +14 -11
|
@@ -30,6 +30,20 @@ export interface BaseFieldJSON {
|
|
|
30
30
|
export interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {
|
|
31
31
|
properties: PropertyJSON<TClassInfoJSON>[];
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Data structure for a [[ArrayPropertiesField]] serialized to JSON.
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {
|
|
38
|
+
itemsField: PropertiesFieldJSON<TClassInfoJSON>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Data structure for a [[StructPropertiesField]] serialized to JSON.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {
|
|
45
|
+
memberFields: PropertiesFieldJSON<TClassInfoJSON>[];
|
|
46
|
+
}
|
|
33
47
|
/**
|
|
34
48
|
* Data structure for a [[NestedContentField]] serialized to JSON.
|
|
35
49
|
* @public
|
|
@@ -47,7 +61,7 @@ export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends
|
|
|
47
61
|
* JSON representation of a [[Field]]
|
|
48
62
|
* @public
|
|
49
63
|
*/
|
|
50
|
-
export type FieldJSON<TClassInfoJSON = ClassInfoJSON> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;
|
|
64
|
+
export type FieldJSON<TClassInfoJSON = ClassInfoJSON> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | ArrayPropertiesFieldJSON<TClassInfoJSON> | StructPropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;
|
|
51
65
|
/**
|
|
52
66
|
* Describes a single content field. A field is usually represented as a grid column
|
|
53
67
|
* or a property pane row.
|
|
@@ -101,7 +115,7 @@ export declare class Field {
|
|
|
101
115
|
/** Serialize this object to JSON */
|
|
102
116
|
toJSON(): FieldJSON;
|
|
103
117
|
/** Serialize this object to compressed JSON */
|
|
104
|
-
toCompressedJSON(
|
|
118
|
+
toCompressedJSON(_classesMap: {
|
|
105
119
|
[id: string]: CompressedClassInfoJSON;
|
|
106
120
|
}): FieldJSON<string>;
|
|
107
121
|
/** Deserialize [[Field]] from JSON */
|
|
@@ -149,9 +163,17 @@ export declare class PropertiesField extends Field {
|
|
|
149
163
|
* @param renderer Property renderer used to render values of this field
|
|
150
164
|
*/
|
|
151
165
|
constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
|
|
166
|
+
/** Is this a an array property field */
|
|
167
|
+
isArrayPropertiesField(): this is ArrayPropertiesField;
|
|
168
|
+
/** Is this a an struct property field */
|
|
169
|
+
isStructPropertiesField(): this is StructPropertiesField;
|
|
152
170
|
clone(): PropertiesField;
|
|
153
171
|
/** Serialize this object to JSON */
|
|
154
172
|
toJSON(): PropertiesFieldJSON;
|
|
173
|
+
/** Serialize this object to compressed JSON */
|
|
174
|
+
toCompressedJSON(classesMap: {
|
|
175
|
+
[id: string]: CompressedClassInfoJSON;
|
|
176
|
+
}): PropertiesFieldJSON<string>;
|
|
155
177
|
/** Deserialize [[PropertiesField]] from JSON */
|
|
156
178
|
static fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined;
|
|
157
179
|
/**
|
|
@@ -173,6 +195,56 @@ export declare class PropertiesField extends Field {
|
|
|
173
195
|
*/
|
|
174
196
|
matchesDescriptor(descriptor: FieldDescriptor): boolean;
|
|
175
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* Describes a content field that's based on one or more similar EC array properties.
|
|
200
|
+
* @public
|
|
201
|
+
*/
|
|
202
|
+
export declare class ArrayPropertiesField extends PropertiesField {
|
|
203
|
+
itemsField: PropertiesField;
|
|
204
|
+
constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, itemsField: PropertiesField, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
|
|
205
|
+
isArrayPropertiesField(): this is ArrayPropertiesField;
|
|
206
|
+
clone(): ArrayPropertiesField;
|
|
207
|
+
/** Serialize this object to JSON */
|
|
208
|
+
toJSON(): ArrayPropertiesFieldJSON;
|
|
209
|
+
/** Serialize this object to compressed JSON */
|
|
210
|
+
toCompressedJSON(classesMap: {
|
|
211
|
+
[id: string]: CompressedClassInfoJSON;
|
|
212
|
+
}): ArrayPropertiesFieldJSON<string>;
|
|
213
|
+
/** Deserialize [[ArrayPropertiesField]] from JSON */
|
|
214
|
+
static fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField;
|
|
215
|
+
/**
|
|
216
|
+
* Deserialize an [[ArrayPropertiesField]] from compressed JSON.
|
|
217
|
+
* @public
|
|
218
|
+
*/
|
|
219
|
+
static fromCompressedJSON(json: ArrayPropertiesFieldJSON<Id64String>, classesMap: {
|
|
220
|
+
[id: string]: CompressedClassInfoJSON;
|
|
221
|
+
}, categories: CategoryDescription[]): ArrayPropertiesField;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Describes a content field that's based on one or more similar EC struct properties.
|
|
225
|
+
* @public
|
|
226
|
+
*/
|
|
227
|
+
export declare class StructPropertiesField extends PropertiesField {
|
|
228
|
+
memberFields: PropertiesField[];
|
|
229
|
+
constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, memberFields: PropertiesField[], isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
|
|
230
|
+
isStructPropertiesField(): this is StructPropertiesField;
|
|
231
|
+
clone(): StructPropertiesField;
|
|
232
|
+
/** Serialize this object to JSON */
|
|
233
|
+
toJSON(): StructPropertiesFieldJSON;
|
|
234
|
+
/** Serialize this object to compressed JSON */
|
|
235
|
+
toCompressedJSON(classesMap: {
|
|
236
|
+
[id: string]: CompressedClassInfoJSON;
|
|
237
|
+
}): StructPropertiesFieldJSON<string>;
|
|
238
|
+
/** Deserialize [[StructPropertiesField]] from JSON */
|
|
239
|
+
static fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField;
|
|
240
|
+
/**
|
|
241
|
+
* Deserialize a [[StructPropertiesField]] from compressed JSON.
|
|
242
|
+
* @public
|
|
243
|
+
*/
|
|
244
|
+
static fromCompressedJSON(json: StructPropertiesFieldJSON<Id64String>, classesMap: {
|
|
245
|
+
[id: string]: CompressedClassInfoJSON;
|
|
246
|
+
}, categories: CategoryDescription[]): StructPropertiesField;
|
|
247
|
+
}
|
|
176
248
|
/**
|
|
177
249
|
* Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).
|
|
178
250
|
*
|
|
@@ -234,6 +306,10 @@ export declare class NestedContentField extends Field {
|
|
|
234
306
|
getFieldByName(name: string, recurse?: boolean): Field | undefined;
|
|
235
307
|
/** Serialize this object to JSON */
|
|
236
308
|
toJSON(): NestedContentFieldJSON;
|
|
309
|
+
/** Serialize this object to compressed JSON */
|
|
310
|
+
toCompressedJSON(classesMap: {
|
|
311
|
+
[id: string]: CompressedClassInfoJSON;
|
|
312
|
+
}): NestedContentFieldJSON<string>;
|
|
237
313
|
/**
|
|
238
314
|
* Deserialize [[NestedContentField]] from JSON
|
|
239
315
|
* @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fields.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"Fields.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,SAAS,EACT,aAAa,EACb,uBAAuB,EAKvB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED;;;GAGG;AAEH,MAAM,WAAW,mBAAmB,CAAC,cAAc,GAAG,aAAa,CAAE,SAAQ,aAAa;IACxF,UAAU,EAA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I,SAAS;IACb,UAAU,eAAe;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,yBAAyB,CAAC;AAE/E,cAAc;AAEd,yBAAiB,eAAe,CAAC;IAC/B,uCAAuC;IACvC,SAAgB,OAAO,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,IAAI,oBAAoB,CAErE;IACD,4CAA4C;IAC5C,SAAgB,YAAY,CAAC,CAAC,EAAE,eAAe,GAAG,CAAC,IAAI,yBAAyB,CAE/E;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,mBAAmB;IAC/D,IAAI,EAAE,mBAAmB,CAAC,IAAI,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,IAAI,EAAE,mBAAmB,CAAC,UAAU,CAAC;IACrC,6BAA6B,EAAE,wBAAwB,CAAC;IACxD;;;OAGG;IACH,UAAU,EAAE,KAAK,CAAC;QAChB,sBAAsB;QACtB,KAAK,EAAE,MAAM,CAAC;QACd,oBAAoB;QACpB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Content
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.FieldDescriptor = exports.FieldDescriptorType = exports.getFieldByDescriptor = exports.getFieldByName = exports.NestedContentField = exports.PropertiesField = exports.Field = void 0;
|
|
10
|
+
exports.FieldDescriptor = exports.FieldDescriptorType = exports.getFieldByDescriptor = exports.getFieldByName = exports.NestedContentField = exports.StructPropertiesField = exports.ArrayPropertiesField = exports.PropertiesField = exports.Field = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const EC_1 = require("../EC");
|
|
13
13
|
const Error_1 = require("../Error");
|
|
14
14
|
const RelatedPropertiesSpecification_1 = require("../rules/content/modifiers/RelatedPropertiesSpecification");
|
|
15
15
|
const Property_1 = require("./Property");
|
|
16
|
-
|
|
17
|
-
const isPropertiesField = (field) => {
|
|
16
|
+
function isPropertiesField(field) {
|
|
18
17
|
return !!field.properties;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
}
|
|
19
|
+
function isArrayPropertiesField(field) {
|
|
20
|
+
return !!field.itemsField;
|
|
21
|
+
}
|
|
22
|
+
function isStructPropertiesField(field) {
|
|
23
|
+
return !!field.memberFields;
|
|
24
|
+
}
|
|
25
|
+
function isNestedContentField(field) {
|
|
22
26
|
return !!field.nestedFields;
|
|
23
|
-
}
|
|
27
|
+
}
|
|
24
28
|
/**
|
|
25
29
|
* Describes a single content field. A field is usually represented as a grid column
|
|
26
30
|
* or a property pane row.
|
|
@@ -52,15 +56,21 @@ class Field {
|
|
|
52
56
|
/**
|
|
53
57
|
* Is this a [[PropertiesField]]
|
|
54
58
|
*/
|
|
55
|
-
isPropertiesField() {
|
|
59
|
+
isPropertiesField() {
|
|
60
|
+
return isPropertiesField(this);
|
|
61
|
+
}
|
|
56
62
|
/**
|
|
57
63
|
* Is this a [[NestedContentField]]
|
|
58
64
|
*/
|
|
59
|
-
isNestedContentField() {
|
|
65
|
+
isNestedContentField() {
|
|
66
|
+
return isNestedContentField(this);
|
|
67
|
+
}
|
|
60
68
|
/**
|
|
61
69
|
* Get parent
|
|
62
70
|
*/
|
|
63
|
-
get parent() {
|
|
71
|
+
get parent() {
|
|
72
|
+
return this._parent;
|
|
73
|
+
}
|
|
64
74
|
clone() {
|
|
65
75
|
const clone = new Field(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.editor, this.renderer);
|
|
66
76
|
clone.rebuildParentship(this.parent);
|
|
@@ -80,33 +90,21 @@ class Field {
|
|
|
80
90
|
};
|
|
81
91
|
}
|
|
82
92
|
/** Serialize this object to compressed JSON */
|
|
83
|
-
toCompressedJSON(
|
|
84
|
-
if (this.isPropertiesField())
|
|
85
|
-
return {
|
|
86
|
-
...this.toJSON(),
|
|
87
|
-
properties: this.properties.map((property) => Property_1.Property.toCompressedJSON(property, classesMap)),
|
|
88
|
-
};
|
|
89
|
-
if (this.isNestedContentField()) {
|
|
90
|
-
const { id, ...leftOverInfo } = this.contentClassInfo;
|
|
91
|
-
classesMap[id] = leftOverInfo;
|
|
92
|
-
return {
|
|
93
|
-
...this.toJSON(),
|
|
94
|
-
contentClassInfo: id,
|
|
95
|
-
pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => EC_1.RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),
|
|
96
|
-
nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),
|
|
97
|
-
};
|
|
98
|
-
}
|
|
93
|
+
toCompressedJSON(_classesMap) {
|
|
99
94
|
return this.toJSON();
|
|
100
95
|
}
|
|
101
96
|
/** Deserialize [[Field]] from JSON */
|
|
102
97
|
static fromJSON(json, categories) {
|
|
103
|
-
if (!json)
|
|
98
|
+
if (!json) {
|
|
104
99
|
return undefined;
|
|
105
|
-
|
|
100
|
+
}
|
|
101
|
+
if (isPropertiesField(json)) {
|
|
106
102
|
return PropertiesField.fromJSON(json, categories);
|
|
107
|
-
|
|
103
|
+
}
|
|
104
|
+
if (isNestedContentField(json)) {
|
|
108
105
|
// eslint-disable-next-line deprecation/deprecation
|
|
109
106
|
return NestedContentField.fromJSON(json, categories);
|
|
107
|
+
}
|
|
110
108
|
const field = Object.create(Field.prototype);
|
|
111
109
|
return Object.assign(field, json, {
|
|
112
110
|
category: Field.getCategoryFromFieldJson(json, categories),
|
|
@@ -114,12 +112,15 @@ class Field {
|
|
|
114
112
|
}
|
|
115
113
|
/** Deserialize a [[Field]] from compressed JSON. */
|
|
116
114
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
117
|
-
if (!json)
|
|
115
|
+
if (!json) {
|
|
118
116
|
return undefined;
|
|
119
|
-
|
|
117
|
+
}
|
|
118
|
+
if (isPropertiesField(json)) {
|
|
120
119
|
return PropertiesField.fromCompressedJSON(json, classesMap, categories);
|
|
121
|
-
|
|
120
|
+
}
|
|
121
|
+
if (isNestedContentField(json)) {
|
|
122
122
|
return NestedContentField.fromCompressedJSON(json, classesMap, categories);
|
|
123
|
+
}
|
|
123
124
|
const field = Object.create(Field.prototype);
|
|
124
125
|
return Object.assign(field, json, {
|
|
125
126
|
category: Field.getCategoryFromFieldJson(json, categories),
|
|
@@ -127,8 +128,9 @@ class Field {
|
|
|
127
128
|
}
|
|
128
129
|
static getCategoryFromFieldJson(fieldJson, categories) {
|
|
129
130
|
const category = categories.find((c) => c.name === fieldJson.category);
|
|
130
|
-
if (!category)
|
|
131
|
+
if (!category) {
|
|
131
132
|
throw new Error_1.PresentationError(Error_1.PresentationStatus.InvalidArgument, `Invalid content field category`);
|
|
133
|
+
}
|
|
132
134
|
return category;
|
|
133
135
|
}
|
|
134
136
|
/** Resets field's parent. */
|
|
@@ -182,6 +184,14 @@ class PropertiesField extends Field {
|
|
|
182
184
|
super(category, name, label, description, isReadonly, priority, editor, renderer);
|
|
183
185
|
this.properties = properties;
|
|
184
186
|
}
|
|
187
|
+
/** Is this a an array property field */
|
|
188
|
+
isArrayPropertiesField() {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
/** Is this a an struct property field */
|
|
192
|
+
isStructPropertiesField() {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
185
195
|
clone() {
|
|
186
196
|
const clone = new PropertiesField(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.properties, this.editor, this.renderer);
|
|
187
197
|
clone.rebuildParentship(this.parent);
|
|
@@ -194,10 +204,24 @@ class PropertiesField extends Field {
|
|
|
194
204
|
properties: this.properties,
|
|
195
205
|
};
|
|
196
206
|
}
|
|
207
|
+
/** Serialize this object to compressed JSON */
|
|
208
|
+
toCompressedJSON(classesMap) {
|
|
209
|
+
return {
|
|
210
|
+
...super.toCompressedJSON(classesMap),
|
|
211
|
+
properties: this.properties.map((property) => Property_1.Property.toCompressedJSON(property, classesMap)),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
197
214
|
/** Deserialize [[PropertiesField]] from JSON */
|
|
198
215
|
static fromJSON(json, categories) {
|
|
199
|
-
if (!json)
|
|
216
|
+
if (!json) {
|
|
200
217
|
return undefined;
|
|
218
|
+
}
|
|
219
|
+
if (isArrayPropertiesField(json)) {
|
|
220
|
+
return ArrayPropertiesField.fromJSON(json, categories);
|
|
221
|
+
}
|
|
222
|
+
if (isStructPropertiesField(json)) {
|
|
223
|
+
return StructPropertiesField.fromJSON(json, categories);
|
|
224
|
+
}
|
|
201
225
|
const field = Object.create(PropertiesField.prototype);
|
|
202
226
|
return Object.assign(field, json, {
|
|
203
227
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
@@ -208,6 +232,12 @@ class PropertiesField extends Field {
|
|
|
208
232
|
* @public
|
|
209
233
|
*/
|
|
210
234
|
static fromCompressedJSON(json, classesMap, categories) {
|
|
235
|
+
if (isArrayPropertiesField(json)) {
|
|
236
|
+
return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);
|
|
237
|
+
}
|
|
238
|
+
if (isStructPropertiesField(json)) {
|
|
239
|
+
return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);
|
|
240
|
+
}
|
|
211
241
|
const field = Object.create(PropertiesField.prototype);
|
|
212
242
|
return Object.assign(field, json, {
|
|
213
243
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
@@ -267,6 +297,112 @@ class PropertiesField extends Field {
|
|
|
267
297
|
}
|
|
268
298
|
}
|
|
269
299
|
exports.PropertiesField = PropertiesField;
|
|
300
|
+
/**
|
|
301
|
+
* Describes a content field that's based on one or more similar EC array properties.
|
|
302
|
+
* @public
|
|
303
|
+
*/
|
|
304
|
+
class ArrayPropertiesField extends PropertiesField {
|
|
305
|
+
constructor(category, name, label, description, itemsField, isReadonly, priority, properties, editor, renderer) {
|
|
306
|
+
super(category, name, label, description, isReadonly, priority, properties, editor, renderer);
|
|
307
|
+
this.itemsField = itemsField;
|
|
308
|
+
}
|
|
309
|
+
isArrayPropertiesField() {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
clone() {
|
|
313
|
+
const clone = new ArrayPropertiesField(this.category, this.name, this.label, this.type, this.itemsField.clone(), this.isReadonly, this.priority, this.properties, this.editor, this.renderer);
|
|
314
|
+
clone.rebuildParentship(this.parent);
|
|
315
|
+
return clone;
|
|
316
|
+
}
|
|
317
|
+
/** Serialize this object to JSON */
|
|
318
|
+
toJSON() {
|
|
319
|
+
return {
|
|
320
|
+
...super.toJSON(),
|
|
321
|
+
itemsField: this.itemsField.toJSON(),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
/** Serialize this object to compressed JSON */
|
|
325
|
+
toCompressedJSON(classesMap) {
|
|
326
|
+
return {
|
|
327
|
+
...super.toCompressedJSON(classesMap),
|
|
328
|
+
itemsField: this.itemsField.toCompressedJSON(classesMap),
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
/** Deserialize [[ArrayPropertiesField]] from JSON */
|
|
332
|
+
static fromJSON(json, categories) {
|
|
333
|
+
const field = Object.create(ArrayPropertiesField.prototype);
|
|
334
|
+
return Object.assign(field, json, {
|
|
335
|
+
category: this.getCategoryFromFieldJson(json, categories),
|
|
336
|
+
itemsField: PropertiesField.fromJSON(json.itemsField, categories),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Deserialize an [[ArrayPropertiesField]] from compressed JSON.
|
|
341
|
+
* @public
|
|
342
|
+
*/
|
|
343
|
+
static fromCompressedJSON(json, classesMap, categories) {
|
|
344
|
+
const field = Object.create(ArrayPropertiesField.prototype);
|
|
345
|
+
return Object.assign(field, json, {
|
|
346
|
+
category: this.getCategoryFromFieldJson(json, categories),
|
|
347
|
+
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
348
|
+
itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
exports.ArrayPropertiesField = ArrayPropertiesField;
|
|
353
|
+
/**
|
|
354
|
+
* Describes a content field that's based on one or more similar EC struct properties.
|
|
355
|
+
* @public
|
|
356
|
+
*/
|
|
357
|
+
class StructPropertiesField extends PropertiesField {
|
|
358
|
+
constructor(category, name, label, description, memberFields, isReadonly, priority, properties, editor, renderer) {
|
|
359
|
+
super(category, name, label, description, isReadonly, priority, properties, editor, renderer);
|
|
360
|
+
this.memberFields = memberFields;
|
|
361
|
+
}
|
|
362
|
+
isStructPropertiesField() {
|
|
363
|
+
return true;
|
|
364
|
+
}
|
|
365
|
+
clone() {
|
|
366
|
+
const clone = new StructPropertiesField(this.category, this.name, this.label, this.type, this.memberFields.map((m) => m.clone()), this.isReadonly, this.priority, this.properties, this.editor, this.renderer);
|
|
367
|
+
clone.rebuildParentship(this.parent);
|
|
368
|
+
return clone;
|
|
369
|
+
}
|
|
370
|
+
/** Serialize this object to JSON */
|
|
371
|
+
toJSON() {
|
|
372
|
+
return {
|
|
373
|
+
...super.toJSON(),
|
|
374
|
+
memberFields: this.memberFields.map((m) => m.toJSON()),
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/** Serialize this object to compressed JSON */
|
|
378
|
+
toCompressedJSON(classesMap) {
|
|
379
|
+
return {
|
|
380
|
+
...super.toCompressedJSON(classesMap),
|
|
381
|
+
memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
/** Deserialize [[StructPropertiesField]] from JSON */
|
|
385
|
+
static fromJSON(json, categories) {
|
|
386
|
+
const field = Object.create(StructPropertiesField.prototype);
|
|
387
|
+
return Object.assign(field, json, {
|
|
388
|
+
category: this.getCategoryFromFieldJson(json, categories),
|
|
389
|
+
memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Deserialize a [[StructPropertiesField]] from compressed JSON.
|
|
394
|
+
* @public
|
|
395
|
+
*/
|
|
396
|
+
static fromCompressedJSON(json, classesMap, categories) {
|
|
397
|
+
const field = Object.create(StructPropertiesField.prototype);
|
|
398
|
+
return Object.assign(field, json, {
|
|
399
|
+
category: this.getCategoryFromFieldJson(json, categories),
|
|
400
|
+
properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
|
|
401
|
+
memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
exports.StructPropertiesField = StructPropertiesField;
|
|
270
406
|
/**
|
|
271
407
|
* Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).
|
|
272
408
|
*
|
|
@@ -325,13 +461,25 @@ class NestedContentField extends Field {
|
|
|
325
461
|
autoExpand: this.autoExpand,
|
|
326
462
|
};
|
|
327
463
|
}
|
|
464
|
+
/** Serialize this object to compressed JSON */
|
|
465
|
+
toCompressedJSON(classesMap) {
|
|
466
|
+
const { id, ...leftOverInfo } = this.contentClassInfo;
|
|
467
|
+
classesMap[id] = leftOverInfo;
|
|
468
|
+
return {
|
|
469
|
+
...super.toCompressedJSON(classesMap),
|
|
470
|
+
contentClassInfo: id,
|
|
471
|
+
pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => EC_1.RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),
|
|
472
|
+
nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),
|
|
473
|
+
};
|
|
474
|
+
}
|
|
328
475
|
/**
|
|
329
476
|
* Deserialize [[NestedContentField]] from JSON
|
|
330
477
|
* @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]
|
|
331
478
|
*/
|
|
332
479
|
static fromJSON(json, categories) {
|
|
333
|
-
if (!json)
|
|
480
|
+
if (!json) {
|
|
334
481
|
return undefined;
|
|
482
|
+
}
|
|
335
483
|
const field = Object.create(NestedContentField.prototype);
|
|
336
484
|
return Object.assign(field, json, this.fromCommonJSON(json, categories), {
|
|
337
485
|
nestedFields: json.nestedFields
|
|
@@ -345,7 +493,8 @@ class NestedContentField extends Field {
|
|
|
345
493
|
const field = Object.create(NestedContentField.prototype);
|
|
346
494
|
return Object.assign(field, json, this.fromCommonJSON(json, categories), {
|
|
347
495
|
category: this.getCategoryFromFieldJson(json, categories),
|
|
348
|
-
nestedFields: json.nestedFields
|
|
496
|
+
nestedFields: json.nestedFields
|
|
497
|
+
.map((nestedFieldJson) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))
|
|
349
498
|
.filter((nestedField) => !!nestedField),
|
|
350
499
|
contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },
|
|
351
500
|
pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => EC_1.RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),
|
|
@@ -363,8 +512,9 @@ class NestedContentField extends Field {
|
|
|
363
512
|
/** Resets parent of this field and all nested fields. */
|
|
364
513
|
resetParentship() {
|
|
365
514
|
super.resetParentship();
|
|
366
|
-
for (const nestedField of this.nestedFields)
|
|
515
|
+
for (const nestedField of this.nestedFields) {
|
|
367
516
|
nestedField.resetParentship();
|
|
517
|
+
}
|
|
368
518
|
}
|
|
369
519
|
/**
|
|
370
520
|
* Sets provided [[NestedContentField]] as parent of this fields and recursively updates
|
|
@@ -372,8 +522,9 @@ class NestedContentField extends Field {
|
|
|
372
522
|
*/
|
|
373
523
|
rebuildParentship(parentField) {
|
|
374
524
|
super.rebuildParentship(parentField);
|
|
375
|
-
for (const nestedField of this.nestedFields)
|
|
525
|
+
for (const nestedField of this.nestedFields) {
|
|
376
526
|
nestedField.rebuildParentship(this);
|
|
527
|
+
}
|
|
377
528
|
}
|
|
378
529
|
}
|
|
379
530
|
exports.NestedContentField = NestedContentField;
|
|
@@ -381,12 +532,14 @@ exports.NestedContentField = NestedContentField;
|
|
|
381
532
|
const getFieldByName = (fields, name, recurse) => {
|
|
382
533
|
if (name) {
|
|
383
534
|
for (const field of fields) {
|
|
384
|
-
if (field.name === name)
|
|
535
|
+
if (field.name === name) {
|
|
385
536
|
return field;
|
|
537
|
+
}
|
|
386
538
|
if (recurse && field.isNestedContentField()) {
|
|
387
539
|
const nested = (0, exports.getFieldByName)(field.nestedFields, name, recurse);
|
|
388
|
-
if (nested)
|
|
540
|
+
if (nested) {
|
|
389
541
|
return nested;
|
|
542
|
+
}
|
|
390
543
|
}
|
|
391
544
|
}
|
|
392
545
|
}
|
|
@@ -396,12 +549,14 @@ exports.getFieldByName = getFieldByName;
|
|
|
396
549
|
/** @internal */
|
|
397
550
|
const getFieldByDescriptor = (fields, fieldDescriptor, recurse) => {
|
|
398
551
|
for (const field of fields) {
|
|
399
|
-
if (field.matchesDescriptor(fieldDescriptor))
|
|
552
|
+
if (field.matchesDescriptor(fieldDescriptor)) {
|
|
400
553
|
return field;
|
|
554
|
+
}
|
|
401
555
|
if (recurse && field.isNestedContentField()) {
|
|
402
556
|
const nested = (0, exports.getFieldByDescriptor)(field.nestedFields, fieldDescriptor, recurse);
|
|
403
|
-
if (nested)
|
|
557
|
+
if (nested) {
|
|
404
558
|
return nested;
|
|
559
|
+
}
|
|
405
560
|
}
|
|
406
561
|
}
|
|
407
562
|
return undefined;
|
|
@@ -417,6 +572,7 @@ var FieldDescriptorType;
|
|
|
417
572
|
FieldDescriptorType["Properties"] = "properties";
|
|
418
573
|
})(FieldDescriptorType = exports.FieldDescriptorType || (exports.FieldDescriptorType = {}));
|
|
419
574
|
/** @public */
|
|
575
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
420
576
|
var FieldDescriptor;
|
|
421
577
|
(function (FieldDescriptor) {
|
|
422
578
|
/** Is this a named field descriptor */
|