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

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 (287) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/Ruleset.schema.json +3 -258
  3. package/lib/cjs/presentation-common/AsyncTasks.d.ts +4 -4
  4. package/lib/cjs/presentation-common/AsyncTasks.d.ts.map +1 -1
  5. package/lib/cjs/presentation-common/AsyncTasks.js +5 -6
  6. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  7. package/lib/cjs/presentation-common/EC.d.ts +36 -80
  8. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  9. package/lib/cjs/presentation-common/EC.js +1 -97
  10. package/lib/cjs/presentation-common/EC.js.map +1 -1
  11. package/lib/cjs/presentation-common/ElementProperties.js +16 -9
  12. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  13. package/lib/cjs/presentation-common/Error.d.ts +2 -0
  14. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  15. package/lib/cjs/presentation-common/Error.js +2 -0
  16. package/lib/cjs/presentation-common/Error.js.map +1 -1
  17. package/lib/cjs/presentation-common/KeySet.d.ts +2 -2
  18. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  19. package/lib/cjs/presentation-common/KeySet.js +9 -11
  20. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  21. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +4 -1
  22. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  23. package/lib/cjs/presentation-common/LabelDefinition.d.ts +0 -48
  24. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  25. package/lib/cjs/presentation-common/LabelDefinition.js +1 -44
  26. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  27. package/lib/cjs/presentation-common/LocalizationHelper.js +1 -0
  28. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  29. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +31 -10
  30. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  31. package/lib/cjs/presentation-common/PresentationManagerOptions.js +0 -5
  32. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  33. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +9 -9
  34. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  35. package/lib/cjs/presentation-common/PresentationRpcInterface.js +36 -21
  36. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  37. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +3 -2
  38. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  39. package/lib/cjs/presentation-common/RegisteredRuleset.js +9 -1
  40. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  41. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +9 -12
  42. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  43. package/lib/cjs/presentation-common/RpcRequestsHandler.js +37 -30
  44. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  45. package/lib/cjs/presentation-common/RulesetVariables.d.ts +1 -46
  46. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  47. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  48. package/lib/cjs/presentation-common/Update.d.ts +2 -79
  49. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  50. package/lib/cjs/presentation-common/Update.js +1 -104
  51. package/lib/cjs/presentation-common/Update.js.map +1 -1
  52. package/lib/cjs/presentation-common/Utils.d.ts +21 -0
  53. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  54. package/lib/cjs/presentation-common/Utils.js +57 -0
  55. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  56. package/lib/cjs/presentation-common/content/Content.d.ts +0 -7
  57. package/lib/cjs/presentation-common/content/Content.d.ts.map +1 -1
  58. package/lib/cjs/presentation-common/content/Content.js +5 -10
  59. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  60. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +1 -1
  61. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  62. package/lib/cjs/presentation-common/content/ContentTraverser.js +116 -28
  63. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  64. package/lib/cjs/presentation-common/content/Descriptor.d.ts +2 -31
  65. package/lib/cjs/presentation-common/content/Descriptor.d.ts.map +1 -1
  66. package/lib/cjs/presentation-common/content/Descriptor.js +68 -22
  67. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  68. package/lib/cjs/presentation-common/content/Fields.d.ts +151 -27
  69. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  70. package/lib/cjs/presentation-common/content/Fields.js +264 -140
  71. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  72. package/lib/cjs/presentation-common/content/Item.d.ts +26 -31
  73. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  74. package/lib/cjs/presentation-common/content/Item.js +52 -67
  75. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  76. package/lib/cjs/presentation-common/content/Property.d.ts +2 -12
  77. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  78. package/lib/cjs/presentation-common/content/Property.js +0 -18
  79. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  80. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +3 -0
  81. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  82. package/lib/cjs/presentation-common/content/Value.d.ts +5 -107
  83. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  84. package/lib/cjs/presentation-common/content/Value.js +1 -215
  85. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  86. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  87. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  88. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +0 -23
  89. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  90. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +0 -83
  91. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  92. package/lib/cjs/presentation-common/hierarchy/Key.js +6 -24
  93. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  94. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +4 -107
  95. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  96. package/lib/cjs/presentation-common/hierarchy/Node.js +0 -99
  97. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  98. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  99. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  100. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +0 -117
  101. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  102. package/lib/cjs/presentation-common/rules/Rule.d.ts +0 -14
  103. package/lib/cjs/presentation-common/rules/Rule.d.ts.map +1 -1
  104. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  105. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  106. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  107. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  108. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  109. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  110. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  111. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  112. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  113. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +1 -15
  114. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  115. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  116. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  117. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  118. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  119. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  120. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  121. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +3 -0
  122. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  123. package/lib/cjs/presentation-common/selection/SelectionScope.js +1 -0
  124. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  125. package/lib/cjs/presentation-common.d.ts +1 -5
  126. package/lib/cjs/presentation-common.d.ts.map +1 -1
  127. package/lib/cjs/presentation-common.js +6 -5
  128. package/lib/cjs/presentation-common.js.map +1 -1
  129. package/lib/esm/presentation-common/AsyncTasks.d.ts +4 -4
  130. package/lib/esm/presentation-common/AsyncTasks.d.ts.map +1 -1
  131. package/lib/esm/presentation-common/AsyncTasks.js +5 -6
  132. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  133. package/lib/esm/presentation-common/EC.d.ts +36 -80
  134. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  135. package/lib/esm/presentation-common/EC.js +0 -96
  136. package/lib/esm/presentation-common/EC.js.map +1 -1
  137. package/lib/esm/presentation-common/ElementProperties.js +16 -9
  138. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  139. package/lib/esm/presentation-common/Error.d.ts +2 -0
  140. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  141. package/lib/esm/presentation-common/Error.js +2 -0
  142. package/lib/esm/presentation-common/Error.js.map +1 -1
  143. package/lib/esm/presentation-common/KeySet.d.ts +2 -2
  144. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  145. package/lib/esm/presentation-common/KeySet.js +9 -11
  146. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  147. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +5 -2
  148. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -1
  149. package/lib/esm/presentation-common/LabelDefinition.d.ts +0 -48
  150. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  151. package/lib/esm/presentation-common/LabelDefinition.js +0 -43
  152. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  153. package/lib/esm/presentation-common/LocalizationHelper.js +1 -0
  154. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  155. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +31 -10
  156. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  157. package/lib/esm/presentation-common/PresentationManagerOptions.js +0 -4
  158. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  159. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +9 -9
  160. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  161. package/lib/esm/presentation-common/PresentationRpcInterface.js +38 -22
  162. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  163. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +3 -2
  164. package/lib/esm/presentation-common/RegisteredRuleset.d.ts.map +1 -1
  165. package/lib/esm/presentation-common/RegisteredRuleset.js +9 -1
  166. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  167. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +9 -12
  168. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  169. package/lib/esm/presentation-common/RpcRequestsHandler.js +39 -32
  170. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  171. package/lib/esm/presentation-common/RulesetVariables.d.ts +1 -46
  172. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  173. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  174. package/lib/esm/presentation-common/Update.d.ts +2 -79
  175. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  176. package/lib/esm/presentation-common/Update.js +0 -103
  177. package/lib/esm/presentation-common/Update.js.map +1 -1
  178. package/lib/esm/presentation-common/Utils.d.ts +21 -0
  179. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  180. package/lib/esm/presentation-common/Utils.js +54 -0
  181. package/lib/esm/presentation-common/Utils.js.map +1 -1
  182. package/lib/esm/presentation-common/content/Content.d.ts +0 -7
  183. package/lib/esm/presentation-common/content/Content.d.ts.map +1 -1
  184. package/lib/esm/presentation-common/content/Content.js +5 -10
  185. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  186. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +1 -1
  187. package/lib/esm/presentation-common/content/ContentTraverser.d.ts.map +1 -1
  188. package/lib/esm/presentation-common/content/ContentTraverser.js +117 -29
  189. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  190. package/lib/esm/presentation-common/content/Descriptor.d.ts +2 -31
  191. package/lib/esm/presentation-common/content/Descriptor.d.ts.map +1 -1
  192. package/lib/esm/presentation-common/content/Descriptor.js +68 -22
  193. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  194. package/lib/esm/presentation-common/content/Fields.d.ts +151 -27
  195. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  196. package/lib/esm/presentation-common/content/Fields.js +264 -140
  197. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  198. package/lib/esm/presentation-common/content/Item.d.ts +26 -31
  199. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  200. package/lib/esm/presentation-common/content/Item.js +52 -67
  201. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  202. package/lib/esm/presentation-common/content/Property.d.ts +2 -12
  203. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  204. package/lib/esm/presentation-common/content/Property.js +0 -18
  205. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  206. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +3 -0
  207. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -1
  208. package/lib/esm/presentation-common/content/Value.d.ts +5 -107
  209. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  210. package/lib/esm/presentation-common/content/Value.js +0 -214
  211. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  212. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +1 -22
  213. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts.map +1 -1
  214. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +1 -22
  215. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  216. package/lib/esm/presentation-common/hierarchy/Key.d.ts +0 -83
  217. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  218. package/lib/esm/presentation-common/hierarchy/Key.js +6 -24
  219. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  220. package/lib/esm/presentation-common/hierarchy/Node.d.ts +4 -107
  221. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  222. package/lib/esm/presentation-common/hierarchy/Node.js +1 -98
  223. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  224. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +1 -67
  225. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts.map +1 -1
  226. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +1 -116
  227. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  228. package/lib/esm/presentation-common/rules/Rule.d.ts +0 -14
  229. package/lib/esm/presentation-common/rules/Rule.d.ts.map +1 -1
  230. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  231. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +0 -7
  232. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts.map +1 -1
  233. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  234. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +1 -5
  235. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts.map +1 -1
  236. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  237. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +2 -28
  238. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts.map +1 -1
  239. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +0 -14
  240. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  241. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +2 -0
  242. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts.map +1 -1
  243. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  244. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +0 -9
  245. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts.map +1 -1
  246. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  247. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +3 -0
  248. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  249. package/lib/esm/presentation-common/selection/SelectionScope.js +1 -0
  250. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  251. package/lib/esm/presentation-common.d.ts +1 -5
  252. package/lib/esm/presentation-common.d.ts.map +1 -1
  253. package/lib/esm/presentation-common.js +1 -5
  254. package/lib/esm/presentation-common.js.map +1 -1
  255. package/package.json +12 -12
  256. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  257. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  258. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +0 -10
  259. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  260. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  261. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  262. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +0 -10
  263. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  264. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  265. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  266. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +0 -10
  267. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  268. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  269. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  270. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +0 -10
  271. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +0 -1
  272. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +0 -45
  273. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts.map +0 -1
  274. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +0 -9
  275. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +0 -1
  276. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +0 -30
  277. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts.map +0 -1
  278. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +0 -9
  279. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +0 -1
  280. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +0 -41
  281. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts.map +0 -1
  282. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +0 -9
  283. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +0 -1
  284. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +0 -49
  285. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts.map +0 -1
  286. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +0 -9
  287. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,8BAWe;AACf,oCAAiE;AACjE,8GAAgG;AAGhG,yCAAoD;AAyEpD,SAAS,iBAAiB,CAAC,KAAwB;IACjD,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC;AAKD,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO,CAAC,CAAE,KAAkC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO,CAAC,CAAE,KAAmC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAKD,SAAS,oBAAoB,CAAC,KAAwB;IACpD,OAAO,CAAC,CAAE,KAAa,CAAC,YAAY,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAa,KAAK;IAsBhB;;;;;;;;;;;OAWG;IACH,YACE,QAA6B,EAC7B,IAAY,EACZ,KAAa,EACb,IAAqB,EACrB,UAAmB,EACnB,QAAgB,EAChB,MAA0B,EAC1B,QAA8B,EAC9B,YAA0C;QAE1C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAA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AsB,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KACpJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n ClassInfoJSON,\r\n CompressedClassInfoJSON,\r\n NavigationPropertyInfo,\r\n PropertyInfo,\r\n PropertyInfoJSON,\r\n RelatedClassInfo,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n StrippedRelationshipPath,\r\n} from \"../EC\";\r\nimport { PresentationError, PresentationStatus } from \"../Error\";\r\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification\";\r\nimport { CategoryDescription } from \"./Category\";\r\nimport { EditorDescription } from \"./Editor\";\r\nimport { Property, PropertyJSON } from \"./Property\";\r\nimport { RendererDescription } from \"./Renderer\";\r\nimport { TypeDescription } from \"./TypeDescription\";\r\n\r\n/**\r\n * Data structure for a [[Field]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface BaseFieldJSON {\r\n category: string;\r\n name: string;\r\n label: string;\r\n type: TypeDescription;\r\n isReadonly: boolean;\r\n priority: number;\r\n renderer?: RendererDescription;\r\n editor?: EditorDescription;\r\n extendedData?: { [key: string]: unknown };\r\n}\r\n\r\n/**\r\n * Data structure for a [[PropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n properties: PropertyJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[ArrayPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n itemsField: PropertiesFieldJSON<TClassInfoJSON>;\r\n}\r\n\r\n/**\r\n * Data structure for a [[StructPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n memberFields: PropertiesFieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[NestedContentField]] serialized to JSON.\r\n * @public\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-deprecated\r\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {\r\n contentClassInfo: TClassInfoJSON;\r\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\r\n relationshipMeaning?: RelationshipMeaning;\r\n actualPrimaryClassIds?: Id64String[];\r\n autoExpand?: boolean;\r\n nestedFields: FieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * JSON representation of a [[Field]]\r\n * @public\r\n */\r\nexport type FieldJSON<TClassInfoJSON = ClassInfoJSON> =\r\n | BaseFieldJSON\r\n | PropertiesFieldJSON<TClassInfoJSON>\r\n | ArrayPropertiesFieldJSON<TClassInfoJSON>\r\n | StructPropertiesFieldJSON<TClassInfoJSON>\r\n | NestedContentFieldJSON<TClassInfoJSON>;\r\n\r\n/** Is supplied field a properties field. */\r\nfunction isPropertiesField(field: FieldJSON): field is PropertiesFieldJSON<any>;\r\nfunction isPropertiesField(field: Field): field is PropertiesField;\r\nfunction isPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as any).properties;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isArrayPropertiesField(field: FieldJSON): field is ArrayPropertiesFieldJSON<any>;\r\nfunction isArrayPropertiesField(field: Field): field is ArrayPropertiesField;\r\nfunction isArrayPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as ArrayPropertiesFieldJSON).itemsField;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isStructPropertiesField(field: FieldJSON): field is StructPropertiesFieldJSON<any>;\r\nfunction isStructPropertiesField(field: Field): field is StructPropertiesField;\r\nfunction isStructPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as StructPropertiesFieldJSON).memberFields;\r\n}\r\n\r\n/** Is supplied field a nested content field. */\r\nfunction isNestedContentField(field: FieldJSON): field is NestedContentFieldJSON<any>;\r\nfunction isNestedContentField(field: Field): field is NestedContentField;\r\nfunction isNestedContentField(field: FieldJSON | Field) {\r\n return !!(field as any).nestedFields;\r\n}\r\n\r\n/**\r\n * Describes a single content field. A field is usually represented as a grid column\r\n * or a property pane row.\r\n *\r\n * @public\r\n */\r\nexport class Field {\r\n /** Category information */\r\n public category: CategoryDescription;\r\n /** Unique name */\r\n public name: string;\r\n /** Display label */\r\n public label: string;\r\n /** Description of this field's values data type */\r\n public type: TypeDescription;\r\n /** Are values in this field read-only */\r\n public isReadonly: boolean;\r\n /** Priority of the field. Higher priority fields should appear first in the UI */\r\n public priority: number;\r\n /** Property renderer used to render values of this field */\r\n public renderer?: RendererDescription;\r\n /** Property editor used to edit values of this field */\r\n public editor?: EditorDescription;\r\n /** Extended data associated with this field */\r\n public extendedData?: { [key: string]: unknown };\r\n /** Parent field */\r\n private _parent?: NestedContentField;\r\n\r\n /**\r\n * Creates an instance of Field.\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n * @param extendedData Extended data associated with this field\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n extendedData?: { [key: string] : unknown }\r\n ) {\r\n this.category = category;\r\n this.name = name;\r\n this.label = label;\r\n this.type = type;\r\n this.isReadonly = isReadonly;\r\n this.priority = priority;\r\n this.editor = editor;\r\n this.renderer = renderer;\r\n this.extendedData = extendedData;\r\n }\r\n\r\n /**\r\n * Is this a [[PropertiesField]]\r\n */\r\n public isPropertiesField(): this is PropertiesField {\r\n return isPropertiesField(this);\r\n }\r\n\r\n /**\r\n * Is this a [[NestedContentField]]\r\n */\r\n public isNestedContentField(): this is NestedContentField {\r\n return isNestedContentField(this);\r\n }\r\n\r\n /**\r\n * Get parent\r\n */\r\n public get parent(): NestedContentField | undefined {\r\n return this._parent;\r\n }\r\n\r\n public clone() {\r\n const clone = new Field(this.category, this.name, this.label, this.type, this.isReadonly, this.priority, this.editor, this.renderer, this.extendedData);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): FieldJSON {\r\n return {\r\n category: this.category.name,\r\n name: this.name,\r\n label: this.label,\r\n type: this.type,\r\n isReadonly: this.isReadonly,\r\n priority: this.priority,\r\n renderer: this.renderer,\r\n editor: this.editor,\r\n extendedData: this.extendedData\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public toCompressedJSON(_classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\r\n return this.toJSON();\r\n }\r\n\r\n /** Deserialize [[Field]] from JSON */\r\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isPropertiesField(json)) {\r\n return PropertiesField.fromJSON(json, categories);\r\n }\r\n if (isNestedContentField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return NestedContentField.fromJSON(json, categories);\r\n }\r\n const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /** Deserialize a [[Field]] from compressed JSON. */\r\n public static fromCompressedJSON(\r\n json: FieldJSON<string> | undefined,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (isPropertiesField(json)) {\r\n return PropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n\r\n if (isNestedContentField(json)) {\r\n return NestedContentField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n\r\n const field = Object.create(Field.prototype);\r\n return Object.assign(field, json, {\r\n category: Field.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, categories: CategoryDescription[]): CategoryDescription {\r\n const category = categories.find((c) => c.name === fieldJson.category);\r\n if (!category) {\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);\r\n }\r\n return category;\r\n }\r\n\r\n /** Resets field's parent. */\r\n public resetParentship(): void {\r\n this._parent = undefined;\r\n }\r\n\r\n /** Sets provided [[NestedContentField]] as parent of this field. */\r\n public rebuildParentship(parentField?: NestedContentField): void {\r\n this._parent = parentField;\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public getFieldDescriptor(): FieldDescriptor {\r\n return {\r\n type: FieldDescriptorType.Name,\r\n fieldName: this.name,\r\n } as NamedFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public matchesDescriptor(descriptor: FieldDescriptor) {\r\n return FieldDescriptor.isNamed(descriptor) && descriptor.fieldName === this.name;\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar\r\n * EC properties.\r\n *\r\n * @public\r\n */\r\nexport class PropertiesField extends Field {\r\n /** A list of properties this field is created from */\r\n public properties: Property[];\r\n\r\n /**\r\n * Creates an instance of PropertiesField.\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param properties A list of properties this field is created from\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.properties = properties;\r\n }\r\n\r\n /** Is this a an array property field */\r\n public isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return false;\r\n }\r\n /** Is this a an struct property field */\r\n public isStructPropertiesField(): this is StructPropertiesField {\r\n return false;\r\n }\r\n\r\n public override clone() {\r\n const clone = new PropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): PropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n properties: this.properties,\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): PropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\r\n };\r\n }\r\n\r\n /** Deserialize [[PropertiesField]] from JSON */\r\n public static override fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (isArrayPropertiesField(json)) {\r\n return ArrayPropertiesField.fromJSON(json, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n return StructPropertiesField.fromJSON(json, categories);\r\n }\r\n\r\n const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[PropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: PropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): PropertiesField | undefined {\r\n if (isArrayPropertiesField(json)) {\r\n return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n const field = Object.create(PropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n });\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public override getFieldDescriptor(): FieldDescriptor {\r\n const pathFromPropertyToSelectClass = new Array<RelatedClassInfo>();\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n pathFromPropertyToSelectClass.push(...currAncestor.pathToPrimaryClass);\r\n currAncestor = currAncestor.parent;\r\n }\r\n return {\r\n type: FieldDescriptorType.Properties,\r\n pathFromSelectToPropertyClass: RelationshipPath.strip(RelationshipPath.reverse(pathFromPropertyToSelectClass)),\r\n properties: this.properties.map((p) => ({\r\n class: p.property.classInfo.name,\r\n name: p.property.name,\r\n })),\r\n } as PropertiesFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public override matchesDescriptor(descriptor: FieldDescriptor) {\r\n if (!FieldDescriptor.isProperties(descriptor)) {\r\n return false;\r\n }\r\n\r\n // ensure at least one descriptor property matches at least one property of this field\r\n if (\r\n !this.properties.some(({ property: fieldProperty }) =>\r\n descriptor.properties.some(\r\n (descriptorProperty) => fieldProperty.name === descriptorProperty.name && fieldProperty.classInfo.name === descriptorProperty.class,\r\n ),\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n // ensure path from select to property in field and in descriptor matches\r\n let stepsCount = 0;\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n const pathFromCurrentToItsParent = RelationshipPath.reverse(currAncestor.pathToPrimaryClass);\r\n for (const step of pathFromCurrentToItsParent) {\r\n if (descriptor.pathFromSelectToPropertyClass.length < stepsCount + 1) {\r\n return false;\r\n }\r\n if (!RelatedClassInfo.equals(step, descriptor.pathFromSelectToPropertyClass[descriptor.pathFromSelectToPropertyClass.length - stepsCount - 1])) {\r\n return false;\r\n }\r\n ++stepsCount;\r\n }\r\n currAncestor = currAncestor.parent;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC array properties.\r\n * @public\r\n */\r\nexport class ArrayPropertiesField extends PropertiesField {\r\n public itemsField: PropertiesField;\r\n\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n itemsField: PropertiesField,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, properties, editor, renderer);\r\n this.itemsField = itemsField;\r\n }\r\n\r\n public override isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new ArrayPropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.itemsField.clone(),\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): ArrayPropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n itemsField: this.itemsField.toJSON(),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): ArrayPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n itemsField: this.itemsField.toCompressedJSON(classesMap),\r\n };\r\n }\r\n\r\n /** Deserialize [[ArrayPropertiesField]] from JSON */\r\n public static override fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField {\r\n const field = Object.create(ArrayPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n itemsField: PropertiesField.fromJSON(json.itemsField, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize an [[ArrayPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: ArrayPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): ArrayPropertiesField {\r\n const field = Object.create(ArrayPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories),\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC struct properties.\r\n * @public\r\n */\r\nexport class StructPropertiesField extends PropertiesField {\r\n public memberFields: PropertiesField[];\r\n\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n memberFields: PropertiesField[],\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, properties, editor, renderer);\r\n this.memberFields = memberFields;\r\n }\r\n\r\n public override isStructPropertiesField(): this is StructPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new StructPropertiesField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.memberFields.map((m) => m.clone()),\r\n this.isReadonly,\r\n this.priority,\r\n this.properties,\r\n this.editor,\r\n this.renderer,\r\n );\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): StructPropertiesFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n memberFields: this.memberFields.map((m) => m.toJSON()),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): StructPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n /** Deserialize [[StructPropertiesField]] from JSON */\r\n public static override fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField {\r\n const field = Object.create(StructPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[StructPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: StructPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): StructPropertiesField {\r\n const field = Object.create(StructPropertiesField.prototype);\r\n return Object.assign(field, json, {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)),\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).\r\n *\r\n * @public\r\n */\r\nexport class NestedContentField extends Field {\r\n /** Information about an ECClass whose properties are nested inside this field */\r\n public contentClassInfo: ClassInfo;\r\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\r\n public pathToPrimaryClass: RelationshipPath;\r\n /**\r\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\r\n * and content class of this field.\r\n *\r\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\r\n * presentation rules for creating the content.\r\n */\r\n public relationshipMeaning: RelationshipMeaning;\r\n /**\r\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\r\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\r\n * here to help.\r\n *\r\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\r\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\r\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\r\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\r\n */\r\n public actualPrimaryClassIds: Id64String[];\r\n /** Contained nested fields */\r\n public nestedFields: Field[];\r\n /** Flag specifying whether field should be expanded */\r\n public autoExpand?: boolean;\r\n\r\n /**\r\n * Creates an instance of NestedContentField.\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param contentClassInfo Information about an ECClass whose properties are nested inside this field\r\n * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)\r\n * @param nestedFields Contained nested fields\r\n * @param editor Property editor used to edit values of this field\r\n * @param autoExpand Flag specifying whether field should be expanded\r\n * @param relationshipMeaning RelationshipMeaning of the field\r\n * @param renderer Property renderer used to render values of this field\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n description: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n contentClassInfo: ClassInfo,\r\n pathToPrimaryClass: RelationshipPath,\r\n nestedFields: Field[],\r\n editor?: EditorDescription,\r\n autoExpand?: boolean,\r\n renderer?: RendererDescription,\r\n ) {\r\n super(category, name, label, description, isReadonly, priority, editor, renderer);\r\n this.contentClassInfo = contentClassInfo;\r\n this.pathToPrimaryClass = pathToPrimaryClass;\r\n this.relationshipMeaning = RelationshipMeaning.RelatedInstance;\r\n this.nestedFields = nestedFields;\r\n this.autoExpand = autoExpand;\r\n this.actualPrimaryClassIds = [];\r\n }\r\n\r\n public override clone() {\r\n const clone = new NestedContentField(\r\n this.category,\r\n this.name,\r\n this.label,\r\n this.type,\r\n this.isReadonly,\r\n this.priority,\r\n this.contentClassInfo,\r\n this.pathToPrimaryClass,\r\n this.nestedFields.map((n) => n.clone()),\r\n this.editor,\r\n this.autoExpand,\r\n this.renderer,\r\n );\r\n clone.actualPrimaryClassIds = this.actualPrimaryClassIds;\r\n clone.relationshipMeaning = this.relationshipMeaning;\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.nestedFields, name, recurse);\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public override toJSON(): NestedContentFieldJSON {\r\n return {\r\n ...super.toJSON(),\r\n contentClassInfo: this.contentClassInfo,\r\n pathToPrimaryClass: this.pathToPrimaryClass,\r\n relationshipMeaning: this.relationshipMeaning,\r\n actualPrimaryClassIds: this.actualPrimaryClassIds,\r\n nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\r\n autoExpand: this.autoExpand,\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): NestedContentFieldJSON<string> {\r\n const { id, ...leftOverInfo } = this.contentClassInfo;\r\n classesMap[id] = leftOverInfo;\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n contentClassInfo: id,\r\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\r\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[NestedContentField]] from JSON\r\n * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]\r\n */\r\n public static override fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n });\r\n }\r\n\r\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\r\n public static override fromCompressedJSON(\r\n json: NestedContentFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ) {\r\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\r\n const field = Object.create(NestedContentField.prototype);\r\n return Object.assign(field, json, this.fromCommonJSON(json, categories), {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },\r\n pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),\r\n });\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n private static fromCommonJSON(json: NestedContentFieldJSON<ClassInfoJSON | string>, categories: CategoryDescription[]): Partial<NestedContentField> {\r\n return {\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,\r\n actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],\r\n autoExpand: json.autoExpand,\r\n };\r\n }\r\n\r\n /** Resets parent of this field and all nested fields. */\r\n public override resetParentship(): void {\r\n super.resetParentship();\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.resetParentship();\r\n }\r\n }\r\n\r\n /**\r\n * Sets provided [[NestedContentField]] as parent of this fields and recursively updates\r\n * all nested fields parents.\r\n */\r\n public override rebuildParentship(parentField?: NestedContentField): void {\r\n super.rebuildParentship(parentField);\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.rebuildParentship(this);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const getFieldByName = (fields: Field[], name: string | undefined, recurse?: boolean): Field | undefined => {\r\n if (name) {\r\n for (const field of fields) {\r\n if (field.name === name) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByName(field.nestedFields, name, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/** @internal */\r\nexport const getFieldByDescriptor = (fields: Field[], fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined => {\r\n for (const field of fields) {\r\n if (field.matchesDescriptor(fieldDescriptor)) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByDescriptor(field.nestedFields, fieldDescriptor, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Types of different field descriptors.\r\n * @public\r\n */\r\nexport enum FieldDescriptorType {\r\n Name = \"name\",\r\n Properties = \"properties\",\r\n}\r\n\r\n/**\r\n * Base for a field descriptor\r\n * @public\r\n */\r\nexport interface FieldDescriptorBase {\r\n type: FieldDescriptorType;\r\n}\r\n\r\n/**\r\n * A union of all possible field descriptor types\r\n * @public\r\n */\r\nexport type FieldDescriptor = NamedFieldDescriptor | PropertiesFieldDescriptor;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace FieldDescriptor {\r\n /** Is this a named field descriptor */\r\n export function isNamed(d: FieldDescriptor): d is NamedFieldDescriptor {\r\n return d.type === FieldDescriptorType.Name;\r\n }\r\n /** Is this a properties field descriptor */\r\n export function isProperties(d: FieldDescriptor): d is PropertiesFieldDescriptor {\r\n return d.type === FieldDescriptorType.Properties;\r\n }\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a content field by its unique name.\r\n * @public\r\n */\r\nexport interface NamedFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Name;\r\n fieldName: string;\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a properties field using a list of\r\n * properties that the field contains.\r\n * @public\r\n */\r\nexport interface PropertiesFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Properties;\r\n pathFromSelectToPropertyClass: StrippedRelationshipPath;\r\n /**\r\n * A list of properties that describe the field. At least one property in the list must\r\n * match at least one property in the field for the descriptor to be considered matching.\r\n */\r\n properties: Array<{\r\n /** Full class name */\r\n class: string;\r\n /** Property name */\r\n name: string;\r\n }>;\r\n}\r\n\r\nfunction fromCompressedPropertyJSON(compressedPropertyJSON: PropertyJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): Property {\r\n return {\r\n property: fromCompressedPropertyInfoJSON(compressedPropertyJSON.property, classesMap),\r\n };\r\n}\r\n\r\nfunction fromCompressedPropertyInfoJSON(compressedPropertyJSON: PropertyInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfo {\r\n assert(classesMap.hasOwnProperty(compressedPropertyJSON.classInfo));\r\n\r\n const { navigationPropertyInfo, ...leftOverPropertyJSON } = compressedPropertyJSON;\r\n\r\n return {\r\n ...leftOverPropertyJSON,\r\n classInfo: { id: compressedPropertyJSON.classInfo, ...classesMap[compressedPropertyJSON.classInfo] },\r\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"Fields.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Fields.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,8BAUe;AACf,oCAAiE;AACjE,8GAAgG;AAChG,oCAAyC;AAGzC,yCAAoD;AAwEpD,SAAS,iBAAiB,CAAC,KAAwB;IACjD,OAAO,CAAC,CAAE,KAAa,CAAC,UAAU,CAAC;AACrC,CAAC;AAKD,SAAS,sBAAsB,CAAC,KAAwB;IACtD,OAAO,CAAC,CAAE,KAAkC,CAAC,UAAU,CAAC;AAC1D,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAwB;IACvD,OAAO,CAAC,CAAE,KAAmC,CAAC,YAAY,CAAC;AAC7D,CAAC;AAKD,SAAS,oBAAoB,CAAC,KAAwB;IACpD,OAAO,CAAC,CAAE,KAAa,CAAC,YAAY,CAAC;AACvC,CAAC;AA2BD;;;;;GAKG;AACH,MAAa,KAAK;IAChB,2BAA2B;IACpB,QAAQ,CAAsB;IACrC,kBAAkB;IACX,IAAI,CAAS;IACpB,oBAAoB;IACb,KAAK,CAAS;IACrB,mDAAmD;IAC5C,IAAI,CAAkB;IAC7B,yCAAyC;IAClC,UAAU,CAAU;IAC3B,kFAAkF;IAC3E,QAAQ,CAAS;IACxB,4DAA4D;IACrD,QAAQ,CAAuB;IACtC,wDAAwD;IACjD,MAAM,CAAqB;IAClC,+CAA+C;IACxC,YAAY,CAA8B;IACjD,mBAAmB;IACX,OAAO,CAAsB;IA4BrC,YACE,eAAiD,EACjD,IAAa,EACb,KAAc,EACd,IAAsB,EACtB,UAAoB,EACpB,Q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EAAE,UAAU,CAAC;QACpD,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,oDAAmB,CAAC,eAAe;QACpF,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,IAAI,EAAE;QACvD,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { assert, Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n ClassInfo,\r\n CompressedClassInfoJSON,\r\n NavigationPropertyInfo,\r\n PropertyInfo,\r\n PropertyInfoJSON,\r\n RelatedClassInfo,\r\n RelationshipPath,\r\n RelationshipPathJSON,\r\n StrippedRelationshipPath,\r\n} from \"../EC\";\r\nimport { PresentationError, PresentationStatus } from \"../Error\";\r\nimport { RelationshipMeaning } from \"../rules/content/modifiers/RelatedPropertiesSpecification\";\r\nimport { omitUndefined } from \"../Utils\";\r\nimport { CategoryDescription } from \"./Category\";\r\nimport { EditorDescription } from \"./Editor\";\r\nimport { Property, PropertyJSON } from \"./Property\";\r\nimport { RendererDescription } from \"./Renderer\";\r\nimport { TypeDescription } from \"./TypeDescription\";\r\n\r\n/**\r\n * Data structure for a [[Field]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface BaseFieldJSON {\r\n category: string;\r\n name: string;\r\n label: string;\r\n type: TypeDescription;\r\n isReadonly: boolean;\r\n priority: number;\r\n renderer?: RendererDescription;\r\n editor?: EditorDescription;\r\n extendedData?: { [key: string]: unknown };\r\n}\r\n\r\n/**\r\n * Data structure for a [[PropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\n\r\nexport interface PropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {\r\n properties: PropertyJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[ArrayPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface ArrayPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n itemsField: PropertiesFieldJSON<TClassInfoJSON>;\r\n}\r\n\r\n/**\r\n * Data structure for a [[StructPropertiesField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends PropertiesFieldJSON<TClassInfoJSON> {\r\n memberFields: PropertiesFieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * Data structure for a [[NestedContentField]] serialized to JSON.\r\n * @public\r\n */\r\nexport interface NestedContentFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {\r\n contentClassInfo: TClassInfoJSON;\r\n pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;\r\n relationshipMeaning?: RelationshipMeaning;\r\n actualPrimaryClassIds?: Id64String[];\r\n autoExpand?: boolean;\r\n nestedFields: FieldJSON<TClassInfoJSON>[];\r\n}\r\n\r\n/**\r\n * JSON representation of a [[Field]]\r\n * @public\r\n */\r\nexport type FieldJSON<TClassInfoJSON = ClassInfo> =\r\n | BaseFieldJSON\r\n | PropertiesFieldJSON<TClassInfoJSON>\r\n | ArrayPropertiesFieldJSON<TClassInfoJSON>\r\n | StructPropertiesFieldJSON<TClassInfoJSON>\r\n | NestedContentFieldJSON<TClassInfoJSON>;\r\n\r\n/** Is supplied field a properties field. */\r\nfunction isPropertiesField(field: FieldJSON): field is PropertiesFieldJSON<any>;\r\nfunction isPropertiesField(field: Field): field is PropertiesField;\r\nfunction isPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as any).properties;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isArrayPropertiesField(field: FieldJSON): field is ArrayPropertiesFieldJSON<any>;\r\nfunction isArrayPropertiesField(field: Field): field is ArrayPropertiesField;\r\nfunction isArrayPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as ArrayPropertiesFieldJSON).itemsField;\r\n}\r\n\r\n/** Is supplied field an array properties field. */\r\nfunction isStructPropertiesField(field: FieldJSON): field is StructPropertiesFieldJSON<any>;\r\nfunction isStructPropertiesField(field: Field): field is StructPropertiesField;\r\nfunction isStructPropertiesField(field: FieldJSON | Field) {\r\n return !!(field as StructPropertiesFieldJSON).memberFields;\r\n}\r\n\r\n/** Is supplied field a nested content field. */\r\nfunction isNestedContentField(field: FieldJSON): field is NestedContentFieldJSON<any>;\r\nfunction isNestedContentField(field: Field): field is NestedContentField;\r\nfunction isNestedContentField(field: FieldJSON | Field) {\r\n return !!(field as any).nestedFields;\r\n}\r\n\r\n/**\r\n * Props for creating [[Field]].\r\n * @public\r\n */\r\ninterface FieldProps {\r\n /** Category information */\r\n category: CategoryDescription;\r\n /** Unique name */\r\n name: string;\r\n /** Display label */\r\n label: string;\r\n /** Description of this field's values data type */\r\n type: TypeDescription;\r\n /** Are values in this field read-only */\r\n isReadonly: boolean;\r\n /** Priority of the field */\r\n priority: number;\r\n /** Property editor used to edit values of this field */\r\n editor?: EditorDescription;\r\n /** Property renderer used to render values of this field */\r\n renderer?: RendererDescription;\r\n /** Extended data associated with this field */\r\n extendedData?: { [key: string]: unknown };\r\n}\r\n\r\n/**\r\n * Describes a single content field. A field is usually represented as a grid column\r\n * or a property pane row.\r\n *\r\n * @public\r\n */\r\nexport class Field {\r\n /** Category information */\r\n public category: CategoryDescription;\r\n /** Unique name */\r\n public name: string;\r\n /** Display label */\r\n public label: string;\r\n /** Description of this field's values data type */\r\n public type: TypeDescription;\r\n /** Are values in this field read-only */\r\n public isReadonly: boolean;\r\n /** Priority of the field. Higher priority fields should appear first in the UI */\r\n public priority: number;\r\n /** Property renderer used to render values of this field */\r\n public renderer?: RendererDescription;\r\n /** Property editor used to edit values of this field */\r\n public editor?: EditorDescription;\r\n /** Extended data associated with this field */\r\n public extendedData?: { [key: string]: unknown };\r\n /** Parent field */\r\n private _parent?: NestedContentField;\r\n\r\n /**\r\n * Creates an instance of [[Field]].\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n * @param extendedData Extended data associated with this field\r\n * @deprecated in 5.0. Use an overload with `FieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n extendedData?: { [key: string]: unknown },\r\n );\r\n /** Creates an instance of [[Field]]. */\r\n public constructor(props: FieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | FieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n extendedData?: { [key: string]: unknown },\r\n ) {\r\n /* istanbul ignore next */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n extendedData,\r\n };\r\n this.category = props.category;\r\n this.name = props.name;\r\n this.label = props.label;\r\n this.type = props.type;\r\n this.isReadonly = props.isReadonly;\r\n this.priority = props.priority;\r\n this.editor = props.editor;\r\n this.renderer = props.renderer;\r\n this.extendedData = props.extendedData;\r\n }\r\n\r\n /**\r\n * Is this a [[PropertiesField]]\r\n */\r\n public isPropertiesField(): this is PropertiesField {\r\n return isPropertiesField(this);\r\n }\r\n\r\n /**\r\n * Is this a [[NestedContentField]]\r\n */\r\n public isNestedContentField(): this is NestedContentField {\r\n return isNestedContentField(this);\r\n }\r\n\r\n /**\r\n * Get parent\r\n */\r\n public get parent(): NestedContentField | undefined {\r\n return this._parent;\r\n }\r\n\r\n public clone() {\r\n const clone = new Field(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.x. Use [[toCompressedJSON]] instead.\r\n */\r\n public toJSON(): FieldJSON {\r\n return this.toCompressedJSON({});\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public toCompressedJSON(_classesMap: { [id: string]: CompressedClassInfoJSON }): FieldJSON<string> {\r\n return omitUndefined({\r\n category: this.category.name,\r\n name: this.name,\r\n label: this.label,\r\n type: this.type,\r\n isReadonly: this.isReadonly,\r\n priority: this.priority,\r\n renderer: this.renderer,\r\n editor: this.editor,\r\n extendedData: this.extendedData,\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize [[Field]] from JSON.\r\n * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isPropertiesField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return PropertiesField.fromJSON(json, categories);\r\n }\r\n if (isNestedContentField(json)) {\r\n return new NestedContentField({\r\n ...json,\r\n ...fromNestedContentFieldJSON(json, categories),\r\n nestedFields: json.nestedFields\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n .map((nestedFieldJson: FieldJSON) => Field.fromJSON(nestedFieldJson, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n });\r\n }\r\n return new Field({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /** Deserialize a [[Field]] from compressed JSON. */\r\n public static fromCompressedJSON(\r\n json: FieldJSON<string> | undefined,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): Field | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isPropertiesField(json)) {\r\n return PropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n if (isNestedContentField(json)) {\r\n return NestedContentField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n return new Field({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n protected static getCategoryFromFieldJson(fieldJson: FieldJSON, categories: CategoryDescription[]): CategoryDescription {\r\n return getCategoryFromFieldJson(fieldJson, categories);\r\n }\r\n\r\n /** Resets field's parent. */\r\n public resetParentship(): void {\r\n this._parent = undefined;\r\n }\r\n\r\n /** Sets provided [[NestedContentField]] as parent of this field. */\r\n public rebuildParentship(parentField?: NestedContentField): void {\r\n this._parent = parentField;\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public getFieldDescriptor(): FieldDescriptor {\r\n return {\r\n type: FieldDescriptorType.Name,\r\n fieldName: this.name,\r\n } as NamedFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public matchesDescriptor(descriptor: FieldDescriptor) {\r\n return FieldDescriptor.isNamed(descriptor) && descriptor.fieldName === this.name;\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[PropertiesField]].\r\n * @public\r\n */\r\ninterface PropertiesFieldProps extends FieldProps {\r\n /** A list of properties this field is created from */\r\n properties: Property[];\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar\r\n * EC properties.\r\n *\r\n * @public\r\n */\r\nexport class PropertiesField extends Field {\r\n /** A list of properties this field is created from */\r\n public properties: Property[];\r\n\r\n /**\r\n * Creates an instance of [[PropertiesField]].\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param properties A list of properties this field is created from\r\n * @param editor Property editor used to edit values of this field\r\n * @param renderer Property renderer used to render values of this field\r\n * @deprecated in 5.0. Use an overload with `PropertiesFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[PropertiesField]]. */\r\n public constructor(props: PropertiesFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | PropertiesFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n properties?: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* istanbul ignore next */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n properties: properties!,\r\n };\r\n super(props);\r\n this.properties = props.properties;\r\n }\r\n\r\n /** Is this a an array property field */\r\n public isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return false;\r\n }\r\n /** Is this a an struct property field */\r\n public isStructPropertiesField(): this is StructPropertiesField {\r\n return false;\r\n }\r\n\r\n public override clone() {\r\n const clone = new PropertiesField(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON\r\n * @deprecated in 5.x. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): PropertiesFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n properties: this.properties,\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): PropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n properties: this.properties.map((property) => Property.toCompressedJSON(property, classesMap)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[PropertiesField]] from JSON.\r\n * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static override fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (isArrayPropertiesField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return ArrayPropertiesField.fromJSON(json, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n return StructPropertiesField.fromJSON(json, categories);\r\n }\r\n return new PropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[PropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: PropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): PropertiesField | undefined {\r\n if (isArrayPropertiesField(json)) {\r\n return ArrayPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n if (isStructPropertiesField(json)) {\r\n return StructPropertiesField.fromCompressedJSON(json, classesMap, categories);\r\n }\r\n return new PropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n });\r\n }\r\n\r\n /**\r\n * Get descriptor for this field.\r\n * @public\r\n */\r\n public override getFieldDescriptor(): FieldDescriptor {\r\n const pathFromPropertyToSelectClass = new Array<RelatedClassInfo>();\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n pathFromPropertyToSelectClass.push(...currAncestor.pathToPrimaryClass);\r\n currAncestor = currAncestor.parent;\r\n }\r\n return {\r\n type: FieldDescriptorType.Properties,\r\n pathFromSelectToPropertyClass: RelationshipPath.strip(RelationshipPath.reverse(pathFromPropertyToSelectClass)),\r\n properties: this.properties.map((p) => ({\r\n class: p.property.classInfo.name,\r\n name: p.property.name,\r\n })),\r\n } as PropertiesFieldDescriptor;\r\n }\r\n\r\n /**\r\n * Checks if this field matches given field descriptor\r\n * @see [[getFieldDescriptor]]\r\n */\r\n public override matchesDescriptor(descriptor: FieldDescriptor) {\r\n if (!FieldDescriptor.isProperties(descriptor)) {\r\n return false;\r\n }\r\n\r\n // ensure at least one descriptor property matches at least one property of this field\r\n if (\r\n !this.properties.some(({ property: fieldProperty }) =>\r\n descriptor.properties.some(\r\n (descriptorProperty) => fieldProperty.name === descriptorProperty.name && fieldProperty.classInfo.name === descriptorProperty.class,\r\n ),\r\n )\r\n ) {\r\n return false;\r\n }\r\n\r\n // ensure path from select to property in field and in descriptor matches\r\n let stepsCount = 0;\r\n let currAncestor = this.parent;\r\n while (currAncestor) {\r\n const pathFromCurrentToItsParent = RelationshipPath.reverse(currAncestor.pathToPrimaryClass);\r\n for (const step of pathFromCurrentToItsParent) {\r\n if (descriptor.pathFromSelectToPropertyClass.length < stepsCount + 1) {\r\n return false;\r\n }\r\n if (!RelatedClassInfo.equals(step, descriptor.pathFromSelectToPropertyClass[descriptor.pathFromSelectToPropertyClass.length - stepsCount - 1])) {\r\n return false;\r\n }\r\n ++stepsCount;\r\n }\r\n currAncestor = currAncestor.parent;\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[ArrayPropertiesField]].\r\n * @public\r\n */\r\ninterface ArrayPropertiesFieldProps extends PropertiesFieldProps {\r\n itemsField: PropertiesField;\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC array properties.\r\n * @public\r\n */\r\nexport class ArrayPropertiesField extends PropertiesField {\r\n public itemsField: PropertiesField;\r\n\r\n /**\r\n * Creates an instance of [[ArrayPropertiesField]].\r\n * @deprecated in 5.0. Use an overload with `ArrayPropertiesFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n itemsField: PropertiesField,\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[ArrayPropertiesField]]. */\r\n public constructor(props: ArrayPropertiesFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | ArrayPropertiesFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n itemsField?: PropertiesField,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n properties?: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* istanbul ignore next */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n properties: properties!,\r\n itemsField: itemsField!,\r\n };\r\n super(props);\r\n this.itemsField = props.itemsField;\r\n }\r\n\r\n public override isArrayPropertiesField(): this is ArrayPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new ArrayPropertiesField(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.x. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): ArrayPropertiesFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n itemsField: this.itemsField.toJSON(),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): ArrayPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n itemsField: this.itemsField.toCompressedJSON(classesMap),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[ArrayPropertiesField]] from JSON.\r\n * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static override fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField {\r\n return new ArrayPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n itemsField: PropertiesField.fromJSON(json.itemsField, categories)!,\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize an [[ArrayPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: ArrayPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): ArrayPropertiesField {\r\n return new ArrayPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n itemsField: PropertiesField.fromCompressedJSON(json.itemsField, classesMap, categories)!,\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[StructPropertiesField]].\r\n * @public\r\n */\r\ninterface StructPropertiesFieldProps extends PropertiesFieldProps {\r\n memberFields: PropertiesField[];\r\n}\r\n\r\n/**\r\n * Describes a content field that's based on one or more similar EC struct properties.\r\n * @public\r\n */\r\nexport class StructPropertiesField extends PropertiesField {\r\n public memberFields: PropertiesField[];\r\n\r\n /**\r\n * Creates an instance of [[StructPropertiesField]].\r\n * @deprecated in 5.0. Use an overload with `StructPropertiesFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n memberFields: PropertiesField[],\r\n isReadonly: boolean,\r\n priority: number,\r\n properties: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[StructPropertiesField]]. */\r\n public constructor(props: StructPropertiesFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | StructPropertiesFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n memberFields?: PropertiesField[],\r\n isReadonly?: boolean,\r\n priority?: number,\r\n properties?: Property[],\r\n editor?: EditorDescription,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* istanbul ignore next */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n properties: properties!,\r\n memberFields: memberFields!,\r\n };\r\n super(props);\r\n this.memberFields = props.memberFields;\r\n }\r\n\r\n public override isStructPropertiesField(): this is StructPropertiesField {\r\n return true;\r\n }\r\n\r\n public override clone() {\r\n const clone = new StructPropertiesField(this);\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.x. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): StructPropertiesFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n memberFields: this.memberFields.map((m) => m.toJSON()),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): StructPropertiesFieldJSON<string> {\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n memberFields: this.memberFields.map((m) => m.toCompressedJSON(classesMap)),\r\n };\r\n }\r\n\r\n /**\r\n * Deserialize [[StructPropertiesField]] from JSON.\r\n * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.\r\n */\r\n public static override fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField {\r\n return new StructPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromJSON(m, categories)!),\r\n });\r\n }\r\n\r\n /**\r\n * Deserialize a [[StructPropertiesField]] from compressed JSON.\r\n * @public\r\n */\r\n public static override fromCompressedJSON(\r\n json: StructPropertiesFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ): StructPropertiesField {\r\n return new StructPropertiesField({\r\n ...json,\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n properties: json.properties.map((propertyJson) => fromCompressedPropertyJSON(propertyJson, classesMap)),\r\n memberFields: json.memberFields.map((m) => PropertiesField.fromCompressedJSON(m, classesMap, categories)!),\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Props for creating [[NestedContentField]].\r\n * @public\r\n */\r\ninterface NestedContentFieldProps extends FieldProps {\r\n /** Information about an ECClass whose properties are nested inside this field */\r\n contentClassInfo: ClassInfo;\r\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\r\n pathToPrimaryClass: RelationshipPath;\r\n /**\r\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\r\n * and content class of this field.\r\n *\r\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\r\n * presentation rules for creating the content.\r\n */\r\n relationshipMeaning?: RelationshipMeaning;\r\n /**\r\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\r\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\r\n * here to help.\r\n *\r\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\r\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\r\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\r\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\r\n */\r\n actualPrimaryClassIds?: Id64String[];\r\n /** Contained nested fields */\r\n nestedFields: Field[];\r\n /** Flag specifying whether field should be expanded */\r\n autoExpand?: boolean;\r\n}\r\n\r\n/**\r\n * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).\r\n *\r\n * @public\r\n */\r\nexport class NestedContentField extends Field {\r\n /** Information about an ECClass whose properties are nested inside this field */\r\n public contentClassInfo: ClassInfo;\r\n /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */\r\n public pathToPrimaryClass: RelationshipPath;\r\n /**\r\n * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)\r\n * and content class of this field.\r\n *\r\n * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up\r\n * presentation rules for creating the content.\r\n */\r\n public relationshipMeaning: RelationshipMeaning;\r\n /**\r\n * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes\r\n * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is\r\n * here to help.\r\n *\r\n * **Example:** There's a base class `A` and it has two derived classes `B` and `C` and class `B` has a relationship to class `D`.\r\n * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,\r\n * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute\r\n * will contain ID of class `B`, identifying that only this specific class has the relationship.\r\n */\r\n public actualPrimaryClassIds: Id64String[];\r\n /** Contained nested fields */\r\n public nestedFields: Field[];\r\n /** Flag specifying whether field should be expanded */\r\n public autoExpand?: boolean;\r\n\r\n /**\r\n * Creates an instance of [[NestedContentField]].\r\n * @param category Category information\r\n * @param name Unique name\r\n * @param label Display label\r\n * @param type Description of this field's values data type\r\n * @param isReadonly Are values in this field read-only\r\n * @param priority Priority of the field\r\n * @param contentClassInfo Information about an ECClass whose properties are nested inside this field\r\n * @param pathToPrimaryClass Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class)\r\n * @param nestedFields Contained nested fields\r\n * @param editor Property editor used to edit values of this field\r\n * @param autoExpand Flag specifying whether field should be expanded\r\n * @param relationshipMeaning RelationshipMeaning of the field\r\n * @param renderer Property renderer used to render values of this field\r\n * @deprecated in 5.0. Use an overload with `NestedContentFieldProps` instead.\r\n */\r\n public constructor(\r\n category: CategoryDescription,\r\n name: string,\r\n label: string,\r\n type: TypeDescription,\r\n isReadonly: boolean,\r\n priority: number,\r\n contentClassInfo: ClassInfo,\r\n pathToPrimaryClass: RelationshipPath,\r\n nestedFields: Field[],\r\n editor?: EditorDescription,\r\n autoExpand?: boolean,\r\n renderer?: RendererDescription,\r\n );\r\n /** Creates an instance of [[NestedContentField]]. */\r\n public constructor(props: NestedContentFieldProps);\r\n public constructor(\r\n categoryOrProps: CategoryDescription | NestedContentFieldProps,\r\n name?: string,\r\n label?: string,\r\n type?: TypeDescription,\r\n isReadonly?: boolean,\r\n priority?: number,\r\n contentClassInfo?: ClassInfo,\r\n pathToPrimaryClass?: RelationshipPath,\r\n nestedFields?: Field[],\r\n editor?: EditorDescription,\r\n autoExpand?: boolean,\r\n renderer?: RendererDescription,\r\n ) {\r\n /* istanbul ignore next */\r\n const props =\r\n \"category\" in categoryOrProps\r\n ? categoryOrProps\r\n : {\r\n category: categoryOrProps,\r\n name: name!,\r\n label: label!,\r\n type: type!,\r\n isReadonly: isReadonly!,\r\n priority: priority!,\r\n editor,\r\n renderer,\r\n contentClassInfo: contentClassInfo!,\r\n pathToPrimaryClass: pathToPrimaryClass!,\r\n nestedFields: nestedFields!,\r\n autoExpand,\r\n };\r\n super(props);\r\n this.contentClassInfo = props.contentClassInfo;\r\n this.pathToPrimaryClass = props.pathToPrimaryClass;\r\n this.relationshipMeaning = props.relationshipMeaning ?? RelationshipMeaning.RelatedInstance;\r\n this.nestedFields = props.nestedFields;\r\n this.autoExpand = props.autoExpand;\r\n this.actualPrimaryClassIds = props.actualPrimaryClassIds ?? [];\r\n }\r\n\r\n public override clone() {\r\n const clone = new NestedContentField({\r\n ...this,\r\n nestedFields: this.nestedFields.map((n) => n.clone()),\r\n });\r\n clone.rebuildParentship(this.parent);\r\n return clone;\r\n }\r\n\r\n /**\r\n * Get field by its name\r\n * @param name Name of the field to find\r\n * @param recurse Recurse into nested fields\r\n */\r\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\r\n return getFieldByName(this.nestedFields, name, recurse);\r\n }\r\n\r\n /**\r\n * Serialize this object to JSON.\r\n * @deprecated in 5.x. Use [[toCompressedJSON]] instead.\r\n */\r\n public override toJSON(): NestedContentFieldJSON {\r\n return {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n ...super.toJSON(),\r\n contentClassInfo: this.contentClassInfo,\r\n pathToPrimaryClass: this.pathToPrimaryClass,\r\n relationshipMeaning: this.relationshipMeaning,\r\n actualPrimaryClassIds: this.actualPrimaryClassIds,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n nestedFields: this.nestedFields.map((field: Field) => field.toJSON()),\r\n ...(this.autoExpand ? { autoExpand: true } : undefined),\r\n };\r\n }\r\n\r\n /** Serialize this object to compressed JSON */\r\n public override toCompressedJSON(classesMap: { [id: string]: CompressedClassInfoJSON }): NestedContentFieldJSON<string> {\r\n const { id, ...leftOverInfo } = this.contentClassInfo;\r\n classesMap[id] = leftOverInfo;\r\n return {\r\n ...super.toCompressedJSON(classesMap),\r\n contentClassInfo: id,\r\n relationshipMeaning: this.relationshipMeaning,\r\n actualPrimaryClassIds: this.actualPrimaryClassIds,\r\n pathToPrimaryClass: this.pathToPrimaryClass.map((classInfo) => RelatedClassInfo.toCompressedJSON(classInfo, classesMap)),\r\n nestedFields: this.nestedFields.map((field) => field.toCompressedJSON(classesMap)),\r\n ...(this.autoExpand ? { autoExpand: true } : undefined),\r\n };\r\n }\r\n\r\n /** Deserialize a [[NestedContentField]] from compressed JSON. */\r\n public static override fromCompressedJSON(\r\n json: NestedContentFieldJSON<Id64String>,\r\n classesMap: { [id: string]: CompressedClassInfoJSON },\r\n categories: CategoryDescription[],\r\n ) {\r\n assert(classesMap.hasOwnProperty(json.contentClassInfo));\r\n return new NestedContentField({\r\n ...json,\r\n ...fromNestedContentFieldJSON(json, categories),\r\n category: this.getCategoryFromFieldJson(json, categories),\r\n nestedFields: json.nestedFields\r\n .map((nestedFieldJson: FieldJSON) => Field.fromCompressedJSON(nestedFieldJson, classesMap, categories))\r\n .filter((nestedField): nestedField is Field => !!nestedField),\r\n contentClassInfo: { id: json.contentClassInfo, ...classesMap[json.contentClassInfo] },\r\n pathToPrimaryClass: json.pathToPrimaryClass.map((stepJson) => RelatedClassInfo.fromCompressedJSON(stepJson, classesMap)),\r\n });\r\n }\r\n\r\n /** Resets parent of this field and all nested fields. */\r\n public override resetParentship(): void {\r\n super.resetParentship();\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.resetParentship();\r\n }\r\n }\r\n\r\n /**\r\n * Sets provided [[NestedContentField]] as parent of this fields and recursively updates\r\n * all nested fields parents.\r\n */\r\n public override rebuildParentship(parentField?: NestedContentField): void {\r\n super.rebuildParentship(parentField);\r\n for (const nestedField of this.nestedFields) {\r\n nestedField.rebuildParentship(this);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport const getFieldByName = (fields: Field[], name: string | undefined, recurse?: boolean): Field | undefined => {\r\n if (name) {\r\n for (const field of fields) {\r\n if (field.name === name) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByName(field.nestedFields, name, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/** @internal */\r\nexport const getFieldByDescriptor = (fields: Field[], fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined => {\r\n for (const field of fields) {\r\n if (field.matchesDescriptor(fieldDescriptor)) {\r\n return field;\r\n }\r\n\r\n if (recurse && field.isNestedContentField()) {\r\n const nested = getFieldByDescriptor(field.nestedFields, fieldDescriptor, recurse);\r\n if (nested) {\r\n return nested;\r\n }\r\n }\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Types of different field descriptors.\r\n * @public\r\n */\r\nexport enum FieldDescriptorType {\r\n Name = \"name\",\r\n Properties = \"properties\",\r\n}\r\n\r\n/**\r\n * Base for a field descriptor\r\n * @public\r\n */\r\nexport interface FieldDescriptorBase {\r\n type: FieldDescriptorType;\r\n}\r\n\r\n/**\r\n * A union of all possible field descriptor types\r\n * @public\r\n */\r\nexport type FieldDescriptor = NamedFieldDescriptor | PropertiesFieldDescriptor;\r\n\r\n/** @public */\r\n// eslint-disable-next-line @typescript-eslint/no-redeclare\r\nexport namespace FieldDescriptor {\r\n /** Is this a named field descriptor */\r\n export function isNamed(d: FieldDescriptor): d is NamedFieldDescriptor {\r\n return d.type === FieldDescriptorType.Name;\r\n }\r\n /** Is this a properties field descriptor */\r\n export function isProperties(d: FieldDescriptor): d is PropertiesFieldDescriptor {\r\n return d.type === FieldDescriptorType.Properties;\r\n }\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a content field by its unique name.\r\n * @public\r\n */\r\nexport interface NamedFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Name;\r\n fieldName: string;\r\n}\r\n\r\n/**\r\n * Field descriptor that identifies a properties field using a list of\r\n * properties that the field contains.\r\n * @public\r\n */\r\nexport interface PropertiesFieldDescriptor extends FieldDescriptorBase {\r\n type: FieldDescriptorType.Properties;\r\n pathFromSelectToPropertyClass: StrippedRelationshipPath;\r\n /**\r\n * A list of properties that describe the field. At least one property in the list must\r\n * match at least one property in the field for the descriptor to be considered matching.\r\n */\r\n properties: Array<{\r\n /** Full class name */\r\n class: string;\r\n /** Property name */\r\n name: string;\r\n }>;\r\n}\r\n\r\nfunction fromCompressedPropertyJSON(compressedPropertyJSON: PropertyJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): Property {\r\n return {\r\n property: fromCompressedPropertyInfoJSON(compressedPropertyJSON.property, classesMap),\r\n };\r\n}\r\n\r\nfunction fromCompressedPropertyInfoJSON(compressedPropertyJSON: PropertyInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): PropertyInfo {\r\n assert(classesMap.hasOwnProperty(compressedPropertyJSON.classInfo));\r\n\r\n const { navigationPropertyInfo, ...leftOverPropertyJSON } = compressedPropertyJSON;\r\n\r\n return {\r\n ...leftOverPropertyJSON,\r\n classInfo: { id: compressedPropertyJSON.classInfo, ...classesMap[compressedPropertyJSON.classInfo] },\r\n ...(navigationPropertyInfo ? { navigationPropertyInfo: NavigationPropertyInfo.fromCompressedJSON(navigationPropertyInfo, classesMap) } : undefined),\r\n };\r\n}\r\n\r\nfunction getCategoryFromFieldJson(fieldJson: { category: string }, categories: CategoryDescription[]): CategoryDescription {\r\n const category = categories.find((c) => c.name === fieldJson.category);\r\n if (!category) {\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid content field category`);\r\n }\r\n return category;\r\n}\r\n\r\nfunction fromNestedContentFieldJSON(json: NestedContentFieldJSON<ClassInfo | string>, categories: CategoryDescription[]) {\r\n return {\r\n category: getCategoryFromFieldJson(json, categories),\r\n relationshipMeaning: json.relationshipMeaning ?? RelationshipMeaning.RelatedInstance,\r\n actualPrimaryClassIds: json.actualPrimaryClassIds ?? [],\r\n autoExpand: json.autoExpand,\r\n };\r\n}\r\n"]}
@@ -2,9 +2,9 @@
2
2
  * @module Content
3
3
  */
4
4
  import { ClassInfo, InstanceKey } from "../EC";
5
- import { LabelDefinition, LabelDefinitionJSON } from "../LabelDefinition";
5
+ import { LabelDefinition } from "../LabelDefinition";
6
6
  import { ValuesDictionary } from "../Utils";
7
- import { DisplayValue, DisplayValueJSON, Value, ValueJSON } from "./Value";
7
+ import { DisplayValue, Value } from "./Value";
8
8
  /**
9
9
  * Serialized [[Item]] JSON representation.
10
10
  * @public
@@ -12,12 +12,28 @@ import { DisplayValue, DisplayValueJSON, Value, ValueJSON } from "./Value";
12
12
  export interface ItemJSON {
13
13
  inputKeys?: InstanceKey[];
14
14
  primaryKeys: InstanceKey[];
15
- labelDefinition: LabelDefinitionJSON;
16
- /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */
17
- imageId: string;
15
+ /** @deprecated in 5.x. Use [[label]] instead. */
16
+ labelDefinition: LabelDefinition;
17
+ label?: LabelDefinition;
18
18
  classInfo?: ClassInfo;
19
- values: ValuesDictionary<ValueJSON>;
20
- displayValues: ValuesDictionary<DisplayValueJSON>;
19
+ values: ValuesDictionary<Value>;
20
+ displayValues: ValuesDictionary<DisplayValue>;
21
+ mergedFieldNames: string[];
22
+ extendedData?: {
23
+ [key: string]: any;
24
+ };
25
+ }
26
+ /**
27
+ * Props for creating [[Item]].
28
+ * @public
29
+ */
30
+ interface ItemProps {
31
+ inputKeys?: InstanceKey[];
32
+ primaryKeys: InstanceKey[];
33
+ label: LabelDefinition;
34
+ classInfo?: ClassInfo;
35
+ values: ValuesDictionary<Value>;
36
+ displayValues: ValuesDictionary<DisplayValue>;
21
37
  mergedFieldNames: string[];
22
38
  extendedData?: {
23
39
  [key: string]: any;
@@ -37,11 +53,6 @@ export declare class Item {
37
53
  primaryKeys: InstanceKey[];
38
54
  /** Display label of the item */
39
55
  label: LabelDefinition;
40
- /**
41
- * ID of the image associated with this item
42
- * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
43
- */
44
- imageId: string;
45
56
  /** For cases when item consists only of same class instances, information about the ECClass */
46
57
  classInfo?: ClassInfo;
47
58
  /** Raw values dictionary */
@@ -64,10 +75,12 @@ export declare class Item {
64
75
  * @param displayValues Display values dictionary
65
76
  * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))
66
77
  * @param extendedData Extended data injected into this content item
78
+ * @deprecated in 5.0. Use an overload with `ItemProps` instead.
67
79
  */
68
80
  constructor(primaryKeys: InstanceKey[], label: string | LabelDefinition, imageId: string, classInfo: ClassInfo | undefined, values: ValuesDictionary<Value>, displayValues: ValuesDictionary<DisplayValue>, mergedFieldNames: string[], extendedData?: {
69
81
  [key: string]: any;
70
82
  });
83
+ constructor(props: ItemProps);
71
84
  /**
72
85
  * Is value of field with the specified name merged in this record.
73
86
  */
@@ -76,24 +89,6 @@ export declare class Item {
76
89
  toJSON(): ItemJSON;
77
90
  /** Deserialize [[Item]] from JSON */
78
91
  static fromJSON(json: ItemJSON | string | undefined): Item | undefined;
79
- /**
80
- * Reviver function that can be used as a second argument for
81
- * `JSON.parse` method when parsing Item objects.
82
- * @internal
83
- */
84
- static reviver(key: string, value: any): any;
85
- /**
86
- * Deserialize items list from JSON
87
- * @param json JSON or JSON serialized to string to deserialize from
88
- * @returns Deserialized items list
89
- * @internal
90
- */
91
- static listFromJSON(json: ItemJSON[] | string): Item[];
92
- /**
93
- * Reviver function that can be used as a second argument for
94
- * `JSON.parse` method when parsing [[Item]][] objects.
95
- * @internal
96
- */
97
- static listReviver(key: string, value: any): any;
98
92
  }
93
+ export {};
99
94
  //# sourceMappingURL=Item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAwB,KAAK,EAAE,SAAS,EAAiB,MAAM,SAAS,CAAC;AAEhH;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC;IAC1B,WAAW,EAAE,WAAW,EAAE,CAAC;IAG3B,eAAe,EAAE,mBAAmB,CAAC;IACrC,gKAAgK;IAChK,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,CAA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KAAE;gBAEpB,KAAK,EAAE,SAAS;IAqCnC;;OAEG;IACI,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIhD,oCAAoC;IAC7B,MAAM,IAAI,QAAQ;IASzB,qCAAqC;WACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS;CAgB9E"}
@@ -9,32 +9,55 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Item = void 0;
11
11
  const LabelDefinition_1 = require("../LabelDefinition");
12
- const Value_1 = require("./Value");
12
+ const Utils_1 = require("../Utils");
13
13
  /**
14
14
  * A data structure that represents a single content record.
15
15
  * @public
16
16
  */
17
17
  class Item {
18
18
  /**
19
- * Creates an instance of Item.
20
- * @param primaryKeys Keys of instances whose data is contained in this item
21
- * @param label Display label of the item
22
- * @param imageId ID of the image associated with this item
23
- * @param classInfo For cases when item consists only of same class instances, information about the ECClass
24
- * @param values Raw values dictionary
25
- * @param displayValues Display values dictionary
26
- * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))
27
- * @param extendedData Extended data injected into this content item
19
+ * Keys of input instances that caused this item to be included in content. Only set if the content is
20
+ * created with [[ContentFlags.IncludeInputKeys]] flag.
28
21
  */
29
- constructor(primaryKeys, label, imageId, classInfo, values, displayValues, mergedFieldNames, extendedData) {
30
- this.primaryKeys = primaryKeys;
31
- this.imageId = imageId; // eslint-disable-line @typescript-eslint/no-deprecated
32
- this.classInfo = classInfo;
33
- this.values = values;
34
- this.displayValues = displayValues;
35
- this.mergedFieldNames = mergedFieldNames;
36
- this.extendedData = extendedData;
37
- this.label = typeof label === "string" ? LabelDefinition_1.LabelDefinition.fromLabelString(label) : label;
22
+ inputKeys;
23
+ /** Keys of instances whose data is contained in this item */
24
+ primaryKeys;
25
+ /** Display label of the item */
26
+ label;
27
+ /** For cases when item consists only of same class instances, information about the ECClass */
28
+ classInfo;
29
+ /** Raw values dictionary */
30
+ values;
31
+ /** Display values dictionary */
32
+ displayValues;
33
+ /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */
34
+ mergedFieldNames;
35
+ /** Extended data injected into this content item */
36
+ extendedData;
37
+ constructor(primaryKeysOrProps, label, imageId, classInfo, values, displayValues, mergedFieldNames, extendedData) {
38
+ /* istanbul ignore next */
39
+ const props = Array.isArray(primaryKeysOrProps)
40
+ ? {
41
+ primaryKeys: primaryKeysOrProps,
42
+ label: typeof label === "string" ? LabelDefinition_1.LabelDefinition.fromLabelString(label) : label,
43
+ imageId: imageId,
44
+ classInfo,
45
+ values: values,
46
+ displayValues: displayValues,
47
+ mergedFieldNames: mergedFieldNames,
48
+ extendedData,
49
+ }
50
+ : primaryKeysOrProps;
51
+ if ("inputKeys" in props) {
52
+ this.inputKeys = props.inputKeys;
53
+ }
54
+ this.primaryKeys = props.primaryKeys;
55
+ this.classInfo = props.classInfo;
56
+ this.values = props.values;
57
+ this.displayValues = props.displayValues;
58
+ this.mergedFieldNames = props.mergedFieldNames;
59
+ this.extendedData = props.extendedData;
60
+ this.label = props.label;
38
61
  }
39
62
  /**
40
63
  * Is value of field with the specified name merged in this record.
@@ -45,15 +68,11 @@ class Item {
45
68
  /** Serialize this object to JSON */
46
69
  toJSON() {
47
70
  const { label, ...baseItem } = this;
48
- return {
71
+ return (0, Utils_1.omitUndefined)({
49
72
  ...baseItem,
50
- // eslint-disable-next-line @typescript-eslint/no-deprecated
51
- values: Value_1.Value.toJSON(this.values),
52
- // eslint-disable-next-line @typescript-eslint/no-deprecated
53
- displayValues: Value_1.DisplayValue.toJSON(this.displayValues),
54
- // eslint-disable-next-line @typescript-eslint/no-deprecated
55
- labelDefinition: LabelDefinition_1.LabelDefinition.toJSON(label),
56
- };
73
+ labelDefinition: label,
74
+ label,
75
+ });
57
76
  }
58
77
  /** Deserialize [[Item]] from JSON */
59
78
  static fromJSON(json) {
@@ -61,49 +80,15 @@ class Item {
61
80
  return undefined;
62
81
  }
63
82
  if (typeof json === "string") {
64
- return JSON.parse(json, (key, value) => Item.reviver(key, value));
83
+ return Item.fromJSON(JSON.parse(json));
65
84
  }
66
- const item = Object.create(Item.prototype);
67
- const { labelDefinition, ...baseJson } = json;
68
- return Object.assign(item, baseJson, {
69
- // eslint-disable-next-line @typescript-eslint/no-deprecated
70
- values: Value_1.Value.fromJSON(json.values),
71
- // eslint-disable-next-line @typescript-eslint/no-deprecated
72
- displayValues: Value_1.DisplayValue.fromJSON(json.displayValues),
73
- // eslint-disable-next-line @typescript-eslint/no-deprecated
74
- label: LabelDefinition_1.LabelDefinition.fromJSON(labelDefinition),
85
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
86
+ const { labelDefinition, label, ...baseJson } = json;
87
+ return new Item({
88
+ ...baseJson,
89
+ label: label ?? labelDefinition,
75
90
  });
76
91
  }
77
- /**
78
- * Reviver function that can be used as a second argument for
79
- * `JSON.parse` method when parsing Item objects.
80
- * @internal
81
- */
82
- static reviver(key, value) {
83
- return key === "" ? Item.fromJSON(value) : value;
84
- }
85
- /**
86
- * Deserialize items list from JSON
87
- * @param json JSON or JSON serialized to string to deserialize from
88
- * @returns Deserialized items list
89
- * @internal
90
- */
91
- static listFromJSON(json) {
92
- if (typeof json === "string") {
93
- // eslint-disable-next-line @typescript-eslint/unbound-method
94
- return JSON.parse(json, Item.listReviver);
95
- }
96
- // eslint-disable-next-line @typescript-eslint/unbound-method
97
- return json.map(Item.fromJSON).filter((item) => !!item);
98
- }
99
- /**
100
- * Reviver function that can be used as a second argument for
101
- * `JSON.parse` method when parsing [[Item]][] objects.
102
- * @internal
103
- */
104
- static listReviver(key, value) {
105
- return key === "" ? Item.listFromJSON(value) : value;
106
- }
107
92
  }
108
93
  exports.Item = Item;
109
94
  //# sourceMappingURL=Item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;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,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxE,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW,EAAE,KAAU;QAC/C,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACvD,CAAC;CACF;AAlID,oBAkIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { ClassInfo, InstanceKey } from \"../EC\";\r\nimport { LabelDefinition, LabelDefinitionJSON } from \"../LabelDefinition\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\nimport { DisplayValue, DisplayValueJSON, DisplayValuesMapJSON, Value, ValueJSON, ValuesMapJSON } from \"./Value\";\r\n\r\n/**\r\n * Serialized [[Item]] JSON representation.\r\n * @public\r\n */\r\nexport interface ItemJSON {\r\n inputKeys?: InstanceKey[];\r\n primaryKeys: InstanceKey[];\r\n // TODO: rename to `label`\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n labelDefinition: LabelDefinitionJSON;\r\n /** @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details. */\r\n imageId: string;\r\n classInfo?: ClassInfo;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n values: ValuesDictionary<ValueJSON>;\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\r\n mergedFieldNames: string[];\r\n extendedData?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * A data structure that represents a single content record.\r\n * @public\r\n */\r\nexport class Item {\r\n /**\r\n * Keys of input instances that caused this item to be included in content. Only set if the content is\r\n * created with [[ContentFlags.IncludeInputKeys]] flag.\r\n */\r\n public inputKeys?: InstanceKey[];\r\n /** Keys of instances whose data is contained in this item */\r\n public primaryKeys: InstanceKey[];\r\n /** Display label of the item */\r\n public label: LabelDefinition;\r\n /**\r\n * ID of the image associated with this item\r\n * @deprecated in 3.x. Use [[extendedData]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\r\n */\r\n public imageId: string;\r\n /** For cases when item consists only of same class instances, information about the ECClass */\r\n public classInfo?: ClassInfo;\r\n /** Raw values dictionary */\r\n public values: ValuesDictionary<Value>;\r\n /** Display values dictionary */\r\n public displayValues: ValuesDictionary<DisplayValue>;\r\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\r\n public mergedFieldNames: string[];\r\n /** Extended data injected into this content item */\r\n public extendedData?: { [key: string]: any };\r\n\r\n /**\r\n * Creates an instance of Item.\r\n * @param primaryKeys Keys of instances whose data is contained in this item\r\n * @param label Display label of the item\r\n * @param imageId ID of the image associated with this item\r\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\r\n * @param values Raw values dictionary\r\n * @param displayValues Display values dictionary\r\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\r\n * @param extendedData Extended data injected into this content item\r\n */\r\n public constructor(\r\n primaryKeys: InstanceKey[],\r\n label: string | LabelDefinition,\r\n imageId: string,\r\n classInfo: ClassInfo | undefined,\r\n values: ValuesDictionary<Value>,\r\n displayValues: ValuesDictionary<DisplayValue>,\r\n mergedFieldNames: string[],\r\n extendedData?: { [key: string]: any },\r\n ) {\r\n this.primaryKeys = primaryKeys;\r\n this.imageId = imageId; // eslint-disable-line @typescript-eslint/no-deprecated\r\n this.classInfo = classInfo;\r\n this.values = values;\r\n this.displayValues = displayValues;\r\n this.mergedFieldNames = mergedFieldNames;\r\n this.extendedData = extendedData;\r\n this.label = typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label;\r\n }\r\n\r\n /**\r\n * Is value of field with the specified name merged in this record.\r\n */\r\n public isFieldMerged(fieldName: string): boolean {\r\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): ItemJSON {\r\n const { label, ...baseItem } = this;\r\n return {\r\n ...baseItem,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n values: Value.toJSON(this.values) as ValuesMapJSON,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n displayValues: DisplayValue.toJSON(this.displayValues) as DisplayValuesMapJSON,\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n labelDefinition: LabelDefinition.toJSON(label),\r\n };\r\n }\r\n\r\n /** Deserialize [[Item]] from JSON */\r\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n if (typeof json === \"string\") {\r\n return JSON.parse(json, (key, value) => Item.reviver(key, value));\r\n }\r\n const item = Object.create(Item.prototype);\r\n const { labelDefinition, ...baseJson } = json;\r\n return Object.assign(item, baseJson, {\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n values: Value.fromJSON(json.values),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n displayValues: DisplayValue.fromJSON(json.displayValues),\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n label: LabelDefinition.fromJSON(labelDefinition),\r\n } as Partial<Item>);\r\n }\r\n\r\n /**\r\n * Reviver function that can be used as a second argument for\r\n * `JSON.parse` method when parsing Item objects.\r\n * @internal\r\n */\r\n public static reviver(key: string, value: any): any {\r\n return key === \"\" ? Item.fromJSON(value) : value;\r\n }\r\n\r\n /**\r\n * Deserialize items list from JSON\r\n * @param json JSON or JSON serialized to string to deserialize from\r\n * @returns Deserialized items list\r\n * @internal\r\n */\r\n public static listFromJSON(json: ItemJSON[] | string): Item[] {\r\n if (typeof json === \"string\") {\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n return JSON.parse(json, Item.listReviver);\r\n }\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n return json.map(Item.fromJSON).filter((item): item is Item => !!item);\r\n }\r\n\r\n /**\r\n * Reviver function that can be used as a second argument for\r\n * `JSON.parse` method when parsing [[Item]][] objects.\r\n * @internal\r\n */\r\n public static listReviver(key: string, value: any): any {\r\n return key === \"\" ? Item.listFromJSON(value) : value;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Item.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,wDAAqD;AACrD,oCAA2D;AAmC3D;;;GAGG;AACH,MAAa,IAAI;IACf;;;OAGG;IACI,SAAS,CAAiB;IACjC,6DAA6D;IACtD,WAAW,CAAgB;IAClC,gCAAgC;IACzB,KAAK,CAAkB;IAC9B,+FAA+F;IACxF,SAAS,CAAa;IAC7B,4BAA4B;IACrB,MAAM,CAA0B;IACvC,gCAAgC;IACzB,aAAa,CAAiC;IACrD,+HAA+H;IACxH,gBAAgB,CAAW;IAClC,oDAAoD;IAC7C,YAAY,CAA0B;IAyB7C,YACE,kBAA6C,EAC7C,KAAgC,EAChC,OAAgB,EAChB,SAAiC,EACjC,MAAgC,EAChC,aAA8C,EAC9C,gBAA2B,EAC3B,YAAqC;QAErC,0BAA0B;QAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC;YAC7C,CAAC,CAAC;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,iCAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAM;gBAClF,OAAO,EAAE,OAAQ;gBACjB,SAAS;gBACT,MAAM,EAAE,MAAO;gB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D;QAC5D,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;QACrD,OAAO,IAAI,IAAI,CAAC;YACd,GAAG,QAAQ;YACX,KAAK,EAAE,KAAK,IAAI,eAAe;SAChC,CAAC,CAAC;IACL,CAAC;CACF;AAlHD,oBAkHC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Content\r\n */\r\n\r\nimport { ClassInfo, InstanceKey } from \"../EC\";\r\nimport { LabelDefinition } from \"../LabelDefinition\";\r\nimport { omitUndefined, ValuesDictionary } from \"../Utils\";\r\nimport { DisplayValue, Value } from \"./Value\";\r\n\r\n/**\r\n * Serialized [[Item]] JSON representation.\r\n * @public\r\n */\r\nexport interface ItemJSON {\r\n inputKeys?: InstanceKey[];\r\n primaryKeys: InstanceKey[];\r\n /** @deprecated in 5.x. Use [[label]] instead. */\r\n labelDefinition: LabelDefinition;\r\n label?: LabelDefinition;\r\n classInfo?: ClassInfo;\r\n values: ValuesDictionary<Value>;\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n mergedFieldNames: string[];\r\n extendedData?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * Props for creating [[Item]].\r\n * @public\r\n */\r\ninterface ItemProps {\r\n inputKeys?: InstanceKey[];\r\n primaryKeys: InstanceKey[];\r\n label: LabelDefinition;\r\n classInfo?: ClassInfo;\r\n values: ValuesDictionary<Value>;\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n mergedFieldNames: string[];\r\n extendedData?: { [key: string]: any };\r\n}\r\n\r\n/**\r\n * A data structure that represents a single content record.\r\n * @public\r\n */\r\nexport class Item {\r\n /**\r\n * Keys of input instances that caused this item to be included in content. Only set if the content is\r\n * created with [[ContentFlags.IncludeInputKeys]] flag.\r\n */\r\n public inputKeys?: InstanceKey[];\r\n /** Keys of instances whose data is contained in this item */\r\n public primaryKeys: InstanceKey[];\r\n /** Display label of the item */\r\n public label: LabelDefinition;\r\n /** For cases when item consists only of same class instances, information about the ECClass */\r\n public classInfo?: ClassInfo;\r\n /** Raw values dictionary */\r\n public values: ValuesDictionary<Value>;\r\n /** Display values dictionary */\r\n public displayValues: ValuesDictionary<DisplayValue>;\r\n /** List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging)) */\r\n public mergedFieldNames: string[];\r\n /** Extended data injected into this content item */\r\n public extendedData?: { [key: string]: any };\r\n\r\n /**\r\n * Creates an instance of Item.\r\n * @param primaryKeys Keys of instances whose data is contained in this item\r\n * @param label Display label of the item\r\n * @param imageId ID of the image associated with this item\r\n * @param classInfo For cases when item consists only of same class instances, information about the ECClass\r\n * @param values Raw values dictionary\r\n * @param displayValues Display values dictionary\r\n * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/presentation/content/Terminology#value-merging))\r\n * @param extendedData Extended data injected into this content item\r\n * @deprecated in 5.0. Use an overload with `ItemProps` instead.\r\n */\r\n public constructor(\r\n primaryKeys: InstanceKey[],\r\n label: string | LabelDefinition,\r\n imageId: string,\r\n classInfo: ClassInfo | undefined,\r\n values: ValuesDictionary<Value>,\r\n displayValues: ValuesDictionary<DisplayValue>,\r\n mergedFieldNames: string[],\r\n extendedData?: { [key: string]: any },\r\n );\r\n public constructor(props: ItemProps);\r\n public constructor(\r\n primaryKeysOrProps: ItemProps | InstanceKey[],\r\n label?: string | LabelDefinition,\r\n imageId?: string,\r\n classInfo?: ClassInfo | undefined,\r\n values?: ValuesDictionary<Value>,\r\n displayValues?: ValuesDictionary<DisplayValue>,\r\n mergedFieldNames?: string[],\r\n extendedData?: { [key: string]: any },\r\n ) {\r\n /* istanbul ignore next */\r\n const props = Array.isArray(primaryKeysOrProps)\r\n ? {\r\n primaryKeys: primaryKeysOrProps,\r\n label: typeof label === \"string\" ? LabelDefinition.fromLabelString(label) : label!,\r\n imageId: imageId!,\r\n classInfo,\r\n values: values!,\r\n displayValues: displayValues!,\r\n mergedFieldNames: mergedFieldNames!,\r\n extendedData,\r\n }\r\n : primaryKeysOrProps;\r\n\r\n if (\"inputKeys\" in props) {\r\n this.inputKeys = props.inputKeys;\r\n }\r\n this.primaryKeys = props.primaryKeys;\r\n this.classInfo = props.classInfo;\r\n this.values = props.values;\r\n this.displayValues = props.displayValues;\r\n this.mergedFieldNames = props.mergedFieldNames;\r\n this.extendedData = props.extendedData;\r\n this.label = props.label;\r\n }\r\n\r\n /**\r\n * Is value of field with the specified name merged in this record.\r\n */\r\n public isFieldMerged(fieldName: string): boolean {\r\n return -1 !== this.mergedFieldNames.indexOf(fieldName);\r\n }\r\n\r\n /** Serialize this object to JSON */\r\n public toJSON(): ItemJSON {\r\n const { label, ...baseItem } = this;\r\n return omitUndefined({\r\n ...baseItem,\r\n labelDefinition: label,\r\n label,\r\n });\r\n }\r\n\r\n /** Deserialize [[Item]] from JSON */\r\n public static fromJSON(json: ItemJSON | string | undefined): Item | undefined {\r\n if (!json) {\r\n return undefined;\r\n }\r\n\r\n if (typeof json === \"string\") {\r\n return Item.fromJSON(JSON.parse(json));\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-deprecated\r\n const { labelDefinition, label, ...baseJson } = json;\r\n return new Item({\r\n ...baseJson,\r\n label: label ?? labelDefinition,\r\n });\r\n }\r\n}\r\n"]}