@itwin/presentation-common 5.0.0-dev.7 → 5.0.0-dev.70

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 (369) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/Ruleset.schema.json +3 -258
  3. package/lib/cjs/assets/locales/en/Presentation.json +19 -19
  4. package/lib/cjs/presentation-common/AsyncTasks.d.ts +4 -4
  5. package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
  6. package/lib/cjs/presentation-common/AsyncTasks.js +5 -6
  7. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  8. package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
  9. package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
  10. package/lib/cjs/presentation-common/EC.d.ts +36 -80
  11. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  12. package/lib/cjs/presentation-common/EC.js +1 -97
  13. package/lib/cjs/presentation-common/EC.js.map +1 -1
  14. package/lib/cjs/presentation-common/ElementProperties.js +16 -9
  15. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  16. package/lib/cjs/presentation-common/Error.d.ts +2 -0
  17. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  18. package/lib/cjs/presentation-common/Error.js +2 -0
  19. package/lib/cjs/presentation-common/Error.js.map +1 -1
  20. package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
  21. package/lib/cjs/presentation-common/KeySet.d.ts +2 -2
  22. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  23. package/lib/cjs/presentation-common/KeySet.js +9 -11
  24. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  25. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +4 -1
  26. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  27. package/lib/cjs/presentation-common/LabelDefinition.d.ts +0 -48
  28. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  29. package/lib/cjs/presentation-common/LabelDefinition.js +1 -44
  30. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  31. package/lib/cjs/presentation-common/LocalizationHelper.js +1 -0
  32. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  33. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  34. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +31 -10
  35. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  36. package/lib/cjs/presentation-common/PresentationManagerOptions.js +0 -5
  37. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  38. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +9 -9
  39. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  40. package/lib/cjs/presentation-common/PresentationRpcInterface.js +36 -21
  41. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  42. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +3 -2
  43. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  44. package/lib/cjs/presentation-common/RegisteredRuleset.js +9 -1
  45. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  46. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +9 -12
  47. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  48. package/lib/cjs/presentation-common/RpcRequestsHandler.js +37 -30
  49. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  50. package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
  51. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  52. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  53. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  54. package/lib/cjs/presentation-common/Update.d.ts +2 -79
  55. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  56. package/lib/cjs/presentation-common/Update.js +1 -104
  57. package/lib/cjs/presentation-common/Update.js.map +1 -1
  58. package/lib/cjs/presentation-common/Utils.d.ts +21 -0
  59. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  60. package/lib/cjs/presentation-common/Utils.js +57 -0
  61. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  62. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  63. package/lib/cjs/presentation-common/content/Content.d.ts +0 -7
  64. package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
  65. package/lib/cjs/presentation-common/content/Content.js +5 -10
  66. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  67. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +1 -1
  68. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  69. package/lib/cjs/presentation-common/content/ContentTraverser.js +116 -28
  70. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  71. package/lib/cjs/presentation-common/content/Descriptor.d.ts +2 -31
  72. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  73. package/lib/cjs/presentation-common/content/Descriptor.js +68 -22
  74. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  75. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  76. package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
  77. package/lib/cjs/presentation-common/content/Fields.d.ts +151 -27
  78. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  79. package/lib/cjs/presentation-common/content/Fields.js +264 -140
  80. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  81. package/lib/cjs/presentation-common/content/Item.d.ts +26 -31
  82. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  83. package/lib/cjs/presentation-common/content/Item.js +52 -67
  84. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  85. package/lib/cjs/presentation-common/content/Property.d.ts +2 -12
  86. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  87. package/lib/cjs/presentation-common/content/Property.js +0 -18
  88. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  89. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +3 -0
  90. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  91. package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
  92. package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
  93. package/lib/cjs/presentation-common/content/Value.d.ts +5 -107
  94. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  95. package/lib/cjs/presentation-common/content/Value.js +1 -215
  96. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  97. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  98. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  99. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
  100. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  101. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +0 -83
  102. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  103. package/lib/cjs/presentation-common/hierarchy/Key.js +6 -24
  104. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  105. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -107
  106. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  107. package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
  108. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  109. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  110. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  111. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
  112. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  113. package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
  114. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  115. package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
  116. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  117. package/lib/cjs/presentation-common/rules/Rule.d.ts +0 -14
  118. package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
  119. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  120. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  121. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  122. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  123. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  124. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  125. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  126. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  127. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  128. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  129. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  130. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  131. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  132. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  133. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  134. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  135. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  136. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  137. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  138. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  139. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  140. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  141. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  142. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  143. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  144. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
  145. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  146. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  147. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  148. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  149. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  150. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  151. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  152. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  153. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  154. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  155. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  156. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  157. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  158. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  159. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  160. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  161. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  162. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +3 -0
  163. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  164. package/lib/cjs/presentation-common/selection/SelectionScope.js +1 -0
  165. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  166. package/lib/cjs/presentation-common.d.ts +1 -5
  167. package/lib/cjs/presentation-common.d.ts.map +1 -1
  168. package/lib/cjs/presentation-common.js +6 -5
  169. package/lib/cjs/presentation-common.js.map +1 -1
  170. package/lib/esm/presentation-common/AsyncTasks.d.ts +4 -4
  171. package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
  172. package/lib/esm/presentation-common/AsyncTasks.js +5 -6
  173. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  174. package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
  175. package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
  176. package/lib/esm/presentation-common/EC.d.ts +36 -80
  177. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  178. package/lib/esm/presentation-common/EC.js +0 -96
  179. package/lib/esm/presentation-common/EC.js.map +1 -1
  180. package/lib/esm/presentation-common/ElementProperties.js +16 -9
  181. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  182. package/lib/esm/presentation-common/Error.d.ts +2 -0
  183. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  184. package/lib/esm/presentation-common/Error.js +2 -0
  185. package/lib/esm/presentation-common/Error.js.map +1 -1
  186. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  187. package/lib/esm/presentation-common/KeySet.d.ts +2 -2
  188. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  189. package/lib/esm/presentation-common/KeySet.js +9 -11
  190. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  191. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +5 -2
  192. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  193. package/lib/esm/presentation-common/LabelDefinition.d.ts +0 -48
  194. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  195. package/lib/esm/presentation-common/LabelDefinition.js +0 -43
  196. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  197. package/lib/esm/presentation-common/LocalizationHelper.js +1 -0
  198. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  199. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  200. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +31 -10
  201. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  202. package/lib/esm/presentation-common/PresentationManagerOptions.js +0 -4
  203. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  204. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +9 -9
  205. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  206. package/lib/esm/presentation-common/PresentationRpcInterface.js +38 -22
  207. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  208. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +3 -2
  209. package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  210. package/lib/esm/presentation-common/RegisteredRuleset.js +9 -1
  211. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  212. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +9 -12
  213. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  214. package/lib/esm/presentation-common/RpcRequestsHandler.js +39 -32
  215. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  216. package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
  217. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  218. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  219. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  220. package/lib/esm/presentation-common/Update.d.ts +2 -79
  221. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  222. package/lib/esm/presentation-common/Update.js +0 -103
  223. package/lib/esm/presentation-common/Update.js.map +1 -1
  224. package/lib/esm/presentation-common/Utils.d.ts +21 -0
  225. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  226. package/lib/esm/presentation-common/Utils.js +54 -0
  227. package/lib/esm/presentation-common/Utils.js.map +1 -1
  228. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  229. package/lib/esm/presentation-common/content/Content.d.ts +0 -7
  230. package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
  231. package/lib/esm/presentation-common/content/Content.js +5 -10
  232. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  233. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +1 -1
  234. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  235. package/lib/esm/presentation-common/content/ContentTraverser.js +117 -29
  236. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  237. package/lib/esm/presentation-common/content/Descriptor.d.ts +2 -31
  238. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  239. package/lib/esm/presentation-common/content/Descriptor.js +68 -22
  240. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  241. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  242. package/lib/esm/presentation-common/content/Editor.js.map +1 -1
  243. package/lib/esm/presentation-common/content/Fields.d.ts +151 -27
  244. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  245. package/lib/esm/presentation-common/content/Fields.js +264 -140
  246. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  247. package/lib/esm/presentation-common/content/Item.d.ts +26 -31
  248. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  249. package/lib/esm/presentation-common/content/Item.js +52 -67
  250. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  251. package/lib/esm/presentation-common/content/Property.d.ts +2 -12
  252. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  253. package/lib/esm/presentation-common/content/Property.js +0 -18
  254. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  255. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +3 -0
  256. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  257. package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
  258. package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
  259. package/lib/esm/presentation-common/content/Value.d.ts +5 -107
  260. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  261. package/lib/esm/presentation-common/content/Value.js +0 -214
  262. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  263. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  264. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  265. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
  266. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  267. package/lib/esm/presentation-common/hierarchy/Key.d.ts +0 -83
  268. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  269. package/lib/esm/presentation-common/hierarchy/Key.js +6 -24
  270. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  271. package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -107
  272. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  273. package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
  274. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  275. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  276. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  277. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
  278. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  279. package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
  280. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  281. package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
  282. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  283. package/lib/esm/presentation-common/rules/Rule.d.ts +0 -14
  284. package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
  285. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  286. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  287. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  288. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  289. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  290. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  291. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  292. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  293. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  294. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  295. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  296. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  297. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  298. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  299. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  300. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  301. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  302. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  303. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  304. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  305. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  306. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  307. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  308. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  309. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  310. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
  311. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  312. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  313. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  314. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  315. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  316. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  317. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  318. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  319. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  320. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  321. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  322. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  323. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  324. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  325. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  326. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  327. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  328. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +3 -0
  329. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  330. package/lib/esm/presentation-common/selection/SelectionScope.js +1 -0
  331. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  332. package/lib/esm/presentation-common.d.ts +1 -5
  333. package/lib/esm/presentation-common.d.ts.map +1 -1
  334. package/lib/esm/presentation-common.js +1 -5
  335. package/lib/esm/presentation-common.js.map +1 -1
  336. package/lib/public/locales/en/Presentation.json +19 -19
  337. package/package.json +12 -12
  338. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  339. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  340. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
  341. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  342. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  343. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  344. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
  345. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  346. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  347. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  348. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
  349. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  350. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  351. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  352. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
  353. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
  354. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  355. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  356. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
  357. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  358. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  359. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  360. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
  361. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  362. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  363. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  364. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
  365. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  366. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  367. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  368. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
  369. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
@@ -12,6 +12,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const EC_1 = require("../EC");
13
13
  const Error_1 = require("../Error");
14
14
  const RelatedPropertiesSpecification_1 = require("../rules/content/modifiers/RelatedPropertiesSpecification");
15
+ const Utils_1 = require("../Utils");
15
16
  const Property_1 = require("./Property");
16
17
  function isPropertiesField(field) {
17
18
  return !!field.properties;
@@ -32,28 +33,50 @@ function isNestedContentField(field) {
32
33
  * @public
33
34
  */
34
35
  class Field {
35
- /**
36
- * Creates an instance of Field.
37
- * @param category Category information
38
- * @param name Unique name
39
- * @param label Display label
40
- * @param type Description of this field's values data type
41
- * @param isReadonly Are values in this field read-only
42
- * @param priority Priority of the field
43
- * @param editor Property editor used to edit values of this field
44
- * @param renderer Property renderer used to render values of this field
45
- * @param extendedData Extended data associated with this field
46
- */
47
- constructor(category, name, label, type, isReadonly, priority, editor, renderer, extendedData) {
48
- this.category = category;
49
- this.name = name;
50
- this.label = label;
51
- this.type = type;
52
- this.isReadonly = isReadonly;
53
- this.priority = priority;
54
- this.editor = editor;
55
- this.renderer = renderer;
56
- this.extendedData = extendedData;
36
+ /** Category information */
37
+ category;
38
+ /** Unique name */
39
+ name;
40
+ /** Display label */
41
+ label;
42
+ /** Description of this field's values data type */
43
+ type;
44
+ /** Are values in this field read-only */
45
+ isReadonly;
46
+ /** Priority of the field. Higher priority fields should appear first in the UI */
47
+ priority;
48
+ /** Property renderer used to render values of this field */
49
+ renderer;
50
+ /** Property editor used to edit values of this field */
51
+ editor;
52
+ /** Extended data associated with this field */
53
+ extendedData;
54
+ /** Parent field */
55
+ _parent;
56
+ constructor(categoryOrProps, name, label, type, isReadonly, priority, editor, renderer, extendedData) {
57
+ /* istanbul ignore next */
58
+ const props = "category" in categoryOrProps
59
+ ? categoryOrProps
60
+ : {
61
+ category: categoryOrProps,
62
+ name: name,
63
+ label: label,
64
+ type: type,
65
+ isReadonly: isReadonly,
66
+ priority: priority,
67
+ editor,
68
+ renderer,
69
+ extendedData,
70
+ };
71
+ this.category = props.category;
72
+ this.name = props.name;
73
+ this.label = props.label;
74
+ this.type = props.type;
75
+ this.isReadonly = props.isReadonly;
76
+ this.priority = props.priority;
77
+ this.editor = props.editor;
78
+ this.renderer = props.renderer;
79
+ this.extendedData = props.extendedData;
57
80
  }
58
81
  /**
59
82
  * Is this a [[PropertiesField]]
@@ -74,13 +97,20 @@ class Field {
74
97
  return this._parent;
75
98
  }
76
99
  clone() {
77
- const clone = new Field(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.editor, this.renderer, this.extendedData);
100
+ const clone = new Field(this);
78
101
  clone.rebuildParentship(this.parent);
79
102
  return clone;
80
103
  }
81
- /** Serialize this object to JSON */
104
+ /**
105
+ * Serialize this object to JSON.
106
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
107
+ */
82
108
  toJSON() {
83
- return {
109
+ return this.toCompressedJSON({});
110
+ }
111
+ /** Serialize this object to compressed JSON */
112
+ toCompressedJSON(_classesMap) {
113
+ return (0, Utils_1.omitUndefined)({
84
114
  category: this.category.name,
85
115
  name: this.name,
86
116
  label: this.label,
@@ -89,28 +119,34 @@ class Field {
89
119
  priority: this.priority,
90
120
  renderer: this.renderer,
91
121
  editor: this.editor,
92
- extendedData: this.extendedData
93
- };
94
- }
95
- /** Serialize this object to compressed JSON */
96
- toCompressedJSON(_classesMap) {
97
- return this.toJSON();
122
+ extendedData: this.extendedData,
123
+ });
98
124
  }
99
- /** Deserialize [[Field]] from JSON */
125
+ /**
126
+ * Deserialize [[Field]] from JSON.
127
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
128
+ */
100
129
  static fromJSON(json, categories) {
101
130
  if (!json) {
102
131
  return undefined;
103
132
  }
104
133
  if (isPropertiesField(json)) {
134
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
105
135
  return PropertiesField.fromJSON(json, categories);
106
136
  }
107
137
  if (isNestedContentField(json)) {
108
- // eslint-disable-next-line @typescript-eslint/no-deprecated
109
- return NestedContentField.fromJSON(json, categories);
138
+ return new NestedContentField({
139
+ ...json,
140
+ ...fromNestedContentFieldJSON(json, categories),
141
+ nestedFields: json.nestedFields
142
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
143
+ .map((nestedFieldJson) => Field.fromJSON(nestedFieldJson, categories))
144
+ .filter((nestedField) => !!nestedField),
145
+ });
110
146
  }
111
- const field = Object.create(Field.prototype);
112
- return Object.assign(field, json, {
113
- category: Field.getCategoryFromFieldJson(json, categories),
147
+ return new Field({
148
+ ...json,
149
+ category: this.getCategoryFromFieldJson(json, categories),
114
150
  });
115
151
  }
116
152
  /** Deserialize a [[Field]] from compressed JSON. */
@@ -124,17 +160,13 @@ class Field {
124
160
  if (isNestedContentField(json)) {
125
161
  return NestedContentField.fromCompressedJSON(json, classesMap, categories);
126
162
  }
127
- const field = Object.create(Field.prototype);
128
- return Object.assign(field, json, {
129
- category: Field.getCategoryFromFieldJson(json, categories),
163
+ return new Field({
164
+ ...json,
165
+ category: this.getCategoryFromFieldJson(json, categories),
130
166
  });
131
167
  }
132
168
  static getCategoryFromFieldJson(fieldJson, categories) {
133
- const category = categories.find((c) => c.name === fieldJson.category);
134
- if (!category) {
135
- throw new Error_1.PresentationError(Error_1.PresentationStatus.InvalidArgument, `Invalid content field category`);
136
- }
137
- return category;
169
+ return getCategoryFromFieldJson(fieldJson, categories);
138
170
  }
139
171
  /** Resets field's parent. */
140
172
  resetParentship() {
@@ -170,21 +202,25 @@ exports.Field = Field;
170
202
  * @public
171
203
  */
172
204
  class PropertiesField extends Field {
173
- /**
174
- * Creates an instance of PropertiesField.
175
- * @param category Category information
176
- * @param name Unique name
177
- * @param label Display label
178
- * @param type Description of this field's values data type
179
- * @param isReadonly Are values in this field read-only
180
- * @param priority Priority of the field
181
- * @param properties A list of properties this field is created from
182
- * @param editor Property editor used to edit values of this field
183
- * @param renderer Property renderer used to render values of this field
184
- */
185
- constructor(category, name, label, description, isReadonly, priority, properties, editor, renderer) {
186
- super(category, name, label, description, isReadonly, priority, editor, renderer);
187
- this.properties = properties;
205
+ /** A list of properties this field is created from */
206
+ properties;
207
+ constructor(categoryOrProps, name, label, type, isReadonly, priority, properties, editor, renderer) {
208
+ /* istanbul ignore next */
209
+ const props = "category" in categoryOrProps
210
+ ? categoryOrProps
211
+ : {
212
+ category: categoryOrProps,
213
+ name: name,
214
+ label: label,
215
+ type: type,
216
+ isReadonly: isReadonly,
217
+ priority: priority,
218
+ editor,
219
+ renderer,
220
+ properties: properties,
221
+ };
222
+ super(props);
223
+ this.properties = props.properties;
188
224
  }
189
225
  /** Is this a an array property field */
190
226
  isArrayPropertiesField() {
@@ -195,13 +231,17 @@ class PropertiesField extends Field {
195
231
  return false;
196
232
  }
197
233
  clone() {
198
- const clone = new PropertiesField(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.properties, this.editor, this.renderer);
234
+ const clone = new PropertiesField(this);
199
235
  clone.rebuildParentship(this.parent);
200
236
  return clone;
201
237
  }
202
- /** Serialize this object to JSON */
238
+ /**
239
+ * Serialize this object to JSON
240
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
241
+ */
203
242
  toJSON() {
204
243
  return {
244
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
205
245
  ...super.toJSON(),
206
246
  properties: this.properties,
207
247
  };
@@ -213,19 +253,24 @@ class PropertiesField extends Field {
213
253
  properties: this.properties.map((property) => Property_1.Property.toCompressedJSON(property, classesMap)),
214
254
  };
215
255
  }
216
- /** Deserialize [[PropertiesField]] from JSON */
256
+ /**
257
+ * Deserialize [[PropertiesField]] from JSON.
258
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
259
+ */
217
260
  static fromJSON(json, categories) {
218
261
  if (!json) {
219
262
  return undefined;
220
263
  }
221
264
  if (isArrayPropertiesField(json)) {
265
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
222
266
  return ArrayPropertiesField.fromJSON(json, categories);
223
267
  }
224
268
  if (isStructPropertiesField(json)) {
269
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
225
270
  return StructPropertiesField.fromJSON(json, categories);
226
271
  }
227
- const field = Object.create(PropertiesField.prototype);
228
- return Object.assign(field, json, {
272
+ return new PropertiesField({
273
+ ...json,
229
274
  category: this.getCategoryFromFieldJson(json, categories),
230
275
  });
231
276
  }
@@ -240,8 +285,8 @@ class PropertiesField extends Field {
240
285
  if (isStructPropertiesField(json)) {
241
286
  return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);
242
287
  }
243
- const field = Object.create(PropertiesField.prototype);
244
- return Object.assign(field, json, {
288
+ return new PropertiesField({
289
+ ...json,
245
290
  category: this.getCategoryFromFieldJson(json, categories),
246
291
  properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
247
292
  });
@@ -303,22 +348,43 @@ exports.PropertiesField = PropertiesField;
303
348
  * @public
304
349
  */
305
350
  class ArrayPropertiesField extends PropertiesField {
306
- constructor(category, name, label, description, itemsField, isReadonly, priority, properties, editor, renderer) {
307
- super(category, name, label, description, isReadonly, priority, properties, editor, renderer);
308
- this.itemsField = itemsField;
351
+ itemsField;
352
+ constructor(categoryOrProps, name, label, type, itemsField, isReadonly, priority, properties, editor, renderer) {
353
+ /* istanbul ignore next */
354
+ const props = "category" in categoryOrProps
355
+ ? categoryOrProps
356
+ : {
357
+ category: categoryOrProps,
358
+ name: name,
359
+ label: label,
360
+ type: type,
361
+ isReadonly: isReadonly,
362
+ priority: priority,
363
+ editor,
364
+ renderer,
365
+ properties: properties,
366
+ itemsField: itemsField,
367
+ };
368
+ super(props);
369
+ this.itemsField = props.itemsField;
309
370
  }
310
371
  isArrayPropertiesField() {
311
372
  return true;
312
373
  }
313
374
  clone() {
314
- const clone = new ArrayPropertiesField(this.category, this.name, this.label, this.type, this.itemsField.clone(), this.isReadonly, this.priority, this.properties, this.editor, this.renderer);
375
+ const clone = new ArrayPropertiesField(this);
315
376
  clone.rebuildParentship(this.parent);
316
377
  return clone;
317
378
  }
318
- /** Serialize this object to JSON */
379
+ /**
380
+ * Serialize this object to JSON.
381
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
382
+ */
319
383
  toJSON() {
320
384
  return {
385
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
321
386
  ...super.toJSON(),
387
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
322
388
  itemsField: this.itemsField.toJSON(),
323
389
  };
324
390
  }
@@ -329,11 +395,15 @@ class ArrayPropertiesField extends PropertiesField {
329
395
  itemsField: this.itemsField.toCompressedJSON(classesMap),
330
396
  };
331
397
  }
332
- /** Deserialize [[ArrayPropertiesField]] from JSON */
398
+ /**
399
+ * Deserialize [[ArrayPropertiesField]] from JSON.
400
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
401
+ */
333
402
  static fromJSON(json, categories) {
334
- const field = Object.create(ArrayPropertiesField.prototype);
335
- return Object.assign(field, json, {
403
+ return new ArrayPropertiesField({
404
+ ...json,
336
405
  category: this.getCategoryFromFieldJson(json, categories),
406
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
337
407
  itemsField: PropertiesField.fromJSON(json.itemsField, categories),
338
408
  });
339
409
  }
@@ -342,8 +412,8 @@ class ArrayPropertiesField extends PropertiesField {
342
412
  * @public
343
413
  */
344
414
  static fromCompressedJSON(json, classesMap, categories) {
345
- const field = Object.create(ArrayPropertiesField.prototype);
346
- return Object.assign(field, json, {
415
+ return new ArrayPropertiesField({
416
+ ...json,
347
417
  category: this.getCategoryFromFieldJson(json, categories),
348
418
  properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
349
419
  itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),
@@ -356,22 +426,43 @@ exports.ArrayPropertiesField = ArrayPropertiesField;
356
426
  * @public
357
427
  */
358
428
  class StructPropertiesField extends PropertiesField {
359
- constructor(category, name, label, description, memberFields, isReadonly, priority, properties, editor, renderer) {
360
- super(category, name, label, description, isReadonly, priority, properties, editor, renderer);
361
- this.memberFields = memberFields;
429
+ memberFields;
430
+ constructor(categoryOrProps, name, label, type, memberFields, isReadonly, priority, properties, editor, renderer) {
431
+ /* istanbul ignore next */
432
+ const props = "category" in categoryOrProps
433
+ ? categoryOrProps
434
+ : {
435
+ category: categoryOrProps,
436
+ name: name,
437
+ label: label,
438
+ type: type,
439
+ isReadonly: isReadonly,
440
+ priority: priority,
441
+ editor,
442
+ renderer,
443
+ properties: properties,
444
+ memberFields: memberFields,
445
+ };
446
+ super(props);
447
+ this.memberFields = props.memberFields;
362
448
  }
363
449
  isStructPropertiesField() {
364
450
  return true;
365
451
  }
366
452
  clone() {
367
- const clone = new StructPropertiesField(this.category, this.name, this.label, this.type, this.memberFields.map((m) => m.clone()), this.isReadonly, this.priority, this.properties, this.editor, this.renderer);
453
+ const clone = new StructPropertiesField(this);
368
454
  clone.rebuildParentship(this.parent);
369
455
  return clone;
370
456
  }
371
- /** Serialize this object to JSON */
457
+ /**
458
+ * Serialize this object to JSON.
459
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
460
+ */
372
461
  toJSON() {
373
462
  return {
463
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
374
464
  ...super.toJSON(),
465
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
375
466
  memberFields: this.memberFields.map((m) => m.toJSON()),
376
467
  };
377
468
  }
@@ -382,11 +473,15 @@ class StructPropertiesField extends PropertiesField {
382
473
  memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),
383
474
  };
384
475
  }
385
- /** Deserialize [[StructPropertiesField]] from JSON */
476
+ /**
477
+ * Deserialize [[StructPropertiesField]] from JSON.
478
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
479
+ */
386
480
  static fromJSON(json, categories) {
387
- const field = Object.create(StructPropertiesField.prototype);
388
- return Object.assign(field, json, {
481
+ return new StructPropertiesField({
482
+ ...json,
389
483
  category: this.getCategoryFromFieldJson(json, categories),
484
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
390
485
  memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),
391
486
  });
392
487
  }
@@ -395,8 +490,8 @@ class StructPropertiesField extends PropertiesField {
395
490
  * @public
396
491
  */
397
492
  static fromCompressedJSON(json, classesMap, categories) {
398
- const field = Object.create(StructPropertiesField.prototype);
399
- return Object.assign(field, json, {
493
+ return new StructPropertiesField({
494
+ ...json,
400
495
  category: this.getCategoryFromFieldJson(json, categories),
401
496
  properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),
402
497
  memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),
@@ -410,35 +505,64 @@ exports.StructPropertiesField = StructPropertiesField;
410
505
  * @public
411
506
  */
412
507
  class NestedContentField extends Field {
508
+ /** Information about an ECClass whose properties are nested inside this field */
509
+ contentClassInfo;
510
+ /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */
511
+ pathToPrimaryClass;
512
+ /**
513
+ * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)
514
+ * and content class of this field.
515
+ *
516
+ * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up
517
+ * presentation rules for creating the content.
518
+ */
519
+ relationshipMeaning;
413
520
  /**
414
- * Creates an instance of NestedContentField.
415
- * @param category Category information
416
- * @param name Unique name
417
- * @param label Display label
418
- * @param type Description of this field's values data type
419
- * @param isReadonly Are values in this field read-only
420
- * @param priority Priority of the field
421
- * @param contentClassInfo Information about an ECClass whose properties are nested inside this field
422
- * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)
423
- * @param nestedFields Contained nested fields
424
- * @param editor Property editor used to edit values of this field
425
- * @param autoExpand Flag specifying whether field should be expanded
426
- * @param relationshipMeaning RelationshipMeaning of the field
427
- * @param renderer Property renderer used to render values of this field
521
+ * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes
522
+ * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is
523
+ * here to help.
524
+ *
525
+ * **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`.
526
+ * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,
527
+ * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute
528
+ * will contain ID of class `B`, identifying that only this specific class has the relationship.
428
529
  */
429
- constructor(category, name, label, description, isReadonly, priority, contentClassInfo, pathToPrimaryClass, nestedFields, editor, autoExpand, renderer) {
430
- super(category, name, label, description, isReadonly, priority, editor, renderer);
431
- this.contentClassInfo = contentClassInfo;
432
- this.pathToPrimaryClass = pathToPrimaryClass;
433
- this.relationshipMeaning = RelatedPropertiesSpecification_1.RelationshipMeaning.RelatedInstance;
434
- this.nestedFields = nestedFields;
435
- this.autoExpand = autoExpand;
436
- this.actualPrimaryClassIds = [];
530
+ actualPrimaryClassIds;
531
+ /** Contained nested fields */
532
+ nestedFields;
533
+ /** Flag specifying whether field should be expanded */
534
+ autoExpand;
535
+ constructor(categoryOrProps, name, label, type, isReadonly, priority, contentClassInfo, pathToPrimaryClass, nestedFields, editor, autoExpand, renderer) {
536
+ /* istanbul ignore next */
537
+ const props = "category" in categoryOrProps
538
+ ? categoryOrProps
539
+ : {
540
+ category: categoryOrProps,
541
+ name: name,
542
+ label: label,
543
+ type: type,
544
+ isReadonly: isReadonly,
545
+ priority: priority,
546
+ editor,
547
+ renderer,
548
+ contentClassInfo: contentClassInfo,
549
+ pathToPrimaryClass: pathToPrimaryClass,
550
+ nestedFields: nestedFields,
551
+ autoExpand,
552
+ };
553
+ super(props);
554
+ this.contentClassInfo = props.contentClassInfo;
555
+ this.pathToPrimaryClass = props.pathToPrimaryClass;
556
+ this.relationshipMeaning = props.relationshipMeaning ?? RelatedPropertiesSpecification_1.RelationshipMeaning.RelatedInstance;
557
+ this.nestedFields = props.nestedFields;
558
+ this.autoExpand = props.autoExpand;
559
+ this.actualPrimaryClassIds = props.actualPrimaryClassIds ?? [];
437
560
  }
438
561
  clone() {
439
- const clone = new NestedContentField(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.contentClassInfo, this.pathToPrimaryClass, this.nestedFields.map((n) => n.clone()), this.editor, this.autoExpand, this.renderer);
440
- clone.actualPrimaryClassIds = this.actualPrimaryClassIds;
441
- clone.relationshipMeaning = this.relationshipMeaning;
562
+ const clone = new NestedContentField({
563
+ ...this,
564
+ nestedFields: this.nestedFields.map((n) => n.clone()),
565
+ });
442
566
  clone.rebuildParentship(this.parent);
443
567
  return clone;
444
568
  }
@@ -450,16 +574,21 @@ class NestedContentField extends Field {
450
574
  getFieldByName(name, recurse) {
451
575
  return (0, exports.getFieldByName)(this.nestedFields, name, recurse);
452
576
  }
453
- /** Serialize this object to JSON */
577
+ /**
578
+ * Serialize this object to JSON.
579
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
580
+ */
454
581
  toJSON() {
455
582
  return {
583
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
456
584
  ...super.toJSON(),
457
585
  contentClassInfo: this.contentClassInfo,
458
586
  pathToPrimaryClass: this.pathToPrimaryClass,
459
587
  relationshipMeaning: this.relationshipMeaning,
460
588
  actualPrimaryClassIds: this.actualPrimaryClassIds,
589
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
461
590
  nestedFields: this.nestedFields.map((field) => field.toJSON()),
462
- autoExpand: this.autoExpand,
591
+ ...(this.autoExpand ? { autoExpand: true } : undefined),
463
592
  };
464
593
  }
465
594
  /** Serialize this object to compressed JSON */
@@ -469,30 +598,19 @@ class NestedContentField extends Field {
469
598
  return {
470
599
  ...super.toCompressedJSON(classesMap),
471
600
  contentClassInfo: id,
601
+ relationshipMeaning: this.relationshipMeaning,
602
+ actualPrimaryClassIds: this.actualPrimaryClassIds,
472
603
  pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => EC_1.RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),
473
604
  nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),
605
+ ...(this.autoExpand ? { autoExpand: true } : undefined),
474
606
  };
475
607
  }
476
- /**
477
- * Deserialize [[NestedContentField]] from JSON
478
- * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]
479
- */
480
- static fromJSON(json, categories) {
481
- if (!json) {
482
- return undefined;
483
- }
484
- const field = Object.create(NestedContentField.prototype);
485
- return Object.assign(field, json, this.fromCommonJSON(json, categories), {
486
- nestedFields: json.nestedFields
487
- .map((nestedFieldJson) => Field.fromJSON(nestedFieldJson, categories))
488
- .filter((nestedField) => !!nestedField),
489
- });
490
- }
491
608
  /** Deserialize a [[NestedContentField]] from compressed JSON. */
492
609
  static fromCompressedJSON(json, classesMap, categories) {
493
610
  (0, core_bentley_1.assert)(classesMap.hasOwnProperty(json.contentClassInfo));
494
- const field = Object.create(NestedContentField.prototype);
495
- return Object.assign(field, json, this.fromCommonJSON(json, categories), {
611
+ return new NestedContentField({
612
+ ...json,
613
+ ...fromNestedContentFieldJSON(json, categories),
496
614
  category: this.getCategoryFromFieldJson(json, categories),
497
615
  nestedFields: json.nestedFields
498
616
  .map((nestedFieldJson) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))
@@ -501,15 +619,6 @@ class NestedContentField extends Field {
501
619
  pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => EC_1.RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),
502
620
  });
503
621
  }
504
- // eslint-disable-next-line @typescript-eslint/no-deprecated
505
- static fromCommonJSON(json, categories) {
506
- return {
507
- category: this.getCategoryFromFieldJson(json, categories),
508
- relationshipMeaning: json.relationshipMeaning ?? RelatedPropertiesSpecification_1.RelationshipMeaning.RelatedInstance,
509
- actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],
510
- autoExpand: json.autoExpand,
511
- };
512
- }
513
622
  /** Resets parent of this field and all nested fields. */
514
623
  resetParentship() {
515
624
  super.resetParentship();
@@ -601,4 +710,19 @@ function fromCompressedPropertyInfoJSON(compressedPropertyJSON, classesMap) {
601
710
  ...(navigationPropertyInfo ? { navigationPropertyInfo: EC_1.NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),
602
711
  };
603
712
  }
713
+ function getCategoryFromFieldJson(fieldJson, categories) {
714
+ const category = categories.find((c) => c.name === fieldJson.category);
715
+ if (!category) {
716
+ throw new Error_1.PresentationError(Error_1.PresentationStatus.InvalidArgument, `Invalid content field category`);
717
+ }
718
+ return category;
719
+ }
720
+ function fromNestedContentFieldJSON(json, categories) {
721
+ return {
722
+ category: getCategoryFromFieldJson(json, categories),
723
+ relationshipMeaning: json.relationshipMeaning ?? RelatedPropertiesSpecification_1.RelationshipMeaning.RelatedInstance,
724
+ actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],
725
+ autoExpand: json.autoExpand,
726
+ };
727
+ }
604
728
  //# sourceMappingURL=Fields.js.map