@itwin/presentation-common 5.5.0-dev.1 → 5.5.0-dev.2
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/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.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.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
- 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.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/cjs/presentation-common/selection/SelectionScope.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.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.js.map +1 -1
- 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.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.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
- package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
- 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.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
- package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
- package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
- package/lib/esm/presentation-common/selection/SelectionScope.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Descriptor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Descriptor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,oCASkB;AAGlB,0CAA4C;AAC5C,+CAA6E;AAC7E,2CAAsG;AAuCtG,cAAc;AACd,IAAiB,eAAe,CA2D/B;AA3DD,WAAiB,eAAe;IAC9B,2DAA2D;IAC3D,SAAgB,kBAAkB,CAAC,IAAiC,EAAE,UAAqD;QACzH,IAAA,qBAAM,EAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QACxD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I,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;YAC5B,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAChC,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACjE,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAClI,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1KD,gCA0KC","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 Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n CompressedClassInfoJSON,\r\n RelatedClassInfo,\r\n RelatedClassInfoJSON,\r\n RelatedClassInfoWithOptionalRelationship,\r\n RelatedClassInfoWithOptionalRelationshipJSON,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n} from \"../EC.js\";\r\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition.js\";\r\nimport { Ruleset } from \"../rules/Ruleset.js\";\r\nimport { omitUndefined } from \"../Utils.js\";\r\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category.js\";\r\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields.js\";\r\n\r\n/**\r\n * Data structure that describes an ECClass in content [[Descriptor]].\r\n * @public\r\n */\r\nexport interface SelectClassInfo {\r\n /** Information about the ECClass */\r\n selectClassInfo: ClassInfo;\r\n\r\n /** Is the class handled polymorphically */\r\n isSelectPolymorphic: boolean;\r\n\r\n /** Relationship path from input class to the select class. */\r\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\r\n\r\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\r\n relatedPropertyPaths?: RelationshipPath[];\r\n\r\n /** Relationship paths to navigation property classes */\r\n navigationPropertyClasses?: RelatedClassInfo[];\r\n\r\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\r\n relatedInstancePaths?: RelationshipPath[];\r\n}\r\n\r\n/**\r\n * Serialized [[SelectClassInfo]] JSON representation\r\n * @public\r\n */\r\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfo> {\r\n selectClassInfo: TClassInfoJSON;\r\n isSelectPolymorphic: boolean;\r\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\r\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\r\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\r\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/** @public */\r\nexport namespace SelectClassInfo {\r\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\r\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\r\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\r\n return {\r\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\r\n isSelectPolymorphic: json.isSelectPolymorphic,\r\n ...(json.navigationPropertyClasses\r\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\r\n : undefined),\r\n ...(json.relatedInstancePaths\r\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n ...(json.pathFromInputToSelectClass\r\n ? {\r\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\r\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(json.relatedPropertyPaths\r\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n };\r\n }\r\n\r\n /** Serialize [[SelectClassInfo]] to compressed JSON */\r\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\r\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\r\n classesMap[id] = leftOverClassInfo;\r\n return {\r\n selectClassInfo: id,\r\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\r\n ...(selectClass.relatedInstancePaths\r\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\r\n : undefined),\r\n ...(selectClass.navigationPropertyClasses\r\n ? {\r\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\r\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(selectClass.pathFromInputToSelectClass\r\n ? {\r\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\r\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\r\n ),\r\n }\r\n : undefined),\r\n ...(selectClass.relatedPropertyPaths\r\n ? {\r\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\r\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\r\n ),\r\n }\r\n : undefined),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Flags that control content format.\r\n * @public\r\n */\r\nexport enum ContentFlags {\r\n /** Each content record only has [[InstanceKey]] and no data */\r\n KeysOnly = 1 << 0,\r\n\r\n /** Each content record additionally has a display label */\r\n ShowLabels = 1 << 2,\r\n\r\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\r\n MergeResults = 1 << 3,\r\n\r\n /** Content has only distinct values */\r\n DistinctValues = 1 << 4,\r\n\r\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\r\n NoFields = 1 << 5,\r\n\r\n /**\r\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\r\n * given input key at the cost of performance creating those items.\r\n */\r\n IncludeInputKeys = 1 << 8,\r\n}\r\n\r\n/**\r\n * Data sorting direction\r\n * @public\r\n */\r\nexport enum SortDirection {\r\n Ascending,\r\n Descending,\r\n}\r\n\r\n/**\r\n * Data structure that contains selection information. Used\r\n * for cases when requesting content after a selection change.\r\n *\r\n * @public\r\n */\r\nexport interface SelectionInfo {\r\n /** Name of selection provider which cause the selection change */\r\n providerName: string;\r\n /** Level of selection that changed */\r\n level?: number;\r\n}\r\n\r\n/**\r\n * Serialized [[Descriptor]] JSON representation.\r\n * @public\r\n */\r\nexport interface DescriptorJSON {\r\n classesMap: { [id: string]: CompressedClassInfoJSON };\r\n connectionId: string;\r\n inputKeysHash: string;\r\n selectionInfo?: SelectionInfo;\r\n displayType: string;\r\n selectClasses: SelectClassInfoJSON<Id64String>[];\r\n categories: CategoryDescriptionJSON[];\r\n fields: FieldJSON<Id64String>[];\r\n sortingFieldName?: string;\r\n sortDirection?: SortDirection;\r\n contentFlags: number;\r\n fieldsFilterExpression?: string;\r\n instanceFilter?: InstanceFilterDefinition;\r\n ruleset?: Ruleset;\r\n}\r\n\r\n/**\r\n * Descriptor overrides that can be used to customize content\r\n * @public\r\n */\r\nexport interface DescriptorOverrides {\r\n /**\r\n * Content display type. Can be accessed in presentation rules and used\r\n * to modify content in various ways. Defaults to empty string.\r\n */\r\n displayType?: string;\r\n\r\n /** Content flags used for content customization. See [[ContentFlags]] */\r\n contentFlags?: number;\r\n\r\n /** Fields selector that allows excluding or including only specified fields. */\r\n fieldsSelector?: {\r\n /** Should the specified fields be included or excluded */\r\n type: \"include\" | \"exclude\";\r\n /** A list of field descriptors that identify fields to include / exclude */\r\n fields: FieldDescriptor[];\r\n };\r\n\r\n /** Specification for sorting data. */\r\n sorting?: {\r\n /** Identifier of the field to use for sorting */\r\n field: FieldDescriptor;\r\n /** Sort direction */\r\n direction: SortDirection;\r\n };\r\n\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n}\r\n\r\n/**\r\n * Descriptor properties\r\n * @public\r\n */\r\nexport interface DescriptorSource {\r\n /** Id of the connection used to create the descriptor */\r\n readonly connectionId?: string;\r\n /** Hash of the input keys used to create the descriptor */\r\n readonly inputKeysHash?: string;\r\n /** Selection info used to create the descriptor */\r\n readonly selectionInfo?: SelectionInfo;\r\n /** Display type used to create the descriptor */\r\n readonly displayType: string;\r\n /** A list of classes that will be selected from when creating content with this descriptor */\r\n readonly selectClasses: SelectClassInfo[];\r\n /** A list of content field categories used in this descriptor */\r\n readonly categories: CategoryDescription[];\r\n /** A list of fields contained in the descriptor */\r\n readonly fields: Field[];\r\n /** [[ContentFlags]] used to create the descriptor */\r\n readonly contentFlags: number;\r\n /** Field used to sort the content */\r\n readonly sortingField?: Field;\r\n /** Sorting direction */\r\n readonly sortDirection?: SortDirection;\r\n /**\r\n * A ruleset used to create this descriptor.\r\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\r\n */\r\n readonly ruleset?: Ruleset;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n instanceFilter?: InstanceFilterDefinition;\r\n}\r\n\r\n/**\r\n * Data structure that describes content: fields, sorting, filtering, format, etc.\r\n * Descriptor may be changed to control how content is created.\r\n *\r\n * @public\r\n */\r\nexport class Descriptor implements DescriptorSource {\r\n /** Id of the connection used to create the descriptor */\r\n public readonly connectionId?: string;\r\n /** Hash of the input keys used to create the descriptor */\r\n public readonly inputKeysHash?: string;\r\n /** Selection info used to create the descriptor */\r\n public readonly selectionInfo?: SelectionInfo;\r\n /** Display type used to create the descriptor */\r\n public readonly displayType: string;\r\n /** A list of classes that will be selected when creating content with this descriptor */\r\n public readonly selectClasses: SelectClassInfo[];\r\n /** A list of content field categories used in this descriptor */\r\n public readonly categories: CategoryDescription[];\r\n /** A list of fields contained in the descriptor */\r\n public readonly fields: Field[];\r\n /** [[ContentFlags]] used to create the descriptor */\r\n public readonly contentFlags: number;\r\n /**\r\n * A ruleset used to create this descriptor.\r\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\r\n */\r\n public readonly ruleset?: Ruleset;\r\n /** Field used to sort the content */\r\n public sortingField?: Field;\r\n /** Sorting direction */\r\n public sortDirection?: SortDirection;\r\n /**\r\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\r\n * select fields.\r\n *\r\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\r\n * which removes access to content instance property values. Instead of referencing properties\r\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\r\n * when properties field merges multiple properties, this allows applying the filter on all of them\r\n * at once. This is useful for filtering table rows by column value, when content is displayed in\r\n * table format.\r\n */\r\n public fieldsFilterExpression?: string;\r\n /**\r\n * Instances filter that allows filtering content by class, properties of specific class\r\n * or properties of instances related to the content instance.\r\n *\r\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\r\n * specific select class rather than a union of multiple select classes. This means the filter has\r\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\r\n * This is useful for filtering instances of specific class.\r\n */\r\n public instanceFilter?: InstanceFilterDefinition;\r\n\r\n /** Construct a new Descriptor using a [[DescriptorSource]] */\r\n public constructor(source: DescriptorSource) {\r\n this.connectionId = source.connectionId;\r\n this.inputKeysHash = source.inputKeysHash;\r\n this.selectionInfo = source.selectionInfo;\r\n this.displayType = source.displayType;\r\n this.contentFlags = source.contentFlags;\r\n this.selectClasses = [...source.selectClasses];\r\n this.categories = [...source.categories];\r\n this.fields = [...source.fields];\r\n this.sortingField = source.sortingField;\r\n this.sortDirection = source.sortDirection;\r\n this.fieldsFilterExpression = source.fieldsFilterExpression;\r\n this.instanceFilter = source.instanceFilter;\r\n this.ruleset = source.ruleset;\r\n }\r\n\r\n /** Serialize [[Descriptor]] to JSON */\r\n public toJSON(): DescriptorJSON {\r\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\r\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\r\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\r\n return omitUndefined({\r\n displayType: this.displayType,\r\n contentFlags: this.contentFlags,\r\n categories: this.categories.map(CategoryDescription.toJSON),\r\n fields,\r\n selectClasses,\r\n classesMap,\r\n connectionId: this.connectionId ?? \"\",\r\n inputKeysHash: this.inputKeysHash ?? \"\",\r\n sortingFieldName: this.sortingField?.name,\r\n sortDirection: this.sortDirection,\r\n fieldsFilterExpression: this.fieldsFilterExpression,\r\n instanceFilter: this.instanceFilter,\r\n selectionInfo: this.selectionInfo,\r\n ruleset: this.ruleset,\r\n });\r\n }\r\n\r\n /** Deserialize [[Descriptor]] from JSON */\r\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n const {\r\n categories: jsonCategories,\r\n selectClasses: jsonSelectClasses,\r\n fields: jsonFields,\r\n connectionId,\r\n inputKeysHash,\r\n classesMap,\r\n sortingFieldName,\r\n ...leftOverJson\r\n } = json;\r\n const categories = CategoryDescription.listFromJSON(jsonCategories);\r\n const selectClasses = jsonSelectClasses.map((jsc) => SelectClassInfo.fromCompressedJSON(jsc, classesMap));\r\n const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\r\n return new Descriptor({\r\n ...leftOverJson,\r\n ...(connectionId ? /* c8 ignore next */ { connectionId } : undefined),\r\n ...(inputKeysHash ? /* c8 ignore next */ { inputKeysHash } : undefined),\r\n selectClasses,\r\n categories,\r\n fields,\r\n sortingField: getFieldByName(fields, sortingFieldName, true),\r\n });\r\n }\r\n\r\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\r\n return json\r\n .map((fieldJson: FieldJSON) => {\r\n const field = factory(fieldJson);\r\n if (field) {\r\n field.rebuildParentship();\r\n }\r\n return field;\r\n })\r\n .filter((field): field is Field => !!field);\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.fields, name, recurse);\r\n }\r\n\r\n /**\r\n * Get field by its descriptor.\r\n */\r\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\r\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\r\n }\r\n\r\n /**\r\n * Create descriptor overrides object from this descriptor.\r\n * @public\r\n */\r\n public createDescriptorOverrides(): DescriptorOverrides {\r\n const overrides: DescriptorOverrides = {};\r\n if (this.displayType) {\r\n overrides.displayType = this.displayType;\r\n }\r\n if (this.contentFlags !== 0) {\r\n overrides.contentFlags = this.contentFlags;\r\n }\r\n if (this.fieldsFilterExpression) {\r\n overrides.fieldsFilterExpression = this.fieldsFilterExpression;\r\n }\r\n if (this.instanceFilter) {\r\n overrides.instanceFilter = this.instanceFilter;\r\n }\r\n if (this.sortingField) {\r\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\r\n }\r\n return overrides;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Descriptor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Descriptor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,oCASkB;AAGlB,0CAA4C;AAC5C,+CAA6E;AAC7E,2CAAsG;AAuCtG,cAAc;AACd,IAAiB,eAAe,CA2D/B;AA3DD,WAAiB,eAAe;IAC9B,2DAA2D;I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,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3C,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;YAC5B,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YAChC,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QACjE,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAClI,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1KD,gCA0KC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n ClassInfo,\n CompressedClassInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n} from \"../EC.js\";\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition.js\";\nimport { Ruleset } from \"../rules/Ruleset.js\";\nimport { omitUndefined } from \"../Utils.js\";\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category.js\";\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields.js\";\n\n/**\n * Data structure that describes an ECClass in content [[Descriptor]].\n * @public\n */\nexport interface SelectClassInfo {\n /** Information about the ECClass */\n selectClassInfo: ClassInfo;\n\n /** Is the class handled polymorphically */\n isSelectPolymorphic: boolean;\n\n /** Relationship path from input class to the select class. */\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\n\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\n relatedPropertyPaths?: RelationshipPath[];\n\n /** Relationship paths to navigation property classes */\n navigationPropertyClasses?: RelatedClassInfo[];\n\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\n relatedInstancePaths?: RelationshipPath[];\n}\n\n/**\n * Serialized [[SelectClassInfo]] JSON representation\n * @public\n */\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfo> {\n selectClassInfo: TClassInfoJSON;\n isSelectPolymorphic: boolean;\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\n}\n\n/** @public */\nexport namespace SelectClassInfo {\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\n return {\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\n isSelectPolymorphic: json.isSelectPolymorphic,\n ...(json.navigationPropertyClasses\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\n : undefined),\n ...(json.relatedInstancePaths\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n ...(json.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(json.relatedPropertyPaths\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n };\n }\n\n /** Serialize [[SelectClassInfo]] to compressed JSON */\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\n classesMap[id] = leftOverClassInfo;\n return {\n selectClassInfo: id,\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\n ...(selectClass.relatedInstancePaths\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\n : undefined),\n ...(selectClass.navigationPropertyClasses\n ? {\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.relatedPropertyPaths\n ? {\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\n ),\n }\n : undefined),\n };\n }\n}\n\n/**\n * Flags that control content format.\n * @public\n */\nexport enum ContentFlags {\n /** Each content record only has [[InstanceKey]] and no data */\n KeysOnly = 1 << 0,\n\n /** Each content record additionally has a display label */\n ShowLabels = 1 << 2,\n\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\n MergeResults = 1 << 3,\n\n /** Content has only distinct values */\n DistinctValues = 1 << 4,\n\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\n NoFields = 1 << 5,\n\n /**\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\n * given input key at the cost of performance creating those items.\n */\n IncludeInputKeys = 1 << 8,\n}\n\n/**\n * Data sorting direction\n * @public\n */\nexport enum SortDirection {\n Ascending,\n Descending,\n}\n\n/**\n * Data structure that contains selection information. Used\n * for cases when requesting content after a selection change.\n *\n * @public\n */\nexport interface SelectionInfo {\n /** Name of selection provider which cause the selection change */\n providerName: string;\n /** Level of selection that changed */\n level?: number;\n}\n\n/**\n * Serialized [[Descriptor]] JSON representation.\n * @public\n */\nexport interface DescriptorJSON {\n classesMap: { [id: string]: CompressedClassInfoJSON };\n connectionId: string;\n inputKeysHash: string;\n selectionInfo?: SelectionInfo;\n displayType: string;\n selectClasses: SelectClassInfoJSON<Id64String>[];\n categories: CategoryDescriptionJSON[];\n fields: FieldJSON<Id64String>[];\n sortingFieldName?: string;\n sortDirection?: SortDirection;\n contentFlags: number;\n fieldsFilterExpression?: string;\n instanceFilter?: InstanceFilterDefinition;\n ruleset?: Ruleset;\n}\n\n/**\n * Descriptor overrides that can be used to customize content\n * @public\n */\nexport interface DescriptorOverrides {\n /**\n * Content display type. Can be accessed in presentation rules and used\n * to modify content in various ways. Defaults to empty string.\n */\n displayType?: string;\n\n /** Content flags used for content customization. See [[ContentFlags]] */\n contentFlags?: number;\n\n /** Fields selector that allows excluding or including only specified fields. */\n fieldsSelector?: {\n /** Should the specified fields be included or excluded */\n type: \"include\" | \"exclude\";\n /** A list of field descriptors that identify fields to include / exclude */\n fields: FieldDescriptor[];\n };\n\n /** Specification for sorting data. */\n sorting?: {\n /** Identifier of the field to use for sorting */\n field: FieldDescriptor;\n /** Sort direction */\n direction: SortDirection;\n };\n\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Descriptor properties\n * @public\n */\nexport interface DescriptorSource {\n /** Id of the connection used to create the descriptor */\n readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n readonly displayType: string;\n /** A list of classes that will be selected from when creating content with this descriptor */\n readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n readonly contentFlags: number;\n /** Field used to sort the content */\n readonly sortingField?: Field;\n /** Sorting direction */\n readonly sortDirection?: SortDirection;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n readonly ruleset?: Ruleset;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Data structure that describes content: fields, sorting, filtering, format, etc.\n * Descriptor may be changed to control how content is created.\n *\n * @public\n */\nexport class Descriptor implements DescriptorSource {\n /** Id of the connection used to create the descriptor */\n public readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n public readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n public readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n public readonly displayType: string;\n /** A list of classes that will be selected when creating content with this descriptor */\n public readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n public readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n public readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n public readonly contentFlags: number;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n public readonly ruleset?: Ruleset;\n /** Field used to sort the content */\n public sortingField?: Field;\n /** Sorting direction */\n public sortDirection?: SortDirection;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n public fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n public instanceFilter?: InstanceFilterDefinition;\n\n /** Construct a new Descriptor using a [[DescriptorSource]] */\n public constructor(source: DescriptorSource) {\n this.connectionId = source.connectionId;\n this.inputKeysHash = source.inputKeysHash;\n this.selectionInfo = source.selectionInfo;\n this.displayType = source.displayType;\n this.contentFlags = source.contentFlags;\n this.selectClasses = [...source.selectClasses];\n this.categories = [...source.categories];\n this.fields = [...source.fields];\n this.sortingField = source.sortingField;\n this.sortDirection = source.sortDirection;\n this.fieldsFilterExpression = source.fieldsFilterExpression;\n this.instanceFilter = source.instanceFilter;\n this.ruleset = source.ruleset;\n }\n\n /** Serialize [[Descriptor]] to JSON */\n public toJSON(): DescriptorJSON {\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\n return omitUndefined({\n displayType: this.displayType,\n contentFlags: this.contentFlags,\n categories: this.categories.map(CategoryDescription.toJSON),\n fields,\n selectClasses,\n classesMap,\n connectionId: this.connectionId ?? \"\",\n inputKeysHash: this.inputKeysHash ?? \"\",\n sortingFieldName: this.sortingField?.name,\n sortDirection: this.sortDirection,\n fieldsFilterExpression: this.fieldsFilterExpression,\n instanceFilter: this.instanceFilter,\n selectionInfo: this.selectionInfo,\n ruleset: this.ruleset,\n });\n }\n\n /** Deserialize [[Descriptor]] from JSON */\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\n if (!json) {\n return undefined;\n }\n\n const {\n categories: jsonCategories,\n selectClasses: jsonSelectClasses,\n fields: jsonFields,\n connectionId,\n inputKeysHash,\n classesMap,\n sortingFieldName,\n ...leftOverJson\n } = json;\n const categories = CategoryDescription.listFromJSON(jsonCategories);\n const selectClasses = jsonSelectClasses.map((jsc) => SelectClassInfo.fromCompressedJSON(jsc, classesMap));\n const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\n return new Descriptor({\n ...leftOverJson,\n ...(connectionId ? /* c8 ignore next */ { connectionId } : undefined),\n ...(inputKeysHash ? /* c8 ignore next */ { inputKeysHash } : undefined),\n selectClasses,\n categories,\n fields,\n sortingField: getFieldByName(fields, sortingFieldName, true),\n });\n }\n\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\n return json\n .map((fieldJson: FieldJSON) => {\n const field = factory(fieldJson);\n if (field) {\n field.rebuildParentship();\n }\n return field;\n })\n .filter((field): field is Field => !!field);\n }\n\n /**\n * Get field by its name\n * @param name Name of the field to find\n * @param recurse Recurse into nested fields\n */\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\n return getFieldByName(this.fields, name, recurse);\n }\n\n /**\n * Get field by its descriptor.\n */\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\n }\n\n /**\n * Create descriptor overrides object from this descriptor.\n * @public\n */\n public createDescriptorOverrides(): DescriptorOverrides {\n const overrides: DescriptorOverrides = {};\n if (this.displayType) {\n overrides.displayType = this.displayType;\n }\n if (this.contentFlags !== 0) {\n overrides.contentFlags = this.contentFlags;\n }\n if (this.fieldsFilterExpression) {\n overrides.fieldsFilterExpression = this.fieldsFilterExpression;\n }\n if (this.instanceFilter) {\n overrides.instanceFilter = this.instanceFilter;\n }\n if (this.sortingField) {\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\n }\n return overrides;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayTypes.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/DisplayTypes.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC,4BAA4B;IAC5B,qDAAuB,CAAA;IAEvB,yFAAyF;IACzF,2CAAa,CAAA;IAEb,sFAAsF;IACtF,2DAA6B,CAAA;IAE7B,yGAAyG;IACzG,2CAAa,CAAA;IAEb,6EAA6E;IAC7E,mDAAqB,CAAA;AACvB,CAAC,EAfW,0BAA0B,0CAA1B,0BAA0B,QAerC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"DisplayTypes.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/DisplayTypes.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;;;GAKG;AACH,IAAY,0BAeX;AAfD,WAAY,0BAA0B;IACpC,4BAA4B;IAC5B,qDAAuB,CAAA;IAEvB,yFAAyF;IACzF,2CAAa,CAAA;IAEb,sFAAsF;IACtF,2DAA6B,CAAA;IAE7B,yGAAyG;IACzG,2CAAa,CAAA;IAEb,6EAA6E;IAC7E,mDAAqB,CAAA;AACvB,CAAC,EAfW,0BAA0B,0CAA1B,0BAA0B,QAerC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\n/**\n * Displayed content types. Affects how the content is formatted, e.g.\n * the [[ContentFlags]].\n *\n * @public\n */\nexport enum DefaultContentDisplayTypes {\n /** Unknown content type. */\n Undefined = \"Undefined\", // eslint-disable-line id-denylist\n\n /** Grid or table view content type. By default adds [[ContentFlags.ShowLabels]] flag. */\n Grid = \"Grid\",\n\n /** Property pane content type. By default adds [[ContentFlags.MergeResults]] flag. */\n PropertyPane = \"PropertyPane\",\n\n /** List content type. By default adds [[ContentFlags.NoFields]] and [[ContentFlags.ShowLabels]] flags */\n List = \"List\",\n\n /** Viewport content type. By default adds [[ContentFlags.KeysOnly]] flag. */\n Viewport = \"Graphics\",\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Editor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Editor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\n/**\n * A data structure which describes property editor used\n * for a content [[Field]].\n *\n * @public\n */\nexport interface EditorDescription {\n /** Unique name */\n name: string;\n /** Editor-specific parameters */\n params?: any;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,oCAUkB;AAClB,0CAAoE;AACpE,oHAAmG;AACnG,0CAA4C;AAG5C,+CAAuD;AAwEvD,SAAS,iBAAiB,CAAC,KAAwB;IACjD,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC;AAKD,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO,CAAC,CAAE,KAAkC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO,CAAC,CAAE,KAAmC,CAAC,YAAY,CAAC;AAC7D,CA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AkB,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACpJ,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,SAA+B,EAAE,UAAiC;IAClG,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,QAAQ,CAAC,CAAC;IACvE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,4BAAiB,CAAC,6BAAkB,CAAC,eAAe,EAAE,gCAAgC,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,0BAA0B,CAAC,IAAgD,EAAE,UAAiC;IACrH,OAAO;QACL,QAAQ,EAAE,wBAAwB,CAAC,IAAI,EAAE,UAAU,CAAC;QACpD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,uDAAmB,CAAC,eAAe;QACpF,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,IAAI,EAAE;QACvD,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n CompressedClassInfoJSON,\r\n NavigationPropertyInfo,\r\n PropertyInfo,\r\n PropertyInfoJSON,\r\n RelatedClassInfo,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n StrippedRelationshipPath,\r\n} from \"../EC.js\";\r\nimport { PresentationError, PresentationStatus } from \"../Error.js\";\r\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification.js\";\r\nimport { omitUndefined } from \"../Utils.js\";\r\nimport { CategoryDescription } from \"./Category.js\";\r\nimport { EditorDescription } from \"./Editor.js\";\r\nimport { Property, PropertyJSON } from \"./Property.js\";\r\nimport { RendererDescription } from \"./Renderer.js\";\r\nimport { TypeDescription } from \"./TypeDescription.js\";\r\n\r\n/**\r\n * Data structure for a [[Field]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface BaseFieldJSON {\r\n category: string;\r\n name: string;\r\n label: string;\r\n type: TypeDescription;\r\n isReadonly: boolean;\r\n priority: number;\r\n renderer?: RendererDescription;\r\n editor?: EditorDescription;\r\n extendedData?: { [key: string]: unknown };\r\n}\r\n\r\n/**\r\n * Data structure for a [[PropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\n\r\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {\r\n properties: PropertyJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[ArrayPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n itemsField: PropertiesFieldJSON<TClassInfoJSON>;\r\n}\r\n\r\n/**\r\n * Data structure for a [[StructPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n memberFields: PropertiesFieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[NestedContentField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {\r\n contentClassInfo: TClassInfoJSON;\r\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\r\n relationshipMeaning?: RelationshipMeaning;\r\n actualPrimaryClassIds?: Id64String[];\r\n autoExpand?: boolean;\r\n nestedFields: FieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * JSON representation of a [[Field]]\r\n * @public\r\n */\r\nexport type FieldJSON<TClassInfoJSON = ClassInfo> =\r\n | BaseFieldJSON\r\n | PropertiesFieldJSON<TClassInfoJSON>\r\n | ArrayPropertiesFieldJSON<TClassInfoJSON>\r\n | StructPropertiesFieldJSON<TClassInfoJSON>\r\n | NestedContentFieldJSON<TClassInfoJSON>;\r\n\r\n/** Is supplied field a properties field. */\r\nfunction isPropertiesField(field: FieldJSON): field is PropertiesFieldJSON<any>;\r\nfunction isPropertiesField(field: Field): field is PropertiesField;\r\nfunction isPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as any).properties;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isArrayPropertiesField(field: FieldJSON): field is ArrayPropertiesFieldJSON<any>;\r\nfunction isArrayPropertiesField(field: Field): field is ArrayPropertiesField;\r\nfunction isArrayPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as ArrayPropertiesFieldJSON).itemsField;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isStructPropertiesField(field: FieldJSON): field is StructPropertiesFieldJSON<any>;\r\nfunction isStructPropertiesField(field: Field): field is StructPropertiesField;\r\nfunction isStructPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as StructPropertiesFieldJSON).memberFields;\r\n}\r\n\r\n/** Is supplied field a nested content field. */\r\nfunction isNestedContentField(field: FieldJSON): field is NestedContentFieldJSON<any>;\r\nfunction isNestedContentField(field: Field): field is NestedContentField;\r\nfunction isNestedContentField(field: FieldJSON | Field) {\r\n return !!(field as any).nestedFields;\r\n}\r\n\r\n/**\r\n * Props for creating [[Field]].\r\n * @public\r\n */\r\ninterface FieldProps {\r\n /** Category information */\r\n category: CategoryDescription;\r\n /** Unique name */\r\n name: string;\r\n /** Display label */\r\n label: string;\r\n /** Description of this field's values data type */\r\n type: TypeDescription;\r\n /** Are values in this field read-only */\r\n isReadonly: boolean;\r\n /** Priority of the field */\r\n priority: number;\r\n /** Property editor used to edit values of this field */\r\n editor?: EditorDescription;\r\n /** Property renderer used to render values of this field */\r\n renderer?: RendererDescription;\r\n /** Extended data associated with this field */\r\n extendedData?: { [key: string]: unknown };\r\n}\r\n\r\n/**\r\n * Describes a single content field. A field is usually represented as a grid column\r\n * or a property pane row.\r\n *\r\n * @public\r\n */\r\nexport class Field {\r\n /** Category information */\r\n public category: CategoryDescription;\r\n /** Unique name */\r\n public name: string;\r\n /** Display label */\r\n public label: string;\r\n /** Description of this field's values data type */\r\n public type: TypeDescription;\r\n /** Are values in this field read-only */\r\n public isReadonly: boolean;\r\n /** Priority of the field. Higher priority fields should appear first in the UI */\r\n public priority: number;\r\n /** Property renderer used to render values of this field */\r\n public renderer?: RendererDescription;\r\n /** Property editor used to edit values of this field */\r\n public editor?: EditorDescription;\r\n /** Extended data associated with this field */\r\n public extendedData?: { [key: string]: unknown };\r\n /** Parent field */\r\n private _parent?: NestedContentField;\r\n\r\n /**\r\n * Creates an instance of [[Field]].\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n * @param extendedData Extended data associated with this field\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `FieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n extendedData?: { [key: string]: unknown },\r\n );\r\n /** Creates an instance of [[Field]]. */\r\n public constructor(props: FieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | FieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n extendedData?: { [key: string]: unknown },\r\n ) {\r\n /* c8 ignore next 14 */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n extendedData,\r\n };\r\n this.category = props.category;\r\n this.name = props.name;\r\n this.label = props.label;\r\n this.type = props.type;\r\n this.isReadonly = props.isReadonly;\r\n this.priority = props.priority;\r\n this.editor = props.editor;\r\n this.renderer = props.renderer;\r\n this.extendedData = props.extendedData;\r\n }\r\n\r\n /**\r\n * Is this a [[PropertiesField]]\r\n */\r\n public isPropertiesField(): this is PropertiesField {\r\n return isPropertiesField(this);\r\n }\r\n\r\n /**\r\n * Is this a [[NestedContentField]]\r\n */\r\n public isNestedContentField(): this is NestedContentField {\r\n return isNestedContentField(this);\r\n }\r\n\r\n /**\r\n * Get parent\r\n */\r\n public get parent(): NestedContentField | undefined {\r\n return this._parent;\r\n }\r\n\r\n public clone() {\r\n const clone = new Field(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\r\n */\r\n public toJSON(): FieldJSON {\r\n return this.toCompressedJSON({});\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public toCompressedJSON(_classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\r\n return omitUndefined({\r\n category: this.category.name,\r\n name: this.name,\r\n label: this.label,\r\n type: this.type,\r\n isReadonly: this.isReadonly,\r\n priority: this.priority,\r\n renderer: this.renderer,\r\n editor: this.editor,\r\n extendedData: this.extendedData,\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize [[Field]] from JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isPropertiesField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return PropertiesField.fromJSON(json, categories);\r\n }\r\n if (isNestedContentField(json)) {\r\n return new NestedContentField({\r\n ...json,\r\n ...fromNestedContentFieldJSON(json, categories),\r\n nestedFields: json.nestedFields\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n });\r\n }\r\n return new Field({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /** Deserialize a [[Field]] from compressed JSON. */\r\n public static fromCompressedJSON(\r\n json: FieldJSON<string> | undefined,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isPropertiesField(json)) {\r\n return PropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n if (isNestedContentField(json)) {\r\n return NestedContentField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n return new Field({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, categories: CategoryDescription[]): CategoryDescription {\r\n return getCategoryFromFieldJson(fieldJson, categories);\r\n }\r\n\r\n /** Resets field's parent. */\r\n public resetParentship(): void {\r\n this._parent = undefined;\r\n }\r\n\r\n /** Sets provided [[NestedContentField]] as parent of this field. */\r\n public rebuildParentship(parentField?: NestedContentField): void {\r\n this._parent = parentField;\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public getFieldDescriptor(): FieldDescriptor {\r\n return {\r\n type: FieldDescriptorType.Name,\r\n fieldName: this.name,\r\n } as NamedFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public matchesDescriptor(descriptor: FieldDescriptor) {\r\n return FieldDescriptor.isNamed(descriptor) && descriptor.fieldName === this.name;\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[PropertiesField]].\r\n * @public\r\n */\r\ninterface PropertiesFieldProps extends FieldProps {\r\n /** A list of properties this field is created from */\r\n properties: Property[];\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar\r\n * EC properties.\r\n *\r\n * @public\r\n */\r\nexport class PropertiesField extends Field {\r\n /** A list of properties this field is created from */\r\n public properties: Property[];\r\n\r\n /**\r\n * Creates an instance of [[PropertiesField]].\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param properties A list of properties this field is created from\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `PropertiesFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[PropertiesField]]. */\r\n public constructor(props: PropertiesFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | PropertiesFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n properties?: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* c8 ignore next 14 */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n properties: properties!,\r\n };\r\n super(props);\r\n this.properties = props.properties;\r\n }\r\n\r\n /** Is this a an array property field */\r\n public isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return false;\r\n }\r\n /** Is this a an struct property field */\r\n public isStructPropertiesField(): this is StructPropertiesField {\r\n return false;\r\n }\r\n\r\n public override clone() {\r\n const clone = new PropertiesField(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): PropertiesFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n properties: this.properties,\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): PropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[PropertiesField]] from JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static override fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isArrayPropertiesField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return ArrayPropertiesField.fromJSON(json, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return StructPropertiesField.fromJSON(json, categories);\r\n }\r\n return new PropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[PropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: PropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): PropertiesField | undefined {\r\n if (isArrayPropertiesField(json)) {\r\n return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n return new PropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n });\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public override getFieldDescriptor(): FieldDescriptor {\r\n const pathFromPropertyToSelectClass = new Array<RelatedClassInfo>();\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n pathFromPropertyToSelectClass.push(...currAncestor.pathToPrimaryClass);\r\n currAncestor = currAncestor.parent;\r\n }\r\n return {\r\n type: FieldDescriptorType.Properties,\r\n pathFromSelectToPropertyClass: RelationshipPath.strip(RelationshipPath.reverse(pathFromPropertyToSelectClass)),\r\n properties: this.properties.map((p) => ({\r\n class: p.property.classInfo.name,\r\n name: p.property.name,\r\n })),\r\n } as PropertiesFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public override matchesDescriptor(descriptor: FieldDescriptor) {\r\n if (!FieldDescriptor.isProperties(descriptor)) {\r\n return false;\r\n }\r\n\r\n // ensure at least one descriptor property matches at least one property of this field\r\n if (\r\n !this.properties.some(({ property: fieldProperty }) =>\r\n descriptor.properties.some(\r\n (descriptorProperty) => fieldProperty.name === descriptorProperty.name && fieldProperty.classInfo.name === descriptorProperty.class,\r\n ),\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n // ensure path from select to property in field and in descriptor matches\r\n let stepsCount = 0;\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n const pathFromCurrentToItsParent = RelationshipPath.reverse(currAncestor.pathToPrimaryClass);\r\n for (const step of pathFromCurrentToItsParent) {\r\n if (descriptor.pathFromSelectToPropertyClass.length < stepsCount + 1) {\r\n return false;\r\n }\r\n if (!RelatedClassInfo.equals(step, descriptor.pathFromSelectToPropertyClass[descriptor.pathFromSelectToPropertyClass.length - stepsCount - 1])) {\r\n return false;\r\n }\r\n ++stepsCount;\r\n }\r\n currAncestor = currAncestor.parent;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[ArrayPropertiesField]].\r\n * @public\r\n */\r\ninterface ArrayPropertiesFieldProps extends PropertiesFieldProps {\r\n itemsField: PropertiesField;\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC array properties.\r\n * @public\r\n */\r\nexport class ArrayPropertiesField extends PropertiesField {\r\n public itemsField: PropertiesField;\r\n\r\n /**\r\n * Creates an instance of [[ArrayPropertiesField]].\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `ArrayPropertiesFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n itemsField: PropertiesField,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[ArrayPropertiesField]]. */\r\n public constructor(props: ArrayPropertiesFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | ArrayPropertiesFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n itemsField?: PropertiesField,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n properties?: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* c8 ignore next 15 */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n properties: properties!,\r\n itemsField: itemsField!,\r\n };\r\n super(props);\r\n this.itemsField = props.itemsField;\r\n }\r\n\r\n public override isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new ArrayPropertiesField(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): ArrayPropertiesFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n itemsField: this.itemsField.toJSON(),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): ArrayPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n itemsField: this.itemsField.toCompressedJSON(classesMap),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[ArrayPropertiesField]] from JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static override fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField {\r\n return new ArrayPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n itemsField: PropertiesField.fromJSON(json.itemsField, categories)!,\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize an [[ArrayPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: ArrayPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): ArrayPropertiesField {\r\n return new ArrayPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories)!,\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[StructPropertiesField]].\r\n * @public\r\n */\r\ninterface StructPropertiesFieldProps extends PropertiesFieldProps {\r\n memberFields: PropertiesField[];\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC struct properties.\r\n * @public\r\n */\r\nexport class StructPropertiesField extends PropertiesField {\r\n public memberFields: PropertiesField[];\r\n\r\n /**\r\n * Creates an instance of [[StructPropertiesField]].\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `StructPropertiesFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n memberFields: PropertiesField[],\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[StructPropertiesField]]. */\r\n public constructor(props: StructPropertiesFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | StructPropertiesFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n memberFields?: PropertiesField[],\r\n isReadonly?: boolean,\r\n priority?: number,\r\n properties?: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* c8 ignore next 15 */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n properties: properties!,\r\n memberFields: memberFields!,\r\n };\r\n super(props);\r\n this.memberFields = props.memberFields;\r\n }\r\n\r\n public override isStructPropertiesField(): this is StructPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new StructPropertiesField(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): StructPropertiesFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n memberFields: this.memberFields.map((m) => m.toJSON()),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): StructPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[StructPropertiesField]] from JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static override fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField {\r\n return new StructPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)!),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[StructPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: StructPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): StructPropertiesField {\r\n return new StructPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)!),\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[NestedContentField]].\r\n * @public\r\n */\r\ninterface NestedContentFieldProps extends FieldProps {\r\n /** Information about an ECClass whose properties are nested inside this field */\r\n contentClassInfo: ClassInfo;\r\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\r\n pathToPrimaryClass: RelationshipPath;\r\n /**\r\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\r\n * and content class of this field.\r\n *\r\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\r\n * presentation rules for creating the content.\r\n */\r\n relationshipMeaning?: RelationshipMeaning;\r\n /**\r\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\r\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\r\n * here to help.\r\n *\r\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\r\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\r\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\r\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\r\n */\r\n actualPrimaryClassIds?: Id64String[];\r\n /** Contained nested fields */\r\n nestedFields: Field[];\r\n /** Flag specifying whether field should be expanded */\r\n autoExpand?: boolean;\r\n}\r\n\r\n/**\r\n * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).\r\n *\r\n * @public\r\n */\r\nexport class NestedContentField extends Field {\r\n /** Information about an ECClass whose properties are nested inside this field */\r\n public contentClassInfo: ClassInfo;\r\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\r\n public pathToPrimaryClass: RelationshipPath;\r\n /**\r\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\r\n * and content class of this field.\r\n *\r\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\r\n * presentation rules for creating the content.\r\n */\r\n public relationshipMeaning: RelationshipMeaning;\r\n /**\r\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\r\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\r\n * here to help.\r\n *\r\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\r\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\r\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\r\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\r\n */\r\n public actualPrimaryClassIds: Id64String[];\r\n /** Contained nested fields */\r\n public nestedFields: Field[];\r\n /** Flag specifying whether field should be expanded */\r\n public autoExpand?: boolean;\r\n\r\n /**\r\n * Creates an instance of [[NestedContentField]].\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param contentClassInfo Information about an ECClass whose properties are nested inside this field\r\n * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)\r\n * @param nestedFields Contained nested fields\r\n * @param editor Property editor used to edit values of this field\r\n * @param autoExpand Flag specifying whether field should be expanded\r\n * @param relationshipMeaning RelationshipMeaning of the field\r\n * @param renderer Property renderer used to render values of this field\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `NestedContentFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n contentClassInfo: ClassInfo,\r\n pathToPrimaryClass: RelationshipPath,\r\n nestedFields: Field[],\r\n editor?: EditorDescription,\r\n autoExpand?: boolean,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[NestedContentField]]. */\r\n public constructor(props: NestedContentFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | NestedContentFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n contentClassInfo?: ClassInfo,\r\n pathToPrimaryClass?: RelationshipPath,\r\n nestedFields?: Field[],\r\n editor?: EditorDescription,\r\n autoExpand?: boolean,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* c8 ignore next 17 */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n contentClassInfo: contentClassInfo!,\r\n pathToPrimaryClass: pathToPrimaryClass!,\r\n nestedFields: nestedFields!,\r\n autoExpand,\r\n };\r\n super(props);\r\n this.contentClassInfo = props.contentClassInfo;\r\n this.pathToPrimaryClass = props.pathToPrimaryClass;\r\n this.relationshipMeaning = props.relationshipMeaning ?? RelationshipMeaning.RelatedInstance;\r\n this.nestedFields = props.nestedFields;\r\n this.autoExpand = props.autoExpand;\r\n this.actualPrimaryClassIds = props.actualPrimaryClassIds ?? [];\r\n }\r\n\r\n public override clone() {\r\n const clone = new NestedContentField({\r\n ...this,\r\n nestedFields: this.nestedFields.map((n) => n.clone()),\r\n });\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.nestedFields, name, recurse);\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): NestedContentFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n contentClassInfo: this.contentClassInfo,\r\n pathToPrimaryClass: this.pathToPrimaryClass,\r\n relationshipMeaning: this.relationshipMeaning,\r\n actualPrimaryClassIds: this.actualPrimaryClassIds,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\r\n ...(this.autoExpand ? { autoExpand: true } : undefined),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): NestedContentFieldJSON<string> {\r\n const { id, ...leftOverInfo } = this.contentClassInfo;\r\n classesMap[id] = leftOverInfo;\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n contentClassInfo: id,\r\n relationshipMeaning: this.relationshipMeaning,\r\n actualPrimaryClassIds: this.actualPrimaryClassIds,\r\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\r\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\r\n ...(this.autoExpand ? { autoExpand: true } : undefined),\r\n };\r\n }\r\n\r\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\r\n public static override fromCompressedJSON(\r\n json: NestedContentFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ) {\r\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\r\n return new NestedContentField({\r\n ...json,\r\n ...fromNestedContentFieldJSON(json, categories),\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },\r\n pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),\r\n });\r\n }\r\n\r\n /** Resets parent of this field and all nested fields. */\r\n public override resetParentship(): void {\r\n super.resetParentship();\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.resetParentship();\r\n }\r\n }\r\n\r\n /**\r\n * Sets provided [[NestedContentField]] as parent of this fields and recursively updates\r\n * all nested fields parents.\r\n */\r\n public override rebuildParentship(parentField?: NestedContentField): void {\r\n super.rebuildParentship(parentField);\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.rebuildParentship(this);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const getFieldByName = (fields: Field[], name: string | undefined, recurse?: boolean): Field | undefined => {\r\n if (name) {\r\n for (const field of fields) {\r\n if (field.name === name) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByName(field.nestedFields, name, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/** @internal */\r\nexport const getFieldByDescriptor = (fields: Field[], fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined => {\r\n for (const field of fields) {\r\n if (field.matchesDescriptor(fieldDescriptor)) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByDescriptor(field.nestedFields, fieldDescriptor, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Types of different field descriptors.\r\n * @public\r\n */\r\nexport enum FieldDescriptorType {\r\n Name = \"name\",\r\n Properties = \"properties\",\r\n}\r\n\r\n/**\r\n * Base for a field descriptor\r\n * @public\r\n */\r\nexport interface FieldDescriptorBase {\r\n type: FieldDescriptorType;\r\n}\r\n\r\n/**\r\n * A union of all possible field descriptor types\r\n * @public\r\n */\r\nexport type FieldDescriptor = NamedFieldDescriptor | PropertiesFieldDescriptor;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace FieldDescriptor {\r\n /** Is this a named field descriptor */\r\n export function isNamed(d: FieldDescriptor): d is NamedFieldDescriptor {\r\n return d.type === FieldDescriptorType.Name;\r\n }\r\n /** Is this a properties field descriptor */\r\n export function isProperties(d: FieldDescriptor): d is PropertiesFieldDescriptor {\r\n return d.type === FieldDescriptorType.Properties;\r\n }\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a content field by its unique name.\r\n * @public\r\n */\r\nexport interface NamedFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Name;\r\n fieldName: string;\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a properties field using a list of\r\n * properties that the field contains.\r\n * @public\r\n */\r\nexport interface PropertiesFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Properties;\r\n pathFromSelectToPropertyClass: StrippedRelationshipPath;\r\n /**\r\n * A list of properties that describe the field. At least one property in the list must\r\n * match at least one property in the field for the descriptor to be considered matching.\r\n */\r\n properties: Array<{\r\n /** Full class name */\r\n class: string;\r\n /** Property name */\r\n name: string;\r\n }>;\r\n}\r\n\r\nfunction fromCompressedPropertyJSON(compressedPropertyJSON: PropertyJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): Property {\r\n return {\r\n property: fromCompressedPropertyInfoJSON(compressedPropertyJSON.property, classesMap),\r\n };\r\n}\r\n\r\nfunction fromCompressedPropertyInfoJSON(compressedPropertyJSON: PropertyInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfo {\r\n assert(classesMap.hasOwnProperty(compressedPropertyJSON.classInfo));\r\n\r\n const { navigationPropertyInfo, ...leftOverPropertyJSON } = compressedPropertyJSON;\r\n\r\n return {\r\n ...leftOverPropertyJSON,\r\n classInfo: { id: compressedPropertyJSON.classInfo, ...classesMap[compressedPropertyJSON.classInfo] },\r\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\r\n };\r\n}\r\n\r\nfunction getCategoryFromFieldJson(fieldJson: { category: string }, categories: CategoryDescription[]): CategoryDescription {\r\n const category = categories.find((c) => c.name === fieldJson.category);\r\n if (!category) {\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);\r\n }\r\n return category;\r\n}\r\n\r\nfunction fromNestedContentFieldJSON(json: NestedContentFieldJSON<ClassInfo | string>, categories: CategoryDescription[]) {\r\n return {\r\n category: getCategoryFromFieldJson(json, categories),\r\n relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,\r\n actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],\r\n autoExpand: json.autoExpand,\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,oCAUkB;AAClB,0CAAoE;AACpE,oHAAmG;AACnG,0CAA4C;AAG5C,+CAAuD;AAwEvD,SAAS,iBAAiB,CAAC,KAAwB;IACjD,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC;AAKD,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO,CAAC,CAAE,KAAkC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO,CAAC,CAAE,KAAmC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAKD,SAAS,oBAAoB,CAAC,KAAwB;IACpD,OAAO,CAAC,CAAE,KAAa,CAAC,YAAY,CAAC;AACvC,CAAC;AA2BD;;;;;GAKG;AACH,MAAa,KAAK;IAChB,2BAA2B;IACpB,QAAQ,CAAsB;IACrC,kBAAkB;IACX,IAAI,CAAS;IACpB,oBAAoB;IACb,KAAK,CAAS;IACrB,mDAAmD;IAC5C,IAAI,CAAkB;IAC7B,yCAAyC;IAClC,UAAU,CAAU;IAC3B,kFAAkF;IAC3E,QAAQ,CAAS;IACxB,4DAA4D;IACrD,QAAQ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C,eAAe,EAAE,gCAAgC,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,0BAA0B,CAAC,IAAgD,EAAE,UAAiC;IACrH,OAAO;QACL,QAAQ,EAAE,wBAAwB,CAAC,IAAI,EAAE,UAAU,CAAC;QACpD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,uDAAmB,CAAC,eAAe;QACpF,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,IAAI,EAAE;QACvD,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n ClassInfo,\n CompressedClassInfoJSON,\n NavigationPropertyInfo,\n PropertyInfo,\n PropertyInfoJSON,\n RelatedClassInfo,\n RelationshipPath,\n RelationshipPathJSON,\n StrippedRelationshipPath,\n} from \"../EC.js\";\nimport { PresentationError, PresentationStatus } from \"../Error.js\";\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification.js\";\nimport { omitUndefined } from \"../Utils.js\";\nimport { CategoryDescription } from \"./Category.js\";\nimport { EditorDescription } from \"./Editor.js\";\nimport { Property, PropertyJSON } from \"./Property.js\";\nimport { RendererDescription } from \"./Renderer.js\";\nimport { TypeDescription } from \"./TypeDescription.js\";\n\n/**\n * Data structure for a [[Field]] serialized to JSON.\n * @public\n */\nexport interface BaseFieldJSON {\n category: string;\n name: string;\n label: string;\n type: TypeDescription;\n isReadonly: boolean;\n priority: number;\n renderer?: RendererDescription;\n editor?: EditorDescription;\n extendedData?: { [key: string]: unknown };\n}\n\n/**\n * Data structure for a [[PropertiesField]] serialized to JSON.\n * @public\n */\n\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {\n properties: PropertyJSON<TClassInfoJSON>[];\n}\n\n/**\n * Data structure for a [[ArrayPropertiesField]] serialized to JSON.\n * @public\n */\nexport interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\n itemsField: PropertiesFieldJSON<TClassInfoJSON>;\n}\n\n/**\n * Data structure for a [[StructPropertiesField]] serialized to JSON.\n * @public\n */\nexport interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\n memberFields: PropertiesFieldJSON<TClassInfoJSON>[];\n}\n\n/**\n * Data structure for a [[NestedContentField]] serialized to JSON.\n * @public\n */\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {\n contentClassInfo: TClassInfoJSON;\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\n relationshipMeaning?: RelationshipMeaning;\n actualPrimaryClassIds?: Id64String[];\n autoExpand?: boolean;\n nestedFields: FieldJSON<TClassInfoJSON>[];\n}\n\n/**\n * JSON representation of a [[Field]]\n * @public\n */\nexport type FieldJSON<TClassInfoJSON = ClassInfo> =\n | BaseFieldJSON\n | PropertiesFieldJSON<TClassInfoJSON>\n | ArrayPropertiesFieldJSON<TClassInfoJSON>\n | StructPropertiesFieldJSON<TClassInfoJSON>\n | NestedContentFieldJSON<TClassInfoJSON>;\n\n/** Is supplied field a properties field. */\nfunction isPropertiesField(field: FieldJSON): field is PropertiesFieldJSON<any>;\nfunction isPropertiesField(field: Field): field is PropertiesField;\nfunction isPropertiesField(field: FieldJSON | Field) {\n return !!(field as any).properties;\n}\n\n/** Is supplied field an array properties field. */\nfunction isArrayPropertiesField(field: FieldJSON): field is ArrayPropertiesFieldJSON<any>;\nfunction isArrayPropertiesField(field: Field): field is ArrayPropertiesField;\nfunction isArrayPropertiesField(field: FieldJSON | Field) {\n return !!(field as ArrayPropertiesFieldJSON).itemsField;\n}\n\n/** Is supplied field an array properties field. */\nfunction isStructPropertiesField(field: FieldJSON): field is StructPropertiesFieldJSON<any>;\nfunction isStructPropertiesField(field: Field): field is StructPropertiesField;\nfunction isStructPropertiesField(field: FieldJSON | Field) {\n return !!(field as StructPropertiesFieldJSON).memberFields;\n}\n\n/** Is supplied field a nested content field. */\nfunction isNestedContentField(field: FieldJSON): field is NestedContentFieldJSON<any>;\nfunction isNestedContentField(field: Field): field is NestedContentField;\nfunction isNestedContentField(field: FieldJSON | Field) {\n return !!(field as any).nestedFields;\n}\n\n/**\n * Props for creating [[Field]].\n * @public\n */\ninterface FieldProps {\n /** Category information */\n category: CategoryDescription;\n /** Unique name */\n name: string;\n /** Display label */\n label: string;\n /** Description of this field's values data type */\n type: TypeDescription;\n /** Are values in this field read-only */\n isReadonly: boolean;\n /** Priority of the field */\n priority: number;\n /** Property editor used to edit values of this field */\n editor?: EditorDescription;\n /** Property renderer used to render values of this field */\n renderer?: RendererDescription;\n /** Extended data associated with this field */\n extendedData?: { [key: string]: unknown };\n}\n\n/**\n * Describes a single content field. A field is usually represented as a grid column\n * or a property pane row.\n *\n * @public\n */\nexport class Field {\n /** Category information */\n public category: CategoryDescription;\n /** Unique name */\n public name: string;\n /** Display label */\n public label: string;\n /** Description of this field's values data type */\n public type: TypeDescription;\n /** Are values in this field read-only */\n public isReadonly: boolean;\n /** Priority of the field. Higher priority fields should appear first in the UI */\n public priority: number;\n /** Property renderer used to render values of this field */\n public renderer?: RendererDescription;\n /** Property editor used to edit values of this field */\n public editor?: EditorDescription;\n /** Extended data associated with this field */\n public extendedData?: { [key: string]: unknown };\n /** Parent field */\n private _parent?: NestedContentField;\n\n /**\n * Creates an instance of [[Field]].\n * @param category Category information\n * @param name Unique name\n * @param label Display label\n * @param type Description of this field's values data type\n * @param isReadonly Are values in this field read-only\n * @param priority Priority of the field\n * @param editor Property editor used to edit values of this field\n * @param renderer Property renderer used to render values of this field\n * @param extendedData Extended data associated with this field\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `FieldProps` instead.\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n type: TypeDescription,\n isReadonly: boolean,\n priority: number,\n editor?: EditorDescription,\n renderer?: RendererDescription,\n extendedData?: { [key: string]: unknown },\n );\n /** Creates an instance of [[Field]]. */\n public constructor(props: FieldProps);\n public constructor(\n categoryOrProps: CategoryDescription | FieldProps,\n name?: string,\n label?: string,\n type?: TypeDescription,\n isReadonly?: boolean,\n priority?: number,\n editor?: EditorDescription,\n renderer?: RendererDescription,\n extendedData?: { [key: string]: unknown },\n ) {\n /* c8 ignore next 14 */\n const props =\n \"category\" in categoryOrProps\n ? categoryOrProps\n : {\n category: categoryOrProps,\n name: name!,\n label: label!,\n type: type!,\n isReadonly: isReadonly!,\n priority: priority!,\n editor,\n renderer,\n extendedData,\n };\n this.category = props.category;\n this.name = props.name;\n this.label = props.label;\n this.type = props.type;\n this.isReadonly = props.isReadonly;\n this.priority = props.priority;\n this.editor = props.editor;\n this.renderer = props.renderer;\n this.extendedData = props.extendedData;\n }\n\n /**\n * Is this a [[PropertiesField]]\n */\n public isPropertiesField(): this is PropertiesField {\n return isPropertiesField(this);\n }\n\n /**\n * Is this a [[NestedContentField]]\n */\n public isNestedContentField(): this is NestedContentField {\n return isNestedContentField(this);\n }\n\n /**\n * Get parent\n */\n public get parent(): NestedContentField | undefined {\n return this._parent;\n }\n\n public clone() {\n const clone = new Field(this);\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /**\n * Serialize this object to JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\n */\n public toJSON(): FieldJSON {\n return this.toCompressedJSON({});\n }\n\n /** Serialize this object to compressed JSON */\n public toCompressedJSON(_classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\n return omitUndefined({\n category: this.category.name,\n name: this.name,\n label: this.label,\n type: this.type,\n isReadonly: this.isReadonly,\n priority: this.priority,\n renderer: this.renderer,\n editor: this.editor,\n extendedData: this.extendedData,\n });\n }\n\n /**\n * Deserialize [[Field]] from JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\n */\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\n if (!json) {\n return undefined;\n }\n if (isPropertiesField(json)) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return PropertiesField.fromJSON(json, categories);\n }\n if (isNestedContentField(json)) {\n return new NestedContentField({\n ...json,\n ...fromNestedContentFieldJSON(json, categories),\n nestedFields: json.nestedFields\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\n .filter((nestedField): nestedField is Field => !!nestedField),\n });\n }\n return new Field({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n });\n }\n\n /** Deserialize a [[Field]] from compressed JSON. */\n public static fromCompressedJSON(\n json: FieldJSON<string> | undefined,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): Field | undefined {\n if (!json) {\n return undefined;\n }\n if (isPropertiesField(json)) {\n return PropertiesField.fromCompressedJSON(json, classesMap, categories);\n }\n if (isNestedContentField(json)) {\n return NestedContentField.fromCompressedJSON(json, classesMap, categories);\n }\n return new Field({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n });\n }\n\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, categories: CategoryDescription[]): CategoryDescription {\n return getCategoryFromFieldJson(fieldJson, categories);\n }\n\n /** Resets field's parent. */\n public resetParentship(): void {\n this._parent = undefined;\n }\n\n /** Sets provided [[NestedContentField]] as parent of this field. */\n public rebuildParentship(parentField?: NestedContentField): void {\n this._parent = parentField;\n }\n\n /**\n * Get descriptor for this field.\n * @public\n */\n public getFieldDescriptor(): FieldDescriptor {\n return {\n type: FieldDescriptorType.Name,\n fieldName: this.name,\n } as NamedFieldDescriptor;\n }\n\n /**\n * Checks if this field matches given field descriptor\n * @see [[getFieldDescriptor]]\n */\n public matchesDescriptor(descriptor: FieldDescriptor) {\n return FieldDescriptor.isNamed(descriptor) && descriptor.fieldName === this.name;\n }\n}\n\n/**\n * Props for creating [[PropertiesField]].\n * @public\n */\ninterface PropertiesFieldProps extends FieldProps {\n /** A list of properties this field is created from */\n properties: Property[];\n}\n\n/**\n * Describes a content field that's based on one or more similar\n * EC properties.\n *\n * @public\n */\nexport class PropertiesField extends Field {\n /** A list of properties this field is created from */\n public properties: Property[];\n\n /**\n * Creates an instance of [[PropertiesField]].\n * @param category Category information\n * @param name Unique name\n * @param label Display label\n * @param type Description of this field's values data type\n * @param isReadonly Are values in this field read-only\n * @param priority Priority of the field\n * @param properties A list of properties this field is created from\n * @param editor Property editor used to edit values of this field\n * @param renderer Property renderer used to render values of this field\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `PropertiesFieldProps` instead.\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n type: TypeDescription,\n isReadonly: boolean,\n priority: number,\n properties: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n );\n /** Creates an instance of [[PropertiesField]]. */\n public constructor(props: PropertiesFieldProps);\n public constructor(\n categoryOrProps: CategoryDescription | PropertiesFieldProps,\n name?: string,\n label?: string,\n type?: TypeDescription,\n isReadonly?: boolean,\n priority?: number,\n properties?: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n ) {\n /* c8 ignore next 14 */\n const props =\n \"category\" in categoryOrProps\n ? categoryOrProps\n : {\n category: categoryOrProps,\n name: name!,\n label: label!,\n type: type!,\n isReadonly: isReadonly!,\n priority: priority!,\n editor,\n renderer,\n properties: properties!,\n };\n super(props);\n this.properties = props.properties;\n }\n\n /** Is this a an array property field */\n public isArrayPropertiesField(): this is ArrayPropertiesField {\n return false;\n }\n /** Is this a an struct property field */\n public isStructPropertiesField(): this is StructPropertiesField {\n return false;\n }\n\n public override clone() {\n const clone = new PropertiesField(this);\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /**\n * Serialize this object to JSON\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\n */\n public override toJSON(): PropertiesFieldJSON {\n return {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...super.toJSON(),\n properties: this.properties,\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): PropertiesFieldJSON<string> {\n return {\n ...super.toCompressedJSON(classesMap),\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\n };\n }\n\n /**\n * Deserialize [[PropertiesField]] from JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\n */\n public static override fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined {\n if (!json) {\n return undefined;\n }\n if (isArrayPropertiesField(json)) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return ArrayPropertiesField.fromJSON(json, categories);\n }\n if (isStructPropertiesField(json)) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return StructPropertiesField.fromJSON(json, categories);\n }\n return new PropertiesField({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n });\n }\n\n /**\n * Deserialize a [[PropertiesField]] from compressed JSON.\n * @public\n */\n public static override fromCompressedJSON(\n json: PropertiesFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): PropertiesField | undefined {\n if (isArrayPropertiesField(json)) {\n return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);\n }\n if (isStructPropertiesField(json)) {\n return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);\n }\n return new PropertiesField({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\n });\n }\n\n /**\n * Get descriptor for this field.\n * @public\n */\n public override getFieldDescriptor(): FieldDescriptor {\n const pathFromPropertyToSelectClass = new Array<RelatedClassInfo>();\n let currAncestor = this.parent;\n while (currAncestor) {\n pathFromPropertyToSelectClass.push(...currAncestor.pathToPrimaryClass);\n currAncestor = currAncestor.parent;\n }\n return {\n type: FieldDescriptorType.Properties,\n pathFromSelectToPropertyClass: RelationshipPath.strip(RelationshipPath.reverse(pathFromPropertyToSelectClass)),\n properties: this.properties.map((p) => ({\n class: p.property.classInfo.name,\n name: p.property.name,\n })),\n } as PropertiesFieldDescriptor;\n }\n\n /**\n * Checks if this field matches given field descriptor\n * @see [[getFieldDescriptor]]\n */\n public override matchesDescriptor(descriptor: FieldDescriptor) {\n if (!FieldDescriptor.isProperties(descriptor)) {\n return false;\n }\n\n // ensure at least one descriptor property matches at least one property of this field\n if (\n !this.properties.some(({ property: fieldProperty }) =>\n descriptor.properties.some(\n (descriptorProperty) => fieldProperty.name === descriptorProperty.name && fieldProperty.classInfo.name === descriptorProperty.class,\n ),\n )\n ) {\n return false;\n }\n\n // ensure path from select to property in field and in descriptor matches\n let stepsCount = 0;\n let currAncestor = this.parent;\n while (currAncestor) {\n const pathFromCurrentToItsParent = RelationshipPath.reverse(currAncestor.pathToPrimaryClass);\n for (const step of pathFromCurrentToItsParent) {\n if (descriptor.pathFromSelectToPropertyClass.length < stepsCount + 1) {\n return false;\n }\n if (!RelatedClassInfo.equals(step, descriptor.pathFromSelectToPropertyClass[descriptor.pathFromSelectToPropertyClass.length - stepsCount - 1])) {\n return false;\n }\n ++stepsCount;\n }\n currAncestor = currAncestor.parent;\n }\n return true;\n }\n}\n\n/**\n * Props for creating [[ArrayPropertiesField]].\n * @public\n */\ninterface ArrayPropertiesFieldProps extends PropertiesFieldProps {\n itemsField: PropertiesField;\n}\n\n/**\n * Describes a content field that's based on one or more similar EC array properties.\n * @public\n */\nexport class ArrayPropertiesField extends PropertiesField {\n public itemsField: PropertiesField;\n\n /**\n * Creates an instance of [[ArrayPropertiesField]].\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `ArrayPropertiesFieldProps` instead.\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n type: TypeDescription,\n itemsField: PropertiesField,\n isReadonly: boolean,\n priority: number,\n properties: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n );\n /** Creates an instance of [[ArrayPropertiesField]]. */\n public constructor(props: ArrayPropertiesFieldProps);\n public constructor(\n categoryOrProps: CategoryDescription | ArrayPropertiesFieldProps,\n name?: string,\n label?: string,\n type?: TypeDescription,\n itemsField?: PropertiesField,\n isReadonly?: boolean,\n priority?: number,\n properties?: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n ) {\n /* c8 ignore next 15 */\n const props =\n \"category\" in categoryOrProps\n ? categoryOrProps\n : {\n category: categoryOrProps,\n name: name!,\n label: label!,\n type: type!,\n isReadonly: isReadonly!,\n priority: priority!,\n editor,\n renderer,\n properties: properties!,\n itemsField: itemsField!,\n };\n super(props);\n this.itemsField = props.itemsField;\n }\n\n public override isArrayPropertiesField(): this is ArrayPropertiesField {\n return true;\n }\n\n public override clone() {\n const clone = new ArrayPropertiesField(this);\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /**\n * Serialize this object to JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\n */\n public override toJSON(): ArrayPropertiesFieldJSON {\n return {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...super.toJSON(),\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n itemsField: this.itemsField.toJSON(),\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): ArrayPropertiesFieldJSON<string> {\n return {\n ...super.toCompressedJSON(classesMap),\n itemsField: this.itemsField.toCompressedJSON(classesMap),\n };\n }\n\n /**\n * Deserialize [[ArrayPropertiesField]] from JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\n */\n public static override fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField {\n return new ArrayPropertiesField({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n itemsField: PropertiesField.fromJSON(json.itemsField, categories)!,\n });\n }\n\n /**\n * Deserialize an [[ArrayPropertiesField]] from compressed JSON.\n * @public\n */\n public static override fromCompressedJSON(\n json: ArrayPropertiesFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): ArrayPropertiesField {\n return new ArrayPropertiesField({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\n itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories)!,\n });\n }\n}\n\n/**\n * Props for creating [[StructPropertiesField]].\n * @public\n */\ninterface StructPropertiesFieldProps extends PropertiesFieldProps {\n memberFields: PropertiesField[];\n}\n\n/**\n * Describes a content field that's based on one or more similar EC struct properties.\n * @public\n */\nexport class StructPropertiesField extends PropertiesField {\n public memberFields: PropertiesField[];\n\n /**\n * Creates an instance of [[StructPropertiesField]].\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `StructPropertiesFieldProps` instead.\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n type: TypeDescription,\n memberFields: PropertiesField[],\n isReadonly: boolean,\n priority: number,\n properties: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n );\n /** Creates an instance of [[StructPropertiesField]]. */\n public constructor(props: StructPropertiesFieldProps);\n public constructor(\n categoryOrProps: CategoryDescription | StructPropertiesFieldProps,\n name?: string,\n label?: string,\n type?: TypeDescription,\n memberFields?: PropertiesField[],\n isReadonly?: boolean,\n priority?: number,\n properties?: Property[],\n editor?: EditorDescription,\n renderer?: RendererDescription,\n ) {\n /* c8 ignore next 15 */\n const props =\n \"category\" in categoryOrProps\n ? categoryOrProps\n : {\n category: categoryOrProps,\n name: name!,\n label: label!,\n type: type!,\n isReadonly: isReadonly!,\n priority: priority!,\n editor,\n renderer,\n properties: properties!,\n memberFields: memberFields!,\n };\n super(props);\n this.memberFields = props.memberFields;\n }\n\n public override isStructPropertiesField(): this is StructPropertiesField {\n return true;\n }\n\n public override clone() {\n const clone = new StructPropertiesField(this);\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /**\n * Serialize this object to JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\n */\n public override toJSON(): StructPropertiesFieldJSON {\n return {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...super.toJSON(),\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n memberFields: this.memberFields.map((m) => m.toJSON()),\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): StructPropertiesFieldJSON<string> {\n return {\n ...super.toCompressedJSON(classesMap),\n memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),\n };\n }\n\n /**\n * Deserialize [[StructPropertiesField]] from JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[fromCompressedJSON]] instead.\n */\n public static override fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField {\n return new StructPropertiesField({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)!),\n });\n }\n\n /**\n * Deserialize a [[StructPropertiesField]] from compressed JSON.\n * @public\n */\n public static override fromCompressedJSON(\n json: StructPropertiesFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ): StructPropertiesField {\n return new StructPropertiesField({\n ...json,\n category: this.getCategoryFromFieldJson(json, categories),\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\n memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)!),\n });\n }\n}\n\n/**\n * Props for creating [[NestedContentField]].\n * @public\n */\ninterface NestedContentFieldProps extends FieldProps {\n /** Information about an ECClass whose properties are nested inside this field */\n contentClassInfo: ClassInfo;\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\n pathToPrimaryClass: RelationshipPath;\n /**\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\n * and content class of this field.\n *\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\n * presentation rules for creating the content.\n */\n relationshipMeaning?: RelationshipMeaning;\n /**\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\n * here to help.\n *\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\n */\n actualPrimaryClassIds?: Id64String[];\n /** Contained nested fields */\n nestedFields: Field[];\n /** Flag specifying whether field should be expanded */\n autoExpand?: boolean;\n}\n\n/**\n * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).\n *\n * @public\n */\nexport class NestedContentField extends Field {\n /** Information about an ECClass whose properties are nested inside this field */\n public contentClassInfo: ClassInfo;\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\n public pathToPrimaryClass: RelationshipPath;\n /**\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\n * and content class of this field.\n *\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\n * presentation rules for creating the content.\n */\n public relationshipMeaning: RelationshipMeaning;\n /**\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\n * here to help.\n *\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\n */\n public actualPrimaryClassIds: Id64String[];\n /** Contained nested fields */\n public nestedFields: Field[];\n /** Flag specifying whether field should be expanded */\n public autoExpand?: boolean;\n\n /**\n * Creates an instance of [[NestedContentField]].\n * @param category Category information\n * @param name Unique name\n * @param label Display label\n * @param type Description of this field's values data type\n * @param isReadonly Are values in this field read-only\n * @param priority Priority of the field\n * @param contentClassInfo Information about an ECClass whose properties are nested inside this field\n * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)\n * @param nestedFields Contained nested fields\n * @param editor Property editor used to edit values of this field\n * @param autoExpand Flag specifying whether field should be expanded\n * @param relationshipMeaning RelationshipMeaning of the field\n * @param renderer Property renderer used to render values of this field\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `NestedContentFieldProps` instead.\n */\n public constructor(\n category: CategoryDescription,\n name: string,\n label: string,\n type: TypeDescription,\n isReadonly: boolean,\n priority: number,\n contentClassInfo: ClassInfo,\n pathToPrimaryClass: RelationshipPath,\n nestedFields: Field[],\n editor?: EditorDescription,\n autoExpand?: boolean,\n renderer?: RendererDescription,\n );\n /** Creates an instance of [[NestedContentField]]. */\n public constructor(props: NestedContentFieldProps);\n public constructor(\n categoryOrProps: CategoryDescription | NestedContentFieldProps,\n name?: string,\n label?: string,\n type?: TypeDescription,\n isReadonly?: boolean,\n priority?: number,\n contentClassInfo?: ClassInfo,\n pathToPrimaryClass?: RelationshipPath,\n nestedFields?: Field[],\n editor?: EditorDescription,\n autoExpand?: boolean,\n renderer?: RendererDescription,\n ) {\n /* c8 ignore next 17 */\n const props =\n \"category\" in categoryOrProps\n ? categoryOrProps\n : {\n category: categoryOrProps,\n name: name!,\n label: label!,\n type: type!,\n isReadonly: isReadonly!,\n priority: priority!,\n editor,\n renderer,\n contentClassInfo: contentClassInfo!,\n pathToPrimaryClass: pathToPrimaryClass!,\n nestedFields: nestedFields!,\n autoExpand,\n };\n super(props);\n this.contentClassInfo = props.contentClassInfo;\n this.pathToPrimaryClass = props.pathToPrimaryClass;\n this.relationshipMeaning = props.relationshipMeaning ?? RelationshipMeaning.RelatedInstance;\n this.nestedFields = props.nestedFields;\n this.autoExpand = props.autoExpand;\n this.actualPrimaryClassIds = props.actualPrimaryClassIds ?? [];\n }\n\n public override clone() {\n const clone = new NestedContentField({\n ...this,\n nestedFields: this.nestedFields.map((n) => n.clone()),\n });\n clone.rebuildParentship(this.parent);\n return clone;\n }\n\n /**\n * Get field by its name\n * @param name Name of the field to find\n * @param recurse Recurse into nested fields\n */\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\n return getFieldByName(this.nestedFields, name, recurse);\n }\n\n /**\n * Serialize this object to JSON.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[toCompressedJSON]] instead.\n */\n public override toJSON(): NestedContentFieldJSON {\n return {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...super.toJSON(),\n contentClassInfo: this.contentClassInfo,\n pathToPrimaryClass: this.pathToPrimaryClass,\n relationshipMeaning: this.relationshipMeaning,\n actualPrimaryClassIds: this.actualPrimaryClassIds,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\n ...(this.autoExpand ? { autoExpand: true } : undefined),\n };\n }\n\n /** Serialize this object to compressed JSON */\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): NestedContentFieldJSON<string> {\n const { id, ...leftOverInfo } = this.contentClassInfo;\n classesMap[id] = leftOverInfo;\n return {\n ...super.toCompressedJSON(classesMap),\n contentClassInfo: id,\n relationshipMeaning: this.relationshipMeaning,\n actualPrimaryClassIds: this.actualPrimaryClassIds,\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\n ...(this.autoExpand ? { autoExpand: true } : undefined),\n };\n }\n\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\n public static override fromCompressedJSON(\n json: NestedContentFieldJSON<Id64String>,\n classesMap: { [id: string]: CompressedClassInfoJSON },\n categories: CategoryDescription[],\n ) {\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\n return new NestedContentField({\n ...json,\n ...fromNestedContentFieldJSON(json, categories),\n category: this.getCategoryFromFieldJson(json, categories),\n nestedFields: json.nestedFields\n .map((nestedFieldJson: FieldJSON) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))\n .filter((nestedField): nestedField is Field => !!nestedField),\n contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },\n pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),\n });\n }\n\n /** Resets parent of this field and all nested fields. */\n public override resetParentship(): void {\n super.resetParentship();\n for (const nestedField of this.nestedFields) {\n nestedField.resetParentship();\n }\n }\n\n /**\n * Sets provided [[NestedContentField]] as parent of this fields and recursively updates\n * all nested fields parents.\n */\n public override rebuildParentship(parentField?: NestedContentField): void {\n super.rebuildParentship(parentField);\n for (const nestedField of this.nestedFields) {\n nestedField.rebuildParentship(this);\n }\n }\n}\n\n/** @internal */\nexport const getFieldByName = (fields: Field[], name: string | undefined, recurse?: boolean): Field | undefined => {\n if (name) {\n for (const field of fields) {\n if (field.name === name) {\n return field;\n }\n\n if (recurse && field.isNestedContentField()) {\n const nested = getFieldByName(field.nestedFields, name, recurse);\n if (nested) {\n return nested;\n }\n }\n }\n }\n return undefined;\n};\n\n/** @internal */\nexport const getFieldByDescriptor = (fields: Field[], fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined => {\n for (const field of fields) {\n if (field.matchesDescriptor(fieldDescriptor)) {\n return field;\n }\n\n if (recurse && field.isNestedContentField()) {\n const nested = getFieldByDescriptor(field.nestedFields, fieldDescriptor, recurse);\n if (nested) {\n return nested;\n }\n }\n }\n return undefined;\n};\n\n/**\n * Types of different field descriptors.\n * @public\n */\nexport enum FieldDescriptorType {\n Name = \"name\",\n Properties = \"properties\",\n}\n\n/**\n * Base for a field descriptor\n * @public\n */\nexport interface FieldDescriptorBase {\n type: FieldDescriptorType;\n}\n\n/**\n * A union of all possible field descriptor types\n * @public\n */\nexport type FieldDescriptor = NamedFieldDescriptor | PropertiesFieldDescriptor;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace FieldDescriptor {\n /** Is this a named field descriptor */\n export function isNamed(d: FieldDescriptor): d is NamedFieldDescriptor {\n return d.type === FieldDescriptorType.Name;\n }\n /** Is this a properties field descriptor */\n export function isProperties(d: FieldDescriptor): d is PropertiesFieldDescriptor {\n return d.type === FieldDescriptorType.Properties;\n }\n}\n\n/**\n * Field descriptor that identifies a content field by its unique name.\n * @public\n */\nexport interface NamedFieldDescriptor extends FieldDescriptorBase {\n type: FieldDescriptorType.Name;\n fieldName: string;\n}\n\n/**\n * Field descriptor that identifies a properties field using a list of\n * properties that the field contains.\n * @public\n */\nexport interface PropertiesFieldDescriptor extends FieldDescriptorBase {\n type: FieldDescriptorType.Properties;\n pathFromSelectToPropertyClass: StrippedRelationshipPath;\n /**\n * A list of properties that describe the field. At least one property in the list must\n * match at least one property in the field for the descriptor to be considered matching.\n */\n properties: Array<{\n /** Full class name */\n class: string;\n /** Property name */\n name: string;\n }>;\n}\n\nfunction fromCompressedPropertyJSON(compressedPropertyJSON: PropertyJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): Property {\n return {\n property: fromCompressedPropertyInfoJSON(compressedPropertyJSON.property, classesMap),\n };\n}\n\nfunction fromCompressedPropertyInfoJSON(compressedPropertyJSON: PropertyInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfo {\n assert(classesMap.hasOwnProperty(compressedPropertyJSON.classInfo));\n\n const { navigationPropertyInfo, ...leftOverPropertyJSON } = compressedPropertyJSON;\n\n return {\n ...leftOverPropertyJSON,\n classInfo: { id: compressedPropertyJSON.classInfo, ...classesMap[compressedPropertyJSON.classInfo] },\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\n };\n}\n\nfunction getCategoryFromFieldJson(fieldJson: { category: string }, categories: CategoryDescription[]): CategoryDescription {\n const category = categories.find((c) => c.name === fieldJson.category);\n if (!category) {\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);\n }\n return category;\n}\n\nfunction fromNestedContentFieldJSON(json: NestedContentFieldJSON<ClassInfo | string>, categories: CategoryDescription[]) {\n return {\n category: getCategoryFromFieldJson(json, categories),\n relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,\n actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],\n autoExpand: json.autoExpand,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,8DAAwD;AACxD,0CAA8D;AAmC9D;;;GAGG;AACH,MAAa,IAAI;IACf;;;OAGG;IACI,SAAS,CAAiB;IACjC,6DAA6D;IACtD,WAAW,CAAgB;IAClC,gCAAgC;IACzB,KAAK,CAAkB;IAC9B,+FAA+F;IACxF,SAAS,CAAa;IAC7B,4BAA4B;IACrB,MAAM,CAA0B;IACvC,gCAAgC;IACzB,aAAa,CAAiC;IACrD,+HAA+H;IACx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ED,oCAAoC;IAC7B,MAAM;QACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QACpC,OAAO,IAAA,wBAAa,EAAC;YACnB,GAAG,QAAQ;YACX,eAAe,EAAE,KAAK;YACtB,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED,qCAAqC;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAmC;QACxD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,CAAC;QAED,4DAA4D;QAC5D,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QACrD,OAAO,IAAI,IAAI,CAAC;YACd,GAAG,QAAQ;YACX,KAAK,EAAE,KAAK,IAAI,eAAe;SAChC,CAAC,CAAC;IACL,CAAC;CACF;AAlHD,oBAkHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,8DAAwD;AACxD,0CAA8D;AAmC9D;;;GAGG;AACH,MAAa,IAAI;IACf;;;OAGG;IACI,SAAS,CAAiB;IACjC,6DAA6D;IACtD,WAAW,CAAgB;IAClC,gCAAgC;IACzB,KAAK,CAAkB;IAC9B,+FAA+F;IACxF,SAAS,CAAa;IAC7B,4BAA4B;IACrB,MAAM,CAA0B;IACvC,gCAAgC;IACzB,aAAa,CAAiC;IACrD,+HAA+H;IACxH,gBAAgB,CAAW;IAClC,oDAAoD;IAC7C,YAAY,CAA0B;IAyB7C,YACE,kBAA6C,EAC7C,KAAgC,EAChC,OAAgB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O,IAAA,wBAAa,EAAC;YACnB,GAAG,QAAQ;YACX,eAAe,EAAE,KAAK;YACtB,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED,qCAAqC;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAmC;QACxD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,CAAC;QAED,4DAA4D;QAC5D,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QACrD,OAAO,IAAI,IAAI,CAAC;YACd,GAAG,QAAQ;YACX,KAAK,EAAE,KAAK,IAAI,eAAe;SAChC,CAAC,CAAC;IACL,CAAC;CACF;AAlHD,oBAkHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { ClassInfo, InstanceKey } from \"../EC.js\";\nimport { LabelDefinition } from \"../LabelDefinition.js\";\nimport { omitUndefined, ValuesDictionary } from \"../Utils.js\";\nimport { DisplayValue, Value } from \"./Value.js\";\n\n/**\n * Serialized [[Item]] JSON representation.\n * @public\n */\nexport interface ItemJSON {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[label]] instead. */\n labelDefinition: LabelDefinition;\n label?: LabelDefinition;\n classInfo?: ClassInfo;\n values: ValuesDictionary<Value>;\n displayValues: ValuesDictionary<DisplayValue>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * Props for creating [[Item]].\n * @public\n */\ninterface ItemProps {\n inputKeys?: InstanceKey[];\n primaryKeys: InstanceKey[];\n label: LabelDefinition;\n classInfo?: ClassInfo;\n values: ValuesDictionary<Value>;\n displayValues: ValuesDictionary<DisplayValue>;\n mergedFieldNames: string[];\n extendedData?: { [key: string]: any };\n}\n\n/**\n * A data structure that represents a single content record.\n * @public\n */\nexport class Item {\n /**\n * Keys of input instances that caused this item to be included in content. Only set if the content is\n * created with [[ContentFlags.IncludeInputKeys]] flag.\n */\n public inputKeys?: InstanceKey[];\n /** Keys of instances whose data is contained in this item */\n public primaryKeys: InstanceKey[];\n /** Display label of the item */\n public label: LabelDefinition;\n /** For cases when item consists only of same class instances, information about the ECClass */\n public classInfo?: ClassInfo;\n /** Raw values dictionary */\n public values: ValuesDictionary<Value>;\n /** Display values dictionary */\n public displayValues: ValuesDictionary<DisplayValue>;\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\n public mergedFieldNames: string[];\n /** Extended data injected into this content item */\n public extendedData?: { [key: string]: any };\n\n /**\n * Creates an instance of Item.\n * @param primaryKeys Keys of instances whose data is contained in this item\n * @param label Display label of the item\n * @param imageId ID of the image associated with this item\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\n * @param values Raw values dictionary\n * @param displayValues Display values dictionary\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\n * @param extendedData Extended data injected into this content item\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `ItemProps` instead.\n */\n public constructor(\n primaryKeys: InstanceKey[],\n label: string | LabelDefinition,\n imageId: string,\n classInfo: ClassInfo | undefined,\n values: ValuesDictionary<Value>,\n displayValues: ValuesDictionary<DisplayValue>,\n mergedFieldNames: string[],\n extendedData?: { [key: string]: any },\n );\n public constructor(props: ItemProps);\n public constructor(\n primaryKeysOrProps: ItemProps | InstanceKey[],\n label?: string | LabelDefinition,\n imageId?: string,\n classInfo?: ClassInfo | undefined,\n values?: ValuesDictionary<Value>,\n displayValues?: ValuesDictionary<DisplayValue>,\n mergedFieldNames?: string[],\n extendedData?: { [key: string]: any },\n ) {\n /* c8 ignore next 12 */\n const props = Array.isArray(primaryKeysOrProps)\n ? {\n primaryKeys: primaryKeysOrProps,\n label: typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label!,\n imageId: imageId!,\n classInfo,\n values: values!,\n displayValues: displayValues!,\n mergedFieldNames: mergedFieldNames!,\n extendedData,\n }\n : primaryKeysOrProps;\n\n if (\"inputKeys\" in props) {\n this.inputKeys = props.inputKeys;\n }\n this.primaryKeys = props.primaryKeys;\n this.classInfo = props.classInfo;\n this.values = props.values;\n this.displayValues = props.displayValues;\n this.mergedFieldNames = props.mergedFieldNames;\n this.extendedData = props.extendedData;\n this.label = props.label;\n }\n\n /**\n * Is value of field with the specified name merged in this record.\n */\n public isFieldMerged(fieldName: string): boolean {\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\n }\n\n /** Serialize this object to JSON */\n public toJSON(): ItemJSON {\n const { label, ...baseItem } = this;\n return omitUndefined({\n ...baseItem,\n labelDefinition: label,\n label,\n });\n }\n\n /** Deserialize [[Item]] from JSON */\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\n if (!json) {\n return undefined;\n }\n\n if (typeof json === \"string\") {\n return Item.fromJSON(JSON.parse(json));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const { labelDefinition, label, ...baseJson } = json;\n return new Item({\n ...baseJson,\n label: label ?? labelDefinition,\n });\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,oCAA8F;AAgC9F,cAAc;AACd,IAAiB,QAAQ,CAOxB;AAPD,WAAiB,QAAQ;IACvB,gDAAgD;IAChD,SAAgB,gBAAgB,CAAC,IAAc,EAAE,UAAqD;QACpG,OAAO;YACL,QAAQ,EAAE,oBAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;SACnE,CAAC;IACJ,CAAC;IAJe,yBAAgB,mBAI/B,CAAA;AACH,CAAC,EAPgB,QAAQ,wBAAR,QAAQ,QAOxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Property.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,oCAA8F;AAgC9F,cAAc;AACd,IAAiB,QAAQ,CAOxB;AAPD,WAAiB,QAAQ;IACvB,gDAAgD;IAChD,SAAgB,gBAAgB,CAAC,IAAc,EAAE,UAAqD;QACpG,OAAO;YACL,QAAQ,EAAE,oBAAY,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;SACnE,CAAC;IACJ,CAAC;IAJe,yBAAgB,mBAI/B,CAAA;AACH,CAAC,EAPgB,QAAQ,wBAAR,QAAQ,QAOxB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { ClassInfo, CompressedClassInfoJSON, PropertyInfo, PropertyInfoJSON } from \"../EC.js\";\n\n/**\n * Data structure that describes one step of property\n * accessor path.\n *\n * @public\n */\nexport interface PropertyAccessor {\n /** Name of ECProperty */\n propertyName: string;\n /** If the property is an array, array index. Otherwise undefined. */\n arrayIndex?: number;\n}\n\n/**\n * Describes path to a property.\n * @public\n */\nexport type PropertyAccessorPath = PropertyAccessor[];\n\n/**\n * Data structure that describes a single ECProperty that's\n * included in a [[PropertiesField]].\n *\n * @public\n */\nexport interface Property {\n /** ECProperty information */\n property: PropertyInfo;\n}\n\n/** @public */\nexport namespace Property {\n /** Serialize [[Property]] to compressed JSON */\n export function toCompressedJSON(prop: Property, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyJSON<string> {\n return {\n property: PropertyInfo.toCompressedJSON(prop.property, classesMap),\n };\n }\n}\n\n/**\n * JSON representation of [[Property]]\n * @public\n */\nexport interface PropertyJSON<TClassInfoJSON = ClassInfo> {\n property: PropertyInfoJSON<TClassInfoJSON>;\n}\n"]}
|