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