@itwin/presentation-common 5.3.0-dev.6 → 5.3.0-dev.8
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 +11 -1
- package/Ruleset.schema.json +18 -18
- package/lib/assets/locales/en/Presentation.json +19 -19
- 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.js.map +1 -1
- package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
- package/lib/cjs/presentation-common/Error.js.map +1 -1
- package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/KeySet.d.ts +4 -4
- package/lib/cjs/presentation-common/KeySet.js +3 -3
- package/lib/cjs/presentation-common/KeySet.js.map +1 -1
- package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +5 -5
- package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +4 -4
- package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/cjs/presentation-common/Update.d.ts +7 -7
- package/lib/cjs/presentation-common/Update.js.map +1 -1
- package/lib/cjs/presentation-common/Utils.js.map +1 -1
- package/lib/cjs/presentation-common/content/Category.js.map +1 -1
- package/lib/cjs/presentation-common/content/Content.js.map +1 -1
- package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/presentation-common/content/Item.js.map +1 -1
- package/lib/cjs/presentation-common/content/Property.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -1
- package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.d.ts +10 -10
- package/lib/cjs/presentation-common/hierarchy/Key.js +2 -2
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.d.ts +2 -2
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +2 -2
- package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +9 -9
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +2 -2
- package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +4 -4
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +6 -6
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +2 -2
- 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.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +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.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/cjs/presentation-common-internal.js.map +1 -1
- package/lib/cjs/presentation-common.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
- package/lib/esm/presentation-common/Error.js.map +1 -1
- package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
- package/lib/esm/presentation-common/KeySet.d.ts +4 -4
- package/lib/esm/presentation-common/KeySet.js +3 -3
- package/lib/esm/presentation-common/KeySet.js.map +1 -1
- package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
- package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
- package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
- package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +5 -5
- package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
- package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +4 -4
- package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
- package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
- package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
- package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
- package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
- package/lib/esm/presentation-common/Update.d.ts +7 -7
- package/lib/esm/presentation-common/Update.js.map +1 -1
- package/lib/esm/presentation-common/Utils.js.map +1 -1
- package/lib/esm/presentation-common/content/Category.js.map +1 -1
- package/lib/esm/presentation-common/content/Content.js.map +1 -1
- package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/presentation-common/content/Item.js.map +1 -1
- package/lib/esm/presentation-common/content/Property.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -1
- package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.d.ts +10 -10
- package/lib/esm/presentation-common/hierarchy/Key.js +2 -2
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.d.ts +2 -2
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +2 -2
- package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
- package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
- package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
- package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
- package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +9 -9
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js +2 -2
- package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +4 -4
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +6 -6
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +2 -2
- 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.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +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.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
- package/lib/esm/presentation-common-internal.js.map +1 -1
- package/lib/esm/presentation-common.js.map +1 -1
- package/lib/public/locales/en/Presentation.json +19 -19
- package/package.json +10 -10
package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer } from "
|
|
|
8
8
|
*
|
|
9
9
|
* @see [Instance nodes of specific classes specification reference documentation page]($docs/presentation/hierarchies/InstanceNodesOfSpecificClasses.md)
|
|
10
10
|
* @public
|
|
11
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
11
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
12
12
|
* package for creating hierarchies.
|
|
13
13
|
*/
|
|
14
14
|
export interface InstanceNodesOfSpecificClassesSpecification extends ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceNodesOfSpecificClassesSpecification.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"InstanceNodesOfSpecificClassesSpecification.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { MultiSchemaClassesSpecification } from \"../ClassSpecifications.js\";\nimport { ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer } from \"./ChildNodeSpecification.js\";\n\n/**\n * Returns nodes for instances of specific ECClasses.\n *\n * @see [Instance nodes of specific classes specification reference documentation page]($docs/presentation/hierarchies/InstanceNodesOfSpecificClasses.md)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface InstanceNodesOfSpecificClassesSpecification extends ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer {\n /** Used for serializing to JSON. */\n specType: \"InstanceNodesOfSpecificClasses\";\n\n /**\n * Defines a set of [multi schema classes]($docs/presentation/MultiSchemaClassesSpecification.md) that\n * specify which ECClasses need to be selected to form the result.\n */\n classes: MultiSchemaClassesSpecification | MultiSchemaClassesSpecification[];\n\n /**\n * Defines a set of [multi schema classes]($docs/presentation/MultiSchemaClassesSpecification.md) that\n * prevents specified ECClasses and subclasses from being selected by [[classes]] attribute.\n */\n excludedClasses?: MultiSchemaClassesSpecification | MultiSchemaClassesSpecification[];\n\n /**\n * Specifies an [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#instance-filter) for filtering\n * instances of ECClasses specified through the [[classes]] attribute.\n */\n instanceFilter?: string;\n}\n"]}
|
|
@@ -12,7 +12,7 @@ import { SubCondition } from "./SubCondition.js";
|
|
|
12
12
|
*
|
|
13
13
|
* @see [Hierarchies reference documentation page]($docs/presentation/hierarchies/index.md)
|
|
14
14
|
* @public
|
|
15
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
15
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
16
16
|
* package for creating hierarchies.
|
|
17
17
|
*/
|
|
18
18
|
export interface NavigationRuleBase extends RuleBase {
|
|
@@ -48,7 +48,7 @@ export interface NavigationRuleBase extends RuleBase {
|
|
|
48
48
|
*
|
|
49
49
|
* @see [Hierarchies reference documentation page]($docs/presentation/hierarchies/index.md)
|
|
50
50
|
* @public
|
|
51
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
51
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
52
52
|
* package for creating hierarchies.
|
|
53
53
|
*/
|
|
54
54
|
export type NavigationRule = RootNodeRule | ChildNodeRule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/NavigationRule.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"NavigationRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/NavigationRule.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { CustomizationRule } from \"../customization/CustomizationRule.js\";\nimport { RuleBase } from \"../Rule.js\";\nimport { ChildNodeRule } from \"./ChildNodeRule.js\";\nimport { ChildNodeSpecification } from \"./ChildNodeSpecification.js\";\nimport { RootNodeRule } from \"./RootNodeRule.js\";\nimport { SubCondition } from \"./SubCondition.js\";\n\n/**\n * Base class for all [[NavigationRule]] implementations.\n *\n * @see [Hierarchies reference documentation page]($docs/presentation/hierarchies/index.md)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NavigationRuleBase extends RuleBase {\n /**\n * Defines a condition which needs to be met in order for the rule to be used. The condition is an\n * [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#rule-condition) which has to evaluate\n * to a boolean value.\n */\n condition?: string;\n\n /**\n * A list of hierarchy specifications that define what nodes are going to be returned.\n */\n specifications?: ChildNodeSpecification[];\n\n /**\n * A list of [customization rules]($docs/presentation/hierarchies/index.md#hierarchy-customization) that\n * apply only to nodes produced by this rule.\n */\n customizationRules?: CustomizationRule[];\n\n /**\n * A list of sub-rules which share *placement attributes* and\n * [nested customization rules]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-customizationrules)\n * of the hierarchy rule. This means the attributes of hierarchy rule are still in effect and the sub-rules\n * can add additional condition of their own.\n */\n subConditions?: SubCondition[];\n\n /**\n * Stop processing rules that have lower priority. Used in cases when recursion suppression is needed.\n */\n stopFurtherProcessing?: boolean;\n}\n\n/**\n * Navigation rules are used to define hierarchies displayed in tree components.\n *\n * @see [Hierarchies reference documentation page]($docs/presentation/hierarchies/index.md)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport type NavigationRule = RootNodeRule | ChildNodeRule;\n"]}
|
|
@@ -8,7 +8,7 @@ import { RuleBase } from "../Rule.js";
|
|
|
8
8
|
*
|
|
9
9
|
* @see [Node artifacts rule reference documentation page]($docs/presentation/hierarchies/NodeArtifactsRule.md)
|
|
10
10
|
* @public
|
|
11
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
11
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
12
12
|
* package for creating hierarchies.
|
|
13
13
|
*/
|
|
14
14
|
export interface NodeArtifactsRule extends RuleBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeArtifactsRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/NodeArtifactsRule.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"NodeArtifactsRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/NodeArtifactsRule.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { RuleBase } from \"../Rule.js\";\n\n/**\n * Node artifacts rules are used to create and assign artifacts to specific nodes. The artifacts can be\n * accessed when evaluating parent node's `hideExpression` to decide whether it should be hidden or not.\n *\n * @see [Node artifacts rule reference documentation page]($docs/presentation/hierarchies/NodeArtifactsRule.md)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface NodeArtifactsRule extends RuleBase {\n /** Used for serializing to JSON. */\n ruleType: \"NodeArtifacts\";\n\n /**\n * Specifies an [ECExpression]($docs/presentation/customization/ECExpressions.md#rule-condition) that\n * allows applying node artifacts based on evaluation result, e.g. by some property of the parent node.\n */\n condition?: string;\n\n /**\n * A map of [ECExpressions]($docs/presentation/hierarchies/ECExpressions.md#specification) whose evaluation results\n * are used as artifact values.\n */\n items: { [key: string]: string };\n}\n"]}
|
|
@@ -9,7 +9,7 @@ import { ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer } from "
|
|
|
9
9
|
*
|
|
10
10
|
* @see [Related instance nodes specification reference documentation page]($docs/presentation/hierarchies/RelatedInstanceNodes.md)
|
|
11
11
|
* @public
|
|
12
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
12
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
13
13
|
* package for creating hierarchies.
|
|
14
14
|
*/
|
|
15
15
|
export interface RelatedInstanceNodesSpecification extends ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer {
|
package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedInstanceNodesSpecification.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"RelatedInstanceNodesSpecification.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { RepeatableRelationshipPathSpecification } from \"../RelationshipPathSpecification.js\";\nimport { ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer } from \"./ChildNodeSpecification.js\";\n\n/**\n * Produces ECInstance nodes that are related to some source ECInstance. The source instance is determined\n * by traversing the hierarchy upwards until an ECInstance node is encountered.\n *\n * @see [Related instance nodes specification reference documentation page]($docs/presentation/hierarchies/RelatedInstanceNodes.md)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface RelatedInstanceNodesSpecification extends ChildNodeSpecificationBase, DefaultGroupingPropertiesContainer {\n /** Used for serializing to JSON. */\n specType: \"RelatedInstanceNodes\";\n\n /**\n * Specifies a chain of [relationship path specifications]($docs/presentation/RepeatableRelationshipPathSpecification.md)\n * that forms a path from a source instance to the output instances. When this array is empty, the specification produces\n * no results.\n */\n relationshipPaths: RepeatableRelationshipPathSpecification[];\n\n /**\n * Specifies an [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#instance-filter) for filtering\n * instances of ECClasses targeted through the [[relationshipPaths]] attribute.\n */\n instanceFilter?: string;\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { NavigationRuleBase } from "./NavigationRule.js";
|
|
|
7
7
|
*
|
|
8
8
|
* @see [Root node rule reference documentation page]($docs/presentation/hierarchies/RootNodeRule.md)
|
|
9
9
|
* @public
|
|
10
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
10
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
11
11
|
* package for creating hierarchies.
|
|
12
12
|
*/
|
|
13
13
|
export interface RootNodeRule extends NavigationRuleBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RootNodeRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/RootNodeRule.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"RootNodeRule.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/RootNodeRule.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { NavigationRuleBase } from \"./NavigationRule.js\";\n\n/**\n * Root node rules are used to define nodes that are displayed at the root hierarchy level.\n *\n * @see [Root node rule reference documentation page]($docs/presentation/hierarchies/RootNodeRule.md)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface RootNodeRule extends NavigationRuleBase {\n /** Used for serializing to JSON. */\n ruleType: \"RootNodes\";\n\n /** Tells the library to assign produced nodes a flag, indicating that they should be automatically expanded. */\n autoExpand?: boolean;\n}\n"]}
|
|
@@ -11,7 +11,7 @@ import { ChildNodeSpecification } from "./ChildNodeSpecification.js";
|
|
|
11
11
|
*
|
|
12
12
|
* @see [Sub-conditions reference documentation section]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-subconditions)
|
|
13
13
|
* @public
|
|
14
|
-
* @deprecated in 5.2. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
14
|
+
* @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)
|
|
15
15
|
* package for creating hierarchies.
|
|
16
16
|
*/
|
|
17
17
|
export interface SubCondition {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubCondition.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/SubCondition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"SubCondition.js","sourceRoot":"","sources":["../../../../../src/presentation-common/rules/hierarchy/SubCondition.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module PresentationRules\n */\n\nimport { RequiredSchemaSpecification } from \"../SchemasSpecification.js\";\nimport { ChildNodeSpecification } from \"./ChildNodeSpecification.js\";\n\n/**\n * This is a sub-rule which shares *placement attributes* and\n * [nested customization rules]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-customizationrules)\n * of the hierarchy rule. This means the attributes of hierarchy rule are still in effect and the sub-rules\n * can add additional condition of their own.\n *\n * @see [Sub-conditions reference documentation section]($docs/presentation/hierarchies/ChildNodeRule.md#attribute-subconditions)\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface SubCondition {\n /**\n * Defines a condition which needs to be met in order for the rule to be used. The condition is an\n * [ECExpression]($docs/presentation/hierarchies/ECExpressions.md#rule-condition) which has to evaluate\n * to a boolean value.\n */\n condition?: string;\n\n /**\n * Specifications that define [ECSchema requirements]($docs/presentation/RequiredSchemaSpecification.md) for\n * the rule to take effect.\n */\n requiredSchemas?: RequiredSchemaSpecification[];\n\n /**\n * A list of nested sub-rules which share *placement attributes* of this sub-condition. This means the\n * attributes of this sub-condition are still in effect and the sub-rules can add additional condition\n * of their own.\n */\n subConditions?: SubCondition[];\n\n /** A list of hierarchy specifications that define what nodes are going to be returned. */\n specifications?: ChildNodeSpecification[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectionScope.js","sourceRoot":"","sources":["../../../../src/presentation-common/selection/SelectionScope.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"SelectionScope.js","sourceRoot":"","sources":["../../../../src/presentation-common/selection/SelectionScope.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module UnifiedSelection\n */\n\n/**\n * Data structure that describes a [selection scope]($docs/presentation/unified-selection/index#selection-scopes).\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `Props<typeof computeSelection>[\"scope\"]` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface SelectionScope {\n /** Unique ID of the selection scope */\n id: string;\n /** Label */\n label: string;\n /** Description */\n description?: string;\n}\n\n/**\n * A data structure that defines properties for applying element selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `Props<typeof computeSelection>[\"scope\"]` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport interface ElementSelectionScopeProps {\n /** Identifies this as the \"element\" selection scope */\n id: \"element\";\n /**\n * Specifies how far \"up\" we should walk to find the target element. When not specified or `0`,\n * the target element matches the request element. When `1`, the target element matches the direct parent element.\n * When `2`, the target element is parent of the parent element and so on. In all situations when this is `> 0`,\n * we're not walking further than the last existing element, for example when `ancestorLevel = 1` (direct parent\n * element is requested), but the request element doesn't have a parent, the request element is returned as the result.\n */\n ancestorLevel?: number;\n}\n\n/**\n * A data structure that defines properties for applying a selection scope.\n * @public\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `Props<typeof computeSelection>[\"scope\"]` from [@itwin/unified-selection](https://github.com/iTwin/presentation/blob/master/packages/unified-selection/README.md#selection-scopes) package instead.\n */\nexport type SelectionScopeProps = ElementSelectionScopeProps | { id: string };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common-internal.js","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,6IAA6I;AAC7I,qHAAqH;AAErH,iGAAmJ;AAA1I,4IAAA,6BAA6B,OAAA;AAAE,oIAAA,qBAAqB,OAAA;AAC7D,uEAAkH;AAAzG,8HAAA,4BAA4B,OAAA;AAAE,8HAAA,4BAA4B,OAAA;AACnE,mFAAoF;AAA3E,8HAAA,sBAAsB,OAAA;AAC/B,2DAA8G;AAArG,2HAAA,+BAA+B,OAAA;AAAE,uHAAA,2BAA2B,OAAA;AACrE,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qGAA8G;AAArG,wJAAA,uCAAuC,OAAA;AAChD,qGAA0H;AAAjH,6HAAA,gBAAgB,OAAA;AAAE,0IAAA,6BAA6B,OAAA;AACxD,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qEAAwE;AAA/D,kHAAA,iBAAiB,OAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"presentation-common-internal.js","sourceRoot":"","sources":["../../src/presentation-common-internal.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,6IAA6I;AAC7I,qHAAqH;AAErH,iGAAmJ;AAA1I,4IAAA,6BAA6B,OAAA;AAAE,oIAAA,qBAAqB,OAAA;AAC7D,uEAAkH;AAAzG,8HAAA,4BAA4B,OAAA;AAAE,8HAAA,4BAA4B,OAAA;AACnE,mFAAoF;AAA3E,8HAAA,sBAAsB,OAAA;AAC/B,2DAA8G;AAArG,2HAAA,+BAA+B,OAAA;AAAE,uHAAA,2BAA2B,OAAA;AACrE,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qGAA8G;AAArG,wJAAA,uCAAuC,OAAA;AAChD,qGAA0H;AAAjH,6HAAA,gBAAgB,OAAA;AAAE,0IAAA,6BAA6B,OAAA;AACxD,qFAAiF;AAAxE,2HAAA,kBAAkB,OAAA;AAC3B,qEAAwE;AAA/D,kHAAA,iBAAiB,OAAA","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\n// WARNING: This barrel file exports internal APIs only for use by `@itwin/presentation-backend` and `@itwin/presentation-frontend` packages.\n// They should not be used outside of these packages. These APIs may be broken or removed at any time without notice.\n\nexport { PRESENTATION_IPC_CHANNEL_NAME, PresentationIpcEvents, PresentationIpcInterface } from \"./presentation-common/PresentationIpcInterface.js\";\nexport { combineDiagnosticsSeverities, compareDiagnosticsSeverities } from \"./presentation-common/Diagnostics.js\";\nexport { buildElementProperties } from \"./presentation-common/ElementProperties.js\";\nexport { createCancellableTimeoutPromise, deepReplaceNullsToUndefined } from \"./presentation-common/Utils.js\";\nexport { LocalizationHelper } from \"./presentation-common/LocalizationHelper.js\";\nexport { isSingleElementPropertiesRequestOptions } from \"./presentation-common/PresentationManagerOptions.js\";\nexport { ContentFormatter, ContentPropertyValueFormatter } from \"./presentation-common/content/PropertyValueFormatter.js\";\nexport { RpcRequestsHandler } from \"./presentation-common/RpcRequestsHandler.js\";\nexport { AsyncTasksTracker } from \"./presentation-common/AsyncTasks.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,uEAW8C;AAD5C,qHAAA,mBAAmB,OAAA;AAErB,qDAyBqC;AAtBnC,oGAAA,WAAW,OAAA;AAMX,+GAAA,sBAAsB,OAAA;AAEtB,qGAAA,YAAY,OAAA;AAMZ,yGAAA,gBAAgB,OAAA;AAEhB,iIAAA,wCAAwC,OAAA;AAExC,yGAAA,gBAAgB,OAAA;AAKlB,2DAAuF;AAA9E,8GAAA,kBAAkB,OA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,eAAe,OAAA;AACf,0HAAA,mBAAmB,OAAA;AACnB,6HAAA,sBAAsB,OAAA;AACtB,wHAAA,iBAAiB,OAAA;AACjB,wHAAA,iBAAiB,OAAA;AACjB,8HAAA,uBAAuB,OAAA;AAsBzB,iEAgBgD;AAf9C,2GAAA,iBAAiB,OAAA;AACjB,iGAAA,OAAO,OAAA;AAkBT;;;;;GAKG;AACH,kFAAkF;AAClF,yFAAuE;AACvE,kGAAgF;AAChF,mGAAiF;AACjF,iHAA+F;AAC/F,uHAAqG;AACrG,0FAAwE;AACxE,6FAA2E;AAC3E,6GAA2F;AAC3F,wFAAsE;AACtE,wFAAsE;AACtE,iGAA+E;AAC/E,gGAA8E;AAC9E,4FAA0E;AAC1E,qGAAmF;AACnF,2FAAyE;AACzE,wHAAsG;AACtG,8GAA4F;AAC5F,qFAAmE;AACnE,8FAA4E;AAC5E,+FAA6E;AAC7E,4GAA0F;AAC1F,yGAAuF;AACvF,qHAAmG;AACnG,mGAAiF;AACjF,iHAA+F;AAC/F,gHAA8F;AAC9F,+GAA6F;AAC7F,kHAAgG;AAChG,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,+FAA6E;AAC7E,sEAAoD;AACpD,yEAAuD;AACvD,sFAAoE;AACpE,2EAAyD","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/**\r\n * @module Core\r\n *\r\n * @docs-group-description Core\r\n * Common types used all across Presentation packages.\r\n */\r\nexport {\r\n DiagnosticsLoggerSeverity,\r\n Diagnostics,\r\n ClientDiagnostics,\r\n DiagnosticsOptions,\r\n ClientDiagnosticsHandler,\r\n ClientDiagnosticsOptions,\r\n ClientDiagnosticsAttribute,\r\n DiagnosticsLogMessage,\r\n DiagnosticsScopeLogs,\r\n DiagnosticsLogEntry,\r\n} from \"./presentation-common/Diagnostics.js\";\r\nexport {\r\n ClassId,\r\n InstanceId,\r\n InstanceKey,\r\n ClassInfo,\r\n CompressedClassInfoJSON,\r\n EnumerationChoice,\r\n EnumerationInfo,\r\n KindOfQuantityInfo,\r\n NavigationPropertyInfo,\r\n NavigationPropertyInfoJSON,\r\n PropertyInfo,\r\n PropertyValueConstraints,\r\n StringPropertyValueConstraints,\r\n NumericPropertyValueConstraints,\r\n ArrayPropertyValueConstraints,\r\n PropertyInfoJSON,\r\n RelatedClassInfo,\r\n RelatedClassInfoJSON,\r\n RelatedClassInfoWithOptionalRelationship,\r\n RelatedClassInfoWithOptionalRelationshipJSON,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n StrippedRelatedClassInfo,\r\n StrippedRelationshipPath,\r\n} from \"./presentation-common/EC.js\";\r\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\r\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\r\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\r\nexport {\r\n RequestOptions,\r\n RequestOptionsWithRuleset,\r\n HierarchyRequestOptions,\r\n HierarchyLevelDescriptorRequestOptions,\r\n FilterByInstancePathsHierarchyRequestOptions,\r\n FilterByTextHierarchyRequestOptions,\r\n ContentSourcesRequestOptions,\r\n ContentDescriptorRequestOptions,\r\n ContentRequestOptions,\r\n DistinctValuesRequestOptions,\r\n ElementPropertiesRequestOptions,\r\n SingleElementPropertiesRequestOptions,\r\n MultiElementPropertiesByClassRequestOptions,\r\n MultiElementPropertiesByIdsRequestOptions,\r\n MultiElementPropertiesRequestOptions,\r\n ContentInstanceKeysRequestOptions,\r\n DisplayLabelRequestOptions,\r\n DisplayLabelsRequestOptions,\r\n SelectionScopeRequestOptions,\r\n ComputeSelectionRequestOptions,\r\n HierarchyCompareOptions,\r\n PageOptions,\r\n Paged,\r\n Prioritized,\r\n WithCancelEvent,\r\n} from \"./presentation-common/PresentationManagerOptions.js\";\r\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\r\nexport {\r\n VariableValueTypes,\r\n VariableValue,\r\n VariableValueJSON,\r\n BooleanRulesetVariable,\r\n StringRulesetVariable,\r\n IntRulesetVariable,\r\n IntsRulesetVariable,\r\n Id64RulesetVariable,\r\n Id64sRulesetVariable,\r\n RulesetVariable,\r\n Id64sRulesetVariableJSON,\r\n RulesetVariableJSON,\r\n} from \"./presentation-common/RulesetVariables.js\";\r\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\r\nexport {\r\n UPDATE_FULL,\r\n UpdateInfo,\r\n HierarchyUpdateInfo,\r\n ContentUpdateInfo,\r\n PartialHierarchyModification,\r\n NodeInsertionInfo,\r\n NodeDeletionInfo,\r\n NodeUpdateInfo,\r\n HierarchyCompareInfo,\r\n} from \"./presentation-common/Update.js\";\r\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\r\nexport {\r\n InstanceFilterDefinition,\r\n InstanceFilterRelatedInstanceDefinition,\r\n InstanceFilterRelatedInstancePath,\r\n InstanceFilterRelatedInstanceTargetAlias,\r\n InstanceFilterRelatedInstanceRelationshipAlias,\r\n} from \"./presentation-common/InstanceFilterDefinition.js\";\r\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\r\n\r\n/**\r\n * @module RPC\r\n *\r\n * @docs-group-description RPC\r\n * Types used for RPC communication between frontend and backend. Generally should\r\n * only be used internally by presentation packages.\r\n */\r\nexport {\r\n PresentationRpcRequestOptions,\r\n PresentationRpcResponseData,\r\n RpcDiagnosticsOptions,\r\n PresentationRpcResponse,\r\n HierarchyRpcRequestOptions,\r\n HierarchyLevelDescriptorRpcRequestOptions,\r\n FilterByInstancePathsHierarchyRpcRequestOptions,\r\n FilterByTextHierarchyRpcRequestOptions,\r\n ContentSourcesRpcRequestOptions,\r\n ContentSourcesRpcResult,\r\n ContentDescriptorRpcRequestOptions,\r\n ContentRpcRequestOptions,\r\n SingleElementPropertiesRpcRequestOptions,\r\n DistinctValuesRpcRequestOptions,\r\n ContentInstanceKeysRpcRequestOptions,\r\n DisplayLabelRpcRequestOptions,\r\n DisplayLabelsRpcRequestOptions,\r\n SelectionScopeRpcRequestOptions,\r\n ComputeSelectionRpcRequestOptions,\r\n PresentationRpcInterface,\r\n} from \"./presentation-common/PresentationRpcInterface.js\";\r\n\r\n/**\r\n * @module UnifiedSelection\r\n *\r\n * @docs-group-description UnifiedSelection\r\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\r\n */\r\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\r\n\r\n/**\r\n * @module Content\r\n *\r\n * @docs-group-description Content\r\n * Types related to presentation [content]($docs/presentation/content/index.md).\r\n */\r\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\r\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\r\nexport {\r\n SelectClassInfo,\r\n SelectClassInfoJSON,\r\n ContentFlags,\r\n SortDirection,\r\n SelectionInfo,\r\n DescriptorJSON,\r\n DescriptorOverrides,\r\n DescriptorSource,\r\n Descriptor,\r\n} from \"./presentation-common/content/Descriptor.js\";\r\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\r\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\r\nexport {\r\n PropertiesFieldJSON,\r\n ArrayPropertiesFieldJSON,\r\n StructPropertiesFieldJSON,\r\n NestedContentFieldJSON,\r\n FieldJSON,\r\n Field,\r\n PropertiesField,\r\n ArrayPropertiesField,\r\n StructPropertiesField,\r\n NestedContentField,\r\n FieldDescriptorType,\r\n FieldDescriptor,\r\n NamedFieldDescriptor,\r\n PropertiesFieldDescriptor,\r\n} from \"./presentation-common/content/Fields.js\";\r\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\r\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\r\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\r\nexport {\r\n PropertyValueFormat,\r\n PrimitiveTypeDescription,\r\n ArrayTypeDescription,\r\n StructFieldMemberDescription,\r\n StructTypeDescription,\r\n TypeDescription,\r\n} from \"./presentation-common/content/TypeDescription.js\";\r\nexport {\r\n Value,\r\n ValuesMap,\r\n ValuesArray,\r\n DisplayValue,\r\n DisplayValuesMap,\r\n DisplayValuesArray,\r\n NestedContentValue,\r\n NavigationPropertyValue,\r\n DisplayValueGroup,\r\n} from \"./presentation-common/content/Value.js\";\r\nexport {\r\n FieldHierarchy,\r\n StartContentProps,\r\n ProcessFieldHierarchiesProps,\r\n StartItemProps,\r\n StartCategoryProps,\r\n StartFieldProps,\r\n StartStructProps,\r\n StartArrayProps,\r\n ProcessMergedValueProps,\r\n ProcessPrimitiveValueProps,\r\n IContentVisitor,\r\n traverseFieldHierarchy,\r\n traverseContent,\r\n traverseContentItem,\r\n createFieldHierarchies,\r\n addFieldHierarchy,\r\n combineFieldNames,\r\n parseCombinedFieldNames,\r\n} from \"./presentation-common/content/ContentTraverser.js\";\r\nexport {\r\n ElementProperties,\r\n ElementPropertiesCategoryItem,\r\n ElementPropertiesPrimitivePropertyItem,\r\n ElementPropertiesPrimitiveArrayPropertyItem,\r\n ElementPropertiesStructArrayPropertyItem,\r\n ElementPropertiesArrayPropertyItem,\r\n ElementPropertiesStructPropertyItem,\r\n ElementPropertiesPropertyValueType,\r\n ElementPropertiesPropertyItem,\r\n ElementPropertiesItem,\r\n} from \"./presentation-common/ElementProperties.js\";\r\n\r\n/**\r\n * @module Hierarchies\r\n *\r\n * @docs-group-description Hierarchies\r\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\r\n */\r\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\r\nexport {\r\n StandardNodeTypes,\r\n NodeKey,\r\n NodeKeyPath,\r\n BaseNodeKey,\r\n ECInstancesNodeKey,\r\n GroupingNodeKey,\r\n ECClassGroupingNodeKey,\r\n ECPropertyGroupingNodeKey,\r\n LabelGroupingNodeKey,\r\n PresentationQuery,\r\n IdBinding,\r\n IdSetBinding,\r\n ECValueBinding,\r\n ECValueSetBinding,\r\n PresentationQueryBinding,\r\n} from \"./presentation-common/hierarchy/Key.js\";\r\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\r\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\r\n\r\n/**\r\n * @module PresentationRules\r\n *\r\n * @docs-group-description PresentationRules\r\n * Types for defining the presentation ruleset.\r\n */\r\n// note: everything under `rules/` is public, so no need to name each exported api\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\r\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\r\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\r\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\r\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\r\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\r\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\r\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\r\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\r\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\r\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\r\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\r\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\r\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\r\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\r\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\r\nexport * from \"./presentation-common/rules/Rule.js\";\r\nexport * from \"./presentation-common/rules/Ruleset.js\";\r\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\r\nexport * from \"./presentation-common/rules/Variables.js\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"presentation-common.js","sourceRoot":"","sources":["../../src/presentation-common.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;gGAGgG;AAChG;;;;;GAKG;AACH,uEAW8C;AAD5C,qHAAA,mBAAmB,OAAA;AAErB,qDAyBqC;AAtBnC,oGAAA,WAAW,OAAA;AAMX,+GAAA,sBAAsB,OAAA;AAEtB,qGAAA,YAAY,OAAA;AAMZ,yGA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EAUgD;AAT9C,iGAAA,KAAK,OAAA;AAGL,wGAAA,YAAY,OAAA;AAOd,yFAmB2D;AAPzD,6HAAA,sBAAsB,OAAA;AACtB,sHAAA,eAAe,OAAA;AACf,0HAAA,mBAAmB,OAAA;AACnB,6HAAA,sBAAsB,OAAA;AACtB,wHAAA,iBAAiB,OAAA;AACjB,wHAAA,iBAAiB,OAAA;AACjB,8HAAA,uBAAuB,OAAA;AAsBzB,iEAgBgD;AAf9C,2GAAA,iBAAiB,OAAA;AACjB,iGAAA,OAAO,OAAA;AAkBT;;;;;GAKG;AACH,kFAAkF;AAClF,yFAAuE;AACvE,kGAAgF;AAChF,mGAAiF;AACjF,iHAA+F;AAC/F,uHAAqG;AACrG,0FAAwE;AACxE,6FAA2E;AAC3E,6GAA2F;AAC3F,wFAAsE;AACtE,wFAAsE;AACtE,iGAA+E;AAC/E,gGAA8E;AAC9E,4FAA0E;AAC1E,qGAAmF;AACnF,2FAAyE;AACzE,wHAAsG;AACtG,8GAA4F;AAC5F,qFAAmE;AACnE,8FAA4E;AAC5E,+FAA6E;AAC7E,4GAA0F;AAC1F,yGAAuF;AACvF,qHAAmG;AACnG,mGAAiF;AACjF,iHAA+F;AAC/F,gHAA8F;AAC9F,+GAA6F;AAC7F,kHAAgG;AAChG,qFAAmE;AACnE,8FAA4E;AAC5E,uFAAqE;AACrE,+FAA6E;AAC7E,sEAAoD;AACpD,yEAAuD;AACvD,sFAAoE;AACpE,2EAAyD","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/**\n * @module Core\n *\n * @docs-group-description Core\n * Common types used all across Presentation packages.\n */\nexport {\n DiagnosticsLoggerSeverity,\n Diagnostics,\n ClientDiagnostics,\n DiagnosticsOptions,\n ClientDiagnosticsHandler,\n ClientDiagnosticsOptions,\n ClientDiagnosticsAttribute,\n DiagnosticsLogMessage,\n DiagnosticsScopeLogs,\n DiagnosticsLogEntry,\n} from \"./presentation-common/Diagnostics.js\";\nexport {\n ClassId,\n InstanceId,\n InstanceKey,\n ClassInfo,\n CompressedClassInfoJSON,\n EnumerationChoice,\n EnumerationInfo,\n KindOfQuantityInfo,\n NavigationPropertyInfo,\n NavigationPropertyInfoJSON,\n PropertyInfo,\n PropertyValueConstraints,\n StringPropertyValueConstraints,\n NumericPropertyValueConstraints,\n ArrayPropertyValueConstraints,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelatedClassInfo,\n StrippedRelationshipPath,\n} from \"./presentation-common/EC.js\";\nexport { PresentationStatus, PresentationError } from \"./presentation-common/Error.js\";\nexport { Key, Keys, KeySetJSON, KeySet } from \"./presentation-common/KeySet.js\";\nexport { LabelCompositeValue, LabelRawValue, LabelDefinition } from \"./presentation-common/LabelDefinition.js\";\nexport {\n RequestOptions,\n RequestOptionsWithRuleset,\n HierarchyRequestOptions,\n HierarchyLevelDescriptorRequestOptions,\n FilterByInstancePathsHierarchyRequestOptions,\n FilterByTextHierarchyRequestOptions,\n ContentSourcesRequestOptions,\n ContentDescriptorRequestOptions,\n ContentRequestOptions,\n DistinctValuesRequestOptions,\n ElementPropertiesRequestOptions,\n SingleElementPropertiesRequestOptions,\n MultiElementPropertiesByClassRequestOptions,\n MultiElementPropertiesByIdsRequestOptions,\n MultiElementPropertiesRequestOptions,\n ContentInstanceKeysRequestOptions,\n DisplayLabelRequestOptions,\n DisplayLabelsRequestOptions,\n SelectionScopeRequestOptions,\n ComputeSelectionRequestOptions,\n HierarchyCompareOptions,\n PageOptions,\n Paged,\n Prioritized,\n WithCancelEvent,\n} from \"./presentation-common/PresentationManagerOptions.js\";\nexport { RegisteredRuleset } from \"./presentation-common/RegisteredRuleset.js\";\nexport {\n VariableValueTypes,\n VariableValue,\n VariableValueJSON,\n BooleanRulesetVariable,\n StringRulesetVariable,\n IntRulesetVariable,\n IntsRulesetVariable,\n Id64RulesetVariable,\n Id64sRulesetVariable,\n RulesetVariable,\n Id64sRulesetVariableJSON,\n RulesetVariableJSON,\n} from \"./presentation-common/RulesetVariables.js\";\nexport { RulesetsFactory, ComputeDisplayValueCallback, PrimitivePropertyValue } from \"./presentation-common/RulesetsFactory.js\";\nexport {\n UPDATE_FULL,\n UpdateInfo,\n HierarchyUpdateInfo,\n ContentUpdateInfo,\n PartialHierarchyModification,\n NodeInsertionInfo,\n NodeDeletionInfo,\n NodeUpdateInfo,\n HierarchyCompareInfo,\n} from \"./presentation-common/Update.js\";\nexport { DEFAULT_KEYS_BATCH_SIZE, Omit, PagedResponse, PartialBy, Subtract, ValuesDictionary, getInstancesCount } from \"./presentation-common/Utils.js\";\nexport {\n InstanceFilterDefinition,\n InstanceFilterRelatedInstanceDefinition,\n InstanceFilterRelatedInstancePath,\n InstanceFilterRelatedInstanceTargetAlias,\n InstanceFilterRelatedInstanceRelationshipAlias,\n} from \"./presentation-common/InstanceFilterDefinition.js\";\nexport { UnitSystemFormat, FormatsMap, FormatOptions, KoqPropertyValueFormatter } from \"./presentation-common/KoqPropertyValueFormatter.js\";\n\n/**\n * @module RPC\n *\n * @docs-group-description RPC\n * Types used for RPC communication between frontend and backend. Generally should\n * only be used internally by presentation packages.\n */\nexport {\n PresentationRpcRequestOptions,\n PresentationRpcResponseData,\n RpcDiagnosticsOptions,\n PresentationRpcResponse,\n HierarchyRpcRequestOptions,\n HierarchyLevelDescriptorRpcRequestOptions,\n FilterByInstancePathsHierarchyRpcRequestOptions,\n FilterByTextHierarchyRpcRequestOptions,\n ContentSourcesRpcRequestOptions,\n ContentSourcesRpcResult,\n ContentDescriptorRpcRequestOptions,\n ContentRpcRequestOptions,\n SingleElementPropertiesRpcRequestOptions,\n DistinctValuesRpcRequestOptions,\n ContentInstanceKeysRpcRequestOptions,\n DisplayLabelRpcRequestOptions,\n DisplayLabelsRpcRequestOptions,\n SelectionScopeRpcRequestOptions,\n ComputeSelectionRpcRequestOptions,\n PresentationRpcInterface,\n} from \"./presentation-common/PresentationRpcInterface.js\";\n\n/**\n * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * Types related to [unified selection]($docs/presentation/unified-selection/index.md).\n */\nexport { SelectionScope, ElementSelectionScopeProps, SelectionScopeProps } from \"./presentation-common/selection/SelectionScope.js\";\n\n/**\n * @module Content\n *\n * @docs-group-description Content\n * Types related to presentation [content]($docs/presentation/content/index.md).\n */\nexport { CategoryDescription, CategoryDescriptionJSON } from \"./presentation-common/content/Category.js\";\nexport { ContentJSON, Content } from \"./presentation-common/content/Content.js\";\nexport {\n SelectClassInfo,\n SelectClassInfoJSON,\n ContentFlags,\n SortDirection,\n SelectionInfo,\n DescriptorJSON,\n DescriptorOverrides,\n DescriptorSource,\n Descriptor,\n} from \"./presentation-common/content/Descriptor.js\";\nexport { DefaultContentDisplayTypes } from \"./presentation-common/content/DisplayTypes.js\";\nexport { EditorDescription } from \"./presentation-common/content/Editor.js\";\nexport {\n PropertiesFieldJSON,\n ArrayPropertiesFieldJSON,\n StructPropertiesFieldJSON,\n NestedContentFieldJSON,\n FieldJSON,\n Field,\n PropertiesField,\n ArrayPropertiesField,\n StructPropertiesField,\n NestedContentField,\n FieldDescriptorType,\n FieldDescriptor,\n NamedFieldDescriptor,\n PropertiesFieldDescriptor,\n} from \"./presentation-common/content/Fields.js\";\nexport { ItemJSON, Item } from \"./presentation-common/content/Item.js\";\nexport { PropertyAccessor, PropertyAccessorPath, Property, PropertyJSON } from \"./presentation-common/content/Property.js\";\nexport { RendererDescription } from \"./presentation-common/content/Renderer.js\";\nexport {\n PropertyValueFormat,\n PrimitiveTypeDescription,\n ArrayTypeDescription,\n StructFieldMemberDescription,\n StructTypeDescription,\n TypeDescription,\n} from \"./presentation-common/content/TypeDescription.js\";\nexport {\n Value,\n ValuesMap,\n ValuesArray,\n DisplayValue,\n DisplayValuesMap,\n DisplayValuesArray,\n NestedContentValue,\n NavigationPropertyValue,\n DisplayValueGroup,\n} from \"./presentation-common/content/Value.js\";\nexport {\n FieldHierarchy,\n StartContentProps,\n ProcessFieldHierarchiesProps,\n StartItemProps,\n StartCategoryProps,\n StartFieldProps,\n StartStructProps,\n StartArrayProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n IContentVisitor,\n traverseFieldHierarchy,\n traverseContent,\n traverseContentItem,\n createFieldHierarchies,\n addFieldHierarchy,\n combineFieldNames,\n parseCombinedFieldNames,\n} from \"./presentation-common/content/ContentTraverser.js\";\nexport {\n ElementProperties,\n ElementPropertiesCategoryItem,\n ElementPropertiesPrimitivePropertyItem,\n ElementPropertiesPrimitiveArrayPropertyItem,\n ElementPropertiesStructArrayPropertyItem,\n ElementPropertiesArrayPropertyItem,\n ElementPropertiesStructPropertyItem,\n ElementPropertiesPropertyValueType,\n ElementPropertiesPropertyItem,\n ElementPropertiesItem,\n} from \"./presentation-common/ElementProperties.js\";\n\n/**\n * @module Hierarchies\n *\n * @docs-group-description Hierarchies\n * Types related to presentation [hierarchies]($docs/presentation/hierarchies/index.md).\n */\nexport { HierarchyLevel } from \"./presentation-common/hierarchy/HierarchyLevel.js\";\nexport {\n StandardNodeTypes,\n NodeKey,\n NodeKeyPath,\n BaseNodeKey,\n ECInstancesNodeKey,\n GroupingNodeKey,\n ECClassGroupingNodeKey,\n ECPropertyGroupingNodeKey,\n LabelGroupingNodeKey,\n PresentationQuery,\n IdBinding,\n IdSetBinding,\n ECValueBinding,\n ECValueSetBinding,\n PresentationQueryBinding,\n} from \"./presentation-common/hierarchy/Key.js\";\nexport { Node, PartialNode } from \"./presentation-common/hierarchy/Node.js\";\nexport { NodePathElement, NodePathFilteringData } from \"./presentation-common/hierarchy/NodePathElement.js\";\n\n/**\n * @module PresentationRules\n *\n * @docs-group-description PresentationRules\n * Types for defining the presentation ruleset.\n */\n// note: everything under `rules/` is public, so no need to name each exported api\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/ChildNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomNodeSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/NavigationRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/NodeArtifactsRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js\";\nexport * from \"./presentation-common/rules/hierarchy/RootNodeRule.js\";\nexport * from \"./presentation-common/rules/hierarchy/SubCondition.js\";\nexport * from \"./presentation-common/rules/customization/CustomizationRule.js\";\nexport * from \"./presentation-common/rules/customization/ExtendedDataRule.js\";\nexport * from \"./presentation-common/rules/customization/GroupingRule.js\";\nexport * from \"./presentation-common/rules/customization/InstanceLabelOverride.js\";\nexport * from \"./presentation-common/rules/customization/SortingRule.js\";\nexport * from \"./presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRelatedInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/ContentRule.js\";\nexport * from \"./presentation-common/rules/content/ContentSpecification.js\";\nexport * from \"./presentation-common/rules/content/PropertySpecification.js\";\nexport * from \"./presentation-common/rules/content/SelectedNodeInstancesSpecification.js\";\nexport * from \"./presentation-common/rules/content/DefaultPropertyCategoryOverride.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/ContentModifier.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyCategorySpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/CustomRendererSpecification.js\";\nexport * from \"./presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js\";\nexport * from \"./presentation-common/rules/ClassSpecifications.js\";\nexport * from \"./presentation-common/rules/RelatedInstanceSpecification.js\";\nexport * from \"./presentation-common/rules/RelationshipDirection.js\";\nexport * from \"./presentation-common/rules/RelationshipPathSpecification.js\";\nexport * from \"./presentation-common/rules/Rule.js\";\nexport * from \"./presentation-common/rules/Ruleset.js\";\nexport * from \"./presentation-common/rules/SchemasSpecification.js\";\nexport * from \"./presentation-common/rules/Variables.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsyncTasks.js","sourceRoot":"","sources":["../../../src/presentation-common/AsyncTasks.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAiB;IACpB,iBAAiB,GAAG,IAAI,GAAG,EAAc,CAAC;IAClD,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IACM,cAAc;QACnB,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/B,OAAO;YACL,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;SAC1D,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"AsyncTasks.js","sourceRoot":"","sources":["../../../src/presentation-common/AsyncTasks.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,iBAAiB;IACpB,iBAAiB,GAAG,IAAI,GAAG,EAAc,CAAC;IAClD,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAChC,CAAC;IACM,cAAc;QACnB,MAAM,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC/B,OAAO;YACL,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;SAC1D,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Core\n */\n\nimport { Guid, GuidString } from \"@itwin/core-bentley\";\n\n/**\n * A helper to track ongoing async tasks. Usage:\n * ```\n * {\n * using _r = tracker.trackAsyncTask();\n * await doSomethingAsync();\n * }\n * ```\n *\n * Can be used with `waitForPendingAsyncs` in test helpers to wait for all\n * async tasks to complete.\n *\n * @internal\n */\nexport class AsyncTasksTracker {\n private _asyncsInProgress = new Set<GuidString>();\n public get pendingAsyncs() {\n return this._asyncsInProgress;\n }\n public trackAsyncTask(): Disposable {\n const id = Guid.createValue();\n this._asyncsInProgress.add(id);\n return {\n [Symbol.dispose]: () => this._asyncsInProgress.delete(id),\n };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommonLoggerCategory.js","sourceRoot":"","sources":["../../../src/presentation-common/CommonLoggerCategory.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gCAEX;AAFD,WAAY,gCAAgC;IAC1C,mEAA+B,CAAA;AACjC,CAAC,EAFW,gCAAgC,KAAhC,gCAAgC,QAE3C","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"CommonLoggerCategory.js","sourceRoot":"","sources":["../../../src/presentation-common/CommonLoggerCategory.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gCAEX;AAFD,WAAY,gCAAgC;IAC1C,mEAA+B,CAAA;AACjC,CAAC,EAFW,gCAAgC,KAAhC,gCAAgC,QAE3C","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\n/**\n * Logger categories used by this package\n * @note All logger categories in this package start with the `presentation-common` prefix.\n * @see [Logger]($bentley)\n * @public\n */\nexport enum PresentationCommonLoggerCategory {\n Package = \"presentation-common\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diagnostics.js","sourceRoot":"","sources":["../../../src/presentation-common/Diagnostics.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAQH;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,GAAoD,EAAE,GAAoD;IACrJ,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,gBAAgB,GACpB,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,OAAO;QAChC,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI;YAClE,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM;gBAChC,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,GAAG,KAAK,SAAS,IAAI,GAA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C,CAAC;AACZ,CAAC;AA4FD;;;GAGG;AACH,2DAA2D;AAC3D,MAAM,KAAW,mBAAmB,CAOnC;AAPD,WAAiB,mBAAmB;IAClC,SAAgB,SAAS,CAAC,KAA0B;QAClD,OAAO,CAAC,CAAE,KAAa,CAAC,OAAO,CAAC;IAClC,CAAC;IAFe,6BAAS,YAExB,CAAA;IACD,SAAgB,OAAO,CAAC,KAA0B;QAChD,OAAO,CAAC,CAAE,KAAa,CAAC,KAAK,CAAC;IAChC,CAAC;IAFe,2BAAO,UAEtB,CAAA;AACH,CAAC,EAPgB,mBAAmB,KAAnB,mBAAmB,QAOnC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Diagnostics.js","sourceRoot":"","sources":["../../../src/presentation-common/Diagnostics.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAQH;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAAC,GAAoD,EAAE,GAAoD;IACrJ,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,gBAAgB,GACpB,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,OAAO;QAChC,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,IAAI;YAClE,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,MAAM;gBAChC,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,SAAS;oBACtC,CAAC,CAAC,SAAS;oBACX,CAAC,CAAC,OAAO,CAAC;IACpB,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,4BAA4B,CAAC,GAAoD,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AC,OAAO,CAAC;IAClC,CAAC;IAFe,6BAAS,YAExB,CAAA;IACD,SAAgB,OAAO,CAAC,KAA0B;QAChD,OAAO,CAAC,CAAE,KAAa,CAAC,KAAK,CAAC;IAChC,CAAC;IAFe,2BAAO,UAEtB,CAAA;AACH,CAAC,EAPgB,mBAAmB,KAAnB,mBAAmB,QAOnC","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\n/**\n * Type of diagnostics logger severity.\n * @public\n */\nexport type DiagnosticsLoggerSeverity = \"error\" | \"warning\" | \"info\" | \"debug\" | \"trace\";\n\n/**\n * Returns lower severity of the given two. Examples:\n * ```\n * combineDiagnosticsSeverities(\"error\", \"error\") === \"error\"\n * combineDiagnosticsSeverities(\"error\", \"debug\") === \"debug\"\n * combineDiagnosticsSeverities(\"debug\", \"error\") === \"debug\"\n * ```\n * @internal\n */\nexport function combineDiagnosticsSeverities(lhs: undefined | boolean | DiagnosticsLoggerSeverity, rhs: undefined | boolean | DiagnosticsLoggerSeverity) {\n if (!lhs && !rhs) {\n return undefined;\n }\n const combinedSeverity: DiagnosticsLoggerSeverity =\n lhs === \"trace\" || rhs === \"trace\"\n ? \"trace\"\n : lhs === \"debug\" || lhs === true || rhs === \"debug\" || rhs === true\n ? \"debug\"\n : lhs === \"info\" || rhs === \"info\"\n ? \"info\"\n : lhs === \"warning\" || rhs === \"warning\"\n ? \"warning\"\n : \"error\";\n return combinedSeverity;\n}\n\n/**\n * Returns 0 if the given severities are equal after normalization, negative if `lhs` is lower, positive if higher. Examples:\n * ```\n * compareDiagnosticsSeverities(\"error\", \"error\") === 0\n * compareDiagnosticsSeverities(\"error\", false) === 0\n * compareDiagnosticsSeverities(\"error\", undefined) === 0\n * compareDiagnosticsSeverities(\"debug\", true) === 0\n * compareDiagnosticsSeverities(\"debug\", \"error\") < 0\n * compareDiagnosticsSeverities(\"error\", \"debug\") > 0\n * ```\n * @internal\n */\nexport function compareDiagnosticsSeverities(lhs: undefined | boolean | DiagnosticsLoggerSeverity, rhs: undefined | boolean | DiagnosticsLoggerSeverity) {\n const normalizedLhs: DiagnosticsLoggerSeverity = lhs === undefined || lhs === false ? \"error\" : lhs === true ? \"debug\" : lhs;\n const normalizedRhs: DiagnosticsLoggerSeverity = rhs === undefined || rhs === false ? \"error\" : rhs === true ? \"debug\" : rhs;\n if (normalizedLhs === normalizedRhs) {\n return 0;\n }\n if (normalizedLhs === \"error\") {\n return 1;\n }\n if (normalizedLhs === \"warning\") {\n return normalizedRhs === \"error\" ? -1 : 1;\n }\n if (normalizedLhs === \"info\") {\n return normalizedRhs === \"warning\" || normalizedRhs === \"error\" ? -1 : 1;\n }\n if (normalizedLhs === \"debug\") {\n return normalizedRhs === \"info\" || normalizedRhs === \"warning\" || normalizedRhs === \"error\" ? -1 : 1;\n }\n return -1;\n}\n\n/**\n * Data structure for diagnostics information.\n * @public\n */\nexport interface Diagnostics {\n logs?: DiagnosticsScopeLogs[];\n}\n\n/**\n * Data structure with client diagnostics information.\n * @public\n */\nexport interface ClientDiagnostics extends Diagnostics {\n backendVersion?: string;\n}\n\n/**\n * Data structure for diagnostics options.\n * @public\n */\nexport interface DiagnosticsOptions {\n /**\n * Flag specifying that performance should be measured, or\n * minimum duration in milliseconds for which performance metric should be included.\n */\n perf?: boolean | { minimumDuration: number };\n /** Severity for developer log messages */\n dev?: boolean | DiagnosticsLoggerSeverity;\n /** Severity for presentation rules' editor log messages */\n editor?: boolean | DiagnosticsLoggerSeverity;\n}\n\n/**\n * A function that can be called after receiving diagnostics.\n * @public\n */\nexport type ClientDiagnosticsHandler = (logs: ClientDiagnostics) => void;\n\n/**\n * Data structure for client diagnostics options.\n * @public\n */\nexport interface ClientDiagnosticsOptions extends DiagnosticsOptions {\n backendVersion?: boolean;\n handler: ClientDiagnosticsHandler;\n}\n\n/**\n * Data structure which contains client diagnostics options.\n * @public\n */\nexport interface ClientDiagnosticsAttribute {\n /**\n * Diagnostics options.\n */\n diagnostics?: ClientDiagnosticsOptions;\n}\n\n/**\n * Data structure for diagnostics log message information.\n * @public\n */\nexport interface DiagnosticsLogMessage {\n severity: {\n dev?: DiagnosticsLoggerSeverity;\n editor?: DiagnosticsLoggerSeverity;\n };\n category: string;\n message: string;\n timestamp: number;\n}\n\n/**\n * Data structure for diagnostics scope information.\n * @public\n */\nexport interface DiagnosticsScopeLogs {\n scope: string;\n scopeCreateTimestamp?: number;\n duration?: number;\n logs?: DiagnosticsLogEntry[];\n attributes?: { [attributeKey: string]: string | string[] };\n}\n\n/**\n * Data structure for diagnostics log entry.\n * @public\n */\nexport type DiagnosticsLogEntry = DiagnosticsLogMessage | DiagnosticsScopeLogs;\n\n/**\n * Functions related to diagnostics log entry.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace DiagnosticsLogEntry {\n export function isMessage(entry: DiagnosticsLogEntry): entry is DiagnosticsLogMessage {\n return !!(entry as any).message;\n }\n export function isScope(entry: DiagnosticsLogEntry): entry is DiagnosticsScopeLogs {\n return !!(entry as any).scope;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EC.js","sourceRoot":"","sources":["../../../src/presentation-common/EC.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA0BhE,cAAc;AACd,MAAM,KAAW,WAAW,CAe3B;AAfD,WAAiB,WAAW;IAC1B,8BAA8B;IAC9B,SAAgB,OAAO,CAAC,GAAgB,EAAE,GAAgB;QACxD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,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,eAAe;YACrC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,qBAAqB,EAAE,CAAC,IAAI,CAAC,qBAAqB;SACnD,CAAC,CAAC,CAAC;IACN,CAAC;IAPe,wBAAO,UAOtB,CAAA;IAED,kFAAkF;IAClF,SAAgB,MAAM,CAAC,GAAuD,EAAE,GAAuD;QACrI,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1G,CAAC;IAFe,uBAAM,SAErB,CAAA;IAED,uEAAuE;IACvE,SAAgB,KAAK,CAAC,IAAsB;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAFe,sBAAK,QAEpB,CAAA;AACH,CAAC,EApBgB,gBAAgB,KAAhB,gBAAgB,QAoBhC","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 { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport { FormatProps } from \"@itwin/core-quantity\";\r\nimport { parseFullClassName } from \"@itwin/presentation-shared\";\r\nimport { PartialBy } from \"./Utils.js\";\r\n\r\n/**\r\n * Type of an ECClass ID.\r\n * @public\r\n */\r\nexport type ClassId = Id64String;\r\n\r\n/**\r\n * Type of an ECInstance ID.\r\n * @public\r\n */\r\nexport type InstanceId = Id64String;\r\n\r\n/**\r\n * A key that uniquely identifies an instance in an iModel\r\n * @public\r\n */\r\nexport interface InstanceKey {\r\n /** Full class name in format `SchemaName:ClassName` */\r\n className: string;\r\n /** ECInstance ID */\r\n id: InstanceId;\r\n}\r\n\r\n/** @public */\r\nexport namespace InstanceKey {\r\n /** Compare 2 instance keys */\r\n export function compare(lhs: InstanceKey, rhs: InstanceKey): number {\r\n const lhsClass = parseFullClassName(lhs.className);\r\n const rhsClass = parseFullClassName(rhs.className);\r\n const schemaNameCompare = lhsClass.schemaName.toLowerCase().localeCompare(rhsClass.schemaName.toLowerCase());\r\n if (schemaNameCompare !== 0) {\r\n return schemaNameCompare;\r\n }\r\n const classNameCompare = lhsClass.className.toLowerCase().localeCompare(rhsClass.className.toLowerCase());\r\n if (classNameCompare !== 0) {\r\n return classNameCompare;\r\n }\r\n return lhs.id.toLowerCase().localeCompare(rhs.id.toLowerCase());\r\n }\r\n}\r\n\r\n/**\r\n * Information about an ECClass\r\n * @public\r\n */\r\nexport interface ClassInfo {\r\n /** ECClass ID */\r\n id: ClassId;\r\n /** Full class name in format `SchemaName:ClassName` */\r\n name: string;\r\n /** ECClass label */\r\n label: string;\r\n}\r\n\r\n/**\r\n * A serialized and compressed version of [[ClassInfo]]\r\n * @public\r\n */\r\nexport interface CompressedClassInfoJSON {\r\n name: string;\r\n label: string;\r\n}\r\n\r\n/**\r\n * A single choice in enumeration\r\n * @public\r\n */\r\nexport interface EnumerationChoice {\r\n /** Label of the choice */\r\n label: string;\r\n /** Value of the choice */\r\n value: string | number;\r\n}\r\n\r\n/**\r\n * Enumeration information\r\n * @public\r\n */\r\nexport interface EnumerationInfo {\r\n /** Available enumeration choices */\r\n choices: EnumerationChoice[];\r\n /** Is the enumeration strict (values only allowed from `choices` list) */\r\n isStrict: boolean;\r\n}\r\n\r\n/**\r\n * Kind of quantity information\r\n * @public\r\n */\r\nexport interface KindOfQuantityInfo {\r\n /** Full name of KindOfQuantity in format `SchemaName:KindOfQuantityName` */\r\n name: string;\r\n /** Label of KindOfQuantity */\r\n label: string;\r\n /** Persistence unit full class name in format `SchemaName:UnitName`. */\r\n persistenceUnit: string;\r\n /** Active format that was used to format property value. */\r\n activeFormat?: FormatProps;\r\n}\r\n\r\n/**\r\n * A data structure for storing navigation property information.\r\n * @public\r\n */\r\nexport interface NavigationPropertyInfo {\r\n /** Information about ECProperty's relationship class */\r\n classInfo: ClassInfo;\r\n /** Is the direction of the relationship forward */\r\n isForwardRelationship: boolean;\r\n /** Information about ECProperty's target class */\r\n targetClassInfo: ClassInfo;\r\n /** Is ECProperty's target class polymorphic */\r\n isTargetPolymorphic: boolean;\r\n}\r\n\r\n/**\r\n * Contains utilities for working with objects of [[NavigationPropertyInfo]] type.\r\n * @public\r\n */\r\nexport namespace NavigationPropertyInfo {\r\n /** Serialize [[NavigationPropertyInfo]] to compressed JSON */\r\n export function toCompressedJSON(\r\n navigationPropertyInfo: NavigationPropertyInfo,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n ): NavigationPropertyInfoJSON<string> {\r\n const { id: relationshipId, ...relationshipLeftOverInfo } = navigationPropertyInfo.classInfo;\r\n const { id: targetId, ...targetLeftOverInfo } = navigationPropertyInfo.targetClassInfo;\r\n classesMap[relationshipId] = relationshipLeftOverInfo;\r\n classesMap[targetId] = targetLeftOverInfo;\r\n\r\n return {\r\n ...navigationPropertyInfo,\r\n classInfo: relationshipId,\r\n targetClassInfo: targetId,\r\n };\r\n }\r\n\r\n /** Deserialize [[NavigationPropertyInfo]] from compressed JSON */\r\n export function fromCompressedJSON(\r\n compressedNavigationPropertyInfoJSON: NavigationPropertyInfoJSON<string>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n ): NavigationPropertyInfo {\r\n return {\r\n ...compressedNavigationPropertyInfoJSON,\r\n classInfo: { id: compressedNavigationPropertyInfoJSON.classInfo, ...classesMap[compressedNavigationPropertyInfoJSON.classInfo] },\r\n targetClassInfo: { id: compressedNavigationPropertyInfoJSON.targetClassInfo, ...classesMap[compressedNavigationPropertyInfoJSON.targetClassInfo] },\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * A serialized version of [[NavigationPropertyInfo]]\r\n * @public\r\n */\r\nexport interface NavigationPropertyInfoJSON<TClassInfoJSON = ClassInfo> {\r\n classInfo: TClassInfoJSON;\r\n isForwardRelationship: boolean;\r\n targetClassInfo: TClassInfoJSON;\r\n isTargetPolymorphic: boolean;\r\n}\r\n\r\n/**\r\n * A structure that describes an ECProperty\r\n * @public\r\n */\r\nexport interface PropertyInfo {\r\n /** Information about ECProperty class */\r\n classInfo: ClassInfo;\r\n /** Name of the ECProperty */\r\n name: string;\r\n /** Type name of the ECProperty */\r\n type: string;\r\n /** Enumeration info if the property is enumerable */\r\n enumerationInfo?: EnumerationInfo;\r\n /** Kind of quantity information, if any. */\r\n kindOfQuantity?: KindOfQuantityInfo;\r\n /** Extended type name of the ECProperty if it has one */\r\n extendedType?: string;\r\n /** Navigation property info if the field is navigation type */\r\n navigationPropertyInfo?: NavigationPropertyInfo;\r\n /** Constraints for values of ECProperty */\r\n constraints?: PropertyValueConstraints;\r\n}\r\n\r\n/**\r\n * Constraints for values of ECProperty\r\n * @public\r\n */\r\nexport type PropertyValueConstraints = StringPropertyValueConstraints | ArrayPropertyValueConstraints | NumericPropertyValueConstraints;\r\n\r\n/**\r\n * Describes constraints for `string` type ECProperty values\r\n * @public\r\n */\r\nexport interface StringPropertyValueConstraints {\r\n minimumLength?: number;\r\n maximumLength?: number;\r\n}\r\n\r\n/**\r\n * Describes constraints for `int` | `double` | `float` type ECProperty values\r\n * @public\r\n */\r\nexport interface NumericPropertyValueConstraints {\r\n minimumValue?: number;\r\n maximumValue?: number;\r\n}\r\n\r\n/**\r\n * Describes constraints for `array` type ECProperty values\r\n * @public\r\n */\r\nexport interface ArrayPropertyValueConstraints {\r\n minOccurs?: number;\r\n maxOccurs?: number;\r\n}\r\n\r\n/** @public */\r\nexport namespace PropertyInfo {\r\n /** Serialize [[PropertyInfo]] to compressed JSON */\r\n export function toCompressedJSON(propertyInfo: PropertyInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfoJSON<string> {\r\n const { navigationPropertyInfo, ...leftOverPropertyInfo } = propertyInfo;\r\n const { id, ...leftOverInfo } = propertyInfo.classInfo;\r\n classesMap[id] = leftOverInfo;\r\n\r\n return {\r\n ...leftOverPropertyInfo,\r\n classInfo: propertyInfo.classInfo.id,\r\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.toCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * A serialized version of [[PropertyInfo]]\r\n * @public\r\n */\r\nexport interface PropertyInfoJSON<TClassInfoJSON = ClassInfo> {\r\n classInfo: TClassInfoJSON;\r\n name: string;\r\n type: string;\r\n enumerationInfo?: EnumerationInfo;\r\n kindOfQuantity?: KindOfQuantityInfo;\r\n navigationPropertyInfo?: NavigationPropertyInfoJSON<TClassInfoJSON>;\r\n}\r\n\r\n/**\r\n * A structure that describes a related class and the properties of that relationship.\r\n * @public\r\n */\r\nexport interface RelatedClassInfo {\r\n /** Information about the source ECClass */\r\n sourceClassInfo: ClassInfo;\r\n\r\n /** Information about the target ECClass */\r\n targetClassInfo: ClassInfo;\r\n\r\n /** Is target class handled polymorphically */\r\n isPolymorphicTargetClass?: boolean;\r\n\r\n /** Optionally, IDs of specific target class instances. */\r\n targetInstanceIds?: Id64String[];\r\n\r\n /** Information about the ECRelationship */\r\n relationshipInfo: ClassInfo;\r\n\r\n /** Should relationship be followed in a forward direction to access the related class. */\r\n isForwardRelationship: boolean;\r\n\r\n /** Is relationship handled polymorphically */\r\n isPolymorphicRelationship?: boolean;\r\n}\r\n\r\n/** @public */\r\nexport namespace RelatedClassInfo {\r\n /** Serialize [[RelatedClassInfo]] to compressed JSON */\r\n export function toCompressedJSON(classInfo: RelatedClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): RelatedClassInfoJSON<string> {\r\n const { id: sourceId, ...sourceLeftOverInfo } = classInfo.sourceClassInfo;\r\n const { id: targetId, ...targetLeftOverInfo } = classInfo.targetClassInfo;\r\n const { id: relationshipId, ...relationshipLeftOverInfo } = classInfo.relationshipInfo;\r\n\r\n classesMap[sourceId] = sourceLeftOverInfo;\r\n classesMap[targetId] = targetLeftOverInfo;\r\n classesMap[relationshipId] = relationshipLeftOverInfo;\r\n\r\n return {\r\n ...classInfo,\r\n sourceClassInfo: sourceId,\r\n targetClassInfo: targetId,\r\n relationshipInfo: relationshipId,\r\n };\r\n }\r\n\r\n /** Deserialize [[RelatedClassInfo]] from compressed JSON */\r\n export function fromCompressedJSON(json: RelatedClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): RelatedClassInfo {\r\n assert(classesMap.hasOwnProperty(json.sourceClassInfo));\r\n assert(classesMap.hasOwnProperty(json.targetClassInfo));\r\n assert(classesMap.hasOwnProperty(json.relationshipInfo));\r\n return {\r\n ...json,\r\n sourceClassInfo: { id: json.sourceClassInfo, ...classesMap[json.sourceClassInfo] },\r\n targetClassInfo: { id: json.targetClassInfo, ...classesMap[json.targetClassInfo] },\r\n relationshipInfo: { id: json.relationshipInfo, ...classesMap[json.relationshipInfo] },\r\n };\r\n }\r\n\r\n /** Check two [[RelatedClassInfo]] or [[StrippedRelatedClassInfo]] for equality */\r\n export function equals(lhs: RelatedClassInfo | StrippedRelatedClassInfo, rhs: RelatedClassInfo | StrippedRelatedClassInfo): boolean {\r\n return (\r\n lhs.isForwardRelationship === rhs.isForwardRelationship &&\r\n getClassName(lhs, \"source\") === getClassName(rhs, \"source\") &&\r\n getClassName(lhs, \"target\") === getClassName(rhs, \"target\") &&\r\n getClassName(lhs, \"relationship\") === getClassName(rhs, \"relationship\")\r\n );\r\n }\r\n\r\n function isStripped(info: RelatedClassInfo | StrippedRelatedClassInfo): info is StrippedRelatedClassInfo {\r\n const maybeStripped = info as StrippedRelatedClassInfo;\r\n return !!maybeStripped.relationshipName && !!maybeStripped.sourceClassName && !!maybeStripped.targetClassName;\r\n }\r\n\r\n function getClassName(info: RelatedClassInfo | StrippedRelatedClassInfo, whichClass: \"relationship\" | \"source\" | \"target\"): string {\r\n switch (whichClass) {\r\n case \"source\":\r\n return isStripped(info) ? info.sourceClassName : info.sourceClassInfo.name;\r\n case \"target\":\r\n return isStripped(info) ? info.targetClassName : info.targetClassInfo.name;\r\n case \"relationship\":\r\n return isStripped(info) ? info.relationshipName : info.relationshipInfo.name;\r\n }\r\n }\r\n\r\n /** Strip given [[RelatedClassInfo]] to [[StrippedRelatedClassInfo]] */\r\n export function strip(full: RelatedClassInfo): StrippedRelatedClassInfo {\r\n return {\r\n sourceClassName: full.sourceClassInfo.name,\r\n targetClassName: full.targetClassInfo.name,\r\n relationshipName: full.relationshipInfo.name,\r\n isForwardRelationship: full.isForwardRelationship,\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * A serialized version of [[RelatedClassInfo]]\r\n * @public\r\n */\r\nexport interface RelatedClassInfoJSON<TClassInfoJSON = ClassInfo> {\r\n sourceClassInfo: TClassInfoJSON;\r\n targetClassInfo: TClassInfoJSON;\r\n isPolymorphicTargetClass?: boolean;\r\n targetInstanceIds?: Id64String[];\r\n relationshipInfo: TClassInfoJSON;\r\n isForwardRelationship: boolean;\r\n isPolymorphicRelationship?: boolean;\r\n}\r\n\r\n/**\r\n * A structure that describes a relationship between source and target classes where\r\n * an actual ECRelationship between them is optional.\r\n * @public\r\n */\r\nexport type RelatedClassInfoWithOptionalRelationship = PartialBy<RelatedClassInfo, \"relationshipInfo\" | \"isForwardRelationship\" | \"isPolymorphicRelationship\">;\r\n\r\n/** @public */\r\nexport type RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON = ClassInfo> = PartialBy<\r\n RelatedClassInfoJSON<TClassInfoJSON>,\r\n \"relationshipInfo\" | \"isForwardRelationship\" | \"isPolymorphicRelationship\"\r\n>;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace RelatedClassInfoWithOptionalRelationship {\r\n /** Serialize [[RelatedClassInfoWithOptionalRelationship]] to compressed JSON */\r\n export function toCompressedJSON(\r\n classInfo: RelatedClassInfoWithOptionalRelationship,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n ): RelatedClassInfoWithOptionalRelationshipJSON<string> {\r\n const { sourceClassInfo, targetClassInfo, relationshipInfo, ...otherProps } = classInfo;\r\n const { id: sourceId, ...sourceLeftOverInfo } = sourceClassInfo;\r\n const { id: targetId, ...targetLeftOverInfo } = targetClassInfo;\r\n\r\n classesMap[sourceId] = sourceLeftOverInfo;\r\n classesMap[targetId] = targetLeftOverInfo;\r\n\r\n if (relationshipInfo) {\r\n const { id: relationshipId, ...relationshipLeftOverInfo } = relationshipInfo;\r\n classesMap[relationshipId] = relationshipLeftOverInfo;\r\n }\r\n\r\n return {\r\n ...otherProps,\r\n sourceClassInfo: sourceId,\r\n targetClassInfo: targetId,\r\n ...(relationshipInfo ? { relationshipInfo: relationshipInfo.id } : undefined),\r\n };\r\n }\r\n\r\n /** Deserialize [[RelatedClassInfoWithOptionalRelationship]] from compressed JSON */\r\n export function fromCompressedJSON(\r\n json: RelatedClassInfoWithOptionalRelationshipJSON<string>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n ): RelatedClassInfoWithOptionalRelationship {\r\n const { sourceClassInfo, targetClassInfo, relationshipInfo, ...otherProps } = json;\r\n assert(classesMap.hasOwnProperty(sourceClassInfo));\r\n assert(classesMap.hasOwnProperty(targetClassInfo));\r\n if (relationshipInfo) {\r\n assert(classesMap.hasOwnProperty(relationshipInfo));\r\n }\r\n return {\r\n ...otherProps,\r\n sourceClassInfo: { id: sourceClassInfo, ...classesMap[sourceClassInfo] },\r\n targetClassInfo: { id: targetClassInfo, ...classesMap[targetClassInfo] },\r\n ...(relationshipInfo ? { relationshipInfo: { id: relationshipInfo, ...classesMap[relationshipInfo] } } : undefined),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * A structure that describes a related class path.\r\n * @public\r\n */\r\nexport type RelationshipPath = RelatedClassInfo[];\r\n\r\n/**\r\n * Serialized [[RelationshipPath]]\r\n * @public\r\n */\r\nexport type RelationshipPathJSON<TClassInfoJSON = ClassInfo> = RelatedClassInfoJSON<TClassInfoJSON>[];\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace RelationshipPath {\r\n /** Reverse direction of the given [[RelationshipPath]] */\r\n export function reverse(path: RelationshipPath): RelationshipPath {\r\n return [...path].reverse().map((step) => ({\r\n ...step,\r\n sourceClassInfo: step.targetClassInfo,\r\n targetClassInfo: step.sourceClassInfo,\r\n isForwardRelationship: !step.isForwardRelationship,\r\n }));\r\n }\r\n\r\n /** Check two [[RelationshipPath]] or [[StrippedRelationshipPath]] for equality */\r\n export function equals(lhs: Array<RelatedClassInfo | StrippedRelatedClassInfo>, rhs: Array<RelatedClassInfo | StrippedRelatedClassInfo>): boolean {\r\n return lhs.length === rhs.length && lhs.every((lhsPart, i) => RelatedClassInfo.equals(lhsPart, rhs[i]));\r\n }\r\n\r\n /** Strip given [[RelationshipPath]] to [[StrippedRelationshipPath]] */\r\n export function strip(full: RelationshipPath): StrippedRelationshipPath {\r\n return full.map(RelatedClassInfo.strip);\r\n }\r\n}\r\n\r\n/**\r\n * Data structure that contains a subset of [[RelatedClassInfo]] required to\r\n * identify the relationship.\r\n * @public\r\n */\r\nexport interface StrippedRelatedClassInfo {\r\n sourceClassName: string;\r\n targetClassName: string;\r\n relationshipName: string;\r\n isForwardRelationship: boolean;\r\n}\r\n\r\n/**\r\n * Data structure that contains a subset of [[RelationshipPath]] required to\r\n * identify the relationship path.\r\n * @public\r\n */\r\nexport type StrippedRelationshipPath = StrippedRelatedClassInfo[];\r\n"]}
|
|
1
|
+
{"version":3,"file":"EC.js","sourceRoot":"","sources":["../../../src/presentation-common/EC.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAc,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA0BhE,cAAc;AACd,MAAM,KAA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gBAAgB;IAC/B,0DAA0D;IAC1D,SAAgB,OAAO,CAAC,IAAsB;QAC5C,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACxC,GAAG,IAAI;YACP,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,qBAAqB,EAAE,CAAC,IAAI,CAAC,qBAAqB;SACnD,CAAC,CAAC,CAAC;IACN,CAAC;IAPe,wBAAO,UAOtB,CAAA;IAED,kFAAkF;IAClF,SAAgB,MAAM,CAAC,GAAuD,EAAE,GAAuD;QACrI,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1G,CAAC;IAFe,uBAAM,SAErB,CAAA;IAED,uEAAuE;IACvE,SAAgB,KAAK,CAAC,IAAsB;QAC1C,OAAO,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAFe,sBAAK,QAEpB,CAAA;AACH,CAAC,EApBgB,gBAAgB,KAAhB,gBAAgB,QAoBhC","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 { assert, Id64String } from \"@itwin/core-bentley\";\nimport { FormatProps } from \"@itwin/core-quantity\";\nimport { parseFullClassName } from \"@itwin/presentation-shared\";\nimport { PartialBy } from \"./Utils.js\";\n\n/**\n * Type of an ECClass ID.\n * @public\n */\nexport type ClassId = Id64String;\n\n/**\n * Type of an ECInstance ID.\n * @public\n */\nexport type InstanceId = Id64String;\n\n/**\n * A key that uniquely identifies an instance in an iModel\n * @public\n */\nexport interface InstanceKey {\n /** Full class name in format `SchemaName:ClassName` */\n className: string;\n /** ECInstance ID */\n id: InstanceId;\n}\n\n/** @public */\nexport namespace InstanceKey {\n /** Compare 2 instance keys */\n export function compare(lhs: InstanceKey, rhs: InstanceKey): number {\n const lhsClass = parseFullClassName(lhs.className);\n const rhsClass = parseFullClassName(rhs.className);\n const schemaNameCompare = lhsClass.schemaName.toLowerCase().localeCompare(rhsClass.schemaName.toLowerCase());\n if (schemaNameCompare !== 0) {\n return schemaNameCompare;\n }\n const classNameCompare = lhsClass.className.toLowerCase().localeCompare(rhsClass.className.toLowerCase());\n if (classNameCompare !== 0) {\n return classNameCompare;\n }\n return lhs.id.toLowerCase().localeCompare(rhs.id.toLowerCase());\n }\n}\n\n/**\n * Information about an ECClass\n * @public\n */\nexport interface ClassInfo {\n /** ECClass ID */\n id: ClassId;\n /** Full class name in format `SchemaName:ClassName` */\n name: string;\n /** ECClass label */\n label: string;\n}\n\n/**\n * A serialized and compressed version of [[ClassInfo]]\n * @public\n */\nexport interface CompressedClassInfoJSON {\n name: string;\n label: string;\n}\n\n/**\n * A single choice in enumeration\n * @public\n */\nexport interface EnumerationChoice {\n /** Label of the choice */\n label: string;\n /** Value of the choice */\n value: string | number;\n}\n\n/**\n * Enumeration information\n * @public\n */\nexport interface EnumerationInfo {\n /** Available enumeration choices */\n choices: EnumerationChoice[];\n /** Is the enumeration strict (values only allowed from `choices` list) */\n isStrict: boolean;\n}\n\n/**\n * Kind of quantity information\n * @public\n */\nexport interface KindOfQuantityInfo {\n /** Full name of KindOfQuantity in format `SchemaName:KindOfQuantityName` */\n name: string;\n /** Label of KindOfQuantity */\n label: string;\n /** Persistence unit full class name in format `SchemaName:UnitName`. */\n persistenceUnit: string;\n /** Active format that was used to format property value. */\n activeFormat?: FormatProps;\n}\n\n/**\n * A data structure for storing navigation property information.\n * @public\n */\nexport interface NavigationPropertyInfo {\n /** Information about ECProperty's relationship class */\n classInfo: ClassInfo;\n /** Is the direction of the relationship forward */\n isForwardRelationship: boolean;\n /** Information about ECProperty's target class */\n targetClassInfo: ClassInfo;\n /** Is ECProperty's target class polymorphic */\n isTargetPolymorphic: boolean;\n}\n\n/**\n * Contains utilities for working with objects of [[NavigationPropertyInfo]] type.\n * @public\n */\nexport namespace NavigationPropertyInfo {\n /** Serialize [[NavigationPropertyInfo]] to compressed JSON */\n export function toCompressedJSON(\n navigationPropertyInfo: NavigationPropertyInfo,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n ): NavigationPropertyInfoJSON<string> {\n const { id: relationshipId, ...relationshipLeftOverInfo } = navigationPropertyInfo.classInfo;\n const { id: targetId, ...targetLeftOverInfo } = navigationPropertyInfo.targetClassInfo;\n classesMap[relationshipId] = relationshipLeftOverInfo;\n classesMap[targetId] = targetLeftOverInfo;\n\n return {\n ...navigationPropertyInfo,\n classInfo: relationshipId,\n targetClassInfo: targetId,\n };\n }\n\n /** Deserialize [[NavigationPropertyInfo]] from compressed JSON */\n export function fromCompressedJSON(\n compressedNavigationPropertyInfoJSON: NavigationPropertyInfoJSON<string>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n ): NavigationPropertyInfo {\n return {\n ...compressedNavigationPropertyInfoJSON,\n classInfo: { id: compressedNavigationPropertyInfoJSON.classInfo, ...classesMap[compressedNavigationPropertyInfoJSON.classInfo] },\n targetClassInfo: { id: compressedNavigationPropertyInfoJSON.targetClassInfo, ...classesMap[compressedNavigationPropertyInfoJSON.targetClassInfo] },\n };\n }\n}\n\n/**\n * A serialized version of [[NavigationPropertyInfo]]\n * @public\n */\nexport interface NavigationPropertyInfoJSON<TClassInfoJSON = ClassInfo> {\n classInfo: TClassInfoJSON;\n isForwardRelationship: boolean;\n targetClassInfo: TClassInfoJSON;\n isTargetPolymorphic: boolean;\n}\n\n/**\n * A structure that describes an ECProperty\n * @public\n */\nexport interface PropertyInfo {\n /** Information about ECProperty class */\n classInfo: ClassInfo;\n /** Name of the ECProperty */\n name: string;\n /** Type name of the ECProperty */\n type: string;\n /** Enumeration info if the property is enumerable */\n enumerationInfo?: EnumerationInfo;\n /** Kind of quantity information, if any. */\n kindOfQuantity?: KindOfQuantityInfo;\n /** Extended type name of the ECProperty if it has one */\n extendedType?: string;\n /** Navigation property info if the field is navigation type */\n navigationPropertyInfo?: NavigationPropertyInfo;\n /** Constraints for values of ECProperty */\n constraints?: PropertyValueConstraints;\n}\n\n/**\n * Constraints for values of ECProperty\n * @public\n */\nexport type PropertyValueConstraints = StringPropertyValueConstraints | ArrayPropertyValueConstraints | NumericPropertyValueConstraints;\n\n/**\n * Describes constraints for `string` type ECProperty values\n * @public\n */\nexport interface StringPropertyValueConstraints {\n minimumLength?: number;\n maximumLength?: number;\n}\n\n/**\n * Describes constraints for `int` | `double` | `float` type ECProperty values\n * @public\n */\nexport interface NumericPropertyValueConstraints {\n minimumValue?: number;\n maximumValue?: number;\n}\n\n/**\n * Describes constraints for `array` type ECProperty values\n * @public\n */\nexport interface ArrayPropertyValueConstraints {\n minOccurs?: number;\n maxOccurs?: number;\n}\n\n/** @public */\nexport namespace PropertyInfo {\n /** Serialize [[PropertyInfo]] to compressed JSON */\n export function toCompressedJSON(propertyInfo: PropertyInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfoJSON<string> {\n const { navigationPropertyInfo, ...leftOverPropertyInfo } = propertyInfo;\n const { id, ...leftOverInfo } = propertyInfo.classInfo;\n classesMap[id] = leftOverInfo;\n\n return {\n ...leftOverPropertyInfo,\n classInfo: propertyInfo.classInfo.id,\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.toCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\n };\n }\n}\n\n/**\n * A serialized version of [[PropertyInfo]]\n * @public\n */\nexport interface PropertyInfoJSON<TClassInfoJSON = ClassInfo> {\n classInfo: TClassInfoJSON;\n name: string;\n type: string;\n enumerationInfo?: EnumerationInfo;\n kindOfQuantity?: KindOfQuantityInfo;\n navigationPropertyInfo?: NavigationPropertyInfoJSON<TClassInfoJSON>;\n}\n\n/**\n * A structure that describes a related class and the properties of that relationship.\n * @public\n */\nexport interface RelatedClassInfo {\n /** Information about the source ECClass */\n sourceClassInfo: ClassInfo;\n\n /** Information about the target ECClass */\n targetClassInfo: ClassInfo;\n\n /** Is target class handled polymorphically */\n isPolymorphicTargetClass?: boolean;\n\n /** Optionally, IDs of specific target class instances. */\n targetInstanceIds?: Id64String[];\n\n /** Information about the ECRelationship */\n relationshipInfo: ClassInfo;\n\n /** Should relationship be followed in a forward direction to access the related class. */\n isForwardRelationship: boolean;\n\n /** Is relationship handled polymorphically */\n isPolymorphicRelationship?: boolean;\n}\n\n/** @public */\nexport namespace RelatedClassInfo {\n /** Serialize [[RelatedClassInfo]] to compressed JSON */\n export function toCompressedJSON(classInfo: RelatedClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): RelatedClassInfoJSON<string> {\n const { id: sourceId, ...sourceLeftOverInfo } = classInfo.sourceClassInfo;\n const { id: targetId, ...targetLeftOverInfo } = classInfo.targetClassInfo;\n const { id: relationshipId, ...relationshipLeftOverInfo } = classInfo.relationshipInfo;\n\n classesMap[sourceId] = sourceLeftOverInfo;\n classesMap[targetId] = targetLeftOverInfo;\n classesMap[relationshipId] = relationshipLeftOverInfo;\n\n return {\n ...classInfo,\n sourceClassInfo: sourceId,\n targetClassInfo: targetId,\n relationshipInfo: relationshipId,\n };\n }\n\n /** Deserialize [[RelatedClassInfo]] from compressed JSON */\n export function fromCompressedJSON(json: RelatedClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): RelatedClassInfo {\n assert(classesMap.hasOwnProperty(json.sourceClassInfo));\n assert(classesMap.hasOwnProperty(json.targetClassInfo));\n assert(classesMap.hasOwnProperty(json.relationshipInfo));\n return {\n ...json,\n sourceClassInfo: { id: json.sourceClassInfo, ...classesMap[json.sourceClassInfo] },\n targetClassInfo: { id: json.targetClassInfo, ...classesMap[json.targetClassInfo] },\n relationshipInfo: { id: json.relationshipInfo, ...classesMap[json.relationshipInfo] },\n };\n }\n\n /** Check two [[RelatedClassInfo]] or [[StrippedRelatedClassInfo]] for equality */\n export function equals(lhs: RelatedClassInfo | StrippedRelatedClassInfo, rhs: RelatedClassInfo | StrippedRelatedClassInfo): boolean {\n return (\n lhs.isForwardRelationship === rhs.isForwardRelationship &&\n getClassName(lhs, \"source\") === getClassName(rhs, \"source\") &&\n getClassName(lhs, \"target\") === getClassName(rhs, \"target\") &&\n getClassName(lhs, \"relationship\") === getClassName(rhs, \"relationship\")\n );\n }\n\n function isStripped(info: RelatedClassInfo | StrippedRelatedClassInfo): info is StrippedRelatedClassInfo {\n const maybeStripped = info as StrippedRelatedClassInfo;\n return !!maybeStripped.relationshipName && !!maybeStripped.sourceClassName && !!maybeStripped.targetClassName;\n }\n\n function getClassName(info: RelatedClassInfo | StrippedRelatedClassInfo, whichClass: \"relationship\" | \"source\" | \"target\"): string {\n switch (whichClass) {\n case \"source\":\n return isStripped(info) ? info.sourceClassName : info.sourceClassInfo.name;\n case \"target\":\n return isStripped(info) ? info.targetClassName : info.targetClassInfo.name;\n case \"relationship\":\n return isStripped(info) ? info.relationshipName : info.relationshipInfo.name;\n }\n }\n\n /** Strip given [[RelatedClassInfo]] to [[StrippedRelatedClassInfo]] */\n export function strip(full: RelatedClassInfo): StrippedRelatedClassInfo {\n return {\n sourceClassName: full.sourceClassInfo.name,\n targetClassName: full.targetClassInfo.name,\n relationshipName: full.relationshipInfo.name,\n isForwardRelationship: full.isForwardRelationship,\n };\n }\n}\n\n/**\n * A serialized version of [[RelatedClassInfo]]\n * @public\n */\nexport interface RelatedClassInfoJSON<TClassInfoJSON = ClassInfo> {\n sourceClassInfo: TClassInfoJSON;\n targetClassInfo: TClassInfoJSON;\n isPolymorphicTargetClass?: boolean;\n targetInstanceIds?: Id64String[];\n relationshipInfo: TClassInfoJSON;\n isForwardRelationship: boolean;\n isPolymorphicRelationship?: boolean;\n}\n\n/**\n * A structure that describes a relationship between source and target classes where\n * an actual ECRelationship between them is optional.\n * @public\n */\nexport type RelatedClassInfoWithOptionalRelationship = PartialBy<RelatedClassInfo, \"relationshipInfo\" | \"isForwardRelationship\" | \"isPolymorphicRelationship\">;\n\n/** @public */\nexport type RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON = ClassInfo> = PartialBy<\n RelatedClassInfoJSON<TClassInfoJSON>,\n \"relationshipInfo\" | \"isForwardRelationship\" | \"isPolymorphicRelationship\"\n>;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RelatedClassInfoWithOptionalRelationship {\n /** Serialize [[RelatedClassInfoWithOptionalRelationship]] to compressed JSON */\n export function toCompressedJSON(\n classInfo: RelatedClassInfoWithOptionalRelationship,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n ): RelatedClassInfoWithOptionalRelationshipJSON<string> {\n const { sourceClassInfo, targetClassInfo, relationshipInfo, ...otherProps } = classInfo;\n const { id: sourceId, ...sourceLeftOverInfo } = sourceClassInfo;\n const { id: targetId, ...targetLeftOverInfo } = targetClassInfo;\n\n classesMap[sourceId] = sourceLeftOverInfo;\n classesMap[targetId] = targetLeftOverInfo;\n\n if (relationshipInfo) {\n const { id: relationshipId, ...relationshipLeftOverInfo } = relationshipInfo;\n classesMap[relationshipId] = relationshipLeftOverInfo;\n }\n\n return {\n ...otherProps,\n sourceClassInfo: sourceId,\n targetClassInfo: targetId,\n ...(relationshipInfo ? { relationshipInfo: relationshipInfo.id } : undefined),\n };\n }\n\n /** Deserialize [[RelatedClassInfoWithOptionalRelationship]] from compressed JSON */\n export function fromCompressedJSON(\n json: RelatedClassInfoWithOptionalRelationshipJSON<string>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n ): RelatedClassInfoWithOptionalRelationship {\n const { sourceClassInfo, targetClassInfo, relationshipInfo, ...otherProps } = json;\n assert(classesMap.hasOwnProperty(sourceClassInfo));\n assert(classesMap.hasOwnProperty(targetClassInfo));\n if (relationshipInfo) {\n assert(classesMap.hasOwnProperty(relationshipInfo));\n }\n return {\n ...otherProps,\n sourceClassInfo: { id: sourceClassInfo, ...classesMap[sourceClassInfo] },\n targetClassInfo: { id: targetClassInfo, ...classesMap[targetClassInfo] },\n ...(relationshipInfo ? { relationshipInfo: { id: relationshipInfo, ...classesMap[relationshipInfo] } } : undefined),\n };\n }\n}\n\n/**\n * A structure that describes a related class path.\n * @public\n */\nexport type RelationshipPath = RelatedClassInfo[];\n\n/**\n * Serialized [[RelationshipPath]]\n * @public\n */\nexport type RelationshipPathJSON<TClassInfoJSON = ClassInfo> = RelatedClassInfoJSON<TClassInfoJSON>[];\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace RelationshipPath {\n /** Reverse direction of the given [[RelationshipPath]] */\n export function reverse(path: RelationshipPath): RelationshipPath {\n return [...path].reverse().map((step) => ({\n ...step,\n sourceClassInfo: step.targetClassInfo,\n targetClassInfo: step.sourceClassInfo,\n isForwardRelationship: !step.isForwardRelationship,\n }));\n }\n\n /** Check two [[RelationshipPath]] or [[StrippedRelationshipPath]] for equality */\n export function equals(lhs: Array<RelatedClassInfo | StrippedRelatedClassInfo>, rhs: Array<RelatedClassInfo | StrippedRelatedClassInfo>): boolean {\n return lhs.length === rhs.length && lhs.every((lhsPart, i) => RelatedClassInfo.equals(lhsPart, rhs[i]));\n }\n\n /** Strip given [[RelationshipPath]] to [[StrippedRelationshipPath]] */\n export function strip(full: RelationshipPath): StrippedRelationshipPath {\n return full.map(RelatedClassInfo.strip);\n }\n}\n\n/**\n * Data structure that contains a subset of [[RelatedClassInfo]] required to\n * identify the relationship.\n * @public\n */\nexport interface StrippedRelatedClassInfo {\n sourceClassName: string;\n targetClassName: string;\n relationshipName: string;\n isForwardRelationship: boolean;\n}\n\n/**\n * Data structure that contains a subset of [[RelationshipPath]] required to\n * identify the relationship path.\n * @public\n */\nexport type StrippedRelationshipPath = StrippedRelatedClassInfo[];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementProperties.js","sourceRoot":"","sources":["../../../src/presentation-common/ElementProperties.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAWL,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AA8HnE,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAsB,EAAE,IAAU,EAAqB,EAAE;IAC9F,MAAM,OAAO,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAC/C,mBAAmB,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAC/C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC,CAAC;AAOF,MAAM,yBAAyB;IAInB;IACA;IAJF,cAAc,GAA+C,EAAE,CAAC;IAChE,sBAAsB,GAAoD,EAAE,CAAC;IACrF,YACU,KAAW,EACX,eAAkD;QADlD,UAAK,GAAL,KAAK,CAAM;QACX,oBAAe,GAAf,eAAe,CAAmC;IACzD,CAAC;IAEG,MAAM,CAAC,KAAa,EAAE,IAA2B;QACtD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACpC,CAAC;IAEM,MAAM;QACX,wCAAwC;QACxC,KAAK,MAAM,YAAY,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;YAC3D,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,CAAC;QAED,IAAI,CAAC,eAAe,CAAC;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KA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,IAAI,CAAC;IACd,CAAC;IACM,YAAY;QACjB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAG,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;IAEM,UAAU,CAAC,KAAsB;QACtC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW;QAChB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAG,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;IAEM,kBAAkB,CAAC,KAA8B;QACtD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;YACpD,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IACM,qBAAqB,CAAC,KAAiC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,IAAI,EAAE,WAAW;YACjB,gEAAgE;YAChE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","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 RPC\r\n */\r\n\r\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { CategoryDescription } from \"./content/Category.js\";\r\nimport {\r\n IContentVisitor,\r\n ProcessFieldHierarchiesProps,\r\n ProcessMergedValueProps,\r\n ProcessPrimitiveValueProps,\r\n StartArrayProps,\r\n StartCategoryProps,\r\n StartContentProps,\r\n StartFieldProps,\r\n StartItemProps,\r\n StartStructProps,\r\n traverseContentItem,\r\n} from \"./content/ContentTraverser.js\";\r\nimport { Descriptor } from \"./content/Descriptor.js\";\r\nimport { Item } from \"./content/Item.js\";\r\nimport { PropertyValueFormat } from \"./content/TypeDescription.js\";\r\n\r\n/**\r\n * Data structure for storing element properties information in a simplified format.\r\n * @see [[Content]] for a format that stores all available element property data.\r\n * @public\r\n */\r\nexport interface ElementProperties {\r\n /** Label of element's ECClass. */\r\n class: string;\r\n /** Element's ID. */\r\n id: Id64String;\r\n /** Element's label. */\r\n label: string;\r\n /** Container of property values */\r\n items: { [label: string]: ElementPropertiesItem };\r\n}\r\n\r\n/**\r\n * Base type for all [[ElementPropertiesItem]] types.\r\n * @public\r\n */\r\nexport interface ElementPropertiesItemBase {\r\n /** Type of the properties item. */\r\n type: \"category\" | ElementPropertiesPropertyValueType;\r\n}\r\n\r\n/**\r\n * Definition for a category. A category can nest other property items, including categories.\r\n * @public\r\n */\r\nexport interface ElementPropertiesCategoryItem extends ElementPropertiesItemBase {\r\n /** Type of the properties item. */\r\n type: \"category\";\r\n /** Container of property values */\r\n items: { [label: string]: ElementPropertiesItem };\r\n}\r\n\r\n/**\r\n * Base type for all [[ElementPropertiesPropertyItem]] types.\r\n * @public\r\n */\r\nexport interface ElementPropertiesPropertyItemBase extends ElementPropertiesItemBase {\r\n /** Type of the properties item. */\r\n type: ElementPropertiesPropertyValueType;\r\n}\r\n\r\n/**\r\n * Definition for a primitive property value.\r\n * @public\r\n */\r\nexport interface ElementPropertiesPrimitivePropertyItem extends ElementPropertiesPropertyItemBase {\r\n /** Type of the properties item. */\r\n type: \"primitive\";\r\n /** Display value of the property. */\r\n value: string;\r\n}\r\n\r\n/**\r\n * Base type for all [[ElementPropertiesArrayPropertyItem]] types.\r\n * @public\r\n */\r\nexport interface ElementPropertiesArrayPropertyItemBase extends ElementPropertiesPropertyItemBase {\r\n /** Type of the properties item. */\r\n type: \"array\";\r\n /** Type of values contained in this array. */\r\n valueType: \"primitive\" | \"struct\";\r\n}\r\n\r\n/**\r\n * Definition for a primitives' array property value.\r\n * @public\r\n */\r\nexport interface ElementPropertiesPrimitiveArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\r\n /** Type of values contained in this array. */\r\n valueType: \"primitive\";\r\n /** Array of display values. */\r\n values: string[];\r\n}\r\n\r\n/**\r\n * Definition for a structs' array property value.\r\n * @public\r\n */\r\nexport interface ElementPropertiesStructArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\r\n /** Type of values contained in this array. */\r\n valueType: \"struct\";\r\n /** Array of structs. */\r\n values: Array<{ [memberLabel: string]: ElementPropertiesPropertyItem }>;\r\n}\r\n\r\n/**\r\n * Definition for an array property value.\r\n * @public\r\n */\r\nexport type ElementPropertiesArrayPropertyItem = ElementPropertiesPrimitiveArrayPropertyItem | ElementPropertiesStructArrayPropertyItem;\r\n\r\n/**\r\n * Definition for an struct property value.\r\n * @public\r\n */\r\nexport interface ElementPropertiesStructPropertyItem extends ElementPropertiesPropertyItemBase {\r\n /** Type of the properties item. */\r\n type: \"struct\";\r\n /** Container of struct members. */\r\n members: { [memberLabel: string]: ElementPropertiesPropertyItem };\r\n}\r\n\r\n/**\r\n * Available element property types.\r\n * @public\r\n */\r\nexport type ElementPropertiesPropertyValueType = \"primitive\" | \"array\" | \"struct\";\r\n\r\n/**\r\n * Definition of a property value.\r\n * @public\r\n */\r\nexport type ElementPropertiesPropertyItem = ElementPropertiesPrimitivePropertyItem | ElementPropertiesArrayPropertyItem | ElementPropertiesStructPropertyItem;\r\n\r\n/**\r\n * Definition of a property item, including a property category.\r\n * @public\r\n */\r\nexport type ElementPropertiesItem = ElementPropertiesCategoryItem | ElementPropertiesPropertyItem;\r\n\r\n/** @internal */\r\nexport const buildElementProperties = (descriptor: Descriptor, item: Item): ElementProperties => {\r\n const builder = new ElementPropertiesBuilder();\r\n traverseContentItem(builder, descriptor, item);\r\n return builder.items[0];\r\n};\r\n\r\ninterface IPropertiesAppender {\r\n append(label: string, item: ElementPropertiesItem): void;\r\n finish(): void;\r\n}\r\n\r\nclass ElementPropertiesAppender implements IPropertiesAppender {\r\n private _propertyItems: { [label: string]: ElementPropertiesItem } = {};\r\n private _categoryItemAppenders: { [categoryName: string]: IPropertiesAppender } = {};\r\n constructor(\r\n private _item: Item,\r\n private _onItemFinished: (item: ElementProperties) => void,\r\n ) {}\r\n\r\n public append(label: string, item: ElementPropertiesItem): void {\r\n this._propertyItems[label] = item;\r\n }\r\n\r\n public finish(): void {\r\n // eslint-disable-next-line guard-for-in\r\n for (const categoryName in this._categoryItemAppenders) {\r\n const appender = this._categoryItemAppenders[categoryName];\r\n appender.finish();\r\n }\r\n\r\n this._onItemFinished({\r\n class: this._item.classInfo?.label ?? \"\",\r\n id: this._item.primaryKeys[0]?.id ?? Id64.invalid,\r\n label: this._item.label.displayValue,\r\n items: this._propertyItems,\r\n });\r\n }\r\n\r\n public getCategoryAppender(parentAppender: IPropertiesAppender, category: CategoryDescription): IPropertiesAppender {\r\n let appender = this._categoryItemAppenders[category.name];\r\n if (!appender) {\r\n appender = new CategoryItemAppender(parentAppender, category);\r\n this._categoryItemAppenders[category.name] = appender;\r\n }\r\n return appender;\r\n }\r\n}\r\n\r\nclass CategoryItemAppender implements IPropertiesAppender {\r\n private _items: { [label: string]: ElementPropertiesItem } = {};\r\n constructor(\r\n private _parentAppender: IPropertiesAppender,\r\n private _category: CategoryDescription,\r\n ) {}\r\n public append(label: string, item: ElementPropertiesItem): void {\r\n this._items[label] = item;\r\n }\r\n public finish(): void {\r\n if (Object.keys(this._items).length === 0) {\r\n return;\r\n }\r\n\r\n this._parentAppender.append(this._category.label, {\r\n type: \"category\",\r\n items: this._items,\r\n });\r\n }\r\n}\r\n\r\nclass ArrayItemAppender implements IPropertiesAppender {\r\n private _items: ElementPropertiesPropertyItem[] = [];\r\n constructor(\r\n private _parentAppender: IPropertiesAppender,\r\n private _props: StartArrayProps,\r\n ) {}\r\n public append(_label: string, item: ElementPropertiesItem): void {\r\n assert(item.type !== \"category\");\r\n this._items.push(item);\r\n }\r\n public finish(): void {\r\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Array);\r\n if (this._props.valueType.memberType.valueFormat === PropertyValueFormat.Primitive) {\r\n this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());\r\n } else {\r\n this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());\r\n }\r\n }\r\n private createPrimitivesArray(): ElementPropertiesPrimitiveArrayPropertyItem {\r\n return {\r\n type: \"array\",\r\n valueType: \"primitive\",\r\n values: this._items.map((item) => {\r\n assert(item.type === \"primitive\");\r\n return item.value;\r\n }),\r\n };\r\n }\r\n private createStructsArray(): ElementPropertiesStructArrayPropertyItem {\r\n return {\r\n type: \"array\",\r\n valueType: \"struct\",\r\n values: this._items.map((item) => {\r\n assert(item.type === \"struct\");\r\n return item.members;\r\n }),\r\n };\r\n }\r\n}\r\n\r\nclass StructItemAppender implements IPropertiesAppender {\r\n private _members: { [label: string]: ElementPropertiesPropertyItem } = {};\r\n constructor(\r\n private _parentAppender: IPropertiesAppender,\r\n private _props: StartStructProps,\r\n ) {}\r\n public append(label: string, item: ElementPropertiesItem): void {\r\n assert(item.type !== \"category\");\r\n this._members[label] = item;\r\n }\r\n public finish(): void {\r\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Struct);\r\n this._parentAppender.append(this._props.hierarchy.field.label, {\r\n type: \"struct\",\r\n members: this._members,\r\n });\r\n }\r\n}\r\n\r\nclass ElementPropertiesBuilder implements IContentVisitor {\r\n private _appendersStack: IPropertiesAppender[] = [];\r\n private _items: ElementProperties[] = [];\r\n private _elementPropertiesAppender: ElementPropertiesAppender | undefined;\r\n\r\n public get items(): ElementProperties[] {\r\n return this._items;\r\n }\r\n\r\n private get _currentAppender(): IPropertiesAppender {\r\n const appender = this._appendersStack[this._appendersStack.length - 1];\r\n assert(appender !== undefined);\r\n return appender;\r\n }\r\n\r\n public startContent(_props: StartContentProps): boolean {\r\n return true;\r\n }\r\n public finishContent(): void {}\r\n\r\n public processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void {}\r\n\r\n public startItem(props: StartItemProps): boolean {\r\n this._elementPropertiesAppender = new ElementPropertiesAppender(props.item, (item) => this._items.push(item));\r\n this._appendersStack.push(this._elementPropertiesAppender);\r\n return true;\r\n }\r\n public finishItem(): void {\r\n this._appendersStack.pop();\r\n assert(this._elementPropertiesAppender !== undefined);\r\n this._elementPropertiesAppender.finish();\r\n this._elementPropertiesAppender = undefined;\r\n }\r\n\r\n public startCategory(props: StartCategoryProps): boolean {\r\n assert(this._elementPropertiesAppender !== undefined);\r\n this._appendersStack.push(this._elementPropertiesAppender.getCategoryAppender(this._currentAppender, props.category));\r\n return true;\r\n }\r\n public finishCategory(): void {\r\n this._appendersStack.pop();\r\n }\r\n\r\n public startField(_props: StartFieldProps): boolean {\r\n return true;\r\n }\r\n public finishField(): void {}\r\n\r\n public startStruct(props: StartStructProps): boolean {\r\n this._appendersStack.push(new StructItemAppender(this._currentAppender, props));\r\n return true;\r\n }\r\n public finishStruct(): void {\r\n this._appendersStack.pop()!.finish();\r\n }\r\n\r\n public startArray(props: StartArrayProps): boolean {\r\n this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));\r\n return true;\r\n }\r\n public finishArray(): void {\r\n this._appendersStack.pop()!.finish();\r\n }\r\n\r\n public processMergedValue(props: ProcessMergedValueProps): void {\r\n this._currentAppender.append(props.mergedField.label, {\r\n type: \"primitive\",\r\n value: \"\",\r\n });\r\n }\r\n public processPrimitiveValue(props: ProcessPrimitiveValueProps): void {\r\n this._currentAppender.append(props.field.label, {\r\n type: \"primitive\",\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n value: props.displayValue?.toString() ?? \"\",\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ElementProperties.js","sourceRoot":"","sources":["../../../src/presentation-common/ElementProperties.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,EAAE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B,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IACM,WAAW;QAChB,IAAI,CAAC,eAAe,CAAC,GAAG,EAAG,CAAC,MAAM,EAAE,CAAC;IACvC,CAAC;IAEM,kBAAkB,CAAC,KAA8B;QACtD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE;YACpD,IAAI,EAAE,WAAW;YACjB,KAAK,EAAE,EAAE;SACV,CAAC,CAAC;IACL,CAAC;IACM,qBAAqB,CAAC,KAAiC;QAC5D,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE;YAC9C,IAAI,EAAE,WAAW;YACjB,gEAAgE;YAChE,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE;SAC5C,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module RPC\n */\n\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { CategoryDescription } from \"./content/Category.js\";\nimport {\n IContentVisitor,\n ProcessFieldHierarchiesProps,\n ProcessMergedValueProps,\n ProcessPrimitiveValueProps,\n StartArrayProps,\n StartCategoryProps,\n StartContentProps,\n StartFieldProps,\n StartItemProps,\n StartStructProps,\n traverseContentItem,\n} from \"./content/ContentTraverser.js\";\nimport { Descriptor } from \"./content/Descriptor.js\";\nimport { Item } from \"./content/Item.js\";\nimport { PropertyValueFormat } from \"./content/TypeDescription.js\";\n\n/**\n * Data structure for storing element properties information in a simplified format.\n * @see [[Content]] for a format that stores all available element property data.\n * @public\n */\nexport interface ElementProperties {\n /** Label of element's ECClass. */\n class: string;\n /** Element's ID. */\n id: Id64String;\n /** Element's label. */\n label: string;\n /** Container of property values */\n items: { [label: string]: ElementPropertiesItem };\n}\n\n/**\n * Base type for all [[ElementPropertiesItem]] types.\n * @public\n */\nexport interface ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: \"category\" | ElementPropertiesPropertyValueType;\n}\n\n/**\n * Definition for a category. A category can nest other property items, including categories.\n * @public\n */\nexport interface ElementPropertiesCategoryItem extends ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: \"category\";\n /** Container of property values */\n items: { [label: string]: ElementPropertiesItem };\n}\n\n/**\n * Base type for all [[ElementPropertiesPropertyItem]] types.\n * @public\n */\nexport interface ElementPropertiesPropertyItemBase extends ElementPropertiesItemBase {\n /** Type of the properties item. */\n type: ElementPropertiesPropertyValueType;\n}\n\n/**\n * Definition for a primitive property value.\n * @public\n */\nexport interface ElementPropertiesPrimitivePropertyItem extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"primitive\";\n /** Display value of the property. */\n value: string;\n}\n\n/**\n * Base type for all [[ElementPropertiesArrayPropertyItem]] types.\n * @public\n */\nexport interface ElementPropertiesArrayPropertyItemBase extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"array\";\n /** Type of values contained in this array. */\n valueType: \"primitive\" | \"struct\";\n}\n\n/**\n * Definition for a primitives' array property value.\n * @public\n */\nexport interface ElementPropertiesPrimitiveArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\n /** Type of values contained in this array. */\n valueType: \"primitive\";\n /** Array of display values. */\n values: string[];\n}\n\n/**\n * Definition for a structs' array property value.\n * @public\n */\nexport interface ElementPropertiesStructArrayPropertyItem extends ElementPropertiesArrayPropertyItemBase {\n /** Type of values contained in this array. */\n valueType: \"struct\";\n /** Array of structs. */\n values: Array<{ [memberLabel: string]: ElementPropertiesPropertyItem }>;\n}\n\n/**\n * Definition for an array property value.\n * @public\n */\nexport type ElementPropertiesArrayPropertyItem = ElementPropertiesPrimitiveArrayPropertyItem | ElementPropertiesStructArrayPropertyItem;\n\n/**\n * Definition for an struct property value.\n * @public\n */\nexport interface ElementPropertiesStructPropertyItem extends ElementPropertiesPropertyItemBase {\n /** Type of the properties item. */\n type: \"struct\";\n /** Container of struct members. */\n members: { [memberLabel: string]: ElementPropertiesPropertyItem };\n}\n\n/**\n * Available element property types.\n * @public\n */\nexport type ElementPropertiesPropertyValueType = \"primitive\" | \"array\" | \"struct\";\n\n/**\n * Definition of a property value.\n * @public\n */\nexport type ElementPropertiesPropertyItem = ElementPropertiesPrimitivePropertyItem | ElementPropertiesArrayPropertyItem | ElementPropertiesStructPropertyItem;\n\n/**\n * Definition of a property item, including a property category.\n * @public\n */\nexport type ElementPropertiesItem = ElementPropertiesCategoryItem | ElementPropertiesPropertyItem;\n\n/** @internal */\nexport const buildElementProperties = (descriptor: Descriptor, item: Item): ElementProperties => {\n const builder = new ElementPropertiesBuilder();\n traverseContentItem(builder, descriptor, item);\n return builder.items[0];\n};\n\ninterface IPropertiesAppender {\n append(label: string, item: ElementPropertiesItem): void;\n finish(): void;\n}\n\nclass ElementPropertiesAppender implements IPropertiesAppender {\n private _propertyItems: { [label: string]: ElementPropertiesItem } = {};\n private _categoryItemAppenders: { [categoryName: string]: IPropertiesAppender } = {};\n constructor(\n private _item: Item,\n private _onItemFinished: (item: ElementProperties) => void,\n ) {}\n\n public append(label: string, item: ElementPropertiesItem): void {\n this._propertyItems[label] = item;\n }\n\n public finish(): void {\n // eslint-disable-next-line guard-for-in\n for (const categoryName in this._categoryItemAppenders) {\n const appender = this._categoryItemAppenders[categoryName];\n appender.finish();\n }\n\n this._onItemFinished({\n class: this._item.classInfo?.label ?? \"\",\n id: this._item.primaryKeys[0]?.id ?? Id64.invalid,\n label: this._item.label.displayValue,\n items: this._propertyItems,\n });\n }\n\n public getCategoryAppender(parentAppender: IPropertiesAppender, category: CategoryDescription): IPropertiesAppender {\n let appender = this._categoryItemAppenders[category.name];\n if (!appender) {\n appender = new CategoryItemAppender(parentAppender, category);\n this._categoryItemAppenders[category.name] = appender;\n }\n return appender;\n }\n}\n\nclass CategoryItemAppender implements IPropertiesAppender {\n private _items: { [label: string]: ElementPropertiesItem } = {};\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _category: CategoryDescription,\n ) {}\n public append(label: string, item: ElementPropertiesItem): void {\n this._items[label] = item;\n }\n public finish(): void {\n if (Object.keys(this._items).length === 0) {\n return;\n }\n\n this._parentAppender.append(this._category.label, {\n type: \"category\",\n items: this._items,\n });\n }\n}\n\nclass ArrayItemAppender implements IPropertiesAppender {\n private _items: ElementPropertiesPropertyItem[] = [];\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _props: StartArrayProps,\n ) {}\n public append(_label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._items.push(item);\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Array);\n if (this._props.valueType.memberType.valueFormat === PropertyValueFormat.Primitive) {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createPrimitivesArray());\n } else {\n this._parentAppender.append(this._props.hierarchy.field.label, this.createStructsArray());\n }\n }\n private createPrimitivesArray(): ElementPropertiesPrimitiveArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"primitive\",\n values: this._items.map((item) => {\n assert(item.type === \"primitive\");\n return item.value;\n }),\n };\n }\n private createStructsArray(): ElementPropertiesStructArrayPropertyItem {\n return {\n type: \"array\",\n valueType: \"struct\",\n values: this._items.map((item) => {\n assert(item.type === \"struct\");\n return item.members;\n }),\n };\n }\n}\n\nclass StructItemAppender implements IPropertiesAppender {\n private _members: { [label: string]: ElementPropertiesPropertyItem } = {};\n constructor(\n private _parentAppender: IPropertiesAppender,\n private _props: StartStructProps,\n ) {}\n public append(label: string, item: ElementPropertiesItem): void {\n assert(item.type !== \"category\");\n this._members[label] = item;\n }\n public finish(): void {\n assert(this._props.valueType.valueFormat === PropertyValueFormat.Struct);\n this._parentAppender.append(this._props.hierarchy.field.label, {\n type: \"struct\",\n members: this._members,\n });\n }\n}\n\nclass ElementPropertiesBuilder implements IContentVisitor {\n private _appendersStack: IPropertiesAppender[] = [];\n private _items: ElementProperties[] = [];\n private _elementPropertiesAppender: ElementPropertiesAppender | undefined;\n\n public get items(): ElementProperties[] {\n return this._items;\n }\n\n private get _currentAppender(): IPropertiesAppender {\n const appender = this._appendersStack[this._appendersStack.length - 1];\n assert(appender !== undefined);\n return appender;\n }\n\n public startContent(_props: StartContentProps): boolean {\n return true;\n }\n public finishContent(): void {}\n\n public processFieldHierarchies(_props: ProcessFieldHierarchiesProps): void {}\n\n public startItem(props: StartItemProps): boolean {\n this._elementPropertiesAppender = new ElementPropertiesAppender(props.item, (item) => this._items.push(item));\n this._appendersStack.push(this._elementPropertiesAppender);\n return true;\n }\n public finishItem(): void {\n this._appendersStack.pop();\n assert(this._elementPropertiesAppender !== undefined);\n this._elementPropertiesAppender.finish();\n this._elementPropertiesAppender = undefined;\n }\n\n public startCategory(props: StartCategoryProps): boolean {\n assert(this._elementPropertiesAppender !== undefined);\n this._appendersStack.push(this._elementPropertiesAppender.getCategoryAppender(this._currentAppender, props.category));\n return true;\n }\n public finishCategory(): void {\n this._appendersStack.pop();\n }\n\n public startField(_props: StartFieldProps): boolean {\n return true;\n }\n public finishField(): void {}\n\n public startStruct(props: StartStructProps): boolean {\n this._appendersStack.push(new StructItemAppender(this._currentAppender, props));\n return true;\n }\n public finishStruct(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public startArray(props: StartArrayProps): boolean {\n this._appendersStack.push(new ArrayItemAppender(this._currentAppender, props));\n return true;\n }\n public finishArray(): void {\n this._appendersStack.pop()!.finish();\n }\n\n public processMergedValue(props: ProcessMergedValueProps): void {\n this._currentAppender.append(props.mergedField.label, {\n type: \"primitive\",\n value: \"\",\n });\n }\n public processPrimitiveValue(props: ProcessPrimitiveValueProps): void {\n this._currentAppender.append(props.field.label, {\n type: \"primitive\",\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n value: props.displayValue?.toString() ?? \"\",\n });\n }\n}\n"]}
|