@itwin/presentation-common 5.0.0-dev.10 → 5.0.0-dev.100
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 +56 -1
- package/Ruleset.schema.json +3 -258
- package/lib/{cjs/assets → assets}/locales/en/Presentation.json +19 -19
- package/lib/cjs/package.json +1 -0
- 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 +37 -81
- 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.d.ts +2 -2
- package/lib/cjs/presentation-common/ElementProperties.d.ts.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js +22 -15
- 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.d.ts +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.d.ts +3 -3
- package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/cjs/presentation-common/KeySet.js +20 -22
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +9 -7
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.d.ts +2 -50
- package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js +4 -47
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts +10 -10
- package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js +13 -12
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +12 -7
- package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js +9 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +40 -25
- 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 +22 -29
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.js +41 -36
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +6 -5
- 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 +21 -24
- package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js +42 -35
- 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.d.ts +4 -4
- package/lib/cjs/presentation-common/RulesetsFactory.d.ts.map +1 -1
- package/lib/cjs/presentation-common/RulesetsFactory.js +15 -15
- 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 +22 -1
- package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
- package/lib/cjs/presentation-common/Utils.js +59 -3
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Category.d.ts +1 -1
- package/lib/cjs/presentation-common/content/Category.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Category.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.d.ts +2 -9
- package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js +9 -14
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +9 -9
- package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js +138 -50
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.d.ts +7 -52
- package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Descriptor.js +82 -53
- 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 +157 -33
- package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Fields.js +275 -151
- package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.d.ts +28 -33
- package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js +53 -68
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.d.ts +2 -14
- package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js +2 -20
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +6 -6
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +12 -9
- 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 +8 -110
- 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 +1 -84
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js +8 -26
- 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.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts.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.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.d.ts +6 -20
- 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.d.ts +3 -3
- package/lib/cjs/presentation-common/rules/Ruleset.d.ts.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.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts.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 +5 -12
- 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.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts +3 -3
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +3 -3
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts.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.d.ts +6 -6
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.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.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.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.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts.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 +6 -10
- 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.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts.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 +4 -30
- 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.d.ts +3 -3
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +6 -6
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.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 +3 -1
- 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.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.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 +2 -11
- 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.d.ts +6 -6
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -2
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts.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-internal.d.ts +10 -0
- package/lib/cjs/presentation-common-internal.d.ts.map +1 -0
- package/lib/cjs/presentation-common-internal.js +32 -0
- package/lib/cjs/presentation-common-internal.js.map +1 -0
- package/lib/cjs/presentation-common.d.ts +68 -77
- package/lib/cjs/presentation-common.d.ts.map +1 -1
- package/lib/cjs/presentation-common.js +110 -89
- 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 +37 -81
- 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.d.ts +2 -2
- package/lib/esm/presentation-common/ElementProperties.d.ts.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js +18 -11
- 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.d.ts +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +3 -3
- package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
- package/lib/esm/presentation-common/KeySet.js +10 -12
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +10 -8
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.d.ts +2 -50
- package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js +3 -46
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.d.ts +10 -10
- package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js +6 -5
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +12 -7
- package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.js +8 -0
- package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +40 -25
- 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 +22 -29
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.js +42 -36
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.d.ts +6 -5
- 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 +21 -24
- package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js +42 -35
- 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.d.ts +4 -4
- package/lib/esm/presentation-common/RulesetsFactory.d.ts.map +1 -1
- package/lib/esm/presentation-common/RulesetsFactory.js +6 -6
- 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 +22 -1
- package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
- package/lib/esm/presentation-common/Utils.js +54 -1
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Category.d.ts +1 -1
- package/lib/esm/presentation-common/content/Category.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Category.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.d.ts +2 -9
- package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Content.js +7 -12
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts +9 -9
- package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js +123 -35
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.d.ts +7 -52
- package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Descriptor.js +71 -42
- 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 +157 -33
- package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Fields.js +268 -144
- package/lib/esm/presentation-common/content/Fields.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.d.ts +28 -33
- package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Item.js +53 -68
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.d.ts +2 -14
- package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/Property.js +1 -19
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +6 -6
- package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -1
- package/lib/esm/presentation-common/content/PropertyValueFormatter.js +5 -2
- 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 +8 -110
- 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 +1 -84
- package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js +7 -25
- 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.d.ts +2 -2
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts.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.d.ts +2 -2
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.d.ts +6 -20
- 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.d.ts +3 -3
- package/lib/esm/presentation-common/rules/Ruleset.d.ts.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.d.ts +2 -2
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +2 -2
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRule.d.ts +2 -2
- package/lib/esm/presentation-common/rules/content/ContentRule.d.ts.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 +5 -12
- 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.d.ts +2 -2
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts +3 -3
- package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +3 -3
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts.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.d.ts +6 -6
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.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.d.ts +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.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.d.ts +2 -2
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts.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 +6 -10
- 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.d.ts +1 -1
- package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts.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 +4 -30
- 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.d.ts +3 -3
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts +2 -2
- package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +6 -6
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.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 +3 -1
- 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.d.ts +2 -2
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts.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 +2 -11
- 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.d.ts +6 -6
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +2 -2
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +2 -2
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts.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-internal.d.ts +10 -0
- package/lib/esm/presentation-common-internal.d.ts.map +1 -0
- package/lib/esm/presentation-common-internal.js +16 -0
- package/lib/esm/presentation-common-internal.js.map +1 -0
- package/lib/esm/presentation-common.d.ts +68 -77
- package/lib/esm/presentation-common.d.ts.map +1 -1
- package/lib/esm/presentation-common.js +60 -89
- package/lib/esm/presentation-common.js.map +1 -1
- package/lib/public/locales/en/Presentation.json +19 -19
- package/package.json +47 -36
- 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
- /package/lib/{cjs/assets → assets}/locales/en-PSEUDO/Presentation.json +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KoqPropertyValueFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wDAAoH;AACpH,gEAUkC;AAiDlC;;;GAGG;AACH,MAAa,yBAAyB;IAIpC,YACU,cAA6B,EACrC,cAA2B;QADnB,mBAAc,GAAd,cAAc,CAAe;QAGrC,IAAI,CAAC,cAAc,GAAG,IAAI,sCAAkB,CAAC,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,eAAe,GAAG,cAAc;YACnC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,EAAE,iB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IAAI,EAAE,SAAS;QACf,YAAY,EAAE,GAAG;QACjB,gBAAgB,EAAE,GAAG;QACrB,SAAS,EAAE;YACT,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,eAAe,CAAC,QAAQ;oBAC9B,KAAK,EAAE,eAAe,CAAC,KAAK;iBAC7B;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAED,SAAS,0BAA0B,CAAC,QAAwB;IAC1D,SAAS,aAAa,CAAC,IAAuB;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,CAAC,UAAsB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACjF,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3E,KAAK,aAAa;YAChB,OAAO,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrE,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { Format, FormatProps, FormatterSpec, ParserSpec, UnitsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport {\r\n getFormatProps,\r\n InvertedUnit,\r\n KindOfQuantity,\r\n SchemaContext,\r\n SchemaKey,\r\n SchemaMatchType,\r\n SchemaUnitProvider,\r\n Unit,\r\n UnitSystem,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * A data structure that associates unit systems with property value formatting props. The associations are used for\r\n * assigning formatting props for specific phenomenon and unit system combinations (see [[FormatsMap]]).\r\n *\r\n * @public\r\n */\r\nexport interface UnitSystemFormat {\r\n unitSystems: UnitSystemKey[];\r\n format: FormatProps;\r\n}\r\n\r\n/**\r\n * A data structure that associates specific phenomenon with one or more formatting props for specific unit system.\r\n *\r\n * Example:\r\n * ```json\r\n * {\r\n * length: [{\r\n * unitSystems: [\"metric\"],\r\n * format: formatForCentimeters,\r\n * }, {\r\n * unitSystems: [\"imperial\", \"usCustomary\"],\r\n * format: formatForInches,\r\n * }, {\r\n * unitSystems: [\"usSurvey\"],\r\n * format: formatForUsSurveyInches,\r\n * }]\r\n * }\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport interface FormatsMap {\r\n [phenomenon: string]: UnitSystemFormat | UnitSystemFormat[];\r\n}\r\n\r\n/**\r\n * Options for finding a formatter spec to use in [[KoqPropertyValueFormatter]].\r\n * @public\r\n */\r\nexport interface FormatOptions {\r\n /** Full name of the `KindOfQuantity`, e.g. `SchemaName:KoqName`. */\r\n koqName: string;\r\n /** Unit system to use for formatting. */\r\n unitSystem?: UnitSystemKey;\r\n}\r\n\r\n/**\r\n * An utility for formatting property values based on `KindOfQuantity` and unit system.\r\n * @public\r\n */\r\nexport class KoqPropertyValueFormatter {\r\n private _unitsProvider: UnitsProvider;\r\n private _defaultFormats?: FormatsMap;\r\n\r\n constructor(\r\n private _schemaContext: SchemaContext,\r\n defaultFormats?: FormatsMap,\r\n ) {\r\n this._unitsProvider = new SchemaUnitProvider(_schemaContext);\r\n this._defaultFormats = defaultFormats\r\n ? Object.entries(defaultFormats).reduce((acc, [phenomenon, unitSystemFormats]) => ({ ...acc, [phenomenon.toUpperCase()]: unitSystemFormats }), {})\r\n : /* istanbul ignore next */ undefined;\r\n }\r\n\r\n public async format(value: number, options: FormatOptions) {\r\n const formatterSpec = await this.getFormatterSpec(options);\r\n if (!formatterSpec) {\r\n return undefined;\r\n }\r\n return formatterSpec.applyFormatting(value);\r\n }\r\n\r\n public async getFormatterSpec(options: FormatOptions) {\r\n const formattingProps = await getFormattingProps(this._schemaContext, this._defaultFormats, options);\r\n if (!formattingProps) {\r\n return undefined;\r\n }\r\n const { formatProps, persistenceUnitName } = formattingProps;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\r\n }\r\n\r\n public async getParserSpec(options: FormatOptions) {\r\n const formattingProps = await getFormattingProps(this._schemaContext, this._defaultFormats, options);\r\n if (!formattingProps) {\r\n return undefined;\r\n }\r\n const { formatProps, persistenceUnitName } = formattingProps;\r\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\r\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\r\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\r\n }\r\n}\r\n\r\ninterface FormattingProps {\r\n formatProps: FormatProps;\r\n persistenceUnitName: string;\r\n}\r\n\r\nasync function getFormattingProps(\r\n schemaLocater: SchemaContext,\r\n defaultFormats: FormatsMap | undefined,\r\n options: FormatOptions,\r\n): Promise<FormattingProps | undefined> {\r\n const { koqName, unitSystem } = options;\r\n\r\n const koq = await getKoq(schemaLocater, koqName);\r\n if (!koq) {\r\n return undefined;\r\n }\r\n\r\n const persistenceUnit = await koq.persistenceUnit;\r\n // istanbul ignore if\r\n if (!persistenceUnit) {\r\n return undefined;\r\n }\r\n\r\n const formatProps = await getKoqFormatProps(koq, persistenceUnit, defaultFormats, unitSystem);\r\n if (!formatProps) {\r\n return undefined;\r\n }\r\n\r\n return { formatProps, persistenceUnitName: persistenceUnit.fullName };\r\n}\r\n\r\nasync function getKoq(schemaLocater: SchemaContext, fullName: string) {\r\n const [schemaName, propKoqName] = fullName.split(\":\");\r\n const schema = await schemaLocater.getSchema(new SchemaKey(schemaName), SchemaMatchType.Latest);\r\n if (!schema) {\r\n return undefined;\r\n }\r\n return schema.getItem<KindOfQuantity>(propKoqName);\r\n}\r\n\r\nasync function getKoqFormatProps(\r\n koq: KindOfQuantity,\r\n persistenceUnit: Unit | InvertedUnit,\r\n defaultFormats: FormatsMap | undefined,\r\n unitSystem?: UnitSystemKey,\r\n) {\r\n const unitSystemMatchers = getUnitSystemGroupMatchers(unitSystem);\r\n // use one of KOQ presentation format that matches requested unit system\r\n const presentationFormat = await getKoqPresentationFormat(koq, unitSystemMatchers);\r\n if (presentationFormat) {\r\n return getFormatProps(presentationFormat);\r\n }\r\n\r\n // use one of the formats in default formats map if there is one for matching phenomena and requested unit\r\n // system combination\r\n if (defaultFormats && unitSystem) {\r\n const actualPersistenceUnit = persistenceUnit instanceof InvertedUnit ? /* istanbul ignore next */ await persistenceUnit.invertsUnit : persistenceUnit;\r\n const phenomenon = await actualPersistenceUnit?.phenomenon;\r\n // istanbul ignore else\r\n if (phenomenon && defaultFormats[phenomenon.name.toUpperCase()]) {\r\n const defaultPhenomenonFormats = defaultFormats[phenomenon.name.toUpperCase()];\r\n for (const defaultUnitSystemFormat of Array.isArray(defaultPhenomenonFormats)\r\n ? /* istanbul ignore next */ defaultPhenomenonFormats\r\n : [defaultPhenomenonFormats]) {\r\n if (defaultUnitSystemFormat.unitSystems.includes(unitSystem)) {\r\n return defaultUnitSystemFormat.format;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // use persistence unit format if it matches requested unit system and matching presentation format was not found\r\n const persistenceUnitSystem = await persistenceUnit.unitSystem;\r\n if (persistenceUnitSystem && unitSystemMatchers.some((matcher) => matcher(persistenceUnitSystem))) {\r\n return getPersistenceUnitFormatProps(persistenceUnit);\r\n }\r\n\r\n // use default presentation format if persistence unit does not match requested unit system\r\n if (koq.defaultPresentationFormat) {\r\n return getFormatProps(koq.defaultPresentationFormat);\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\nasync function getKoqPresentationFormat(koq: KindOfQuantity, unitSystemMatchers: Array<(unitSystem: UnitSystem) => boolean>) {\r\n const presentationFormats = koq.presentationFormats;\r\n for (const matcher of unitSystemMatchers) {\r\n for (const format of presentationFormats) {\r\n const unit = format.units && format.units[0][0];\r\n // istanbul ignore if\r\n if (!unit) {\r\n continue;\r\n }\r\n const currentUnitSystem = await unit.unitSystem;\r\n if (currentUnitSystem && matcher(currentUnitSystem)) {\r\n return format;\r\n }\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction getPersistenceUnitFormatProps(persistenceUnit: Unit | InvertedUnit): FormatProps {\r\n // Same as Format \"DefaultRealU\" in Formats ecschema\r\n return {\r\n formatTraits: [\"keepSingleZero\", \"keepDecimalPoint\", \"showUnitLabel\"],\r\n precision: 6,\r\n type: \"Decimal\",\r\n uomSeparator: \" \",\r\n decimalSeparator: \".\",\r\n composite: {\r\n units: [\r\n {\r\n name: persistenceUnit.fullName,\r\n label: persistenceUnit.label,\r\n },\r\n ],\r\n },\r\n };\r\n}\r\n\r\nfunction getUnitSystemGroupMatchers(groupKey?: UnitSystemKey) {\r\n function createMatcher(name: string | string[]) {\r\n const names = Array.isArray(name) ? name : [name];\r\n return (unitSystem: UnitSystem) => names.some((n) => n === unitSystem.name.toUpperCase());\r\n }\r\n switch (groupKey) {\r\n case \"imperial\":\r\n return [\"IMPERIAL\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\r\n case \"metric\":\r\n return [[\"SI\", \"METRIC\"], \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\r\n case \"usCustomary\":\r\n return [\"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\r\n case \"usSurvey\":\r\n return [\"USSURVEY\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\r\n }\r\n return [];\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"KoqPropertyValueFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,wDAAoH;AACpH,gEAUkC;AAiDlC;;;GAGG;AACH,MAAa,yBAAyB;IAK1B;IAJF,cAAc,CAAgB;IAC9B,eAAe,CAAc;IAErC,YACU,cAA6B,EACrC,cAA2B;QADnB,mBAAc,GAAd,cAAc,CAAe;QAGrC,IAAI,CAAC,cAAc,GAAG,IAAI,sCAAkB,CAAC,cAAc,CAAC,CAAC;QAC7D,IAAI,CAAC,eAAe,GAAG,cAAc;YACnC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,EAAE,CAAC;YAClJ,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,KAAa,EAAE,OAAsB;QACvD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;I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C,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,CAAC,UAAsB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5F,CAAC;IACD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACjF,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3E,KAAK,aAAa;YAChB,OAAO,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrE,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { Format, FormatProps, FormatterSpec, ParserSpec, UnitsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport {\n getFormatProps,\n InvertedUnit,\n KindOfQuantity,\n SchemaContext,\n SchemaKey,\n SchemaMatchType,\n SchemaUnitProvider,\n Unit,\n UnitSystem,\n} from \"@itwin/ecschema-metadata\";\n\n/**\n * A data structure that associates unit systems with property value formatting props. The associations are used for\n * assigning formatting props for specific phenomenon and unit system combinations (see [[FormatsMap]]).\n *\n * @public\n */\nexport interface UnitSystemFormat {\n unitSystems: UnitSystemKey[];\n format: FormatProps;\n}\n\n/**\n * A data structure that associates specific phenomenon with one or more formatting props for specific unit system.\n *\n * Example:\n * ```json\n * {\n * length: [{\n * unitSystems: [\"metric\"],\n * format: formatForCentimeters,\n * }, {\n * unitSystems: [\"imperial\", \"usCustomary\"],\n * format: formatForInches,\n * }, {\n * unitSystems: [\"usSurvey\"],\n * format: formatForUsSurveyInches,\n * }]\n * }\n * ```\n *\n * @public\n */\nexport interface FormatsMap {\n [phenomenon: string]: UnitSystemFormat | UnitSystemFormat[];\n}\n\n/**\n * Options for finding a formatter spec to use in [[KoqPropertyValueFormatter]].\n * @public\n */\nexport interface FormatOptions {\n /** Full name of the `KindOfQuantity`, e.g. `SchemaName:KoqName`. */\n koqName: string;\n /** Unit system to use for formatting. */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * An utility for formatting property values based on `KindOfQuantity` and unit system.\n * @public\n */\nexport class KoqPropertyValueFormatter {\n private _unitsProvider: UnitsProvider;\n private _defaultFormats?: FormatsMap;\n\n constructor(\n private _schemaContext: SchemaContext,\n defaultFormats?: FormatsMap,\n ) {\n this._unitsProvider = new SchemaUnitProvider(_schemaContext);\n this._defaultFormats = defaultFormats\n ? Object.entries(defaultFormats).reduce((acc, [phenomenon, unitSystemFormats]) => ({ ...acc, [phenomenon.toUpperCase()]: unitSystemFormats }), {})\n : /* c8 ignore next */ undefined;\n }\n\n public async format(value: number, options: FormatOptions) {\n const formatterSpec = await this.getFormatterSpec(options);\n if (!formatterSpec) {\n return undefined;\n }\n return formatterSpec.applyFormatting(value);\n }\n\n public async getFormatterSpec(options: FormatOptions) {\n const formattingProps = await getFormattingProps(this._schemaContext, this._defaultFormats, options);\n if (!formattingProps) {\n return undefined;\n }\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\n }\n\n public async getParserSpec(options: FormatOptions) {\n const formattingProps = await getFormattingProps(this._schemaContext, this._defaultFormats, options);\n if (!formattingProps) {\n return undefined;\n }\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\n }\n}\n\ninterface FormattingProps {\n formatProps: FormatProps;\n persistenceUnitName: string;\n}\n\nasync function getFormattingProps(\n schemaLocater: SchemaContext,\n defaultFormats: FormatsMap | undefined,\n options: FormatOptions,\n): Promise<FormattingProps | undefined> {\n const { koqName, unitSystem } = options;\n\n const koq = await getKoq(schemaLocater, koqName);\n if (!koq) {\n return undefined;\n }\n\n const persistenceUnit = await koq.persistenceUnit;\n /* c8 ignore next 3 */\n if (!persistenceUnit) {\n return undefined;\n }\n\n const formatProps = await getKoqFormatProps(koq, persistenceUnit, defaultFormats, unitSystem);\n if (!formatProps) {\n return undefined;\n }\n\n return { formatProps, persistenceUnitName: persistenceUnit.fullName };\n}\n\nasync function getKoq(schemaLocater: SchemaContext, fullName: string) {\n const [schemaName, propKoqName] = fullName.split(\":\");\n const schema = await schemaLocater.getSchema(new SchemaKey(schemaName), SchemaMatchType.Latest);\n if (!schema) {\n return undefined;\n }\n return schema.getItem(propKoqName, KindOfQuantity);\n}\n\nasync function getKoqFormatProps(\n koq: KindOfQuantity,\n persistenceUnit: Unit | InvertedUnit,\n defaultFormats: FormatsMap | undefined,\n unitSystem?: UnitSystemKey,\n) {\n const unitSystemMatchers = getUnitSystemGroupMatchers(unitSystem);\n // use one of KOQ presentation format that matches requested unit system\n const presentationFormat = await getKoqPresentationFormat(koq, unitSystemMatchers);\n if (presentationFormat) {\n return getFormatProps(presentationFormat);\n }\n\n // use one of the formats in default formats map if there is one for matching phenomena and requested unit\n // system combination\n if (defaultFormats && unitSystem) {\n const actualPersistenceUnit = persistenceUnit instanceof InvertedUnit ? /* c8 ignore next */ await persistenceUnit.invertsUnit : persistenceUnit;\n const phenomenon = await actualPersistenceUnit?.phenomenon;\n if (phenomenon && defaultFormats[phenomenon.name.toUpperCase()]) {\n const defaultPhenomenonFormats = defaultFormats[phenomenon.name.toUpperCase()];\n for (const defaultUnitSystemFormat of Array.isArray(defaultPhenomenonFormats)\n ? /* c8 ignore next */ defaultPhenomenonFormats\n : [defaultPhenomenonFormats]) {\n if (defaultUnitSystemFormat.unitSystems.includes(unitSystem)) {\n return defaultUnitSystemFormat.format;\n }\n }\n }\n }\n\n // use persistence unit format if it matches requested unit system and matching presentation format was not found\n const persistenceUnitSystem = await persistenceUnit.unitSystem;\n if (persistenceUnitSystem && unitSystemMatchers.some((matcher) => matcher(persistenceUnitSystem))) {\n return getPersistenceUnitFormatProps(persistenceUnit);\n }\n\n // use default presentation format if persistence unit does not match requested unit system\n if (koq.defaultPresentationFormat) {\n return getFormatProps(koq.defaultPresentationFormat);\n }\n\n return undefined;\n}\n\nasync function getKoqPresentationFormat(koq: KindOfQuantity, unitSystemMatchers: Array<(unitSystem: UnitSystem) => boolean>) {\n const presentationFormats = koq.presentationFormats;\n for (const matcher of unitSystemMatchers) {\n for (const format of presentationFormats) {\n const unit = format.units && format.units[0][0];\n /* c8 ignore next 3 */\n if (!unit) {\n continue;\n }\n const currentUnitSystem = await unit.unitSystem;\n if (currentUnitSystem && matcher(currentUnitSystem)) {\n return format;\n }\n }\n }\n return undefined;\n}\n\nfunction getPersistenceUnitFormatProps(persistenceUnit: Unit | InvertedUnit): FormatProps {\n // Same as Format \"DefaultRealU\" in Formats ecschema\n return {\n formatTraits: [\"keepSingleZero\", \"keepDecimalPoint\", \"showUnitLabel\"],\n precision: 6,\n type: \"Decimal\",\n uomSeparator: \" \",\n decimalSeparator: \".\",\n composite: {\n units: [\n {\n name: persistenceUnit.fullName,\n label: persistenceUnit.label,\n },\n ],\n },\n };\n}\n\nfunction getUnitSystemGroupMatchers(groupKey?: UnitSystemKey) {\n function createMatcher(name: string | string[]) {\n const names = Array.isArray(name) ? name : [name];\n return (unitSystem: UnitSystem) => names.some((n) => n === unitSystem.name.toUpperCase());\n }\n switch (groupKey) {\n case \"imperial\":\n return [\"IMPERIAL\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n case \"metric\":\n return [[\"SI\", \"METRIC\"], \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n case \"usCustomary\":\n return [\"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n case \"usSurvey\":\n return [\"USSURVEY\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n }\n return [];\n}\n"]}
|
|
@@ -9,39 +9,11 @@ export interface LabelCompositeValue {
|
|
|
9
9
|
separator: string;
|
|
10
10
|
values: LabelDefinition[];
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
13
|
-
* JSON representation of [[LabelCompositeValue]]
|
|
14
|
-
* @public
|
|
15
|
-
* @deprecated in 3.x. Use [[LabelCompositeValue]].
|
|
16
|
-
*/
|
|
17
|
-
export interface LabelCompositeValueJSON {
|
|
18
|
-
separator: string;
|
|
19
|
-
values: LabelDefinition[];
|
|
20
|
-
}
|
|
21
|
-
/** @public */
|
|
22
|
-
export declare namespace LabelCompositeValue {
|
|
23
|
-
/**
|
|
24
|
-
* Serialize given [[LabelCompositeValue]] to JSON
|
|
25
|
-
* @deprecated in 3.x. Use [[LabelCompositeValue]].
|
|
26
|
-
*/
|
|
27
|
-
function toJSON(compositeValue: LabelCompositeValue): LabelCompositeValueJSON;
|
|
28
|
-
/**
|
|
29
|
-
* Deserialize [[LabelCompositeValue]] from JSON
|
|
30
|
-
* @deprecated in 3.x. Use [[LabelCompositeValue]].
|
|
31
|
-
*/
|
|
32
|
-
function fromJSON(json: LabelCompositeValueJSON): LabelCompositeValue;
|
|
33
|
-
}
|
|
34
12
|
/**
|
|
35
13
|
* Type definition of label raw value.
|
|
36
14
|
* @public
|
|
37
15
|
*/
|
|
38
16
|
export type LabelRawValue = string | number | boolean | LabelCompositeValue;
|
|
39
|
-
/**
|
|
40
|
-
* JSON representation of [[LabelRawValue]]
|
|
41
|
-
* @public
|
|
42
|
-
* @deprecated in 3.x. Use [[LabelRawValue]].
|
|
43
|
-
*/
|
|
44
|
-
export type LabelRawValueJSON = LabelRawValue;
|
|
45
17
|
/**
|
|
46
18
|
* Data structure that describes label definition.
|
|
47
19
|
* @public
|
|
@@ -54,30 +26,10 @@ export interface LabelDefinition {
|
|
|
54
26
|
/** Type name of raw value */
|
|
55
27
|
typeName: string;
|
|
56
28
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
* @public
|
|
60
|
-
* @deprecated in 3.x. Use [[LabelDefinition]].
|
|
61
|
-
*/
|
|
62
|
-
export interface LabelDefinitionJSON {
|
|
63
|
-
displayValue: string;
|
|
64
|
-
rawValue: LabelRawValue;
|
|
65
|
-
typeName: string;
|
|
66
|
-
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
export declare const COMPOSITE_LABEL_DEFINITION_TYPENAME = "composite";
|
|
67
31
|
/** @public */
|
|
68
32
|
export declare namespace LabelDefinition {
|
|
69
|
-
/**
|
|
70
|
-
* Serialize given [[LabelDefinition]] to JSON
|
|
71
|
-
* @deprecated in 3.x. Use [[LabelDefinition]].
|
|
72
|
-
*/
|
|
73
|
-
function toJSON(labelDefinition: LabelDefinition): LabelDefinitionJSON;
|
|
74
|
-
/**
|
|
75
|
-
* Deserialize [[LabelDefinition]] from JSON
|
|
76
|
-
* @deprecated in 3.x. Use [[LabelDefinition]].
|
|
77
|
-
*/
|
|
78
|
-
function fromJSON(json: LabelDefinitionJSON | string): LabelDefinition;
|
|
79
|
-
/** @internal */
|
|
80
|
-
const COMPOSITE_DEFINITION_TYPENAME = "composite";
|
|
81
33
|
/**
|
|
82
34
|
* Checks if provided [[LabelDefinition]] has raw value of type [[LabelCompositeValue]].
|
|
83
35
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelDefinition.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LabelDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED
|
|
1
|
+
{"version":3,"file":"LabelDefinition.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LabelDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,mBAAmB,CAAC;AAE5E;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,gBAAgB;AAChB,eAAO,MAAM,mCAAmC,cAAc,CAAC;AAE/D,cAAc;AACd,yBAAiB,eAAe,CAAC;IAC/B;;;OAGG;IACH,SAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,eAAe,GAAG;QAAE,QAAQ,EAAE,mBAAmB,CAAA;KAAE,CAEtH;IAED;;;OAGG;IACH,SAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CAM9D;CACF"}
|
|
@@ -7,61 +7,18 @@
|
|
|
7
7
|
* @module Hierarchies
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.LabelDefinition = exports.
|
|
11
|
-
/** @
|
|
12
|
-
|
|
13
|
-
(function (LabelCompositeValue) {
|
|
14
|
-
/**
|
|
15
|
-
* Serialize given [[LabelCompositeValue]] to JSON
|
|
16
|
-
* @deprecated in 3.x. Use [[LabelCompositeValue]].
|
|
17
|
-
*/
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
19
|
-
function toJSON(compositeValue) {
|
|
20
|
-
return { ...compositeValue };
|
|
21
|
-
}
|
|
22
|
-
LabelCompositeValue.toJSON = toJSON;
|
|
23
|
-
/**
|
|
24
|
-
* Deserialize [[LabelCompositeValue]] from JSON
|
|
25
|
-
* @deprecated in 3.x. Use [[LabelCompositeValue]].
|
|
26
|
-
*/
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
28
|
-
function fromJSON(json) {
|
|
29
|
-
return { ...json };
|
|
30
|
-
}
|
|
31
|
-
LabelCompositeValue.fromJSON = fromJSON;
|
|
32
|
-
})(LabelCompositeValue || (exports.LabelCompositeValue = LabelCompositeValue = {}));
|
|
10
|
+
exports.LabelDefinition = exports.COMPOSITE_LABEL_DEFINITION_TYPENAME = void 0;
|
|
11
|
+
/** @internal */
|
|
12
|
+
exports.COMPOSITE_LABEL_DEFINITION_TYPENAME = "composite";
|
|
33
13
|
/** @public */
|
|
34
14
|
var LabelDefinition;
|
|
35
15
|
(function (LabelDefinition) {
|
|
36
|
-
/**
|
|
37
|
-
* Serialize given [[LabelDefinition]] to JSON
|
|
38
|
-
* @deprecated in 3.x. Use [[LabelDefinition]].
|
|
39
|
-
*/
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
41
|
-
function toJSON(labelDefinition) {
|
|
42
|
-
return { ...labelDefinition };
|
|
43
|
-
}
|
|
44
|
-
LabelDefinition.toJSON = toJSON;
|
|
45
|
-
/**
|
|
46
|
-
* Deserialize [[LabelDefinition]] from JSON
|
|
47
|
-
* @deprecated in 3.x. Use [[LabelDefinition]].
|
|
48
|
-
*/
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
50
|
-
function fromJSON(json) {
|
|
51
|
-
if (typeof json === "string") {
|
|
52
|
-
return JSON.parse(json);
|
|
53
|
-
}
|
|
54
|
-
return { ...json };
|
|
55
|
-
}
|
|
56
|
-
LabelDefinition.fromJSON = fromJSON;
|
|
57
|
-
/** @internal */
|
|
58
|
-
LabelDefinition.COMPOSITE_DEFINITION_TYPENAME = "composite";
|
|
59
16
|
/**
|
|
60
17
|
* Checks if provided [[LabelDefinition]] has raw value of type [[LabelCompositeValue]].
|
|
61
18
|
* @public
|
|
62
19
|
*/
|
|
63
20
|
function isCompositeDefinition(def) {
|
|
64
|
-
return def.typeName ===
|
|
21
|
+
return def.typeName === exports.COMPOSITE_LABEL_DEFINITION_TYPENAME;
|
|
65
22
|
}
|
|
66
23
|
LabelDefinition.isCompositeDefinition = isCompositeDefinition;
|
|
67
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelDefinition.js","sourceRoot":"","sources":["../../../src/presentation-common/LabelDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"LabelDefinition.js","sourceRoot":"","sources":["../../../src/presentation-common/LabelDefinition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA8BH,gBAAgB;AACH,QAAA,mCAAmC,GAAG,WAAW,CAAC;AAE/D,cAAc;AACd,IAAiB,eAAe,CAoB/B;AApBD,WAAiB,eAAe;IAC9B;;;OAGG;IACH,SAAgB,qBAAqB,CAAC,GAAoB;QACxD,OAAO,GAAG,CAAC,QAAQ,KAAK,2CAAmC,CAAC;IAC9D,CAAC;IAFe,qCAAqB,wBAEpC,CAAA;IAED;;;OAGG;IACH,SAAgB,eAAe,CAAC,KAAa;QAC3C,OAAO;YACL,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,KAAK;YACf,QAAQ,EAAE,QAAQ;SACnB,CAAC;IACJ,CAAC;IANe,+BAAe,kBAM9B,CAAA;AACH,CAAC,EApBgB,eAAe,+BAAf,eAAe,QAoB/B","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Hierarchies\n */\n\n/**\n * Data structure that describes raw composite label value.\n * @public\n */\nexport interface LabelCompositeValue {\n separator: string;\n values: LabelDefinition[];\n}\n\n/**\n * Type definition of label raw value.\n * @public\n */\nexport type LabelRawValue = string | number | boolean | LabelCompositeValue;\n\n/**\n * Data structure that describes label definition.\n * @public\n */\nexport interface LabelDefinition {\n /** Display value of label */\n displayValue: string;\n /** Raw value of label */\n rawValue: LabelRawValue;\n /** Type name of raw value */\n typeName: string;\n}\n\n/** @internal */\nexport const COMPOSITE_LABEL_DEFINITION_TYPENAME = \"composite\";\n\n/** @public */\nexport namespace LabelDefinition {\n /**\n * Checks if provided [[LabelDefinition]] has raw value of type [[LabelCompositeValue]].\n * @public\n */\n export function isCompositeDefinition(def: LabelDefinition): def is LabelDefinition & { rawValue: LabelCompositeValue } {\n return def.typeName === COMPOSITE_LABEL_DEFINITION_TYPENAME;\n }\n\n /**\n * Creates [[LabelDefinition]] from string value.\n * @public\n */\n export function fromLabelString(label: string): LabelDefinition {\n return {\n displayValue: label,\n rawValue: label,\n typeName: \"string\",\n };\n }\n}\n"]}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Core
|
|
3
3
|
*/
|
|
4
|
-
import { Content } from "./content/Content";
|
|
5
|
-
import { Descriptor } from "./content/Descriptor";
|
|
6
|
-
import { Item } from "./content/Item";
|
|
7
|
-
import { DisplayValueGroup } from "./content/Value";
|
|
8
|
-
import { ElementProperties } from "./ElementProperties";
|
|
9
|
-
import { Node } from "./hierarchy/Node";
|
|
10
|
-
import { NodePathElement } from "./hierarchy/NodePathElement";
|
|
11
|
-
import { LabelDefinition } from "./LabelDefinition";
|
|
12
|
-
|
|
13
|
-
export interface LocalizationHelperProps {
|
|
4
|
+
import { Content } from "./content/Content.js";
|
|
5
|
+
import { Descriptor } from "./content/Descriptor.js";
|
|
6
|
+
import { Item } from "./content/Item.js";
|
|
7
|
+
import { DisplayValueGroup } from "./content/Value.js";
|
|
8
|
+
import { ElementProperties } from "./ElementProperties.js";
|
|
9
|
+
import { Node } from "./hierarchy/Node.js";
|
|
10
|
+
import { NodePathElement } from "./hierarchy/NodePathElement.js";
|
|
11
|
+
import { LabelDefinition } from "./LabelDefinition.js";
|
|
12
|
+
interface LocalizationHelperProps {
|
|
14
13
|
getLocalizedString: (key: string) => string;
|
|
15
14
|
}
|
|
16
15
|
/** @internal */
|
|
@@ -34,4 +33,5 @@ export declare class LocalizationHelper {
|
|
|
34
33
|
getLocalizedNode(node: Node): Node;
|
|
35
34
|
private getLocalizedDisplayValue;
|
|
36
35
|
}
|
|
36
|
+
export {};
|
|
37
37
|
//# sourceMappingURL=LocalizationHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalizationHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"LocalizationHelper.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAgB,iBAAiB,EAAS,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,C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
|
|
14
|
-
const
|
|
11
|
+
const Content_js_1 = require("./content/Content.js");
|
|
12
|
+
const Descriptor_js_1 = require("./content/Descriptor.js");
|
|
13
|
+
const Value_js_1 = require("./content/Value.js");
|
|
14
|
+
const LabelDefinition_js_1 = require("./LabelDefinition.js");
|
|
15
15
|
const KEY_PATTERN = /@[\w\d\-_]+:[\w\d\-\._]+?@/g;
|
|
16
16
|
/** @internal */
|
|
17
17
|
class LocalizationHelper {
|
|
18
|
+
_getLocalizedString;
|
|
18
19
|
constructor(props) {
|
|
19
20
|
this._getLocalizedString = props.getLocalizedString;
|
|
20
21
|
}
|
|
@@ -42,7 +43,7 @@ class LocalizationHelper {
|
|
|
42
43
|
...compositeValue,
|
|
43
44
|
values: compositeValue.values.map((value) => this.getLocalizedLabelDefinition(value)),
|
|
44
45
|
});
|
|
45
|
-
if (labelDefinition.typeName ===
|
|
46
|
+
if (labelDefinition.typeName === LabelDefinition_js_1.COMPOSITE_LABEL_DEFINITION_TYPENAME) {
|
|
46
47
|
return {
|
|
47
48
|
...labelDefinition,
|
|
48
49
|
rawValue: getLocalizedComposite(labelDefinition.rawValue),
|
|
@@ -61,7 +62,7 @@ class LocalizationHelper {
|
|
|
61
62
|
return labelDefinitions.map((labelDefinition) => this.getLocalizedLabelDefinition(labelDefinition));
|
|
62
63
|
}
|
|
63
64
|
getLocalizedContentDescriptor(descriptor) {
|
|
64
|
-
const clone = new
|
|
65
|
+
const clone = new Descriptor_js_1.Descriptor(descriptor);
|
|
65
66
|
clone.fields.forEach((field) => this.getLocalizedContentField(field));
|
|
66
67
|
clone.categories.forEach((category) => this.getLocalizedCategoryDescription(category));
|
|
67
68
|
return clone;
|
|
@@ -70,7 +71,7 @@ class LocalizationHelper {
|
|
|
70
71
|
return items.map((item) => this.getLocalizedContentItem(item));
|
|
71
72
|
}
|
|
72
73
|
getLocalizedContent(content) {
|
|
73
|
-
return new
|
|
74
|
+
return new Content_js_1.Content(this.getLocalizedContentDescriptor(content.descriptor), this.getLocalizedContentItems(content.contentSet));
|
|
74
75
|
}
|
|
75
76
|
getLocalizedElementProperties(elem) {
|
|
76
77
|
return {
|
|
@@ -89,23 +90,23 @@ class LocalizationHelper {
|
|
|
89
90
|
if (typeof value === "string") {
|
|
90
91
|
return this.getLocalizedString(value);
|
|
91
92
|
}
|
|
92
|
-
if (
|
|
93
|
+
if (Value_js_1.Value.isNavigationValue(value)) {
|
|
93
94
|
return {
|
|
94
95
|
...value,
|
|
95
96
|
label: this.getLocalizedLabelDefinition(value.label),
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
|
-
if (
|
|
99
|
+
if (Value_js_1.Value.isNestedContent(value)) {
|
|
99
100
|
return value.map((item) => ({
|
|
100
101
|
...item,
|
|
101
102
|
values: Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {}),
|
|
102
103
|
displayValues: Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {}),
|
|
103
104
|
}));
|
|
104
105
|
}
|
|
105
|
-
if (
|
|
106
|
+
if (Value_js_1.Value.isArray(value)) {
|
|
106
107
|
return value.map((v) => this.getLocalizedRawValue(v));
|
|
107
108
|
}
|
|
108
|
-
if (
|
|
109
|
+
if (Value_js_1.Value.isMap(value)) {
|
|
109
110
|
return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});
|
|
110
111
|
}
|
|
111
112
|
return value;
|
|
@@ -146,7 +147,7 @@ class LocalizationHelper {
|
|
|
146
147
|
if (typeof value === "string") {
|
|
147
148
|
return this.getLocalizedString(value);
|
|
148
149
|
}
|
|
149
|
-
if (
|
|
150
|
+
if (Value_js_1.DisplayValue.isArray(value)) {
|
|
150
151
|
return value.map((v) => this.getLocalizedDisplayValue(v));
|
|
151
152
|
}
|
|
152
153
|
return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});
|
|
@@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r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Core\r\n */\r\n\r\nimport { CategoryDescription } from \"./content/Category\";\r\nimport { Content } from \"./content/Content\";\r\nimport { Descriptor } from \"./content/Descriptor\";\r\nimport { Field } from \"./content/Fields\";\r\nimport { Item } from \"./content/Item\";\r\nimport { DisplayValue, DisplayValueGroup, Value } from \"./content/Value\";\r\nimport { ElementProperties } from \"./ElementProperties\";\r\nimport { Node } from \"./hierarchy/Node\";\r\nimport { NodePathElement } from \"./hierarchy/NodePathElement\";\r\nimport { LabelCompositeValue, LabelDefinition } from \"./LabelDefinition\";\r\n\r\nconst KEY_PATTERN = /@[\\w\\d\\-_]+:[\\w\\d\\-\\._]+?@/g;\r\n\r\n/** @internal */\r\nexport interface LocalizationHelperProps {\r\n getLocalizedString: (key: string) => string;\r\n}\r\n\r\n/** @internal */\r\nexport class LocalizationHelper {\r\n private _getLocalizedString: (key: string) => string;\r\n\r\n constructor(props: LocalizationHelperProps) {\r\n this._getLocalizedString = props.getLocalizedString;\r\n }\r\n\r\n public getLocalizedString(text: string) {\r\n return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, \"\")));\r\n }\r\n\r\n public getLocalizedNodes(nodes: Node[]): Node[] {\r\n return nodes.map((n) => this.getLocalizedNode(n));\r\n }\r\n\r\n public getLocalizedNodePathElement(npe: NodePathElement): NodePathElement {\r\n return {\r\n ...npe,\r\n node: this.getLocalizedNode(npe.node),\r\n children: npe.children.map((c) => this.getLocalizedNodePathElement(c)),\r\n };\r\n }\r\n\r\n public getLocalizedDisplayValueGroup(group: DisplayValueGroup): DisplayValueGroup {\r\n return {\r\n ...group,\r\n displayValue: this.getLocalizedDisplayValue(group.displayValue),\r\n };\r\n }\r\n\r\n public getLocalizedLabelDefinition(labelDefinition: LabelDefinition): LabelDefinition {\r\n const getLocalizedComposite = (compositeValue: LabelCompositeValue) => ({\r\n ...compositeValue,\r\n values: compositeValue.values.map((value) => this.getLocalizedLabelDefinition(value)),\r\n });\r\n\r\n if (labelDefinition.typeName === LabelDefinition.COMPOSITE_DEFINITION_TYPENAME) {\r\n return {\r\n ...labelDefinition,\r\n rawValue: getLocalizedComposite(labelDefinition.rawValue as LabelCompositeValue),\r\n };\r\n }\r\n if (labelDefinition.typeName === \"string\") {\r\n return {\r\n ...labelDefinition,\r\n rawValue: this.getLocalizedString(labelDefinition.rawValue as string),\r\n displayValue: this.getLocalizedString(labelDefinition.displayValue),\r\n };\r\n }\r\n return labelDefinition;\r\n }\r\n\r\n public getLocalizedLabelDefinitions(labelDefinitions: LabelDefinition[]) {\r\n return labelDefinitions.map((labelDefinition) => this.getLocalizedLabelDefinition(labelDefinition));\r\n }\r\n\r\n public getLocalizedContentDescriptor(descriptor: Descriptor) {\r\n const clone = new Descriptor(descriptor);\r\n clone.fields.forEach((field) => this.getLocalizedContentField(field));\r\n clone.categories.forEach((category) => this.getLocalizedCategoryDescription(category));\r\n return clone;\r\n }\r\n\r\n public getLocalizedContentItems(items: Item[]): Item[] {\r\n return items.map((item) => this.getLocalizedContentItem(item));\r\n }\r\n\r\n public getLocalizedContent(content: Content): Content {\r\n return new Content(this.getLocalizedContentDescriptor(content.descriptor), this.getLocalizedContentItems(content.contentSet));\r\n }\r\n\r\n public getLocalizedElementProperties(elem: ElementProperties): ElementProperties {\r\n return {\r\n ...elem,\r\n label: this.getLocalizedString(elem.label),\r\n };\r\n }\r\n\r\n // warning: this function mutates the item\r\n private getLocalizedContentItem(item: Item): Item {\r\n item.label = this.getLocalizedLabelDefinition(item.label);\r\n item.values = Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\r\n item.displayValues = Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\r\n return item;\r\n }\r\n\r\n private getLocalizedRawValue(value: Value): Value {\r\n if (typeof value === \"string\") {\r\n return this.getLocalizedString(value);\r\n }\r\n if (Value.isNavigationValue(value)) {\r\n return {\r\n ...value,\r\n label: this.getLocalizedLabelDefinition(value.label),\r\n };\r\n }\r\n if (Value.isNestedContent(value)) {\r\n return value.map((item) => ({\r\n ...item,\r\n values: Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {}),\r\n displayValues: Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {}),\r\n }));\r\n }\r\n if (Value.isArray(value)) {\r\n return value.map((v) => this.getLocalizedRawValue(v));\r\n }\r\n if (Value.isMap(value)) {\r\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\r\n }\r\n return value;\r\n }\r\n\r\n // warning: this function mutates the field\r\n private getLocalizedContentField<TField extends Field>(field: TField) {\r\n field.label = this.getLocalizedString(field.label);\r\n if (field.isPropertiesField()) {\r\n if (field.isStructPropertiesField()) {\r\n field.memberFields = field.memberFields.map((m) => this.getLocalizedContentField(m));\r\n } else if (field.isArrayPropertiesField()) {\r\n field.itemsField = this.getLocalizedContentField(field.itemsField);\r\n }\r\n } else if (field.isNestedContentField()) {\r\n field.nestedFields = field.nestedFields.map((m) => this.getLocalizedContentField(m));\r\n }\r\n return field;\r\n }\r\n\r\n // warning: this function mutates the category\r\n private getLocalizedCategoryDescription(category: CategoryDescription) {\r\n category.label = this.getLocalizedString(category.label);\r\n category.description = this.getLocalizedString(category.description);\r\n return category;\r\n }\r\n\r\n public getLocalizedNode(node: Node): Node {\r\n return {\r\n ...node,\r\n label: this.getLocalizedLabelDefinition(node.label),\r\n ...(node.description ? { description: this.getLocalizedString(node.description) } : undefined),\r\n };\r\n }\r\n\r\n private getLocalizedDisplayValue(value: DisplayValue): DisplayValue {\r\n if (typeof value === \"undefined\") {\r\n return undefined;\r\n }\r\n if (typeof value === \"string\") {\r\n return this.getLocalizedString(value);\r\n }\r\n if (DisplayValue.isArray(value)) {\r\n return value.map((v) => this.getLocalizedDisplayValue(v));\r\n }\r\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"LocalizationHelper.js","sourceRoot":"","sources":["../../../src/presentation-common/LocalizationHelper.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,qDAA+C;AAC/C,2DAAqD;AAGrD,iDAA4E;AAI5E,6DAAiH;AAEjH,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAMlD,gBAAgB;AAChB,MAAa,kBAAkB;IACrB,mBAAmB,CAA0B;IAErD,YAAY,KAA8B;QACxC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,kBAAkB,CAAC;IACtD,CAAC;IAEM,kBAAkB,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;IAEM,iBAAiB,CAAC,KAAa;QACpC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;IAEM,2BAA2B,CAAC,GAAoB;QACrD,OAAO;YACL,GAAG,GAAG;YACN,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC;YACrC,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;SACvE,CAAC;IACJ,CAAC;IAEM,6BAA6B,CAAC,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AAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5G,CAAC;CACF;AA1JD,gDA0JC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { CategoryDescription } from \"./content/Category.js\";\nimport { Content } from \"./content/Content.js\";\nimport { Descriptor } from \"./content/Descriptor.js\";\nimport { Field } from \"./content/Fields.js\";\nimport { Item } from \"./content/Item.js\";\nimport { DisplayValue, DisplayValueGroup, Value } from \"./content/Value.js\";\nimport { ElementProperties } from \"./ElementProperties.js\";\nimport { Node } from \"./hierarchy/Node.js\";\nimport { NodePathElement } from \"./hierarchy/NodePathElement.js\";\nimport { COMPOSITE_LABEL_DEFINITION_TYPENAME, LabelCompositeValue, LabelDefinition } from \"./LabelDefinition.js\";\n\nconst KEY_PATTERN = /@[\\w\\d\\-_]+:[\\w\\d\\-\\._]+?@/g;\n\ninterface LocalizationHelperProps {\n getLocalizedString: (key: string) => string;\n}\n\n/** @internal */\nexport class LocalizationHelper {\n private _getLocalizedString: (key: string) => string;\n\n constructor(props: LocalizationHelperProps) {\n this._getLocalizedString = props.getLocalizedString;\n }\n\n public getLocalizedString(text: string) {\n return text.replace(KEY_PATTERN, (key) => this._getLocalizedString(key.replace(/^@|@$/g, \"\")));\n }\n\n public getLocalizedNodes(nodes: Node[]): Node[] {\n return nodes.map((n) => this.getLocalizedNode(n));\n }\n\n public getLocalizedNodePathElement(npe: NodePathElement): NodePathElement {\n return {\n ...npe,\n node: this.getLocalizedNode(npe.node),\n children: npe.children.map((c) => this.getLocalizedNodePathElement(c)),\n };\n }\n\n public getLocalizedDisplayValueGroup(group: DisplayValueGroup): DisplayValueGroup {\n return {\n ...group,\n displayValue: this.getLocalizedDisplayValue(group.displayValue),\n };\n }\n\n public getLocalizedLabelDefinition(labelDefinition: LabelDefinition): LabelDefinition {\n const getLocalizedComposite = (compositeValue: LabelCompositeValue) => ({\n ...compositeValue,\n values: compositeValue.values.map((value) => this.getLocalizedLabelDefinition(value)),\n });\n\n if (labelDefinition.typeName === COMPOSITE_LABEL_DEFINITION_TYPENAME) {\n return {\n ...labelDefinition,\n rawValue: getLocalizedComposite(labelDefinition.rawValue as LabelCompositeValue),\n };\n }\n if (labelDefinition.typeName === \"string\") {\n return {\n ...labelDefinition,\n rawValue: this.getLocalizedString(labelDefinition.rawValue as string),\n displayValue: this.getLocalizedString(labelDefinition.displayValue),\n };\n }\n return labelDefinition;\n }\n\n public getLocalizedLabelDefinitions(labelDefinitions: LabelDefinition[]) {\n return labelDefinitions.map((labelDefinition) => this.getLocalizedLabelDefinition(labelDefinition));\n }\n\n public getLocalizedContentDescriptor(descriptor: Descriptor) {\n const clone = new Descriptor(descriptor);\n clone.fields.forEach((field) => this.getLocalizedContentField(field));\n clone.categories.forEach((category) => this.getLocalizedCategoryDescription(category));\n return clone;\n }\n\n public getLocalizedContentItems(items: Item[]): Item[] {\n return items.map((item) => this.getLocalizedContentItem(item));\n }\n\n public getLocalizedContent(content: Content): Content {\n return new Content(this.getLocalizedContentDescriptor(content.descriptor), this.getLocalizedContentItems(content.contentSet));\n }\n\n public getLocalizedElementProperties(elem: ElementProperties): ElementProperties {\n return {\n ...elem,\n label: this.getLocalizedString(elem.label),\n };\n }\n\n // warning: this function mutates the item\n private getLocalizedContentItem(item: Item): Item {\n item.label = this.getLocalizedLabelDefinition(item.label);\n item.values = Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\n item.displayValues = Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\n return item;\n }\n\n private getLocalizedRawValue(value: Value): Value {\n if (typeof value === \"string\") {\n return this.getLocalizedString(value);\n }\n if (Value.isNavigationValue(value)) {\n return {\n ...value,\n label: this.getLocalizedLabelDefinition(value.label),\n };\n }\n if (Value.isNestedContent(value)) {\n return value.map((item) => ({\n ...item,\n values: Object.entries(item.values).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {}),\n displayValues: Object.entries(item.displayValues).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {}),\n }));\n }\n if (Value.isArray(value)) {\n return value.map((v) => this.getLocalizedRawValue(v));\n }\n if (Value.isMap(value)) {\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedRawValue(v) }), {});\n }\n return value;\n }\n\n // warning: this function mutates the field\n private getLocalizedContentField<TField extends Field>(field: TField) {\n field.label = this.getLocalizedString(field.label);\n if (field.isPropertiesField()) {\n if (field.isStructPropertiesField()) {\n field.memberFields = field.memberFields.map((m) => this.getLocalizedContentField(m));\n } else if (field.isArrayPropertiesField()) {\n field.itemsField = this.getLocalizedContentField(field.itemsField);\n }\n } else if (field.isNestedContentField()) {\n field.nestedFields = field.nestedFields.map((m) => this.getLocalizedContentField(m));\n }\n return field;\n }\n\n // warning: this function mutates the category\n private getLocalizedCategoryDescription(category: CategoryDescription) {\n category.label = this.getLocalizedString(category.label);\n category.description = this.getLocalizedString(category.description);\n return category;\n }\n\n public getLocalizedNode(node: Node): Node {\n return {\n ...node,\n label: this.getLocalizedLabelDefinition(node.label),\n ...(node.description ? { description: this.getLocalizedString(node.description) } : undefined),\n };\n }\n\n private getLocalizedDisplayValue(value: DisplayValue): DisplayValue {\n if (typeof value === \"undefined\") {\n return undefined;\n }\n if (typeof value === \"string\") {\n return this.getLocalizedString(value);\n }\n if (DisplayValue.isArray(value)) {\n return value.map((v) => this.getLocalizedDisplayValue(v));\n }\n return Object.entries(value).reduce((o, [k, v]) => ({ ...o, [k]: this.getLocalizedDisplayValue(v) }), {});\n }\n}\n"]}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module Core
|
|
3
3
|
*/
|
|
4
|
-
import { RulesetVariableJSON } from "./RulesetVariables";
|
|
4
|
+
import { RulesetVariableJSON } from "./RulesetVariables.js";
|
|
5
5
|
/** @internal */
|
|
6
6
|
export declare const PRESENTATION_IPC_CHANNEL_NAME = "itwinjs-presentation/ipc-interface";
|
|
7
|
-
|
|
8
|
-
export interface CommonIpcParams {
|
|
7
|
+
interface CommonIpcParams {
|
|
9
8
|
clientId: string;
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
export interface SetRulesetVariableParams<TVariable> extends CommonIpcParams {
|
|
10
|
+
interface SetRulesetVariableParams<TVariable> extends CommonIpcParams {
|
|
13
11
|
rulesetId: string;
|
|
14
12
|
variable: TVariable;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
export interface UnsetRulesetVariableParams extends CommonIpcParams {
|
|
14
|
+
interface UnsetRulesetVariableParams extends CommonIpcParams {
|
|
18
15
|
rulesetId: string;
|
|
19
16
|
variableId: string;
|
|
20
17
|
}
|
|
@@ -25,4 +22,12 @@ export interface PresentationIpcInterface {
|
|
|
25
22
|
/** Unsets ruleset variable value. */
|
|
26
23
|
unsetRulesetVariable(params: UnsetRulesetVariableParams): Promise<void>;
|
|
27
24
|
}
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare enum PresentationIpcEvents {
|
|
27
|
+
/**
|
|
28
|
+
* ID of an event that's emitted when backend detects changes in presented data.
|
|
29
|
+
*/
|
|
30
|
+
Update = "presentation.onUpdate"
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
28
33
|
//# sourceMappingURL=PresentationIpcInterface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationIpcInterface.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PresentationIpcInterface.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,uCAAuC,CAAC;AAElF,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,wBAAwB,CAAC,SAAS,CAAE,SAAQ,eAAe;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,UAAU,0BAA2B,SAAQ,eAAe;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,wBAAwB;IACvC,mCAAmC;IACnC,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzF,qCAAqC;IACrC,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,gBAAgB;AAChB,oBAAY,qBAAqB;IAC/B;;OAEG;IACH,MAAM,0BAA0B;CACjC"}
|
|
@@ -7,7 +7,15 @@
|
|
|
7
7
|
* @module Core
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.PRESENTATION_IPC_CHANNEL_NAME = void 0;
|
|
10
|
+
exports.PresentationIpcEvents = exports.PRESENTATION_IPC_CHANNEL_NAME = void 0;
|
|
11
11
|
/** @internal */
|
|
12
12
|
exports.PRESENTATION_IPC_CHANNEL_NAME = "itwinjs-presentation/ipc-interface";
|
|
13
|
+
/** @internal */
|
|
14
|
+
var PresentationIpcEvents;
|
|
15
|
+
(function (PresentationIpcEvents) {
|
|
16
|
+
/**
|
|
17
|
+
* ID of an event that's emitted when backend detects changes in presented data.
|
|
18
|
+
*/
|
|
19
|
+
PresentationIpcEvents["Update"] = "presentation.onUpdate";
|
|
20
|
+
})(PresentationIpcEvents || (exports.PresentationIpcEvents = PresentationIpcEvents = {}));
|
|
13
21
|
//# sourceMappingURL=PresentationIpcInterface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresentationIpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,gBAAgB;AACH,QAAA,6BAA6B,GAAG,oCAAoC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"PresentationIpcInterface.js","sourceRoot":"","sources":["../../../src/presentation-common/PresentationIpcInterface.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAIH,gBAAgB;AACH,QAAA,6BAA6B,GAAG,oCAAoC,CAAC;AAyBlF,gBAAgB;AAChB,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,yDAAgC,CAAA;AAClC,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { RulesetVariableJSON } from \"./RulesetVariables.js\";\n\n/** @internal */\nexport const PRESENTATION_IPC_CHANNEL_NAME = \"itwinjs-presentation/ipc-interface\";\n\ninterface CommonIpcParams {\n clientId: string;\n}\n\ninterface SetRulesetVariableParams<TVariable> extends CommonIpcParams {\n rulesetId: string;\n variable: TVariable;\n}\n\ninterface UnsetRulesetVariableParams extends CommonIpcParams {\n rulesetId: string;\n variableId: string;\n}\n\n/** @internal */\nexport interface PresentationIpcInterface {\n /** Sets ruleset variable value. */\n setRulesetVariable(params: SetRulesetVariableParams<RulesetVariableJSON>): Promise<void>;\n\n /** Unsets ruleset variable value. */\n unsetRulesetVariable(params: UnsetRulesetVariableParams): Promise<void>;\n}\n\n/** @internal */\nexport enum PresentationIpcEvents {\n /**\n * ID of an event that's emitted when backend detects changes in presented data.\n */\n Update = \"presentation.onUpdate\",\n}\n"]}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BeEvent, Id64String } from "@itwin/core-bentley";
|
|
5
5
|
import { UnitSystemKey } from "@itwin/core-quantity";
|
|
6
|
-
import { Descriptor, SelectionInfo } from "./content/Descriptor";
|
|
7
|
-
import { FieldDescriptor } from "./content/Fields";
|
|
8
|
-
import { Item } from "./content/Item";
|
|
9
|
-
import { InstanceKey } from "./EC";
|
|
10
|
-
import { ElementProperties } from "./ElementProperties";
|
|
11
|
-
import { InstanceFilterDefinition } from "./InstanceFilterDefinition";
|
|
12
|
-
import { Ruleset } from "./rules/Ruleset";
|
|
13
|
-
import { RulesetVariable } from "./RulesetVariables";
|
|
14
|
-
import { SelectionScopeProps } from "./selection/SelectionScope";
|
|
6
|
+
import { Descriptor, SelectionInfo } from "./content/Descriptor.js";
|
|
7
|
+
import { FieldDescriptor } from "./content/Fields.js";
|
|
8
|
+
import { Item } from "./content/Item.js";
|
|
9
|
+
import { InstanceKey } from "./EC.js";
|
|
10
|
+
import { ElementProperties } from "./ElementProperties.js";
|
|
11
|
+
import { InstanceFilterDefinition } from "./InstanceFilterDefinition.js";
|
|
12
|
+
import { Ruleset } from "./rules/Ruleset.js";
|
|
13
|
+
import { RulesetVariable } from "./RulesetVariables.js";
|
|
14
|
+
import { SelectionScopeProps } from "./selection/SelectionScope.js";
|
|
15
15
|
/**
|
|
16
16
|
* A generic request options type used for both hierarchy and content requests.
|
|
17
17
|
* @public
|
|
@@ -26,12 +26,6 @@ export interface RequestOptions<TIModel> {
|
|
|
26
26
|
* unit is used if unit system is not specified.
|
|
27
27
|
*/
|
|
28
28
|
unitSystem?: UnitSystemKey;
|
|
29
|
-
/**
|
|
30
|
-
* Expected form of response. This property is set automatically on newer frontends.
|
|
31
|
-
* `unparsed-json` — deliver response from native addon without parsing it.
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
transport?: "unparsed-json";
|
|
35
29
|
}
|
|
36
30
|
/**
|
|
37
31
|
* Options for requests that require presentation ruleset. Not
|
|
@@ -175,16 +169,10 @@ export interface SingleElementPropertiesRequestOptions<TIModel, TParsedContent =
|
|
|
175
169
|
contentParser?: (descriptor: Descriptor, item: Item) => TParsedContent;
|
|
176
170
|
}
|
|
177
171
|
/**
|
|
178
|
-
*
|
|
172
|
+
* Base request type for multiple elements properties requests.
|
|
179
173
|
* @public
|
|
180
174
|
*/
|
|
181
|
-
export interface
|
|
182
|
-
/**
|
|
183
|
-
* Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes
|
|
184
|
-
* are used. Classes should be specified in one of these formats: "<schema name or alias>.<class_name>" or
|
|
185
|
-
* "<schema name or alias>:<class_name>".
|
|
186
|
-
*/
|
|
187
|
-
elementClasses?: string[];
|
|
175
|
+
export interface MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent = ElementProperties> extends RequestOptions<TIModel> {
|
|
188
176
|
/**
|
|
189
177
|
* Content parser that creates a result item based on given content descriptor and content item. Defaults
|
|
190
178
|
* to a parser that creates [[ElementProperties]] objects.
|
|
@@ -197,6 +185,33 @@ export interface MultiElementPropertiesRequestOptions<TIModel, TParsedContent =
|
|
|
197
185
|
*/
|
|
198
186
|
batchSize?: number;
|
|
199
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Request type for multiple elements properties requests, where elements are specified by class.
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
export interface MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent = ElementProperties> extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {
|
|
193
|
+
/**
|
|
194
|
+
* Classes of the elements to get properties for. If [[elementClasses]] is `undefined`, all classes
|
|
195
|
+
* are used. Classes should be specified in one of these formats: "<schema name or alias>.<class_name>" or
|
|
196
|
+
* "<schema name or alias>:<class_name>".
|
|
197
|
+
*/
|
|
198
|
+
elementClasses?: string[];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Request type for multiple elements properties requests, where elements are specified by element id.
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
export interface MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent = ElementProperties> extends MultiElementPropertiesBaseRequestOptions<TIModel, TParsedContent> {
|
|
205
|
+
/**
|
|
206
|
+
* A list of `bis.Element` IDs to get properties for.
|
|
207
|
+
*/
|
|
208
|
+
elementIds?: Id64String[];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Request type for multiple elements properties requests.
|
|
212
|
+
* @public
|
|
213
|
+
*/
|
|
214
|
+
export type MultiElementPropertiesRequestOptions<TIModel, TParsedContent = ElementProperties> = MultiElementPropertiesByClassRequestOptions<TIModel, TParsedContent> | MultiElementPropertiesByIdsRequestOptions<TIModel, TParsedContent>;
|
|
200
215
|
/**
|
|
201
216
|
* Request type for content instance keys' requests.
|
|
202
217
|
* @public
|
|
@@ -229,19 +244,19 @@ export interface DisplayLabelsRequestOptions<TIModel, TInstanceKey> extends Requ
|
|
|
229
244
|
/**
|
|
230
245
|
* Request options used for selection scope related requests
|
|
231
246
|
* @public
|
|
247
|
+
* @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.
|
|
232
248
|
*/
|
|
233
249
|
export interface SelectionScopeRequestOptions<TIModel> extends RequestOptions<TIModel> {
|
|
234
250
|
}
|
|
235
251
|
/**
|
|
236
252
|
* Request options used for calculating selection based on given instance keys and selection scope.
|
|
237
253
|
* @public
|
|
254
|
+
* @deprecated in 5.0. Use `computeSelection` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.
|
|
238
255
|
*/
|
|
239
256
|
export interface ComputeSelectionRequestOptions<TIModel> extends RequestOptions<TIModel> {
|
|
240
257
|
elementIds: Id64String[];
|
|
241
258
|
scope: SelectionScopeProps;
|
|
242
259
|
}
|
|
243
|
-
/** @internal */
|
|
244
|
-
export declare function isComputeSelectionRequestOptions<TIModel>(options: ComputeSelectionRequestOptions<TIModel> | SelectionScopeRequestOptions<TIModel>): options is ComputeSelectionRequestOptions<TIModel>;
|
|
245
260
|
/**
|
|
246
261
|
* Data structure for comparing a hierarchy after ruleset or ruleset variable changes.
|
|
247
262
|
* @public
|