@itwin/presentation-common 5.4.0-dev.4 → 5.4.0-dev.6

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.
Files changed (155) hide show
  1. package/lib/assets/locales/en/Presentation.json +19 -19
  2. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  3. package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
  4. package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
  5. package/lib/cjs/presentation-common/EC.js.map +1 -1
  6. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  7. package/lib/cjs/presentation-common/Error.js.map +1 -1
  8. package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
  9. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  10. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  11. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  12. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  13. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  14. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  15. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  16. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  17. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  18. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  19. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  20. package/lib/cjs/presentation-common/Update.js.map +1 -1
  21. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  22. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  23. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  24. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  25. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  26. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  27. package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
  28. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  29. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  30. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  31. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  32. package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
  33. package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
  34. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  35. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  36. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  37. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  38. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  39. package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
  40. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  41. package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
  42. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  43. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  44. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  45. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  46. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  47. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  48. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  49. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  50. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  51. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  52. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  53. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  54. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  55. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  56. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  57. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  58. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  59. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  60. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  61. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  62. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  63. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  64. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  65. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  66. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  67. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  68. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  69. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  70. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  71. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  72. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  73. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  74. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  75. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  76. package/lib/cjs/presentation-common-internal.js.map +1 -1
  77. package/lib/cjs/presentation-common.js.map +1 -1
  78. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  79. package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
  80. package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
  81. package/lib/esm/presentation-common/EC.js.map +1 -1
  82. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  83. package/lib/esm/presentation-common/Error.js.map +1 -1
  84. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  85. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  86. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  87. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  88. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  89. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  90. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  91. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  92. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  93. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  94. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  95. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  96. package/lib/esm/presentation-common/Update.js.map +1 -1
  97. package/lib/esm/presentation-common/Utils.js.map +1 -1
  98. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  99. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  100. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  101. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  102. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  103. package/lib/esm/presentation-common/content/Editor.js.map +1 -1
  104. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  105. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  106. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  107. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  108. package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
  109. package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
  110. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  111. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  112. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  113. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  114. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  115. package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
  116. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  117. package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
  118. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  119. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  120. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  121. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  122. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  123. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  124. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  125. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  126. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  127. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  128. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  129. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  130. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  131. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  132. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  133. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  134. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  135. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  136. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  137. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  138. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  139. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  140. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  141. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  142. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  143. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  144. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  145. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  146. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  147. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  148. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  149. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  150. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  151. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  152. package/lib/esm/presentation-common-internal.js.map +1 -1
  153. package/lib/esm/presentation-common.js.map +1 -1
  154. package/lib/public/locales/en/Presentation.json +19 -19
  155. package/package.json +11 -11
@@ -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":["/*---------------------------------------------------------------------------------------------\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
+ {"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":["/*---------------------------------------------------------------------------------------------\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\n/**\r\n * Displayed content types. Affects how the content is formatted, e.g.\r\n * the [[ContentFlags]].\r\n *\r\n * @public\r\n */\r\nexport enum DefaultContentDisplayTypes {\r\n /** Unknown content type. */\r\n Undefined = \"Undefined\", // eslint-disable-line id-denylist\r\n\r\n /** Grid or table view content type. By default adds [[ContentFlags.ShowLabels]] flag. */\r\n Grid = \"Grid\",\r\n\r\n /** Property pane content type. By default adds [[ContentFlags.MergeResults]] flag. */\r\n PropertyPane = \"PropertyPane\",\r\n\r\n /** List content type. By default adds [[ContentFlags.NoFields]] and [[ContentFlags.ShowLabels]] flags */\r\n List = \"List\",\r\n\r\n /** Viewport content type. By default adds [[ContentFlags.KeysOnly]] flag. */\r\n Viewport = \"Graphics\",\r\n}\r\n"]}
@@ -1 +1 @@
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
+ {"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Editor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","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\n/**\r\n * A data structure which describes property editor used\r\n * for a content [[Field]].\r\n *\r\n * @public\r\n */\r\nexport interface EditorDescription {\r\n /** Unique name */\r\n name: string;\r\n /** Editor-specific parameters */\r\n params?: any;\r\n}\r\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,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,CAAuB;IACtC,wDAAwD;I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AC,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
+ {"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,C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,EAAE,sBAAsB,EAAE,8BAAsB,CAAC,kBAAkB,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 +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;IACxH,gBAAgB,CAAW;IAClC,oDAAoD;IAC7C,YAAY,CAA0B;IAyB7C,YACE,kBAA6C,EAC7C,KAAgC,EAChC,OAAgB,EAChB,SAAiC,EACjC,MAAgC,EAChC,aAA8C,EAC9C,gBAA2B,EAC3B,YAAqC;QAErC,uBAAuB;QACvB,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAC7C,CAAC,CAAC;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,oCAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,C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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
+ {"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,EAChB,SAAiC,EACjC,MAAgC,EAChC,aAA8C,EAC9C,gBAA2B,EAC3B,YAAqC;QAErC,uBAAuB;QACvB,MAAM,KAAK,GAAG,KA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AqC;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":["/*---------------------------------------------------------------------------------------------\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 { ClassInfo, InstanceKey } from \"../EC.js\";\r\nimport { LabelDefinition } from \"../LabelDefinition.js\";\r\nimport { omitUndefined, ValuesDictionary } from \"../Utils.js\";\r\nimport { DisplayValue, Value } from \"./Value.js\";\r\n\r\n/**\r\n * Serialized [[Item]] JSON representation.\r\n * @public\r\n */\r\nexport interface ItemJSON {\r\n inputKeys?: InstanceKey[];\r\n primaryKeys: InstanceKey[];\r\n /** @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[label]] instead. */\r\n labelDefinition: LabelDefinition;\r\n label?: LabelDefinition;\r\n classInfo?: ClassInfo;\r\n values: ValuesDictionary<Value>;\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n mergedFieldNames: string[];\r\n extendedData?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * Props for creating [[Item]].\r\n * @public\r\n */\r\ninterface ItemProps {\r\n inputKeys?: InstanceKey[];\r\n primaryKeys: InstanceKey[];\r\n label: LabelDefinition;\r\n classInfo?: ClassInfo;\r\n values: ValuesDictionary<Value>;\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n mergedFieldNames: string[];\r\n extendedData?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * A data structure that represents a single content record.\r\n * @public\r\n */\r\nexport class Item {\r\n /**\r\n * Keys of input instances that caused this item to be included in content. Only set if the content is\r\n * created with [[ContentFlags.IncludeInputKeys]] flag.\r\n */\r\n public inputKeys?: InstanceKey[];\r\n /** Keys of instances whose data is contained in this item */\r\n public primaryKeys: InstanceKey[];\r\n /** Display label of the item */\r\n public label: LabelDefinition;\r\n /** For cases when item consists only of same class instances, information about the ECClass */\r\n public classInfo?: ClassInfo;\r\n /** Raw values dictionary */\r\n public values: ValuesDictionary<Value>;\r\n /** Display values dictionary */\r\n public displayValues: ValuesDictionary<DisplayValue>;\r\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\r\n public mergedFieldNames: string[];\r\n /** Extended data injected into this content item */\r\n public extendedData?: { [key: string]: any };\r\n\r\n /**\r\n * Creates an instance of Item.\r\n * @param primaryKeys Keys of instances whose data is contained in this item\r\n * @param label Display label of the item\r\n * @param imageId ID of the image associated with this item\r\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\r\n * @param values Raw values dictionary\r\n * @param displayValues Display values dictionary\r\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\r\n * @param extendedData Extended data injected into this content item\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use an overload with `ItemProps` instead.\r\n */\r\n public constructor(\r\n primaryKeys: InstanceKey[],\r\n label: string | LabelDefinition,\r\n imageId: string,\r\n classInfo: ClassInfo | undefined,\r\n values: ValuesDictionary<Value>,\r\n displayValues: ValuesDictionary<DisplayValue>,\r\n mergedFieldNames: string[],\r\n extendedData?: { [key: string]: any },\r\n );\r\n public constructor(props: ItemProps);\r\n public constructor(\r\n primaryKeysOrProps: ItemProps | InstanceKey[],\r\n label?: string | LabelDefinition,\r\n imageId?: string,\r\n classInfo?: ClassInfo | undefined,\r\n values?: ValuesDictionary<Value>,\r\n displayValues?: ValuesDictionary<DisplayValue>,\r\n mergedFieldNames?: string[],\r\n extendedData?: { [key: string]: any },\r\n ) {\r\n /* c8 ignore next 12 */\r\n const props = Array.isArray(primaryKeysOrProps)\r\n ? {\r\n primaryKeys: primaryKeysOrProps,\r\n label: typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label!,\r\n imageId: imageId!,\r\n classInfo,\r\n values: values!,\r\n displayValues: displayValues!,\r\n mergedFieldNames: mergedFieldNames!,\r\n extendedData,\r\n }\r\n : primaryKeysOrProps;\r\n\r\n if (\"inputKeys\" in props) {\r\n this.inputKeys = props.inputKeys;\r\n }\r\n this.primaryKeys = props.primaryKeys;\r\n this.classInfo = props.classInfo;\r\n this.values = props.values;\r\n this.displayValues = props.displayValues;\r\n this.mergedFieldNames = props.mergedFieldNames;\r\n this.extendedData = props.extendedData;\r\n this.label = props.label;\r\n }\r\n\r\n /**\r\n * Is value of field with the specified name merged in this record.\r\n */\r\n public isFieldMerged(fieldName: string): boolean {\r\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): ItemJSON {\r\n const { label, ...baseItem } = this;\r\n return omitUndefined({\r\n ...baseItem,\r\n labelDefinition: label,\r\n label,\r\n });\r\n }\r\n\r\n /** Deserialize [[Item]] from JSON */\r\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (typeof json === \"string\") {\r\n return Item.fromJSON(JSON.parse(json));\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n const { labelDefinition, label, ...baseJson } = json;\r\n return new Item({\r\n ...baseJson,\r\n label: label ?? labelDefinition,\r\n });\r\n }\r\n}\r\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":["/*---------------------------------------------------------------------------------------------\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"]}
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":["/*---------------------------------------------------------------------------------------------\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 { ClassInfo, CompressedClassInfoJSON, PropertyInfo, PropertyInfoJSON } from \"../EC.js\";\r\n\r\n/**\r\n * Data structure that describes one step of property\r\n * accessor path.\r\n *\r\n * @public\r\n */\r\nexport interface PropertyAccessor {\r\n /** Name of ECProperty */\r\n propertyName: string;\r\n /** If the property is an array, array index. Otherwise undefined. */\r\n arrayIndex?: number;\r\n}\r\n\r\n/**\r\n * Describes path to a property.\r\n * @public\r\n */\r\nexport type PropertyAccessorPath = PropertyAccessor[];\r\n\r\n/**\r\n * Data structure that describes a single ECProperty that's\r\n * included in a [[PropertiesField]].\r\n *\r\n * @public\r\n */\r\nexport interface Property {\r\n /** ECProperty information */\r\n property: PropertyInfo;\r\n}\r\n\r\n/** @public */\r\nexport namespace Property {\r\n /** Serialize [[Property]] to compressed JSON */\r\n export function toCompressedJSON(prop: Property, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyJSON<string> {\r\n return {\r\n property: PropertyInfo.toCompressedJSON(prop.property, classesMap),\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * JSON representation of [[Property]]\r\n * @public\r\n */\r\nexport interface PropertyJSON<TClassInfoJSON = ClassInfo> {\r\n property: PropertyInfoJSON<TClassInfoJSON>;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA4CH,wDAGC;AA7CD,sDAA6C;AAK7C,6CAAuC;AAIvC,yCAA+G;AA6B/G;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,KAA4B;IACjE,MAAM,sBAAsB,GAAG,IAAI,6BAA6B,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC/F,OAAO,IAAI,oBAAoB,CAAC,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;AAC5E,CAAC;AAED,MAAa,oBAAoB;IAErB;IACA;IAFV,YACU,uBAAmI,EACnI,WAA2B;QAD3B,4BAAuB,GAAvB,uBAAuB,CAA4G;QACnI,gBAAW,GAAX,WAAW,CAAgB;IAClC,CAAC;IAEG,KAAK,CAAC,aAAa,CAAC,OAAgB;QACzC,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7F,OAAO,IAAI,oBAAO,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,KAAa,EAAE,UAAsB;QACnE,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,EAAE,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AAC;IACJ,CAAC;CACF;AApGD,sEAoGC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAYD,SAAS,cAAc,CAAC,KAAY;IAClC,OAAO,KAAK,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;AAC/H,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,GAAG,KAAK,SAAS,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,SAAS,CAAC,GAAU;IAC3B,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAE,GAAW,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,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 } from \"@itwin/core-bentley\";\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC.js\";\nimport { FormatOptions } from \"../KoqPropertyValueFormatter.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\nimport { Content } from \"./Content.js\";\nimport { Descriptor } from \"./Descriptor.js\";\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\nimport { Item } from \"./Item.js\";\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\n\n/**\n * An interface for something that can format `Content` and its `Item`s.\n * @public\n */\ninterface ContentFormatter {\n /** Format content in place and return it. */\n formatContent(content: Content): Promise<Content>;\n /** Format content `Item`s in place and return them. */\n formatContentItems(items: Item[], descriptor: Descriptor): Promise<Item[]>;\n}\n\n/**\n * Props for `createContentFormatter`.\n * @public\n */\ninterface ContentFormatterProps {\n /**\n * An interface for something that knows how to format a single numeric value using\n * a given kind-of-quantity (contained within the options object argument).\n */\n propertyValueFormatter: {\n format(value: number, options: FormatOptions): Promise<string | undefined>;\n };\n /** An optional unit system to format content in. */\n unitSystem?: UnitSystemKey;\n}\n\n/**\n * Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.\n * @public\n */\nexport function createContentFormatter(props: ContentFormatterProps): ContentFormatter {\n const propertyValueFormatter = new ContentPropertyValueFormatter(props.propertyValueFormatter);\n return new ContentFormatterImpl(propertyValueFormatter, props.unitSystem);\n}\n\nexport class ContentFormatterImpl implements ContentFormatter {\n constructor(\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\n private _unitSystem?: UnitSystemKey,\n ) {}\n\n public async formatContent(content: Content) {\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\n return new Content(content.descriptor, formattedItems);\n }\n\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\n return Promise.all(\n items.map(async (item) => {\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\n return item;\n }),\n );\n }\n\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\n for (const field of fields) {\n const value = values[field.name];\n\n // format display value of merged values\n if (mergedFields.includes(field.name)) {\n displayValues[field.name] = \"@Presentation:label.varies@\";\n continue;\n }\n\n // do not add undefined value to display values\n if (value === undefined) {\n continue;\n }\n\n // format display values of nested content field\n if (field.isNestedContentField()) {\n assert(Value.isNestedContent(value));\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\n continue;\n }\n\n // format property items\n if (field.isPropertiesField()) {\n displayValues[field.name] = await this.formatPropertyValue(value, field);\n continue;\n }\n\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n }\n\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\n for (const nestedValue of nestedValues) {\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\n }\n }\n\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\n if (field.isArrayPropertiesField()) {\n assert(Value.isArray(value));\n return this.formatArrayItems(value, field);\n }\n if (field.isStructPropertiesField()) {\n assert(Value.isMap(value));\n return this.formatStructMembers(value, field);\n }\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\n }\n\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\n }\n\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\n const displayValues: DisplayValuesMap = {};\n await Promise.all(\n field.memberFields.map(async (memberField) => {\n const memberValue = memberValues[memberField.name];\n // do not add undefined value to display values\n if (memberValue === undefined) {\n return;\n }\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, memberField);\n }),\n );\n return displayValues;\n }\n}\n\nexport class ContentPropertyValueFormatter {\n constructor(private _propertyValueFormatter: ContentFormatterProps[\"propertyValueFormatter\"]) {}\n\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\n const doubleFormatter = isFieldWithKoq(field)\n ? async (rawValue: number) => {\n const koq = field.properties[0].property.kindOfQuantity;\n const formattedValue = await this._propertyValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\n if (formattedValue !== undefined) {\n return formattedValue;\n }\n return formatDouble(rawValue);\n }\n : async (rawValue: number) => formatDouble(rawValue);\n\n return this.formatValue(field, value, { doubleFormatter });\n }\n\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\n if (field.isPropertiesField()) {\n if (field.isArrayPropertiesField()) {\n return this.formatArrayValue(field, value);\n }\n\n if (field.isStructPropertiesField()) {\n return this.formatStructValue(field, value);\n }\n }\n\n return this.formatPrimitiveValue(field, value, ctx);\n }\n\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\n if (value === undefined) {\n return \"\";\n }\n\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\n\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\n }\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\n }\n if (field.type.typeName === \"dateTime\") {\n assert(typeof value === \"string\");\n return value;\n }\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\n assert(typeof value === \"boolean\");\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\n }\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\n assert(isNumber(value));\n return value.toFixed(0);\n }\n if (field.type.typeName === \"double\") {\n assert(isNumber(value));\n return formatDoubleValue(value);\n }\n if (field.type.typeName === \"navigation\") {\n assert(Value.isNavigationValue(value));\n return value.label.displayValue;\n }\n\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\n : undefined;\n\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\n }\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n return value.toString();\n }\n\n private async formatStructValue(field: StructPropertiesField, value: Value) {\n if (!Value.isMap(value)) {\n return {};\n }\n\n const formattedMember: DisplayValuesMap = {};\n for (const member of field.memberFields) {\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\n }\n return formattedMember;\n }\n\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\n if (!Value.isArray(value)) {\n return [];\n }\n\n return Promise.all(\n value.map(async (arrayVal) => {\n return this.formatValue(field.itemsField, arrayVal);\n }),\n );\n }\n}\n\nfunction formatDouble(value: number) {\n return value.toFixed(2);\n}\n\ntype FieldWithKoq = PropertiesField & {\n properties: [\n {\n property: PropertyInfo & {\n kindOfQuantity: KindOfQuantityInfo;\n };\n },\n ];\n};\n\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\n}\n\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\n}\n\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\n return isPoint2d(obj) && isNumber((obj as any).z);\n}\n\nfunction isNumber(obj: Value): obj is number {\n return !isNaN(Number(obj));\n}\n"]}
1
+ {"version":3,"file":"PropertyValueFormatter.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/PropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AA4CH,wDAGC;AA7CD,sDAA6C;AAK7C,6CAAuC;AAIvC,yCAA+G;AA6B/G;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,KAA4B;IACjE,MAAM,sBAAsB,GAAG,IAAI,6BAA6B,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC/F,OAAO,IAAI,oBAAoB,CAAC,sBAAsB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;AAC5E,CAAC;AAED,MAAa,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AC,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAU;IAC1B,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7B,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 } from \"@itwin/core-bentley\";\r\nimport { UnitSystemKey } from \"@itwin/core-quantity\";\r\nimport { KindOfQuantityInfo, PropertyInfo } from \"../EC.js\";\r\nimport { FormatOptions } from \"../KoqPropertyValueFormatter.js\";\r\nimport { ValuesDictionary } from \"../Utils.js\";\r\nimport { Content } from \"./Content.js\";\r\nimport { Descriptor } from \"./Descriptor.js\";\r\nimport { ArrayPropertiesField, Field, PropertiesField, StructPropertiesField } from \"./Fields.js\";\r\nimport { Item } from \"./Item.js\";\r\nimport { DisplayValue, DisplayValuesMap, NestedContentValue, Value, ValuesArray, ValuesMap } from \"./Value.js\";\r\n\r\n/**\r\n * An interface for something that can format `Content` and its `Item`s.\r\n * @public\r\n */\r\ninterface ContentFormatter {\r\n /** Format content in place and return it. */\r\n formatContent(content: Content): Promise<Content>;\r\n /** Format content `Item`s in place and return them. */\r\n formatContentItems(items: Item[], descriptor: Descriptor): Promise<Item[]>;\r\n}\r\n\r\n/**\r\n * Props for `createContentFormatter`.\r\n * @public\r\n */\r\ninterface ContentFormatterProps {\r\n /**\r\n * An interface for something that knows how to format a single numeric value using\r\n * a given kind-of-quantity (contained within the options object argument).\r\n */\r\n propertyValueFormatter: {\r\n format(value: number, options: FormatOptions): Promise<string | undefined>;\r\n };\r\n /** An optional unit system to format content in. */\r\n unitSystem?: UnitSystemKey;\r\n}\r\n\r\n/**\r\n * Create a `ContentFormatter` that knows how to format `Content` and its `Item`s.\r\n * @public\r\n */\r\nexport function createContentFormatter(props: ContentFormatterProps): ContentFormatter {\r\n const propertyValueFormatter = new ContentPropertyValueFormatter(props.propertyValueFormatter);\r\n return new ContentFormatterImpl(propertyValueFormatter, props.unitSystem);\r\n}\r\n\r\nexport class ContentFormatterImpl implements ContentFormatter {\r\n constructor(\r\n private _propertyValueFormatter: { formatPropertyValue: (field: Field, value: Value, unitSystem?: UnitSystemKey) => Promise<DisplayValue> },\r\n private _unitSystem?: UnitSystemKey,\r\n ) {}\r\n\r\n public async formatContent(content: Content) {\r\n const formattedItems = await this.formatContentItems(content.contentSet, content.descriptor);\r\n return new Content(content.descriptor, formattedItems);\r\n }\r\n\r\n public async formatContentItems(items: Item[], descriptor: Descriptor) {\r\n return Promise.all(\r\n items.map(async (item) => {\r\n await this.formatValues(item.values, item.displayValues, descriptor.fields, item.mergedFieldNames);\r\n return item;\r\n }),\r\n );\r\n }\r\n\r\n private async formatValues(values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, fields: Field[], mergedFields: string[]) {\r\n for (const field of fields) {\r\n const value = values[field.name];\r\n\r\n // format display value of merged values\r\n if (mergedFields.includes(field.name)) {\r\n displayValues[field.name] = \"@Presentation:label.varies@\";\r\n continue;\r\n }\r\n\r\n // do not add undefined value to display values\r\n if (value === undefined) {\r\n continue;\r\n }\r\n\r\n // format display values of nested content field\r\n if (field.isNestedContentField()) {\r\n assert(Value.isNestedContent(value));\r\n await this.formatNestedContentDisplayValues(value, field.nestedFields);\r\n continue;\r\n }\r\n\r\n // format property items\r\n if (field.isPropertiesField()) {\r\n displayValues[field.name] = await this.formatPropertyValue(value, field);\r\n continue;\r\n }\r\n\r\n displayValues[field.name] = await this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\r\n }\r\n }\r\n\r\n private async formatNestedContentDisplayValues(nestedValues: NestedContentValue[], fields: Field[]) {\r\n for (const nestedValue of nestedValues) {\r\n await this.formatValues(nestedValue.values, nestedValue.displayValues, fields, nestedValue.mergedFieldNames);\r\n }\r\n }\r\n\r\n private async formatPropertyValue(value: Value, field: PropertiesField): Promise<DisplayValue> {\r\n if (field.isArrayPropertiesField()) {\r\n assert(Value.isArray(value));\r\n return this.formatArrayItems(value, field);\r\n }\r\n if (field.isStructPropertiesField()) {\r\n assert(Value.isMap(value));\r\n return this.formatStructMembers(value, field);\r\n }\r\n return this._propertyValueFormatter.formatPropertyValue(field, value, this._unitSystem);\r\n }\r\n\r\n private async formatArrayItems(itemValues: ValuesArray, field: ArrayPropertiesField) {\r\n return Promise.all(itemValues.map(async (value) => this.formatPropertyValue(value, field.itemsField)));\r\n }\r\n\r\n private async formatStructMembers(memberValues: ValuesMap, field: StructPropertiesField) {\r\n const displayValues: DisplayValuesMap = {};\r\n await Promise.all(\r\n field.memberFields.map(async (memberField) => {\r\n const memberValue = memberValues[memberField.name];\r\n // do not add undefined value to display values\r\n if (memberValue === undefined) {\r\n return;\r\n }\r\n displayValues[memberField.name] = await this.formatPropertyValue(memberValue, memberField);\r\n }),\r\n );\r\n return displayValues;\r\n }\r\n}\r\n\r\nexport class ContentPropertyValueFormatter {\r\n constructor(private _propertyValueFormatter: ContentFormatterProps[\"propertyValueFormatter\"]) {}\r\n\r\n public async formatPropertyValue(field: Field, value: Value, unitSystem?: UnitSystemKey): Promise<DisplayValue> {\r\n const doubleFormatter = isFieldWithKoq(field)\r\n ? async (rawValue: number) => {\r\n const koq = field.properties[0].property.kindOfQuantity;\r\n const formattedValue = await this._propertyValueFormatter.format(rawValue, { koqName: koq.name, unitSystem });\r\n if (formattedValue !== undefined) {\r\n return formattedValue;\r\n }\r\n return formatDouble(rawValue);\r\n }\r\n : async (rawValue: number) => formatDouble(rawValue);\r\n\r\n return this.formatValue(field, value, { doubleFormatter });\r\n }\r\n\r\n private async formatValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }): Promise<DisplayValue> {\r\n if (field.isPropertiesField()) {\r\n if (field.isArrayPropertiesField()) {\r\n return this.formatArrayValue(field, value);\r\n }\r\n\r\n if (field.isStructPropertiesField()) {\r\n return this.formatStructValue(field, value);\r\n }\r\n }\r\n\r\n return this.formatPrimitiveValue(field, value, ctx);\r\n }\r\n\r\n private async formatPrimitiveValue(field: Field, value: Value, ctx?: { doubleFormatter: (raw: number) => Promise<string> }) {\r\n if (value === undefined) {\r\n return \"\";\r\n }\r\n\r\n const formatDoubleValue = async (raw: number) => (ctx ? ctx.doubleFormatter(raw) : formatDouble(raw));\r\n\r\n if (field.type.typeName === \"point2d\" && isPoint2d(value)) {\r\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}`;\r\n }\r\n if (field.type.typeName === \"point3d\" && isPoint3d(value)) {\r\n return `X: ${await formatDoubleValue(value.x)}; Y: ${await formatDoubleValue(value.y)}; Z: ${await formatDoubleValue(value.z)}`;\r\n }\r\n if (field.type.typeName === \"dateTime\") {\r\n assert(typeof value === \"string\");\r\n return value;\r\n }\r\n if (field.type.typeName === \"bool\" || field.type.typeName === \"boolean\") {\r\n assert(typeof value === \"boolean\");\r\n return value ? \"@Presentation:value.true@\" : \"@Presentation:value.false@\";\r\n }\r\n if (field.type.typeName === \"int\" || field.type.typeName === \"long\") {\r\n assert(isNumber(value));\r\n return value.toFixed(0);\r\n }\r\n if (field.type.typeName === \"double\") {\r\n assert(isNumber(value));\r\n return formatDoubleValue(value);\r\n }\r\n if (field.type.typeName === \"navigation\") {\r\n assert(Value.isNavigationValue(value));\r\n return value.label.displayValue;\r\n }\r\n\r\n if (field.type.typeName === \"enum\" && field.isPropertiesField()) {\r\n const defaultValue = !field.properties[0].property.enumerationInfo?.isStrict\r\n ? value.toString() // eslint-disable-line @typescript-eslint/no-base-to-string\r\n : undefined;\r\n\r\n return field.properties[0].property.enumerationInfo?.choices.find(({ value: enumValue }) => enumValue === value)?.label ?? defaultValue;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\r\n return value.toString();\r\n }\r\n\r\n private async formatStructValue(field: StructPropertiesField, value: Value) {\r\n if (!Value.isMap(value)) {\r\n return {};\r\n }\r\n\r\n const formattedMember: DisplayValuesMap = {};\r\n for (const member of field.memberFields) {\r\n formattedMember[member.name] = await this.formatValue(member, value[member.name]);\r\n }\r\n return formattedMember;\r\n }\r\n\r\n private async formatArrayValue(field: ArrayPropertiesField, value: Value) {\r\n if (!Value.isArray(value)) {\r\n return [];\r\n }\r\n\r\n return Promise.all(\r\n value.map(async (arrayVal) => {\r\n return this.formatValue(field.itemsField, arrayVal);\r\n }),\r\n );\r\n }\r\n}\r\n\r\nfunction formatDouble(value: number) {\r\n return value.toFixed(2);\r\n}\r\n\r\ntype FieldWithKoq = PropertiesField & {\r\n properties: [\r\n {\r\n property: PropertyInfo & {\r\n kindOfQuantity: KindOfQuantityInfo;\r\n };\r\n },\r\n ];\r\n};\r\n\r\nfunction isFieldWithKoq(field: Field): field is FieldWithKoq {\r\n return field.isPropertiesField() && field.properties.length > 0 && field.properties[0].property.kindOfQuantity !== undefined;\r\n}\r\n\r\nfunction isPoint2d(obj: Value): obj is { x: number; y: number } {\r\n return obj !== undefined && isNumber((obj as any).x) && isNumber((obj as any).y);\r\n}\r\n\r\nfunction isPoint3d(obj: Value): obj is { x: number; y: number; z: number } {\r\n return isPoint2d(obj) && isNumber((obj as any).z);\r\n}\r\n\r\nfunction isNumber(obj: Value): obj is number {\r\n return !isNaN(Number(obj));\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Renderer.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 * Describes property renderer used for a content [[Field]].\n * @public\n */\nexport interface RendererDescription {\n /** Renderer name. */\n name: string;\n}\n"]}
1
+ {"version":3,"file":"Renderer.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Renderer.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG","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\n/**\r\n * Describes property renderer used for a content [[Field]].\r\n * @public\r\n */\r\nexport interface RendererDescription {\r\n /** Renderer name. */\r\n name: string;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TypeDescription.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/TypeDescription.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;GAGG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,sBAAsB;IACtB,8CAAuB,CAAA;IACvB,kBAAkB;IAClB,sCAAe,CAAA;IACf,mBAAmB;IACnB,wCAAiB,CAAA;AACnB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B","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 * Format of the property value.\n * @public\n */\nexport enum PropertyValueFormat {\n /** Primitive value */\n Primitive = \"Primitive\",\n /** Array value */\n Array = \"Array\",\n /** Struct value */\n Struct = \"Struct\",\n}\n\n/**\n * Data structure for base content field type description. Not\n * meant to be used directly, see `TypeDescription`.\n *\n * @public\n */\nexport interface BaseTypeDescription {\n /** Value format */\n valueFormat: PropertyValueFormat;\n /** Type name */\n typeName: string;\n}\n\n/**\n * Type description for primitive properties.\n * @public\n */\nexport interface PrimitiveTypeDescription extends BaseTypeDescription {\n /** Primitive format */\n valueFormat: PropertyValueFormat.Primitive;\n}\n\n/**\n * Type description for array properties.\n * @public\n */\nexport interface ArrayTypeDescription extends BaseTypeDescription {\n /** Array format */\n valueFormat: PropertyValueFormat.Array;\n /** Type of array items */\n memberType: TypeDescription;\n}\n\n/**\n * A data structure that describes a struct member.\n * @public\n */\nexport interface StructFieldMemberDescription {\n /** Unique name of a struct member */\n name: string;\n /** Label of the struct member */\n label: string;\n /** Type of the struct member */\n type: TypeDescription;\n}\n\n/**\n * Type description for struct properties.\n * @public\n */\nexport interface StructTypeDescription extends BaseTypeDescription {\n /** Struct format */\n valueFormat: PropertyValueFormat.Struct;\n /** Type descriptions of struct members */\n members: StructFieldMemberDescription[];\n}\n\n/**\n * One of content field type descriptions.\n * @public\n */\nexport type TypeDescription = PrimitiveTypeDescription | ArrayTypeDescription | StructTypeDescription;\n"]}
1
+ {"version":3,"file":"TypeDescription.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/TypeDescription.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH;;;GAGG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,sBAAsB;IACtB,8CAAuB,CAAA;IACvB,kBAAkB;IAClB,sCAAe,CAAA;IACf,mBAAmB;IACnB,wCAAiB,CAAA;AACnB,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B","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\n/**\r\n * Format of the property value.\r\n * @public\r\n */\r\nexport enum PropertyValueFormat {\r\n /** Primitive value */\r\n Primitive = \"Primitive\",\r\n /** Array value */\r\n Array = \"Array\",\r\n /** Struct value */\r\n Struct = \"Struct\",\r\n}\r\n\r\n/**\r\n * Data structure for base content field type description. Not\r\n * meant to be used directly, see `TypeDescription`.\r\n *\r\n * @public\r\n */\r\nexport interface BaseTypeDescription {\r\n /** Value format */\r\n valueFormat: PropertyValueFormat;\r\n /** Type name */\r\n typeName: string;\r\n}\r\n\r\n/**\r\n * Type description for primitive properties.\r\n * @public\r\n */\r\nexport interface PrimitiveTypeDescription extends BaseTypeDescription {\r\n /** Primitive format */\r\n valueFormat: PropertyValueFormat.Primitive;\r\n}\r\n\r\n/**\r\n * Type description for array properties.\r\n * @public\r\n */\r\nexport interface ArrayTypeDescription extends BaseTypeDescription {\r\n /** Array format */\r\n valueFormat: PropertyValueFormat.Array;\r\n /** Type of array items */\r\n memberType: TypeDescription;\r\n}\r\n\r\n/**\r\n * A data structure that describes a struct member.\r\n * @public\r\n */\r\nexport interface StructFieldMemberDescription {\r\n /** Unique name of a struct member */\r\n name: string;\r\n /** Label of the struct member */\r\n label: string;\r\n /** Type of the struct member */\r\n type: TypeDescription;\r\n}\r\n\r\n/**\r\n * Type description for struct properties.\r\n * @public\r\n */\r\nexport interface StructTypeDescription extends BaseTypeDescription {\r\n /** Struct format */\r\n valueFormat: PropertyValueFormat.Struct;\r\n /** Type descriptions of struct members */\r\n members: StructFieldMemberDescription[];\r\n}\r\n\r\n/**\r\n * One of content field type descriptions.\r\n * @public\r\n */\r\nexport type TypeDescription = PrimitiveTypeDescription | ArrayTypeDescription | StructTypeDescription;\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAYH,cAAc;AACd,2DAA2D;AAC3D,IAAiB,KAAK,CA8BrB;AA9BD,WAAiB,KAAK;IACpB,+BAA+B;IAC/B,SAAgB,WAAW,CAAC,KAAY;QACtC,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAFe,iBAAW,cAE1B,CAAA;IAED,4BAA4B;IAC5B,SAAgB,OAAO,CAAC,KAAY;QAClC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C,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC;YACb,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC,CAAwB,CAAC,WAAW,KAAK,SAAS;gBACrD,CAAC,CAAC,CAAC,CAAwB,CAAC,MAAM,KAAK,SAAS;gBAChD,CAAC,CAAC,CAAC,CAAwB,CAAC,aAAa,KAAK,SAAS;gBACvD,CAAC,CAAC,CAAC,CAAwB,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAClE,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,CAAuB;IAC3C,+GAA+G;IAC/G,sDAAsD;IACtD,OAAO,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,UAAU,CAAC,CAAuB;IACzC,OAAO,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AACD,SAAS,gBAAgB,CAAC,CAAuB;IAC/C,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC5C,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 { InstanceId, InstanceKey } from \"../EC.js\";\nimport { LabelDefinition } from \"../LabelDefinition.js\";\nimport { ValuesDictionary } from \"../Utils.js\";\n\n/**\n * Raw value type\n * @public\n */\nexport type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NavigationPropertyValue | NestedContentValue[];\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace Value {\n /** Is the value a primitive */\n export function isPrimitive(value: Value): value is string | number | boolean | undefined {\n return isPrimitiveValue(value);\n }\n\n /** Is the value an array */\n export function isArray(value: Value): value is ValuesArray {\n return isArrayValue(value);\n }\n\n /** Is the value a map / struct */\n export function isMap(value: Value): value is ValuesMap {\n return isMapValue(value);\n }\n\n /** Is the value a nested content value */\n export function isNestedContent(value: Value): value is NestedContentValue[] {\n return isNestedContentValue(value);\n }\n\n /** Is the value a navigation value */\n export function isNavigationValue(value: Value): value is NavigationPropertyValue {\n return (\n value !== undefined &&\n (value as NavigationPropertyValue).id !== undefined &&\n (value as NavigationPropertyValue).className !== undefined &&\n (value as NavigationPropertyValue).label !== undefined\n );\n }\n}\n\n/**\n * A map of raw values\n * @public\n */\nexport interface ValuesMap extends ValuesDictionary<Value> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * An array of raw values\n * @public\n */\nexport interface ValuesArray extends Array<Value> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * Display value type.\n * @public\n */\nexport type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace DisplayValue {\n /** Is the value a primitive */\n export function isPrimitive(value: DisplayValue): value is string | undefined {\n return isPrimitiveValue(value);\n }\n\n /** Is the value an array */\n export function isArray(value: DisplayValue): value is DisplayValuesArray {\n return isArrayValue(value);\n }\n\n /** Is the value a map / struct */\n export function isMap(value: DisplayValue): value is DisplayValuesMap {\n return isMapValue(value);\n }\n}\n\n/**\n * A map of display values\n * @public\n */\nexport interface DisplayValuesMap extends ValuesDictionary<DisplayValue> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * An array of display values\n * @public\n */\nexport interface DisplayValuesArray extends Array<DisplayValue> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\n\n/**\n * Data structure that describes nested content value.\n * @public\n */\nexport interface NestedContentValue {\n /** Keys of instances whose content is contained in this value */\n primaryKeys: InstanceKey[];\n /** Content values map */\n values: ValuesDictionary<Value>;\n /** Content display values map */\n displayValues: ValuesDictionary<DisplayValue>;\n /** Names of fields whose values are merged */\n mergedFieldNames: string[];\n /**\n * Label of the ECInstance that this `NestedContentValue` is based on.\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[label]] instead.\n */\n labelDefinition?: LabelDefinition;\n label?: LabelDefinition;\n}\n\n/**\n * Data structure that describes value of the navigation property.\n * @public\n */\nexport interface NavigationPropertyValue {\n /** Label of target instance. */\n label: LabelDefinition;\n /** Full class name of target instance in format `SchemaName:ClassName` */\n className: string;\n /** Id of target instance. */\n id: InstanceId;\n}\n\n/**\n * A group of raw values and their common display value.\n * @public\n */\nexport interface DisplayValueGroup {\n /** Common display value for all grouped raw values */\n displayValue: DisplayValue;\n /** A list of grouped raw values */\n groupedRawValues: Value[];\n}\n\nfunction isNestedContentValue(v: Value): v is NestedContentValue[] {\n return (\n v !== undefined &&\n Array.isArray(v) &&\n (v.length === 0 ||\n (!!v[0] &&\n (v[0] as NestedContentValue).primaryKeys !== undefined &&\n (v[0] as NestedContentValue).values !== undefined &&\n (v[0] as NestedContentValue).displayValues !== undefined &&\n (v[0] as NestedContentValue).mergedFieldNames !== undefined))\n );\n}\n\nfunction isArrayValue(v: Value | DisplayValue): v is ValuesArray | DisplayValuesArray {\n // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.\n // we have other means to determine the type of value.\n return v !== undefined && Array.isArray(v);\n}\nfunction isMapValue(v: Value | DisplayValue): v is ValuesMap | DisplayValuesMap {\n return v !== undefined && typeof v === \"object\" && !Array.isArray(v);\n}\nfunction isPrimitiveValue(v: Value | DisplayValue): v is string | number | boolean | undefined {\n return !isArrayValue(v) && !isMapValue(v);\n}\n"]}
1
+ {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAYH,cAAc;AACd,2DAA2D;AA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mB;QACvC,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAFe,kBAAK,QAEpB,CAAA;AACH,CAAC,EAfgB,YAAY,4BAAZ,YAAY,QAe5B;AA2DD,SAAS,oBAAoB,CAAC,CAAQ;IACpC,OAAO,CACL,CAAC,KAAK,SAAS;QACf,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC;YACb,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACJ,CAAC,CAAC,CAAC,CAAwB,CAAC,WAAW,KAAK,SAAS;gBACrD,CAAC,CAAC,CAAC,CAAwB,CAAC,MAAM,KAAK,SAAS;gBAChD,CAAC,CAAC,CAAC,CAAwB,CAAC,aAAa,KAAK,SAAS;gBACvD,CAAC,CAAC,CAAC,CAAwB,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAClE,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,CAAuB;IAC3C,+GAA+G;IAC/G,sDAAsD;IACtD,OAAO,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,UAAU,CAAC,CAAuB;IACzC,OAAO,CAAC,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AACD,SAAS,gBAAgB,CAAC,CAAuB;IAC/C,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAC5C,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 { InstanceId, InstanceKey } from \"../EC.js\";\r\nimport { LabelDefinition } from \"../LabelDefinition.js\";\r\nimport { ValuesDictionary } from \"../Utils.js\";\r\n\r\n/**\r\n * Raw value type\r\n * @public\r\n */\r\nexport type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NavigationPropertyValue | NestedContentValue[];\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace Value {\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: Value): value is string | number | boolean | undefined {\r\n return isPrimitiveValue(value);\r\n }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: Value): value is ValuesArray {\r\n return isArrayValue(value);\r\n }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: Value): value is ValuesMap {\r\n return isMapValue(value);\r\n }\r\n\r\n /** Is the value a nested content value */\r\n export function isNestedContent(value: Value): value is NestedContentValue[] {\r\n return isNestedContentValue(value);\r\n }\r\n\r\n /** Is the value a navigation value */\r\n export function isNavigationValue(value: Value): value is NavigationPropertyValue {\r\n return (\r\n value !== undefined &&\r\n (value as NavigationPropertyValue).id !== undefined &&\r\n (value as NavigationPropertyValue).className !== undefined &&\r\n (value as NavigationPropertyValue).label !== undefined\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * A map of raw values\r\n * @public\r\n */\r\nexport interface ValuesMap extends ValuesDictionary<Value> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\r\n\r\n/**\r\n * An array of raw values\r\n * @public\r\n */\r\nexport interface ValuesArray extends Array<Value> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\r\n\r\n/**\r\n * Display value type.\r\n * @public\r\n */\r\nexport type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace DisplayValue {\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: DisplayValue): value is string | undefined {\r\n return isPrimitiveValue(value);\r\n }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: DisplayValue): value is DisplayValuesArray {\r\n return isArrayValue(value);\r\n }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: DisplayValue): value is DisplayValuesMap {\r\n return isMapValue(value);\r\n }\r\n}\r\n\r\n/**\r\n * A map of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesMap extends ValuesDictionary<DisplayValue> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\r\n\r\n/**\r\n * An array of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesArray extends Array<DisplayValue> {} // eslint-disable-line @typescript-eslint/no-empty-object-type\r\n\r\n/**\r\n * Data structure that describes nested content value.\r\n * @public\r\n */\r\nexport interface NestedContentValue {\r\n /** Keys of instances whose content is contained in this value */\r\n primaryKeys: InstanceKey[];\r\n /** Content values map */\r\n values: ValuesDictionary<Value>;\r\n /** Content display values map */\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n /** Names of fields whose values are merged */\r\n mergedFieldNames: string[];\r\n /**\r\n * Label of the ECInstance that this `NestedContentValue` is based on.\r\n * @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[label]] instead.\r\n */\r\n labelDefinition?: LabelDefinition;\r\n label?: LabelDefinition;\r\n}\r\n\r\n/**\r\n * Data structure that describes value of the navigation property.\r\n * @public\r\n */\r\nexport interface NavigationPropertyValue {\r\n /** Label of target instance. */\r\n label: LabelDefinition;\r\n /** Full class name of target instance in format `SchemaName:ClassName` */\r\n className: string;\r\n /** Id of target instance. */\r\n id: InstanceId;\r\n}\r\n\r\n/**\r\n * A group of raw values and their common display value.\r\n * @public\r\n */\r\nexport interface DisplayValueGroup {\r\n /** Common display value for all grouped raw values */\r\n displayValue: DisplayValue;\r\n /** A list of grouped raw values */\r\n groupedRawValues: Value[];\r\n}\r\n\r\nfunction isNestedContentValue(v: Value): v is NestedContentValue[] {\r\n return (\r\n v !== undefined &&\r\n Array.isArray(v) &&\r\n (v.length === 0 ||\r\n (!!v[0] &&\r\n (v[0] as NestedContentValue).primaryKeys !== undefined &&\r\n (v[0] as NestedContentValue).values !== undefined &&\r\n (v[0] as NestedContentValue).displayValues !== undefined &&\r\n (v[0] as NestedContentValue).mergedFieldNames !== undefined))\r\n );\r\n}\r\n\r\nfunction isArrayValue(v: Value | DisplayValue): v is ValuesArray | DisplayValuesArray {\r\n // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.\r\n // we have other means to determine the type of value.\r\n return v !== undefined && Array.isArray(v);\r\n}\r\nfunction isMapValue(v: Value | DisplayValue): v is ValuesMap | DisplayValuesMap {\r\n return v !== undefined && typeof v === \"object\" && !Array.isArray(v);\r\n}\r\nfunction isPrimitiveValue(v: Value | DisplayValue): v is string | number | boolean | undefined {\r\n return !isArrayValue(v) && !isMapValue(v);\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HierarchyLevel.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/HierarchyLevel.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/* eslint-disable @typescript-eslint/no-deprecated */\n/** @packageDocumentation\n * @module Hierarchies\n */\n\nimport { Node } from \"./Node.js\";\n\n/**\n * Defines a hierarchy level that consists of an array of nodes and possibly other information.\n * @public\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\n * package for creating hierarchies.\n */\nexport interface HierarchyLevel {\n /** A list of nodes in a hierarchy level. */\n nodes: Node[];\n /**\n * Identifies whether the hierarchy level supports filtering. If not, requesting either a hierarchy level descriptor or\n * a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.\n */\n supportsFiltering?: boolean;\n}\n"]}
1
+ {"version":3,"file":"HierarchyLevel.js","sourceRoot":"","sources":["../../../../src/presentation-common/hierarchy/HierarchyLevel.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG,qDAAqD;AACrD;;GAEG","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/* eslint-disable @typescript-eslint/no-deprecated */\r\n/** @packageDocumentation\r\n * @module Hierarchies\r\n */\r\n\r\nimport { Node } from \"./Node.js\";\r\n\r\n/**\r\n * Defines a hierarchy level that consists of an array of nodes and possibly other information.\r\n * @public\r\n * @deprecated in 5.2 - will not be removed until after 2026-10-01. Use the new [@itwin/presentation-hierarchies](https://github.com/iTwin/presentation/blob/master/packages/hierarchies/README.md)\r\n * package for creating hierarchies.\r\n */\r\nexport interface HierarchyLevel {\r\n /** A list of nodes in a hierarchy level. */\r\n nodes: Node[];\r\n /**\r\n * Identifies whether the hierarchy level supports filtering. If not, requesting either a hierarchy level descriptor or\r\n * a hierarchy level with [[HierarchyRequestOptions.instanceFilter]] will throw an error with [[PresentationStatus.InvalidArgument]] status.\r\n */\r\n supportsFiltering?: boolean;\r\n}\r\n"]}