@itwin/presentation-common 4.0.0-dev.8 → 4.0.0-dev.81

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 (441) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/Ruleset.schema.json +15 -0
  3. package/lib/cjs/assets/locales/en/Presentation.json +19 -0
  4. package/lib/cjs/assets/locales/en-PSEUDO/Presentation.json +19 -0
  5. package/lib/cjs/presentation-common/AsyncTasks.d.ts +22 -22
  6. package/lib/cjs/presentation-common/AsyncTasks.js +38 -38
  7. package/lib/cjs/presentation-common/CommonLoggerCategory.d.ts +12 -12
  8. package/lib/cjs/presentation-common/CommonLoggerCategory.js +20 -20
  9. package/lib/cjs/presentation-common/Diagnostics.d.ts +125 -125
  10. package/lib/cjs/presentation-common/Diagnostics.d.ts.map +1 -1
  11. package/lib/cjs/presentation-common/Diagnostics.js +72 -72
  12. package/lib/cjs/presentation-common/EC.d.ts +347 -350
  13. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  14. package/lib/cjs/presentation-common/EC.js +290 -290
  15. package/lib/cjs/presentation-common/EC.js.map +1 -1
  16. package/lib/cjs/presentation-common/ElementProperties.d.ts +123 -123
  17. package/lib/cjs/presentation-common/ElementProperties.d.ts.map +1 -1
  18. package/lib/cjs/presentation-common/ElementProperties.js +9 -9
  19. package/lib/cjs/presentation-common/Error.d.ts +47 -45
  20. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  21. package/lib/cjs/presentation-common/Error.js +64 -62
  22. package/lib/cjs/presentation-common/Error.js.map +1 -1
  23. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts +93 -93
  24. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  25. package/lib/cjs/presentation-common/InstanceFilterDefinition.js +9 -9
  26. package/lib/cjs/presentation-common/KeySet.d.ts +146 -146
  27. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  28. package/lib/cjs/presentation-common/KeySet.js +428 -428
  29. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts +20 -0
  30. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
  31. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +156 -0
  32. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
  33. package/lib/cjs/presentation-common/LabelDefinition.d.ts +93 -87
  34. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  35. package/lib/cjs/presentation-common/LabelDefinition.js +78 -73
  36. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  37. package/lib/cjs/presentation-common/LocalizationHelper.d.ts +29 -29
  38. package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
  39. package/lib/cjs/presentation-common/LocalizationHelper.js +113 -110
  40. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  41. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +27 -40
  42. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  43. package/lib/cjs/presentation-common/PresentationIpcInterface.js +12 -12
  44. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  45. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +279 -261
  46. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  47. package/lib/cjs/presentation-common/PresentationManagerOptions.js +23 -23
  48. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  49. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +186 -186
  50. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  51. package/lib/cjs/presentation-common/PresentationRpcInterface.js +108 -104
  52. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  53. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +26 -26
  54. package/lib/cjs/presentation-common/RegisteredRuleset.js +33 -33
  55. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +82 -83
  56. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  57. package/lib/cjs/presentation-common/RpcRequestsHandler.js +166 -171
  58. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  59. package/lib/cjs/presentation-common/RulesetVariables.d.ts +171 -171
  60. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  61. package/lib/cjs/presentation-common/RulesetVariables.js +55 -55
  62. package/lib/cjs/presentation-common/RulesetsFactory.d.ts +44 -44
  63. package/lib/cjs/presentation-common/RulesetsFactory.d.ts.map +1 -1
  64. package/lib/cjs/presentation-common/RulesetsFactory.js +223 -223
  65. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  66. package/lib/cjs/presentation-common/Update.d.ts +150 -213
  67. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  68. package/lib/cjs/presentation-common/Update.js +114 -226
  69. package/lib/cjs/presentation-common/Update.js.map +1 -1
  70. package/lib/cjs/presentation-common/Utils.d.ts +62 -62
  71. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  72. package/lib/cjs/presentation-common/Utils.js +43 -43
  73. package/lib/cjs/presentation-common/content/Category.d.ts +49 -49
  74. package/lib/cjs/presentation-common/content/Category.js +48 -48
  75. package/lib/cjs/presentation-common/content/Content.d.ts +38 -38
  76. package/lib/cjs/presentation-common/content/Content.js +56 -56
  77. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +271 -271
  78. package/lib/cjs/presentation-common/content/ContentTraverser.js +437 -439
  79. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  80. package/lib/cjs/presentation-common/content/Descriptor.d.ts +328 -328
  81. package/lib/cjs/presentation-common/content/Descriptor.js +191 -193
  82. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  83. package/lib/cjs/presentation-common/content/DisplayTypes.d.ts +21 -21
  84. package/lib/cjs/presentation-common/content/DisplayTypes.js +29 -29
  85. package/lib/cjs/presentation-common/content/Editor.d.ts +15 -15
  86. package/lib/cjs/presentation-common/content/Editor.js +9 -9
  87. package/lib/cjs/presentation-common/content/Fields.d.ts +298 -301
  88. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  89. package/lib/cjs/presentation-common/content/Fields.js +393 -397
  90. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  91. package/lib/cjs/presentation-common/content/Item.d.ts +85 -85
  92. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  93. package/lib/cjs/presentation-common/content/Item.js +84 -84
  94. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  95. package/lib/cjs/presentation-common/content/Property.d.ts +57 -57
  96. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  97. package/lib/cjs/presentation-common/content/Property.js +40 -40
  98. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
  99. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
  100. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +139 -0
  101. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -0
  102. package/lib/cjs/presentation-common/content/Renderer.d.ts +11 -11
  103. package/lib/cjs/presentation-common/content/Renderer.js +9 -9
  104. package/lib/cjs/presentation-common/content/TypeDescription.d.ts +72 -72
  105. package/lib/cjs/presentation-common/content/TypeDescription.d.ts.map +1 -1
  106. package/lib/cjs/presentation-common/content/TypeDescription.js +23 -23
  107. package/lib/cjs/presentation-common/content/Value.d.ts +204 -189
  108. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  109. package/lib/cjs/presentation-common/content/Value.js +281 -273
  110. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  111. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +37 -37
  112. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +31 -31
  113. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +246 -246
  114. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  115. package/lib/cjs/presentation-common/hierarchy/Key.js +121 -121
  116. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  117. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +154 -154
  118. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  119. package/lib/cjs/presentation-common/hierarchy/Node.js +106 -106
  120. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  121. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +96 -96
  122. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +122 -122
  123. package/lib/cjs/presentation-common/rules/ClassSpecifications.d.ts +45 -45
  124. package/lib/cjs/presentation-common/rules/ClassSpecifications.js +9 -9
  125. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts +31 -31
  126. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js +9 -9
  127. package/lib/cjs/presentation-common/rules/RelationshipDirection.d.ts +13 -13
  128. package/lib/cjs/presentation-common/rules/RelationshipDirection.js +21 -21
  129. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts +56 -56
  130. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  131. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js +9 -9
  132. package/lib/cjs/presentation-common/rules/Rule.d.ts +76 -76
  133. package/lib/cjs/presentation-common/rules/Rule.js +35 -35
  134. package/lib/cjs/presentation-common/rules/Ruleset.d.ts +65 -65
  135. package/lib/cjs/presentation-common/rules/Ruleset.js +9 -9
  136. package/lib/cjs/presentation-common/rules/SchemasSpecification.d.ts +41 -41
  137. package/lib/cjs/presentation-common/rules/SchemasSpecification.js +9 -9
  138. package/lib/cjs/presentation-common/rules/Variables.d.ts +58 -58
  139. package/lib/cjs/presentation-common/rules/Variables.js +25 -25
  140. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +41 -41
  141. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +9 -9
  142. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +25 -25
  143. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +9 -9
  144. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts +30 -30
  145. package/lib/cjs/presentation-common/rules/content/ContentRule.js +9 -9
  146. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +58 -58
  147. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js +20 -20
  148. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +19 -19
  149. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +9 -9
  150. package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts +86 -86
  151. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js +9 -9
  152. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +28 -28
  153. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +9 -9
  154. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +25 -25
  155. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +9 -9
  156. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +64 -57
  157. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  158. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js +9 -9
  159. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  160. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.d.ts +17 -17
  161. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +9 -9
  162. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +107 -107
  163. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.map +1 -1
  164. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +9 -9
  165. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +108 -108
  166. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +21 -21
  167. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +96 -96
  168. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +43 -43
  169. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +44 -44
  170. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +9 -9
  171. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +36 -36
  172. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +9 -9
  173. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts +27 -27
  174. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js +9 -9
  175. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +207 -207
  176. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +51 -51
  177. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +29 -29
  178. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +9 -9
  179. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts +158 -158
  180. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  181. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js +25 -25
  182. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +40 -40
  183. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +9 -9
  184. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts +58 -58
  185. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  186. package/lib/cjs/presentation-common/rules/customization/SortingRule.js +9 -9
  187. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +48 -48
  188. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +9 -9
  189. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +14 -14
  190. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +9 -9
  191. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +98 -98
  192. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  193. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +21 -21
  194. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +31 -31
  195. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +9 -9
  196. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +79 -79
  197. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +19 -19
  198. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +39 -39
  199. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +9 -9
  200. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +50 -50
  201. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
  202. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +9 -9
  203. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +27 -27
  204. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js +9 -9
  205. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +27 -27
  206. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +9 -9
  207. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +16 -16
  208. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +9 -9
  209. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +35 -35
  210. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +9 -9
  211. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +38 -38
  212. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  213. package/lib/cjs/presentation-common/selection/SelectionScope.js +9 -9
  214. package/lib/cjs/presentation-common.d.ts +114 -112
  215. package/lib/cjs/presentation-common.d.ts.map +1 -1
  216. package/lib/cjs/presentation-common.js +134 -128
  217. package/lib/cjs/presentation-common.js.map +1 -1
  218. package/lib/esm/presentation-common/AsyncTasks.d.ts +22 -22
  219. package/lib/esm/presentation-common/AsyncTasks.js +34 -34
  220. package/lib/esm/presentation-common/CommonLoggerCategory.d.ts +12 -12
  221. package/lib/esm/presentation-common/CommonLoggerCategory.js +17 -17
  222. package/lib/esm/presentation-common/Diagnostics.d.ts +125 -125
  223. package/lib/esm/presentation-common/Diagnostics.d.ts.map +1 -1
  224. package/lib/esm/presentation-common/Diagnostics.js +67 -67
  225. package/lib/esm/presentation-common/EC.d.ts +347 -350
  226. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  227. package/lib/esm/presentation-common/EC.js +287 -287
  228. package/lib/esm/presentation-common/EC.js.map +1 -1
  229. package/lib/esm/presentation-common/ElementProperties.d.ts +123 -123
  230. package/lib/esm/presentation-common/ElementProperties.d.ts.map +1 -1
  231. package/lib/esm/presentation-common/ElementProperties.js +8 -8
  232. package/lib/esm/presentation-common/Error.d.ts +47 -45
  233. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  234. package/lib/esm/presentation-common/Error.js +60 -58
  235. package/lib/esm/presentation-common/Error.js.map +1 -1
  236. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts +93 -93
  237. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  238. package/lib/esm/presentation-common/InstanceFilterDefinition.js +8 -8
  239. package/lib/esm/presentation-common/KeySet.d.ts +146 -146
  240. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  241. package/lib/esm/presentation-common/KeySet.js +424 -424
  242. package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts +20 -0
  243. package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
  244. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +152 -0
  245. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
  246. package/lib/esm/presentation-common/LabelDefinition.d.ts +93 -87
  247. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  248. package/lib/esm/presentation-common/LabelDefinition.js +75 -70
  249. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  250. package/lib/esm/presentation-common/LocalizationHelper.d.ts +29 -29
  251. package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
  252. package/lib/esm/presentation-common/LocalizationHelper.js +109 -106
  253. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  254. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +27 -40
  255. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  256. package/lib/esm/presentation-common/PresentationIpcInterface.js +9 -9
  257. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  258. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +279 -261
  259. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  260. package/lib/esm/presentation-common/PresentationManagerOptions.js +18 -18
  261. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  262. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +186 -186
  263. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  264. package/lib/esm/presentation-common/PresentationRpcInterface.js +105 -100
  265. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  266. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +26 -26
  267. package/lib/esm/presentation-common/RegisteredRuleset.js +29 -29
  268. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +82 -83
  269. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  270. package/lib/esm/presentation-common/RpcRequestsHandler.js +162 -167
  271. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  272. package/lib/esm/presentation-common/RulesetVariables.d.ts +171 -171
  273. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  274. package/lib/esm/presentation-common/RulesetVariables.js +52 -52
  275. package/lib/esm/presentation-common/RulesetsFactory.d.ts +44 -44
  276. package/lib/esm/presentation-common/RulesetsFactory.d.ts.map +1 -1
  277. package/lib/esm/presentation-common/RulesetsFactory.js +219 -219
  278. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  279. package/lib/esm/presentation-common/Update.d.ts +150 -213
  280. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  281. package/lib/esm/presentation-common/Update.js +111 -223
  282. package/lib/esm/presentation-common/Update.js.map +1 -1
  283. package/lib/esm/presentation-common/Utils.d.ts +62 -62
  284. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  285. package/lib/esm/presentation-common/Utils.js +39 -39
  286. package/lib/esm/presentation-common/content/Category.d.ts +49 -49
  287. package/lib/esm/presentation-common/content/Category.js +45 -45
  288. package/lib/esm/presentation-common/content/Content.d.ts +38 -38
  289. package/lib/esm/presentation-common/content/Content.js +52 -52
  290. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +271 -271
  291. package/lib/esm/presentation-common/content/ContentTraverser.js +427 -429
  292. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  293. package/lib/esm/presentation-common/content/Descriptor.d.ts +328 -328
  294. package/lib/esm/presentation-common/content/Descriptor.js +187 -189
  295. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  296. package/lib/esm/presentation-common/content/DisplayTypes.d.ts +21 -21
  297. package/lib/esm/presentation-common/content/DisplayTypes.js +26 -26
  298. package/lib/esm/presentation-common/content/Editor.d.ts +15 -15
  299. package/lib/esm/presentation-common/content/Editor.js +8 -8
  300. package/lib/esm/presentation-common/content/Fields.d.ts +298 -301
  301. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  302. package/lib/esm/presentation-common/content/Fields.js +386 -390
  303. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  304. package/lib/esm/presentation-common/content/Item.d.ts +85 -85
  305. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  306. package/lib/esm/presentation-common/content/Item.js +80 -80
  307. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  308. package/lib/esm/presentation-common/content/Property.d.ts +57 -57
  309. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  310. package/lib/esm/presentation-common/content/Property.js +37 -37
  311. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
  312. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
  313. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +134 -0
  314. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -0
  315. package/lib/esm/presentation-common/content/Renderer.d.ts +11 -11
  316. package/lib/esm/presentation-common/content/Renderer.js +8 -8
  317. package/lib/esm/presentation-common/content/TypeDescription.d.ts +72 -72
  318. package/lib/esm/presentation-common/content/TypeDescription.d.ts.map +1 -1
  319. package/lib/esm/presentation-common/content/TypeDescription.js +20 -20
  320. package/lib/esm/presentation-common/content/Value.d.ts +204 -189
  321. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  322. package/lib/esm/presentation-common/content/Value.js +278 -270
  323. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  324. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +37 -37
  325. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +28 -28
  326. package/lib/esm/presentation-common/hierarchy/Key.d.ts +246 -246
  327. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  328. package/lib/esm/presentation-common/hierarchy/Key.js +118 -118
  329. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  330. package/lib/esm/presentation-common/hierarchy/Node.d.ts +154 -154
  331. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  332. package/lib/esm/presentation-common/hierarchy/Node.js +103 -103
  333. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  334. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +96 -96
  335. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +119 -119
  336. package/lib/esm/presentation-common/rules/ClassSpecifications.d.ts +45 -45
  337. package/lib/esm/presentation-common/rules/ClassSpecifications.js +8 -8
  338. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts +31 -31
  339. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js +8 -8
  340. package/lib/esm/presentation-common/rules/RelationshipDirection.d.ts +13 -13
  341. package/lib/esm/presentation-common/rules/RelationshipDirection.js +18 -18
  342. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts +56 -56
  343. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  344. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js +8 -8
  345. package/lib/esm/presentation-common/rules/Rule.d.ts +76 -76
  346. package/lib/esm/presentation-common/rules/Rule.js +32 -32
  347. package/lib/esm/presentation-common/rules/Ruleset.d.ts +65 -65
  348. package/lib/esm/presentation-common/rules/Ruleset.js +8 -8
  349. package/lib/esm/presentation-common/rules/SchemasSpecification.d.ts +41 -41
  350. package/lib/esm/presentation-common/rules/SchemasSpecification.js +8 -8
  351. package/lib/esm/presentation-common/rules/Variables.d.ts +58 -58
  352. package/lib/esm/presentation-common/rules/Variables.js +22 -22
  353. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +41 -41
  354. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +8 -8
  355. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +25 -25
  356. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +8 -8
  357. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts +30 -30
  358. package/lib/esm/presentation-common/rules/content/ContentRule.js +8 -8
  359. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +58 -58
  360. package/lib/esm/presentation-common/rules/content/ContentSpecification.js +17 -17
  361. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +19 -19
  362. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +8 -8
  363. package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts +86 -86
  364. package/lib/esm/presentation-common/rules/content/PropertySpecification.js +8 -8
  365. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +28 -28
  366. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +8 -8
  367. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +25 -25
  368. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +8 -8
  369. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +64 -57
  370. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  371. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js +8 -8
  372. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  373. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.d.ts +17 -17
  374. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +8 -8
  375. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +107 -107
  376. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.map +1 -1
  377. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +8 -8
  378. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +108 -108
  379. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +18 -18
  380. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +96 -96
  381. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +40 -40
  382. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +44 -44
  383. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +8 -8
  384. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +36 -36
  385. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +8 -8
  386. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts +27 -27
  387. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js +8 -8
  388. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +207 -207
  389. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +48 -48
  390. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +29 -29
  391. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +8 -8
  392. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts +158 -158
  393. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  394. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js +22 -22
  395. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +40 -40
  396. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +8 -8
  397. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts +58 -58
  398. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  399. package/lib/esm/presentation-common/rules/customization/SortingRule.js +8 -8
  400. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +48 -48
  401. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +8 -8
  402. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +14 -14
  403. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +8 -8
  404. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +98 -98
  405. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  406. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +18 -18
  407. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +31 -31
  408. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +8 -8
  409. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +79 -79
  410. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +16 -16
  411. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +39 -39
  412. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +8 -8
  413. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +50 -50
  414. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
  415. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +8 -8
  416. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +27 -27
  417. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js +8 -8
  418. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +27 -27
  419. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +8 -8
  420. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +16 -16
  421. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +8 -8
  422. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +35 -35
  423. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +8 -8
  424. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +38 -38
  425. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  426. package/lib/esm/presentation-common/selection/SelectionScope.js +8 -8
  427. package/lib/esm/presentation-common.d.ts +114 -112
  428. package/lib/esm/presentation-common.d.ts.map +1 -1
  429. package/lib/esm/presentation-common.js +118 -116
  430. package/lib/esm/presentation-common.js.map +1 -1
  431. package/lib/public/locales/en/Presentation.json +19 -0
  432. package/package.json +17 -15
  433. package/lib/cjs/assets/locales/en/BisCore.json +0 -18
  434. package/lib/cjs/assets/locales/en/ECPresentation.json +0 -9
  435. package/lib/cjs/assets/locales/en/RulesEngine.json +0 -6
  436. package/lib/cjs/assets/locales/en-PSEUDO/BisCore.json +0 -18
  437. package/lib/cjs/assets/locales/en-PSEUDO/ECPresentation.json +0 -9
  438. package/lib/cjs/assets/locales/en-PSEUDO/RulesEngine.json +0 -6
  439. package/lib/public/locales/en/BisCore.json +0 -18
  440. package/lib/public/locales/en/ECPresentation.json +0 -9
  441. package/lib/public/locales/en/RulesEngine.json +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAyD;AACzD,8BAGe;AACf,oCAAiE;AACjE,8GAAgG;AAGhG,yCAAoD;AAkDpD,4CAA4C;AAC5C,MAAM,iBAAiB,GAAG,CAAC,KAAwB,EAAuD,EAAE;IAC1G,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC,CAAC;AAEF,gDAAgD;AAChD,MAAM,oBAAoB,GAAG,CAAC,KAAwB,EAA6D,EAAE;IACnH,OAAO,CAAC,CAAE,KAAa,CAAC,YAAY,CAAC;AACvC,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAa,KAAK;IAoBhB;;;;;;;;;;OAUG;IACH,YAAmB,QAA6B,EAAE,IAAY,EAAE,KAAa,EAAE,IAAqB,EAClG,UAAmB,EAAE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C","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, ClassInfoJSON, CompressedClassInfoJSON, NavigationPropertyInfo, PropertyInfo, PropertyInfoJSON, RelatedClassInfo, RelationshipPath,\r\n RelationshipPathJSON, StrippedRelationshipPath,\r\n} from \"../EC\";\r\nimport { PresentationError, PresentationStatus } from \"../Error\";\r\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification\";\r\nimport { CategoryDescription } from \"./Category\";\r\nimport { EditorDescription } from \"./Editor\";\r\nimport { Property, PropertyJSON } from \"./Property\";\r\nimport { RendererDescription } from \"./Renderer\";\r\nimport { TypeDescription } from \"./TypeDescription\";\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}\r\n\r\n/**\r\n * Data structure for a [[PropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n properties: PropertyJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[NestedContentField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n contentClassInfo: TClassInfoJSON;\r\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\r\n relationshipMeaning?: RelationshipMeaning;\r\n /** @beta */\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\n// eslint-disable-next-line deprecation/deprecation\r\nexport type FieldJSON<TClassInfoJSON = ClassInfoJSON> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;\r\n\r\n/** Is supplied field a properties field. */\r\nconst isPropertiesField = (field: FieldJSON | Field): field is PropertiesFieldJSON<any> | PropertiesField => {\r\n return !!(field as any).properties;\r\n};\r\n\r\n/** Is supplied field a nested content field. */\r\nconst isNestedContentField = (field: FieldJSON | Field): field is NestedContentFieldJSON<any> | NestedContentField => {\r\n return !!(field as any).nestedFields;\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 /** 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 */\r\n public constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription,\r\n isReadonly: boolean, priority: number, editor?: EditorDescription, renderer?: RendererDescription) {\r\n this.category = category;\r\n this.name = name;\r\n this.label = label;\r\n this.type = type;\r\n this.isReadonly = isReadonly;\r\n this.priority = priority;\r\n this.editor = editor;\r\n this.renderer = renderer;\r\n }\r\n\r\n /**\r\n * Is this a [[PropertiesField]]\r\n */\r\n public isPropertiesField(): this is PropertiesField { return isPropertiesField(this); }\r\n\r\n /**\r\n * Is this a [[NestedContentField]]\r\n */\r\n public isNestedContentField(): this is NestedContentField { return isNestedContentField(this); }\r\n\r\n /**\r\n * Get parent\r\n */\r\n public get parent(): NestedContentField | undefined { return this._parent; }\r\n\r\n public clone() {\r\n const clone = new Field(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): FieldJSON {\r\n return {\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 };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\r\n if (this.isPropertiesField())\r\n return {\r\n ...this.toJSON(),\r\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\r\n };\r\n\r\n if (this.isNestedContentField()) {\r\n const { id, ...leftOverInfo } = this.contentClassInfo;\r\n classesMap[id] = leftOverInfo;\r\n return {\r\n ...this.toJSON(),\r\n contentClassInfo: id,\r\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\r\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n return this.toJSON();\r\n }\r\n\r\n /** Deserialize [[Field]] from JSON */\r\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\r\n if (!json)\r\n return undefined;\r\n if (isPropertiesField(json))\r\n return PropertiesField.fromJSON(json, categories);\r\n if (isNestedContentField(json))\r\n // eslint-disable-next-line deprecation/deprecation\r\n return NestedContentField.fromJSON(json, categories);\r\n const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[Field]] from compressed JSON.\r\n * @public\r\n */\r\n public static fromCompressedJSON(json: FieldJSON<string> | undefined, classesMap: { [id: string]: CompressedClassInfoJSON }, categories: CategoryDescription[]): 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 const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, 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 return category;\r\n }\r\n\r\n /** @internal */\r\n public resetParentship(): void {\r\n this._parent = undefined;\r\n }\r\n\r\n /** @internal */\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/**\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 */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: 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 super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.properties = properties;\r\n }\r\n\r\n public override clone() {\r\n const clone = new PropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): PropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n properties: this.properties,\r\n };\r\n }\r\n\r\n /** Deserialize [[PropertiesField]] from JSON */\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 const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, 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(json: PropertiesFieldJSON<Id64String>, classesMap: { [id: string]: CompressedClassInfoJSON }, categories: CategoryDescription[]): PropertiesField | undefined {\r\n const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, 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/**\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 * @beta\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 */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: 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 super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.contentClassInfo = contentClassInfo;\r\n this.pathToPrimaryClass = pathToPrimaryClass;\r\n this.relationshipMeaning = RelationshipMeaning.RelatedInstance;\r\n this.nestedFields = nestedFields;\r\n this.autoExpand = autoExpand;\r\n this.actualPrimaryClassIds = [];\r\n }\r\n\r\n public override clone() {\r\n const clone = new NestedContentField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.contentClassInfo,\r\n this.pathToPrimaryClass,\r\n this.nestedFields.map((n) => n.clone()),\r\n this.editor,\r\n this.autoExpand,\r\n this.renderer,\r\n );\r\n clone.actualPrimaryClassIds = this.actualPrimaryClassIds;\r\n clone.relationshipMeaning = this.relationshipMeaning;\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 /** Serialize this object to JSON */\r\n public override toJSON(): NestedContentFieldJSON {\r\n return {\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 nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\r\n autoExpand: this.autoExpand,\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[NestedContentField]] from JSON\r\n * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]\r\n */\r\n public static override fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined {\r\n if (!json)\r\n return undefined;\r\n\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[NestedContentField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(json: NestedContentFieldJSON<Id64String>, classesMap: { [id: string]: CompressedClassInfoJSON }, categories: CategoryDescription[]) {\r\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n nestedFields: json.nestedFields.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 // eslint-disable-next-line deprecation/deprecation\r\n private static fromCommonJSON(json: NestedContentFieldJSON<ClassInfoJSON | string>, categories: CategoryDescription[]): Partial<NestedContentField> {\r\n return {\r\n category: this.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\r\n /** @internal */\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 /** @internal */\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/** @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 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 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/** @public */\r\nexport namespace FieldDescriptor { // eslint-disable-line @typescript-eslint/no-redeclare\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"]}
1
+ {"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/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,8BAA8B,CAAC,sBAAgD,EAAE,UAAqD;IAC7I,IAAA,qBAAM,EAAC,UAAU,CAAC,cAAc,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC,CAAC;IAEpE,MAAM,EAAE,sBAAsB,EAAE,GAAG,oBAAoB,EAAE,GAAG,sBAAsB,CAAC;IAEnF,OAAO;QACL,GAAG,oBAAoB;QACvB,SAAS,EAAE,EAAE,EAAE,EAAE,sBAAsB,CAAC,SAAS,EAAE,GAAG,UAAU,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE;QACpG,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,sBAAsB,EAAE,2BAAsB,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACpJ,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, ClassInfoJSON, CompressedClassInfoJSON, NavigationPropertyInfo, PropertyInfo, PropertyInfoJSON, RelatedClassInfo, RelationshipPath,\r\n RelationshipPathJSON, StrippedRelationshipPath,\r\n} from \"../EC\";\r\nimport { PresentationError, PresentationStatus } from \"../Error\";\r\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification\";\r\nimport { CategoryDescription } from \"./Category\";\r\nimport { EditorDescription } from \"./Editor\";\r\nimport { Property, PropertyJSON } from \"./Property\";\r\nimport { RendererDescription } from \"./Renderer\";\r\nimport { TypeDescription } from \"./TypeDescription\";\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}\r\n\r\n/**\r\n * Data structure for a [[PropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n properties: PropertyJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[NestedContentField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line deprecation/deprecation\r\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n contentClassInfo: TClassInfoJSON;\r\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\r\n relationshipMeaning?: RelationshipMeaning;\r\n /** @beta */\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\n// eslint-disable-next-line deprecation/deprecation\r\nexport type FieldJSON<TClassInfoJSON = ClassInfoJSON> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;\r\n\r\n/** Is supplied field a properties field. */\r\nconst isPropertiesField = (field: FieldJSON | Field): field is PropertiesFieldJSON<any> | PropertiesField => {\r\n return !!(field as any).properties;\r\n};\r\n\r\n/** Is supplied field a nested content field. */\r\nconst isNestedContentField = (field: FieldJSON | Field): field is NestedContentFieldJSON<any> | NestedContentField => {\r\n return !!(field as any).nestedFields;\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 /** 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 */\r\n public constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription,\r\n isReadonly: boolean, priority: number, editor?: EditorDescription, renderer?: RendererDescription) {\r\n this.category = category;\r\n this.name = name;\r\n this.label = label;\r\n this.type = type;\r\n this.isReadonly = isReadonly;\r\n this.priority = priority;\r\n this.editor = editor;\r\n this.renderer = renderer;\r\n }\r\n\r\n /**\r\n * Is this a [[PropertiesField]]\r\n */\r\n public isPropertiesField(): this is PropertiesField { return isPropertiesField(this); }\r\n\r\n /**\r\n * Is this a [[NestedContentField]]\r\n */\r\n public isNestedContentField(): this is NestedContentField { return isNestedContentField(this); }\r\n\r\n /**\r\n * Get parent\r\n */\r\n public get parent(): NestedContentField | undefined { return this._parent; }\r\n\r\n public clone() {\r\n const clone = new Field(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): FieldJSON {\r\n return {\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 };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\r\n if (this.isPropertiesField())\r\n return {\r\n ...this.toJSON(),\r\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\r\n };\r\n\r\n if (this.isNestedContentField()) {\r\n const { id, ...leftOverInfo } = this.contentClassInfo;\r\n classesMap[id] = leftOverInfo;\r\n return {\r\n ...this.toJSON(),\r\n contentClassInfo: id,\r\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\r\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n return this.toJSON();\r\n }\r\n\r\n /** Deserialize [[Field]] from JSON */\r\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\r\n if (!json)\r\n return undefined;\r\n if (isPropertiesField(json))\r\n return PropertiesField.fromJSON(json, categories);\r\n if (isNestedContentField(json))\r\n // eslint-disable-next-line deprecation/deprecation\r\n return NestedContentField.fromJSON(json, categories);\r\n const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /** Deserialize a [[Field]] from compressed JSON. */\r\n public static fromCompressedJSON(json: FieldJSON<string> | undefined, classesMap: { [id: string]: CompressedClassInfoJSON }, categories: CategoryDescription[]): 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 const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, 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 return category;\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/**\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 */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: 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 super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.properties = properties;\r\n }\r\n\r\n public override clone() {\r\n const clone = new PropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): PropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n properties: this.properties,\r\n };\r\n }\r\n\r\n /** Deserialize [[PropertiesField]] from JSON */\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 const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, 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(json: PropertiesFieldJSON<Id64String>, classesMap: { [id: string]: CompressedClassInfoJSON }, categories: CategoryDescription[]): PropertiesField | undefined {\r\n const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, 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/**\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 * @beta\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 */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: 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 super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.contentClassInfo = contentClassInfo;\r\n this.pathToPrimaryClass = pathToPrimaryClass;\r\n this.relationshipMeaning = RelationshipMeaning.RelatedInstance;\r\n this.nestedFields = nestedFields;\r\n this.autoExpand = autoExpand;\r\n this.actualPrimaryClassIds = [];\r\n }\r\n\r\n public override clone() {\r\n const clone = new NestedContentField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.contentClassInfo,\r\n this.pathToPrimaryClass,\r\n this.nestedFields.map((n) => n.clone()),\r\n this.editor,\r\n this.autoExpand,\r\n this.renderer,\r\n );\r\n clone.actualPrimaryClassIds = this.actualPrimaryClassIds;\r\n clone.relationshipMeaning = this.relationshipMeaning;\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 /** Serialize this object to JSON */\r\n public override toJSON(): NestedContentFieldJSON {\r\n return {\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 nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\r\n autoExpand: this.autoExpand,\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[NestedContentField]] from JSON\r\n * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]\r\n */\r\n public static override fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined {\r\n if (!json)\r\n return undefined;\r\n\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n });\r\n }\r\n\r\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\r\n public static override fromCompressedJSON(json: NestedContentFieldJSON<Id64String>, classesMap: { [id: string]: CompressedClassInfoJSON }, categories: CategoryDescription[]) {\r\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n nestedFields: json.nestedFields.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 // eslint-disable-next-line deprecation/deprecation\r\n private static fromCommonJSON(json: NestedContentFieldJSON<ClassInfoJSON | string>, categories: CategoryDescription[]): Partial<NestedContentField> {\r\n return {\r\n category: this.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\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 * 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/** @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 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 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/** @public */\r\nexport namespace FieldDescriptor { // eslint-disable-line @typescript-eslint/no-redeclare\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"]}
@@ -1,86 +1,86 @@
1
- /** @packageDocumentation
2
- * @module Content
3
- */
4
- import { ClassInfo, InstanceKey } from "../EC";
5
- import { LabelDefinition, LabelDefinitionJSON } from "../LabelDefinition";
6
- import { ValuesDictionary } from "../Utils";
7
- import { DisplayValue, DisplayValueJSON, Value, ValueJSON } from "./Value";
8
- /**
9
- * Serialized [[Item]] JSON representation.
10
- * @public
11
- */
12
- export interface ItemJSON {
13
- inputKeys?: InstanceKey[];
14
- primaryKeys: InstanceKey[];
15
- labelDefinition: LabelDefinitionJSON;
16
- /** @deprecated in 3.x. */
17
- imageId: string;
18
- classInfo?: ClassInfo;
19
- values: ValuesDictionary<ValueJSON>;
20
- displayValues: ValuesDictionary<DisplayValueJSON>;
21
- mergedFieldNames: string[];
22
- extendedData?: {
23
- [key: string]: any;
24
- };
25
- }
26
- /**
27
- * A data structure that represents a single content record.
28
- * @public
29
- */
30
- export declare class Item {
31
- /**
32
- * Keys of input instances that caused this item to be included in content. Only set if the content is
33
- * created with [[ContentFlags.IncludeInputKeys]] flag.
34
- */
35
- inputKeys?: InstanceKey[];
36
- /** Keys of instances whose data is contained in this item */
37
- primaryKeys: InstanceKey[];
38
- /** Display label of the item */
39
- label: LabelDefinition;
40
- /**
41
- * ID of the image associated with this item
42
- * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
43
- */
44
- imageId: string;
45
- /** For cases when item consists only of same class instances, information about the ECClass */
46
- classInfo?: ClassInfo;
47
- /** Raw values dictionary */
48
- values: ValuesDictionary<Value>;
49
- /** Display values dictionary */
50
- displayValues: ValuesDictionary<DisplayValue>;
51
- /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */
52
- mergedFieldNames: string[];
53
- /** Extended data injected into this content item */
54
- extendedData?: {
55
- [key: string]: any;
56
- };
57
- /**
58
- * Creates an instance of Item.
59
- * @param primaryKeys Keys of instances whose data is contained in this item
60
- * @param label Display label of the item
61
- * @param imageId ID of the image associated with this item
62
- * @param classInfo For cases when item consists only of same class instances, information about the ECClass
63
- * @param values Raw values dictionary
64
- * @param displayValues Display values dictionary
65
- * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))
66
- * @param extendedData Extended data injected into this content item
67
- */
68
- constructor(primaryKeys: InstanceKey[], label: string | LabelDefinition, imageId: string, classInfo: ClassInfo | undefined, values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, mergedFieldNames: string[], extendedData?: {
69
- [key: string]: any;
70
- });
71
- /**
72
- * Is value of field with the specified name merged in this record.
73
- */
74
- isFieldMerged(fieldName: string): boolean;
75
- /** Serialize this object to JSON */
76
- toJSON(): ItemJSON;
77
- /** Deserialize [[Item]] from JSON */
78
- static fromJSON(json: ItemJSON | string | undefined): Item | undefined;
79
- /**
80
- * Reviver function that can be used as a second argument for
81
- * `JSON.parse` method when parsing Item objects.
82
- * @internal
83
- */
84
- static reviver(key: string, value: any): any;
85
- }
1
+ /** @packageDocumentation
2
+ * @module Content
3
+ */
4
+ import { ClassInfo, InstanceKey } from "../EC";
5
+ import { LabelDefinition, LabelDefinitionJSON } from "../LabelDefinition";
6
+ import { ValuesDictionary } from "../Utils";
7
+ import { DisplayValue, DisplayValueJSON, Value, ValueJSON } from "./Value";
8
+ /**
9
+ * Serialized [[Item]] JSON representation.
10
+ * @public
11
+ */
12
+ export interface ItemJSON {
13
+ inputKeys?: InstanceKey[];
14
+ primaryKeys: InstanceKey[];
15
+ labelDefinition: LabelDefinitionJSON;
16
+ /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */
17
+ imageId: string;
18
+ classInfo?: ClassInfo;
19
+ values: ValuesDictionary<ValueJSON>;
20
+ displayValues: ValuesDictionary<DisplayValueJSON>;
21
+ mergedFieldNames: string[];
22
+ extendedData?: {
23
+ [key: string]: any;
24
+ };
25
+ }
26
+ /**
27
+ * A data structure that represents a single content record.
28
+ * @public
29
+ */
30
+ export declare class Item {
31
+ /**
32
+ * Keys of input instances that caused this item to be included in content. Only set if the content is
33
+ * created with [[ContentFlags.IncludeInputKeys]] flag.
34
+ */
35
+ inputKeys?: InstanceKey[];
36
+ /** Keys of instances whose data is contained in this item */
37
+ primaryKeys: InstanceKey[];
38
+ /** Display label of the item */
39
+ label: LabelDefinition;
40
+ /**
41
+ * ID of the image associated with this item
42
+ * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
43
+ */
44
+ imageId: string;
45
+ /** For cases when item consists only of same class instances, information about the ECClass */
46
+ classInfo?: ClassInfo;
47
+ /** Raw values dictionary */
48
+ values: ValuesDictionary<Value>;
49
+ /** Display values dictionary */
50
+ displayValues: ValuesDictionary<DisplayValue>;
51
+ /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */
52
+ mergedFieldNames: string[];
53
+ /** Extended data injected into this content item */
54
+ extendedData?: {
55
+ [key: string]: any;
56
+ };
57
+ /**
58
+ * Creates an instance of Item.
59
+ * @param primaryKeys Keys of instances whose data is contained in this item
60
+ * @param label Display label of the item
61
+ * @param imageId ID of the image associated with this item
62
+ * @param classInfo For cases when item consists only of same class instances, information about the ECClass
63
+ * @param values Raw values dictionary
64
+ * @param displayValues Display values dictionary
65
+ * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))
66
+ * @param extendedData Extended data injected into this content item
67
+ */
68
+ constructor(primaryKeys: InstanceKey[], label: string | LabelDefinition, imageId: string, classInfo: ClassInfo | undefined, values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, mergedFieldNames: string[], extendedData?: {
69
+ [key: string]: any;
70
+ });
71
+ /**
72
+ * Is value of field with the specified name merged in this record.
73
+ */
74
+ isFieldMerged(fieldName: string): boolean;
75
+ /** Serialize this object to JSON */
76
+ toJSON(): ItemJSON;
77
+ /** Deserialize [[Item]] from JSON */
78
+ static fromJSON(json: ItemJSON | string | undefined): Item | undefined;
79
+ /**
80
+ * Reviver function that can be used as a second argument for
81
+ * `JSON.parse` method when parsing Item objects.
82
+ * @internal
83
+ */
84
+ static reviver(key: string, value: any): any;
85
+ }
86
86
  //# sourceMappingURL=Item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAwB,KAAK,EAAE,SAAS,EAAiB,MAAM,SAAS,CAAC;AAEhH;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,WAAW,EAAE,WAAW,EAAE,CAAC;IAG3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AW,EAAE,CAAC;IACjC,6DAA6D;IACtD,WAAW,EAAE,WAAW,EAAE,CAAC;IAClC,gCAAgC;IACzB,KAAK,EAAE,eAAe,CAAC;IAC9B;;;OAGG;IACI,OAAO,EAAE,MAAM,CAAC;IACvB,+FAA+F;IACxF,SAAS,CAAC,EAAE,SAAS,CAAC;IAC7B,4BAA4B;IACrB,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACvC,gCAAgC;IACzB,aAAa,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACrD,+HAA+H;IACxH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAClC,oDAAoD;IAC7C,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAE7C;;;;;;;;;;OAUG;gBACgB,WAAW,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,SAAS,EAC/H,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,gBAAgB,CAAC,YAAY,CAAC,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAWnJ;;OAEG;IACI,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIhD,oCAAoC;IAC7B,MAAM,IAAI,QAAQ;IAazB,qCAAqC;WACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;IAiB7E;;;;OAIG;WACW,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,GAAG;CAGpD"}
@@ -1,85 +1,85 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module Content
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.Item = void 0;
11
- const LabelDefinition_1 = require("../LabelDefinition");
12
- const Value_1 = require("./Value");
13
- /**
14
- * A data structure that represents a single content record.
15
- * @public
16
- */
17
- class Item {
18
- /**
19
- * Creates an instance of Item.
20
- * @param primaryKeys Keys of instances whose data is contained in this item
21
- * @param label Display label of the item
22
- * @param imageId ID of the image associated with this item
23
- * @param classInfo For cases when item consists only of same class instances, information about the ECClass
24
- * @param values Raw values dictionary
25
- * @param displayValues Display values dictionary
26
- * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))
27
- * @param extendedData Extended data injected into this content item
28
- */
29
- constructor(primaryKeys, label, imageId, classInfo, values, displayValues, mergedFieldNames, extendedData) {
30
- this.primaryKeys = primaryKeys;
31
- this.imageId = imageId; // eslint-disable-line deprecation/deprecation
32
- this.classInfo = classInfo;
33
- this.values = values;
34
- this.displayValues = displayValues;
35
- this.mergedFieldNames = mergedFieldNames;
36
- this.extendedData = extendedData;
37
- this.label = (typeof label === "string") ? LabelDefinition_1.LabelDefinition.fromLabelString(label) : label;
38
- }
39
- /**
40
- * Is value of field with the specified name merged in this record.
41
- */
42
- isFieldMerged(fieldName) {
43
- return -1 !== this.mergedFieldNames.indexOf(fieldName);
44
- }
45
- /** Serialize this object to JSON */
46
- toJSON() {
47
- const { label, ...baseItem } = this;
48
- return {
49
- ...baseItem,
50
- // eslint-disable-next-line deprecation/deprecation
51
- values: Value_1.Value.toJSON(this.values),
52
- // eslint-disable-next-line deprecation/deprecation
53
- displayValues: Value_1.DisplayValue.toJSON(this.displayValues),
54
- // eslint-disable-next-line deprecation/deprecation
55
- labelDefinition: LabelDefinition_1.LabelDefinition.toJSON(label),
56
- };
57
- }
58
- /** Deserialize [[Item]] from JSON */
59
- static fromJSON(json) {
60
- if (!json)
61
- return undefined;
62
- if (typeof json === "string")
63
- return JSON.parse(json, Item.reviver);
64
- const item = Object.create(Item.prototype);
65
- const { labelDefinition, ...baseJson } = json;
66
- return Object.assign(item, baseJson, {
67
- // eslint-disable-next-line deprecation/deprecation
68
- values: Value_1.Value.fromJSON(json.values),
69
- // eslint-disable-next-line deprecation/deprecation
70
- displayValues: Value_1.DisplayValue.fromJSON(json.displayValues),
71
- // eslint-disable-next-line deprecation/deprecation
72
- label: LabelDefinition_1.LabelDefinition.fromJSON(labelDefinition),
73
- });
74
- }
75
- /**
76
- * Reviver function that can be used as a second argument for
77
- * `JSON.parse` method when parsing Item objects.
78
- * @internal
79
- */
80
- static reviver(key, value) {
81
- return key === "" ? Item.fromJSON(value) : value;
82
- }
83
- }
84
- exports.Item = Item;
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Content
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.Item = void 0;
11
+ const LabelDefinition_1 = require("../LabelDefinition");
12
+ const Value_1 = require("./Value");
13
+ /**
14
+ * A data structure that represents a single content record.
15
+ * @public
16
+ */
17
+ class Item {
18
+ /**
19
+ * Creates an instance of Item.
20
+ * @param primaryKeys Keys of instances whose data is contained in this item
21
+ * @param label Display label of the item
22
+ * @param imageId ID of the image associated with this item
23
+ * @param classInfo For cases when item consists only of same class instances, information about the ECClass
24
+ * @param values Raw values dictionary
25
+ * @param displayValues Display values dictionary
26
+ * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))
27
+ * @param extendedData Extended data injected into this content item
28
+ */
29
+ constructor(primaryKeys, label, imageId, classInfo, values, displayValues, mergedFieldNames, extendedData) {
30
+ this.primaryKeys = primaryKeys;
31
+ this.imageId = imageId; // eslint-disable-line deprecation/deprecation
32
+ this.classInfo = classInfo;
33
+ this.values = values;
34
+ this.displayValues = displayValues;
35
+ this.mergedFieldNames = mergedFieldNames;
36
+ this.extendedData = extendedData;
37
+ this.label = (typeof label === "string") ? LabelDefinition_1.LabelDefinition.fromLabelString(label) : label;
38
+ }
39
+ /**
40
+ * Is value of field with the specified name merged in this record.
41
+ */
42
+ isFieldMerged(fieldName) {
43
+ return -1 !== this.mergedFieldNames.indexOf(fieldName);
44
+ }
45
+ /** Serialize this object to JSON */
46
+ toJSON() {
47
+ const { label, ...baseItem } = this;
48
+ return {
49
+ ...baseItem,
50
+ // eslint-disable-next-line deprecation/deprecation
51
+ values: Value_1.Value.toJSON(this.values),
52
+ // eslint-disable-next-line deprecation/deprecation
53
+ displayValues: Value_1.DisplayValue.toJSON(this.displayValues),
54
+ // eslint-disable-next-line deprecation/deprecation
55
+ labelDefinition: LabelDefinition_1.LabelDefinition.toJSON(label),
56
+ };
57
+ }
58
+ /** Deserialize [[Item]] from JSON */
59
+ static fromJSON(json) {
60
+ if (!json)
61
+ return undefined;
62
+ if (typeof json === "string")
63
+ return JSON.parse(json, Item.reviver);
64
+ const item = Object.create(Item.prototype);
65
+ const { labelDefinition, ...baseJson } = json;
66
+ return Object.assign(item, baseJson, {
67
+ // eslint-disable-next-line deprecation/deprecation
68
+ values: Value_1.Value.fromJSON(json.values),
69
+ // eslint-disable-next-line deprecation/deprecation
70
+ displayValues: Value_1.DisplayValue.fromJSON(json.displayValues),
71
+ // eslint-disable-next-line deprecation/deprecation
72
+ label: LabelDefinition_1.LabelDefinition.fromJSON(labelDefinition),
73
+ });
74
+ }
75
+ /**
76
+ * Reviver function that can be used as a second argument for
77
+ * `JSON.parse` method when parsing Item objects.
78
+ * @internal
79
+ */
80
+ static reviver(key, value) {
81
+ return key === "" ? Item.fromJSON(value) : value;
82
+ }
83
+ }
84
+ exports.Item = Item;
85
85
  //# sourceMappingURL=Item.js.map
@@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9E,mDAAmD;YACnD,eAAe,EAAE,iCAAe,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/C,CAAC;IACJ,CAAC;IAED,qCAAqC;IAC9B,MAAM,CAAC,QAAQ,CAAC,IAAmC;QACxD,IAAI,CAAC,IAAI;YACP,OAAO,SAAS,CAAC;QACnB,IAAI,OAAO,IAAI,KAAK,QAAQ;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACxC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,EAAE,eAAe,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QAC9C,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE;YACnC,mDAAmD;YACnD,MAAM,EAAE,aAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;YACnC,mDAAmD;YACnD,aAAa,EAAE,oBAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;YACxD,mDAAmD;YACnD,KAAK,EAAE,iCAAe,CAAC,QAAQ,CAAC,eAAe,CAAC;SAChC,CAAC,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,GAAW,EAAE,KAAU;QAC3C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,CAAC;CACF;AAhGD,oBAgGC","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\";\r\nimport { LabelDefinition, LabelDefinitionJSON } from \"../LabelDefinition\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\nimport { DisplayValue, DisplayValueJSON, DisplayValuesMapJSON, Value, ValueJSON, ValuesMapJSON } from \"./Value\";\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 // TODO: rename to `label`\r\n // eslint-disable-next-line deprecation/deprecation\r\n labelDefinition: LabelDefinitionJSON;\r\n /** @deprecated in 3.x. */\r\n imageId: string;\r\n classInfo?: ClassInfo;\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: ValuesDictionary<ValueJSON>;\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\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 /**\r\n * ID of the image associated with this item\r\n * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\r\n */\r\n public imageId: string;\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 */\r\n public constructor(primaryKeys: InstanceKey[], label: string | LabelDefinition, imageId: string, classInfo: ClassInfo | undefined,\r\n values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, mergedFieldNames: string[], extendedData?: { [key: string]: any }) {\r\n this.primaryKeys = primaryKeys;\r\n this.imageId = imageId; // eslint-disable-line deprecation/deprecation\r\n this.classInfo = classInfo;\r\n this.values = values;\r\n this.displayValues = displayValues;\r\n this.mergedFieldNames = mergedFieldNames;\r\n this.extendedData = extendedData;\r\n this.label = (typeof label === \"string\") ? LabelDefinition.fromLabelString(label) : 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 {\r\n ...baseItem,\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: Value.toJSON(this.values) as ValuesMapJSON,\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: DisplayValue.toJSON(this.displayValues) as DisplayValuesMapJSON,\r\n // eslint-disable-next-line deprecation/deprecation\r\n labelDefinition: LabelDefinition.toJSON(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 if (typeof json === \"string\")\r\n return JSON.parse(json, Item.reviver);\r\n const item = Object.create(Item.prototype);\r\n const { labelDefinition, ...baseJson } = json;\r\n return Object.assign(item, baseJson, {\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: Value.fromJSON(json.values),\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: DisplayValue.fromJSON(json.displayValues),\r\n // eslint-disable-next-line deprecation/deprecation\r\n label: LabelDefinition.fromJSON(labelDefinition),\r\n } as Partial<Item>);\r\n }\r\n\r\n /**\r\n * Reviver function that can be used as a second argument for\r\n * `JSON.parse` method when parsing Item objects.\r\n * @internal\r\n */\r\n public static reviver(key: string, value: any): any {\r\n return key === \"\" ? Item.fromJSON(value) : value;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA0E;AAE1E,mCAAgH;AAuBhH;;;GAGG;AACH,MAAa,IAAI;IA0Bf;;;;;;;;;;OAUG;IACH,YAAmB,WAA0B,EAAE,KAA+B,EAAE,OAAe,EAAE,SAAgC,EAC/H,MAA+B,EAAE,aAA6C,EAAE,gBAA0B,EAAE,YAAqC;QACjJ,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,8CAA8C;QACtE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,iCAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5F,CAAC;IAED;;OAEG;IACI,aAAa,CAAC,SAAiB;QACpC,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,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AC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,CAAC;CACF;AAhGD,oBAgGC","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\";\r\nimport { LabelDefinition, LabelDefinitionJSON } from \"../LabelDefinition\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\nimport { DisplayValue, DisplayValueJSON, DisplayValuesMapJSON, Value, ValueJSON, ValuesMapJSON } from \"./Value\";\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 // TODO: rename to `label`\r\n // eslint-disable-next-line deprecation/deprecation\r\n labelDefinition: LabelDefinitionJSON;\r\n /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */\r\n imageId: string;\r\n classInfo?: ClassInfo;\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: ValuesDictionary<ValueJSON>;\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\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 /**\r\n * ID of the image associated with this item\r\n * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\r\n */\r\n public imageId: string;\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 */\r\n public constructor(primaryKeys: InstanceKey[], label: string | LabelDefinition, imageId: string, classInfo: ClassInfo | undefined,\r\n values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, mergedFieldNames: string[], extendedData?: { [key: string]: any }) {\r\n this.primaryKeys = primaryKeys;\r\n this.imageId = imageId; // eslint-disable-line deprecation/deprecation\r\n this.classInfo = classInfo;\r\n this.values = values;\r\n this.displayValues = displayValues;\r\n this.mergedFieldNames = mergedFieldNames;\r\n this.extendedData = extendedData;\r\n this.label = (typeof label === \"string\") ? LabelDefinition.fromLabelString(label) : 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 {\r\n ...baseItem,\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: Value.toJSON(this.values) as ValuesMapJSON,\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: DisplayValue.toJSON(this.displayValues) as DisplayValuesMapJSON,\r\n // eslint-disable-next-line deprecation/deprecation\r\n labelDefinition: LabelDefinition.toJSON(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 if (typeof json === \"string\")\r\n return JSON.parse(json, Item.reviver);\r\n const item = Object.create(Item.prototype);\r\n const { labelDefinition, ...baseJson } = json;\r\n return Object.assign(item, baseJson, {\r\n // eslint-disable-next-line deprecation/deprecation\r\n values: Value.fromJSON(json.values),\r\n // eslint-disable-next-line deprecation/deprecation\r\n displayValues: DisplayValue.fromJSON(json.displayValues),\r\n // eslint-disable-next-line deprecation/deprecation\r\n label: LabelDefinition.fromJSON(labelDefinition),\r\n } as Partial<Item>);\r\n }\r\n\r\n /**\r\n * Reviver function that can be used as a second argument for\r\n * `JSON.parse` method when parsing Item objects.\r\n * @internal\r\n */\r\n public static reviver(key: string, value: any): any {\r\n return key === \"\" ? Item.fromJSON(value) : value;\r\n }\r\n}\r\n"]}