@itwin/presentation-common 5.0.0-dev.8 → 5.0.0-dev.82

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 +46 -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 +17 -18
  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
@@ -12,6 +12,7 @@ const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const EC_1 = require("../EC");
13
13
  const Category_1 = require("./Category");
14
14
  const Fields_1 = require("./Fields");
15
+ const Utils_1 = require("../Utils");
15
16
  /** @public */
16
17
  var SelectClassInfo;
17
18
  (function (SelectClassInfo) {
@@ -86,11 +87,6 @@ var ContentFlags;
86
87
  (function (ContentFlags) {
87
88
  /** Each content record only has [[InstanceKey]] and no data */
88
89
  ContentFlags[ContentFlags["KeysOnly"] = 1] = "KeysOnly";
89
- /**
90
- * Each content record additionally has an image id
91
- * @deprecated in 3.x. Use [[ExtendedDataRule]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.
92
- */
93
- ContentFlags[ContentFlags["ShowImages"] = 2] = "ShowImages";
94
90
  /** Each content record additionally has a display label */
95
91
  ContentFlags[ContentFlags["ShowLabels"] = 4] = "ShowLabels";
96
92
  /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */
@@ -127,6 +123,53 @@ var SortDirection;
127
123
  * @public
128
124
  */
129
125
  class Descriptor {
126
+ /** Id of the connection used to create the descriptor */
127
+ connectionId;
128
+ /** Hash of the input keys used to create the descriptor */
129
+ inputKeysHash;
130
+ /** Selection info used to create the descriptor */
131
+ selectionInfo;
132
+ /** Display type used to create the descriptor */
133
+ displayType;
134
+ /** A list of classes that will be selected when creating content with this descriptor */
135
+ selectClasses;
136
+ /** A list of content field categories used in this descriptor */
137
+ categories;
138
+ /** A list of fields contained in the descriptor */
139
+ fields;
140
+ /** [[ContentFlags]] used to create the descriptor */
141
+ contentFlags;
142
+ /**
143
+ * A ruleset used to create this descriptor.
144
+ * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.
145
+ */
146
+ ruleset;
147
+ /** Field used to sort the content */
148
+ sortingField;
149
+ /** Sorting direction */
150
+ sortDirection;
151
+ /**
152
+ * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by
153
+ * select fields.
154
+ *
155
+ * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,
156
+ * which removes access to content instance property values. Instead of referencing properties
157
+ * through `this.PropertyName` alias, the expression should reference them by field names. In cases
158
+ * when properties field merges multiple properties, this allows applying the filter on all of them
159
+ * at once. This is useful for filtering table rows by column value, when content is displayed in
160
+ * table format.
161
+ */
162
+ fieldsFilterExpression;
163
+ /**
164
+ * Instances filter that allows filtering content by class, properties of specific class
165
+ * or properties of instances related to the content instance.
166
+ *
167
+ * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on
168
+ * specific select class rather than a union of multiple select classes. This means the filter has
169
+ * access to properties of that class and they can be referenced using symbols like `this.Property`.
170
+ * This is useful for filtering instances of specific class.
171
+ */
172
+ instanceFilter;
130
173
  /** Construct a new Descriptor using a [[DescriptorSource]] */
131
174
  constructor(source) {
132
175
  this.connectionId = source.connectionId;
@@ -139,8 +182,7 @@ class Descriptor {
139
182
  this.fields = [...source.fields];
140
183
  this.sortingField = source.sortingField;
141
184
  this.sortDirection = source.sortDirection;
142
- this.filterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated
143
- this.fieldsFilterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated
185
+ this.fieldsFilterExpression = source.fieldsFilterExpression;
144
186
  this.instanceFilter = source.instanceFilter;
145
187
  this.ruleset = source.ruleset;
146
188
  }
@@ -149,34 +191,40 @@ class Descriptor {
149
191
  const classesMap = {};
150
192
  const selectClasses = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));
151
193
  const fields = this.fields.map((field) => field.toCompressedJSON(classesMap));
152
- return Object.assign({
194
+ return (0, Utils_1.omitUndefined)({
153
195
  displayType: this.displayType,
154
196
  contentFlags: this.contentFlags,
155
197
  categories: this.categories.map(Category_1.CategoryDescription.toJSON),
156
198
  fields,
157
199
  selectClasses,
158
200
  classesMap,
159
- }, this.connectionId !== undefined && { connectionId: this.connectionId }, this.inputKeysHash !== undefined && { inputKeysHash: this.inputKeysHash },
160
- // istanbul ignore next
161
- this.contentOptions !== undefined && { contentOptions: this.contentOptions }, // eslint-disable-line @typescript-eslint/no-deprecated
162
- this.sortingField !== undefined && { sortingFieldName: this.sortingField.name }, this.sortDirection !== undefined && { sortDirection: this.sortDirection }, this.filterExpression !== undefined && { filterExpression: this.filterExpression }, // eslint-disable-line @typescript-eslint/no-deprecated
163
- this.fieldsFilterExpression !== undefined && { fieldsFilterExpression: this.fieldsFilterExpression }, this.instanceFilter !== undefined && { instanceFilter: this.instanceFilter }, this.selectionInfo !== undefined && { selectionInfo: this.selectionInfo }, this.ruleset !== undefined && { ruleset: this.ruleset });
201
+ connectionId: this.connectionId ?? "",
202
+ inputKeysHash: this.inputKeysHash ?? "",
203
+ sortingFieldName: this.sortingField?.name,
204
+ sortDirection: this.sortDirection,
205
+ fieldsFilterExpression: this.fieldsFilterExpression,
206
+ instanceFilter: this.instanceFilter,
207
+ selectionInfo: this.selectionInfo,
208
+ ruleset: this.ruleset,
209
+ });
164
210
  }
165
211
  /** Deserialize [[Descriptor]] from JSON */
166
212
  static fromJSON(json) {
167
213
  if (!json) {
168
214
  return undefined;
169
215
  }
170
- const { classesMap, ...leftOverJson } = json;
171
- const categories = Category_1.CategoryDescription.listFromJSON(json.categories);
172
- const selectClasses = SelectClassInfo.listFromCompressedJSON(json.selectClasses, classesMap);
173
- const fields = this.getFieldsFromJSON(json.fields, (fieldJson) => Fields_1.Field.fromCompressedJSON(fieldJson, classesMap, categories));
216
+ const { categories: jsonCategories, selectClasses: jsonSelectClasses, fields: jsonFields, connectionId, inputKeysHash, classesMap, sortingFieldName, ...leftOverJson } = json;
217
+ const categories = Category_1.CategoryDescription.listFromJSON(jsonCategories);
218
+ const selectClasses = SelectClassInfo.listFromCompressedJSON(jsonSelectClasses, classesMap);
219
+ const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Fields_1.Field.fromCompressedJSON(fieldJson, classesMap, categories));
174
220
  return new Descriptor({
175
221
  ...leftOverJson,
222
+ ...(connectionId ? /* istanbul ignore next */ { connectionId } : undefined),
223
+ ...(inputKeysHash ? /* istanbul ignore next */ { inputKeysHash } : undefined),
176
224
  selectClasses,
177
225
  categories,
178
226
  fields,
179
- sortingField: (0, Fields_1.getFieldByName)(fields, json.sortingFieldName, true),
227
+ sortingField: (0, Fields_1.getFieldByName)(fields, sortingFieldName, true),
180
228
  });
181
229
  }
182
230
  static getFieldsFromJSON(json, factory) {
@@ -216,10 +264,8 @@ class Descriptor {
216
264
  if (this.contentFlags !== 0) {
217
265
  overrides.contentFlags = this.contentFlags;
218
266
  }
219
- // eslint-disable-next-line @typescript-eslint/no-deprecated
220
- if (this.filterExpression || this.fieldsFilterExpression) {
221
- // eslint-disable-next-line @typescript-eslint/no-deprecated
222
- overrides.fieldsFilterExpression = this.fieldsFilterExpression ?? this.filterExpression;
267
+ if (this.fieldsFilterExpression) {
268
+ overrides.fieldsFilterExpression = this.fieldsFilterExpression;
223
269
  }
224
270
  if (this.instanceFilter) {
225
271
  overrides.instanceFilter = this.instanceFilter;
@@ -1 +1 @@
1
- {"version":3,"file":"Descriptor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Descriptor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,8BAUe;A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;;;;OAIG;IACI,cAAc,CAAC,IAAY,EAAE,OAAiB;QACnD,OAAO,IAAA,uBAAc,EAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,oBAAoB,CAAC,eAAgC,EAAE,OAAiB;QAC7E,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,yBAAyB;QAC9B,MAAM,SAAS,GAAwB,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3C,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;YAC5B,SAAS,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QAC7C,CAAC;QACD,4DAA4D;QAC5D,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAAC;YACzD,4DAA4D;YAC5D,SAAS,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,gBAAgB,CAAC;QAC1F,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAClI,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAjLD,gCAiLC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n ClassInfo,\n ClassInfoJSON,\n CompressedClassInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n} from \"../EC\";\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition\";\nimport { Ruleset } from \"../rules/Ruleset\";\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category\";\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields\";\n\n/**\n * Data structure that describes an ECClass in content [[Descriptor]].\n * @public\n */\nexport interface SelectClassInfo {\n /** Information about the ECClass */\n selectClassInfo: ClassInfo;\n\n /** Is the class handled polymorphically */\n isSelectPolymorphic: boolean;\n\n /** Relationship path from input class to the select class. */\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\n\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\n relatedPropertyPaths?: RelationshipPath[];\n\n /** Relationship paths to navigation property classes */\n navigationPropertyClasses?: RelatedClassInfo[];\n\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\n relatedInstancePaths?: RelationshipPath[];\n}\n\n/**\n * Serialized [[SelectClassInfo]] JSON representation\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfoJSON> {\n selectClassInfo: TClassInfoJSON;\n isSelectPolymorphic: boolean;\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\n}\n\n/** @public */\nexport namespace SelectClassInfo {\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\n return {\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\n isSelectPolymorphic: json.isSelectPolymorphic,\n ...(json.navigationPropertyClasses\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\n : undefined),\n ...(json.relatedInstancePaths\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n ...(json.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(json.relatedPropertyPaths\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n };\n }\n\n /** Serialize [[SelectClassInfo]] to compressed JSON */\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\n classesMap[id] = leftOverClassInfo;\n return {\n selectClassInfo: id,\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\n ...(selectClass.relatedInstancePaths\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\n : undefined),\n ...(selectClass.navigationPropertyClasses\n ? {\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.relatedPropertyPaths\n ? {\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\n ),\n }\n : undefined),\n };\n }\n\n /**\n * Deserialize [[SelectClassInfo]] list from JSON\n * @param json JSON or JSON serialized to string to deserialize from\n * @returns Deserialized [[SelectClassInfo]] objects list\n *\n * @internal\n */\n export function listFromCompressedJSON(json: SelectClassInfoJSON<Id64String>[], classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo[] {\n return json.map((sci) => fromCompressedJSON(sci, classesMap));\n }\n}\n\n/**\n * Flags that control content format.\n * @public\n */\nexport enum ContentFlags {\n /** Each content record only has [[InstanceKey]] and no data */\n KeysOnly = 1 << 0,\n\n /**\n * Each content record additionally has an image id\n * @deprecated in 3.x. Use [[ExtendedDataRule]] instead. See [extended data usage page]($docs/presentation/customization/ExtendedDataUsage.md) for more details.\n */\n ShowImages = 1 << 1,\n\n /** Each content record additionally has a display label */\n ShowLabels = 1 << 2,\n\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\n MergeResults = 1 << 3,\n\n /** Content has only distinct values */\n DistinctValues = 1 << 4,\n\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\n NoFields = 1 << 5,\n\n /**\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\n * given input key at the cost of performance creating those items.\n */\n IncludeInputKeys = 1 << 8,\n\n /**\n * Produce content descriptor that is not intended for querying content. Allows the implementation to omit certain\n * operations to make obtaining content descriptor faster.\n * @internal\n */\n DescriptorOnly = 1 << 9,\n}\n\n/**\n * Data sorting direction\n * @public\n */\nexport enum SortDirection {\n Ascending,\n Descending,\n}\n\n/**\n * Data structure that contains selection information. Used\n * for cases when requesting content after a selection change.\n *\n * @public\n */\nexport interface SelectionInfo {\n /** Name of selection provider which cause the selection change */\n providerName: string;\n /** Level of selection that changed */\n level?: number;\n}\n\n/**\n * Serialized [[Descriptor]] JSON representation.\n * @public\n */\nexport interface DescriptorJSON {\n classesMap: { [id: string]: CompressedClassInfoJSON };\n connectionId: string;\n inputKeysHash: string;\n /** @deprecated in 3.x. The attribute is not used anymore. */\n contentOptions: any;\n selectionInfo?: SelectionInfo;\n displayType: string;\n selectClasses: SelectClassInfoJSON<Id64String>[];\n categories: CategoryDescriptionJSON[];\n fields: FieldJSON<Id64String>[];\n sortingFieldName?: string;\n sortDirection?: SortDirection;\n contentFlags: number;\n /** @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]]. */\n filterExpression?: string;\n fieldsFilterExpression?: string;\n instanceFilter?: InstanceFilterDefinition;\n ruleset?: Ruleset;\n}\n\n/**\n * Descriptor overrides that can be used to customize content\n * @public\n */\nexport interface DescriptorOverrides {\n /**\n * Content display type. Can be accessed in presentation rules and used\n * to modify content in various ways. Defaults to empty string.\n */\n displayType?: string;\n\n /** Content flags used for content customization. See [[ContentFlags]] */\n contentFlags?: number;\n\n /** Fields selector that allows excluding or including only specified fields. */\n fieldsSelector?: {\n /** Should the specified fields be included or excluded */\n type: \"include\" | \"exclude\";\n /** A list of field descriptors that identify fields to include / exclude */\n fields: FieldDescriptor[];\n };\n\n /** Specification for sorting data. */\n sorting?: {\n /** Identifier of the field to use for sorting */\n field: FieldDescriptor;\n /** Sort direction */\n direction: SortDirection;\n };\n\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content\n * @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]].\n */\n filterExpression?: string;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Descriptor properties\n * @public\n */\nexport interface DescriptorSource {\n /** Id of the connection used to create the descriptor */\n readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n readonly displayType: string;\n /** A list of classes that will be selected from when creating content with this descriptor */\n readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n readonly contentFlags: number;\n /** Field used to sort the content */\n readonly sortingField?: Field;\n /** Sorting direction */\n readonly sortDirection?: SortDirection;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n readonly ruleset?: Ruleset;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content\n * @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]].\n */\n filterExpression?: string;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Data structure that describes content: fields, sorting, filtering, format, etc.\n * Descriptor may be changed to control how content is created.\n *\n * @public\n */\nexport class Descriptor implements DescriptorSource {\n /** Id of the connection used to create the descriptor */\n public readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n public readonly inputKeysHash?: string;\n /**\n * Extended options used to create the descriptor.\n * @deprecated in 3.6. The attribute is not used anymore.\n */\n public readonly contentOptions: any;\n /** Selection info used to create the descriptor */\n public readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n public readonly displayType: string;\n /** A list of classes that will be selected when creating content with this descriptor */\n public readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n public readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n public readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n public readonly contentFlags: number;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n public readonly ruleset?: Ruleset;\n /** Field used to sort the content */\n public sortingField?: Field;\n /** Sorting direction */\n public sortDirection?: SortDirection;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content\n * @deprecated in 3.x. The attribute was replaced with [[fieldsFilterExpression]].\n */\n public filterExpression?: string;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n public fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n public instanceFilter?: InstanceFilterDefinition;\n\n /** Construct a new Descriptor using a [[DescriptorSource]] */\n public constructor(source: DescriptorSource) {\n this.connectionId = source.connectionId;\n this.inputKeysHash = source.inputKeysHash;\n this.selectionInfo = source.selectionInfo;\n this.displayType = source.displayType;\n this.contentFlags = source.contentFlags;\n this.selectClasses = [...source.selectClasses];\n this.categories = [...source.categories];\n this.fields = [...source.fields];\n this.sortingField = source.sortingField;\n this.sortDirection = source.sortDirection;\n this.filterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated\n this.fieldsFilterExpression = source.fieldsFilterExpression ?? source.filterExpression; // eslint-disable-line @typescript-eslint/no-deprecated\n this.instanceFilter = source.instanceFilter;\n this.ruleset = source.ruleset;\n }\n\n /** Serialize [[Descriptor]] to JSON */\n public toJSON(): DescriptorJSON {\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\n return Object.assign(\n {\n displayType: this.displayType,\n contentFlags: this.contentFlags,\n categories: this.categories.map(CategoryDescription.toJSON),\n fields,\n selectClasses,\n classesMap,\n },\n this.connectionId !== undefined && { connectionId: this.connectionId },\n this.inputKeysHash !== undefined && { inputKeysHash: this.inputKeysHash },\n // istanbul ignore next\n this.contentOptions !== undefined && { contentOptions: this.contentOptions }, // eslint-disable-line @typescript-eslint/no-deprecated\n this.sortingField !== undefined && { sortingFieldName: this.sortingField.name },\n this.sortDirection !== undefined && { sortDirection: this.sortDirection },\n this.filterExpression !== undefined && { filterExpression: this.filterExpression }, // eslint-disable-line @typescript-eslint/no-deprecated\n this.fieldsFilterExpression !== undefined && { fieldsFilterExpression: this.fieldsFilterExpression },\n this.instanceFilter !== undefined && { instanceFilter: this.instanceFilter },\n this.selectionInfo !== undefined && { selectionInfo: this.selectionInfo },\n this.ruleset !== undefined && { ruleset: this.ruleset },\n );\n }\n\n /** Deserialize [[Descriptor]] from JSON */\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\n if (!json) {\n return undefined;\n }\n\n const { classesMap, ...leftOverJson } = json;\n const categories = CategoryDescription.listFromJSON(json.categories);\n const selectClasses = SelectClassInfo.listFromCompressedJSON(json.selectClasses, classesMap);\n const fields = this.getFieldsFromJSON(json.fields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\n return new Descriptor({\n ...leftOverJson,\n selectClasses,\n categories,\n fields,\n sortingField: getFieldByName(fields, json.sortingFieldName, true),\n });\n }\n\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\n return json\n .map((fieldJson: FieldJSON) => {\n const field = factory(fieldJson);\n if (field) {\n field.rebuildParentship();\n }\n return field;\n })\n .filter((field): field is Field => !!field);\n }\n\n /**\n * Get field by its name\n * @param name Name of the field to find\n * @param recurse Recurse into nested fields\n */\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\n return getFieldByName(this.fields, name, recurse);\n }\n\n /**\n * Get field by its descriptor.\n */\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\n }\n\n /**\n * Create descriptor overrides object from this descriptor.\n * @public\n */\n public createDescriptorOverrides(): DescriptorOverrides {\n const overrides: DescriptorOverrides = {};\n if (this.displayType) {\n overrides.displayType = this.displayType;\n }\n if (this.contentFlags !== 0) {\n overrides.contentFlags = this.contentFlags;\n }\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (this.filterExpression || this.fieldsFilterExpression) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n overrides.fieldsFilterExpression = this.fieldsFilterExpression ?? this.filterExpression;\n }\n if (this.instanceFilter) {\n overrides.instanceFilter = this.instanceFilter;\n }\n if (this.sortingField) {\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\n }\n return overrides;\n }\n}\n"]}
1
+ {"version":3,"file":"Descriptor.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Descriptor.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,sDAAyD;AACzD,8BASe;AAGf,yCAA0E;AAC1E,qCAAmG;AACnG,oCAAyC;AAuCzC,cAAc;AACd,IAAiB,eAAe,CAsE/B;AAtED,WAAiB,eAAe;IAC9B,2DAA2D;IAC3D,SAAgB,kBAAkB,CAAC,IAAiC,EAAE,UAAqD;QACzH,IAAA,qBAAM,EAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QACxD,OAAO;YACL,eAAe,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE;YAClF,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,GAAG,CAAC,IAAI,CAAC,yBAAyB;gBAChC,CAAC,CAAC,EAAE,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAgB,CAAC,kBAAkB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE;gBACpI,CAAC,CAAC,SAAS,CAAC;YACd,GAAG,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jE,CAAC;QACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACxB,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACjD,CAAC;QACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,SAAS,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,EAAE,CAAC;QAClI,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA1KD,gCA0KC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Content\n */\n\nimport { assert, Id64String } from \"@itwin/core-bentley\";\nimport {\n ClassInfo,\n CompressedClassInfoJSON,\n RelatedClassInfo,\n RelatedClassInfoJSON,\n RelatedClassInfoWithOptionalRelationship,\n RelatedClassInfoWithOptionalRelationshipJSON,\n RelationshipPath,\n RelationshipPathJSON,\n} from \"../EC\";\nimport { InstanceFilterDefinition } from \"../InstanceFilterDefinition\";\nimport { Ruleset } from \"../rules/Ruleset\";\nimport { CategoryDescription, CategoryDescriptionJSON } from \"./Category\";\nimport { Field, FieldDescriptor, FieldJSON, getFieldByDescriptor, getFieldByName } from \"./Fields\";\nimport { omitUndefined } from \"../Utils\";\n\n/**\n * Data structure that describes an ECClass in content [[Descriptor]].\n * @public\n */\nexport interface SelectClassInfo {\n /** Information about the ECClass */\n selectClassInfo: ClassInfo;\n\n /** Is the class handled polymorphically */\n isSelectPolymorphic: boolean;\n\n /** Relationship path from input class to the select class. */\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationship[];\n\n /** Relationship paths to [related property]($docs/presentation/content/Terminology#related-properties) classes */\n relatedPropertyPaths?: RelationshipPath[];\n\n /** Relationship paths to navigation property classes */\n navigationPropertyClasses?: RelatedClassInfo[];\n\n /** Relationship paths to [related instance]($docs/presentation/content/Terminology#related-instance) classes. */\n relatedInstancePaths?: RelationshipPath[];\n}\n\n/**\n * Serialized [[SelectClassInfo]] JSON representation\n * @public\n */\nexport interface SelectClassInfoJSON<TClassInfoJSON = ClassInfo> {\n selectClassInfo: TClassInfoJSON;\n isSelectPolymorphic: boolean;\n pathFromInputToSelectClass?: RelatedClassInfoWithOptionalRelationshipJSON<TClassInfoJSON>[];\n relatedPropertyPaths?: RelationshipPathJSON<TClassInfoJSON>[];\n navigationPropertyClasses?: RelatedClassInfoJSON<TClassInfoJSON>[];\n relatedInstancePaths?: RelationshipPathJSON<TClassInfoJSON>[];\n}\n\n/** @public */\nexport namespace SelectClassInfo {\n /** Deserialize [[SelectClassInfo]] from compressed JSON */\n export function fromCompressedJSON(json: SelectClassInfoJSON<string>, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo {\n assert(classesMap.hasOwnProperty(json.selectClassInfo));\n return {\n selectClassInfo: { id: json.selectClassInfo, ...classesMap[json.selectClassInfo] },\n isSelectPolymorphic: json.isSelectPolymorphic,\n ...(json.navigationPropertyClasses\n ? { navigationPropertyClasses: json.navigationPropertyClasses.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap)) }\n : undefined),\n ...(json.relatedInstancePaths\n ? { relatedInstancePaths: json.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n ...(json.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: json.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.fromCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(json.relatedPropertyPaths\n ? { relatedPropertyPaths: json.relatedPropertyPaths.map((path) => path.map((item) => RelatedClassInfo.fromCompressedJSON(item, classesMap))) }\n : undefined),\n };\n }\n\n /** Serialize [[SelectClassInfo]] to compressed JSON */\n export function toCompressedJSON(selectClass: SelectClassInfo, classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfoJSON<string> {\n const { id, ...leftOverClassInfo } = selectClass.selectClassInfo;\n classesMap[id] = leftOverClassInfo;\n return {\n selectClassInfo: id,\n isSelectPolymorphic: selectClass.isSelectPolymorphic,\n ...(selectClass.relatedInstancePaths\n ? { relatedInstancePaths: selectClass.relatedInstancePaths.map((rip) => rip.map((item) => RelatedClassInfo.toCompressedJSON(item, classesMap))) }\n : undefined),\n ...(selectClass.navigationPropertyClasses\n ? {\n navigationPropertyClasses: selectClass.navigationPropertyClasses.map((propertyClass) =>\n RelatedClassInfo.toCompressedJSON(propertyClass, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.pathFromInputToSelectClass\n ? {\n pathFromInputToSelectClass: selectClass.pathFromInputToSelectClass.map((item) =>\n RelatedClassInfoWithOptionalRelationship.toCompressedJSON(item, classesMap),\n ),\n }\n : undefined),\n ...(selectClass.relatedPropertyPaths\n ? {\n relatedPropertyPaths: selectClass.relatedPropertyPaths.map((path) =>\n path.map((relatedClass) => RelatedClassInfo.toCompressedJSON(relatedClass, classesMap)),\n ),\n }\n : undefined),\n };\n }\n\n /**\n * Deserialize [[SelectClassInfo]] list from JSON\n * @param json JSON or JSON serialized to string to deserialize from\n * @returns Deserialized [[SelectClassInfo]] objects list\n *\n * @internal\n */\n export function listFromCompressedJSON(json: SelectClassInfoJSON<Id64String>[], classesMap: { [id: string]: CompressedClassInfoJSON }): SelectClassInfo[] {\n return json.map((sci) => fromCompressedJSON(sci, classesMap));\n }\n}\n\n/**\n * Flags that control content format.\n * @public\n */\nexport enum ContentFlags {\n /** Each content record only has [[InstanceKey]] and no data */\n KeysOnly = 1 << 0,\n\n /** Each content record additionally has a display label */\n ShowLabels = 1 << 2,\n\n /** All content records are merged into a single record (see [Merging values]($docs/presentation/content/terminology#value-merging)) */\n MergeResults = 1 << 3,\n\n /** Content has only distinct values */\n DistinctValues = 1 << 4,\n\n /** Doesn't create property or calculated fields. Can be used in conjunction with [[ShowLabels]]. */\n NoFields = 1 << 5,\n\n /**\n * Set related input keys on [[Item]] objects when creating content. This helps identify which [[Item]] is associated to which\n * given input key at the cost of performance creating those items.\n */\n IncludeInputKeys = 1 << 8,\n\n /**\n * Produce content descriptor that is not intended for querying content. Allows the implementation to omit certain\n * operations to make obtaining content descriptor faster.\n * @internal\n */\n DescriptorOnly = 1 << 9,\n}\n\n/**\n * Data sorting direction\n * @public\n */\nexport enum SortDirection {\n Ascending,\n Descending,\n}\n\n/**\n * Data structure that contains selection information. Used\n * for cases when requesting content after a selection change.\n *\n * @public\n */\nexport interface SelectionInfo {\n /** Name of selection provider which cause the selection change */\n providerName: string;\n /** Level of selection that changed */\n level?: number;\n}\n\n/**\n * Serialized [[Descriptor]] JSON representation.\n * @public\n */\nexport interface DescriptorJSON {\n classesMap: { [id: string]: CompressedClassInfoJSON };\n connectionId: string;\n inputKeysHash: string;\n selectionInfo?: SelectionInfo;\n displayType: string;\n selectClasses: SelectClassInfoJSON<Id64String>[];\n categories: CategoryDescriptionJSON[];\n fields: FieldJSON<Id64String>[];\n sortingFieldName?: string;\n sortDirection?: SortDirection;\n contentFlags: number;\n fieldsFilterExpression?: string;\n instanceFilter?: InstanceFilterDefinition;\n ruleset?: Ruleset;\n}\n\n/**\n * Descriptor overrides that can be used to customize content\n * @public\n */\nexport interface DescriptorOverrides {\n /**\n * Content display type. Can be accessed in presentation rules and used\n * to modify content in various ways. Defaults to empty string.\n */\n displayType?: string;\n\n /** Content flags used for content customization. See [[ContentFlags]] */\n contentFlags?: number;\n\n /** Fields selector that allows excluding or including only specified fields. */\n fieldsSelector?: {\n /** Should the specified fields be included or excluded */\n type: \"include\" | \"exclude\";\n /** A list of field descriptors that identify fields to include / exclude */\n fields: FieldDescriptor[];\n };\n\n /** Specification for sorting data. */\n sorting?: {\n /** Identifier of the field to use for sorting */\n field: FieldDescriptor;\n /** Sort direction */\n direction: SortDirection;\n };\n\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Descriptor properties\n * @public\n */\nexport interface DescriptorSource {\n /** Id of the connection used to create the descriptor */\n readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n readonly displayType: string;\n /** A list of classes that will be selected from when creating content with this descriptor */\n readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n readonly contentFlags: number;\n /** Field used to sort the content */\n readonly sortingField?: Field;\n /** Sorting direction */\n readonly sortDirection?: SortDirection;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n readonly ruleset?: Ruleset;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n instanceFilter?: InstanceFilterDefinition;\n}\n\n/**\n * Data structure that describes content: fields, sorting, filtering, format, etc.\n * Descriptor may be changed to control how content is created.\n *\n * @public\n */\nexport class Descriptor implements DescriptorSource {\n /** Id of the connection used to create the descriptor */\n public readonly connectionId?: string;\n /** Hash of the input keys used to create the descriptor */\n public readonly inputKeysHash?: string;\n /** Selection info used to create the descriptor */\n public readonly selectionInfo?: SelectionInfo;\n /** Display type used to create the descriptor */\n public readonly displayType: string;\n /** A list of classes that will be selected when creating content with this descriptor */\n public readonly selectClasses: SelectClassInfo[];\n /** A list of content field categories used in this descriptor */\n public readonly categories: CategoryDescription[];\n /** A list of fields contained in the descriptor */\n public readonly fields: Field[];\n /** [[ContentFlags]] used to create the descriptor */\n public readonly contentFlags: number;\n /**\n * A ruleset used to create this descriptor.\n * Only set if descriptor is created using a ruleset different from the input ruleset, e.g. when creating a hierarchy level descriptor.\n */\n public readonly ruleset?: Ruleset;\n /** Field used to sort the content */\n public sortingField?: Field;\n /** Sorting direction */\n public sortDirection?: SortDirection;\n /**\n * [ECExpression]($docs/presentation/advanced/ECExpressions.md) for filtering content by\n * select fields.\n *\n * This is different from [[instanceFilter]] as filtering is applied on the union of all selects,\n * which removes access to content instance property values. Instead of referencing properties\n * through `this.PropertyName` alias, the expression should reference them by field names. In cases\n * when properties field merges multiple properties, this allows applying the filter on all of them\n * at once. This is useful for filtering table rows by column value, when content is displayed in\n * table format.\n */\n public fieldsFilterExpression?: string;\n /**\n * Instances filter that allows filtering content by class, properties of specific class\n * or properties of instances related to the content instance.\n *\n * This is different from [[fieldsFilterExpression]] as filter is applied at a lower level - on\n * specific select class rather than a union of multiple select classes. This means the filter has\n * access to properties of that class and they can be referenced using symbols like `this.Property`.\n * This is useful for filtering instances of specific class.\n */\n public instanceFilter?: InstanceFilterDefinition;\n\n /** Construct a new Descriptor using a [[DescriptorSource]] */\n public constructor(source: DescriptorSource) {\n this.connectionId = source.connectionId;\n this.inputKeysHash = source.inputKeysHash;\n this.selectionInfo = source.selectionInfo;\n this.displayType = source.displayType;\n this.contentFlags = source.contentFlags;\n this.selectClasses = [...source.selectClasses];\n this.categories = [...source.categories];\n this.fields = [...source.fields];\n this.sortingField = source.sortingField;\n this.sortDirection = source.sortDirection;\n this.fieldsFilterExpression = source.fieldsFilterExpression;\n this.instanceFilter = source.instanceFilter;\n this.ruleset = source.ruleset;\n }\n\n /** Serialize [[Descriptor]] to JSON */\n public toJSON(): DescriptorJSON {\n const classesMap: { [id: string]: CompressedClassInfoJSON } = {};\n const selectClasses: SelectClassInfoJSON<string>[] = this.selectClasses.map((selectClass) => SelectClassInfo.toCompressedJSON(selectClass, classesMap));\n const fields: FieldJSON<string>[] = this.fields.map((field) => field.toCompressedJSON(classesMap));\n return omitUndefined({\n displayType: this.displayType,\n contentFlags: this.contentFlags,\n categories: this.categories.map(CategoryDescription.toJSON),\n fields,\n selectClasses,\n classesMap,\n connectionId: this.connectionId ?? \"\",\n inputKeysHash: this.inputKeysHash ?? \"\",\n sortingFieldName: this.sortingField?.name,\n sortDirection: this.sortDirection,\n fieldsFilterExpression: this.fieldsFilterExpression,\n instanceFilter: this.instanceFilter,\n selectionInfo: this.selectionInfo,\n ruleset: this.ruleset,\n });\n }\n\n /** Deserialize [[Descriptor]] from JSON */\n public static fromJSON(json: DescriptorJSON | undefined): Descriptor | undefined {\n if (!json) {\n return undefined;\n }\n\n const {\n categories: jsonCategories,\n selectClasses: jsonSelectClasses,\n fields: jsonFields,\n connectionId,\n inputKeysHash,\n classesMap,\n sortingFieldName,\n ...leftOverJson\n } = json;\n const categories = CategoryDescription.listFromJSON(jsonCategories);\n const selectClasses = SelectClassInfo.listFromCompressedJSON(jsonSelectClasses, classesMap);\n const fields = this.getFieldsFromJSON(jsonFields, (fieldJson) => Field.fromCompressedJSON(fieldJson, classesMap, categories));\n return new Descriptor({\n ...leftOverJson,\n ...(connectionId ? /* istanbul ignore next */ { connectionId } : undefined),\n ...(inputKeysHash ? /* istanbul ignore next */ { inputKeysHash } : undefined),\n selectClasses,\n categories,\n fields,\n sortingField: getFieldByName(fields, sortingFieldName, true),\n });\n }\n\n private static getFieldsFromJSON(json: FieldJSON[], factory: (json: FieldJSON) => Field | undefined): Field[] {\n return json\n .map((fieldJson: FieldJSON) => {\n const field = factory(fieldJson);\n if (field) {\n field.rebuildParentship();\n }\n return field;\n })\n .filter((field): field is Field => !!field);\n }\n\n /**\n * Get field by its name\n * @param name Name of the field to find\n * @param recurse Recurse into nested fields\n */\n public getFieldByName(name: string, recurse?: boolean): Field | undefined {\n return getFieldByName(this.fields, name, recurse);\n }\n\n /**\n * Get field by its descriptor.\n */\n public getFieldByDescriptor(fieldDescriptor: FieldDescriptor, recurse?: boolean): Field | undefined {\n return getFieldByDescriptor(this.fields, fieldDescriptor, recurse);\n }\n\n /**\n * Create descriptor overrides object from this descriptor.\n * @public\n */\n public createDescriptorOverrides(): DescriptorOverrides {\n const overrides: DescriptorOverrides = {};\n if (this.displayType) {\n overrides.displayType = this.displayType;\n }\n if (this.contentFlags !== 0) {\n overrides.contentFlags = this.contentFlags;\n }\n if (this.fieldsFilterExpression) {\n overrides.fieldsFilterExpression = this.fieldsFilterExpression;\n }\n if (this.instanceFilter) {\n overrides.instanceFilter = this.instanceFilter;\n }\n if (this.sortingField) {\n overrides.sorting = { field: this.sortingField.getFieldDescriptor(), direction: this.sortDirection ?? SortDirection.Ascending };\n }\n return overrides;\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * @module Content
3
3
  */
4
4
  import { Id64String } from "@itwin/core-bentley";
5
- import { ClassInfo, ClassInfoJSON, CompressedClassInfoJSON, RelationshipPath, RelationshipPathJSON, StrippedRelationshipPath } from "../EC";
5
+ import { ClassInfo, CompressedClassInfoJSON, RelationshipPath, RelationshipPathJSON, StrippedRelationshipPath } from "../EC";
6
6
  import { RelationshipMeaning } from "../rules/content/modifiers/RelatedPropertiesSpecification";
7
7
  import { CategoryDescription } from "./Category";
8
8
  import { EditorDescription } from "./Editor";
@@ -30,7 +30,7 @@ export interface BaseFieldJSON {
30
30
  * Data structure for a [[PropertiesField]] serialized to JSON.
31
31
  * @public
32
32
  */
33
- export interface PropertiesFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {
33
+ export interface PropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {
34
34
  properties: PropertyJSON<TClassInfoJSON>[];
35
35
  }
36
36
  /**
@@ -51,7 +51,7 @@ export interface StructPropertiesFieldJSON<TClassInfoJSON = ClassInfo> extends P
51
51
  * Data structure for a [[NestedContentField]] serialized to JSON.
52
52
  * @public
53
53
  */
54
- export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends BaseFieldJSON {
54
+ export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfo> extends BaseFieldJSON {
55
55
  contentClassInfo: TClassInfoJSON;
56
56
  pathToPrimaryClass: RelationshipPathJSON<TClassInfoJSON>;
57
57
  relationshipMeaning?: RelationshipMeaning;
@@ -63,7 +63,33 @@ export interface NestedContentFieldJSON<TClassInfoJSON = ClassInfoJSON> extends
63
63
  * JSON representation of a [[Field]]
64
64
  * @public
65
65
  */
66
- export type FieldJSON<TClassInfoJSON = ClassInfoJSON> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | ArrayPropertiesFieldJSON<TClassInfoJSON> | StructPropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;
66
+ export type FieldJSON<TClassInfoJSON = ClassInfo> = BaseFieldJSON | PropertiesFieldJSON<TClassInfoJSON> | ArrayPropertiesFieldJSON<TClassInfoJSON> | StructPropertiesFieldJSON<TClassInfoJSON> | NestedContentFieldJSON<TClassInfoJSON>;
67
+ /**
68
+ * Props for creating [[Field]].
69
+ * @public
70
+ */
71
+ interface FieldProps {
72
+ /** Category information */
73
+ category: CategoryDescription;
74
+ /** Unique name */
75
+ name: string;
76
+ /** Display label */
77
+ label: string;
78
+ /** Description of this field's values data type */
79
+ type: TypeDescription;
80
+ /** Are values in this field read-only */
81
+ isReadonly: boolean;
82
+ /** Priority of the field */
83
+ priority: number;
84
+ /** Property editor used to edit values of this field */
85
+ editor?: EditorDescription;
86
+ /** Property renderer used to render values of this field */
87
+ renderer?: RendererDescription;
88
+ /** Extended data associated with this field */
89
+ extendedData?: {
90
+ [key: string]: unknown;
91
+ };
92
+ }
67
93
  /**
68
94
  * Describes a single content field. A field is usually represented as a grid column
69
95
  * or a property pane row.
@@ -94,7 +120,7 @@ export declare class Field {
94
120
  /** Parent field */
95
121
  private _parent?;
96
122
  /**
97
- * Creates an instance of Field.
123
+ * Creates an instance of [[Field]].
98
124
  * @param category Category information
99
125
  * @param name Unique name
100
126
  * @param label Display label
@@ -104,10 +130,13 @@ export declare class Field {
104
130
  * @param editor Property editor used to edit values of this field
105
131
  * @param renderer Property renderer used to render values of this field
106
132
  * @param extendedData Extended data associated with this field
133
+ * @deprecated in 5.0. Use an overload with `FieldProps` instead.
107
134
  */
108
135
  constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, isReadonly: boolean, priority: number, editor?: EditorDescription, renderer?: RendererDescription, extendedData?: {
109
136
  [key: string]: unknown;
110
137
  });
138
+ /** Creates an instance of [[Field]]. */
139
+ constructor(props: FieldProps);
111
140
  /**
112
141
  * Is this a [[PropertiesField]]
113
142
  */
@@ -121,13 +150,19 @@ export declare class Field {
121
150
  */
122
151
  get parent(): NestedContentField | undefined;
123
152
  clone(): Field;
124
- /** Serialize this object to JSON */
153
+ /**
154
+ * Serialize this object to JSON.
155
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
156
+ */
125
157
  toJSON(): FieldJSON;
126
158
  /** Serialize this object to compressed JSON */
127
159
  toCompressedJSON(_classesMap: {
128
160
  [id: string]: CompressedClassInfoJSON;
129
161
  }): FieldJSON<string>;
130
- /** Deserialize [[Field]] from JSON */
162
+ /**
163
+ * Deserialize [[Field]] from JSON.
164
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
165
+ */
131
166
  static fromJSON(json: FieldJSON | undefined, categories: CategoryDescription[]): Field | undefined;
132
167
  /** Deserialize a [[Field]] from compressed JSON. */
133
168
  static fromCompressedJSON(json: FieldJSON<string> | undefined, classesMap: {
@@ -149,6 +184,14 @@ export declare class Field {
149
184
  */
150
185
  matchesDescriptor(descriptor: FieldDescriptor): boolean;
151
186
  }
187
+ /**
188
+ * Props for creating [[PropertiesField]].
189
+ * @public
190
+ */
191
+ interface PropertiesFieldProps extends FieldProps {
192
+ /** A list of properties this field is created from */
193
+ properties: Property[];
194
+ }
152
195
  /**
153
196
  * Describes a content field that's based on one or more similar
154
197
  * EC properties.
@@ -159,7 +202,7 @@ export declare class PropertiesField extends Field {
159
202
  /** A list of properties this field is created from */
160
203
  properties: Property[];
161
204
  /**
162
- * Creates an instance of PropertiesField.
205
+ * Creates an instance of [[PropertiesField]].
163
206
  * @param category Category information
164
207
  * @param name Unique name
165
208
  * @param label Display label
@@ -169,20 +212,29 @@ export declare class PropertiesField extends Field {
169
212
  * @param properties A list of properties this field is created from
170
213
  * @param editor Property editor used to edit values of this field
171
214
  * @param renderer Property renderer used to render values of this field
215
+ * @deprecated in 5.0. Use an overload with `PropertiesFieldProps` instead.
172
216
  */
173
- constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
217
+ constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
218
+ /** Creates an instance of [[PropertiesField]]. */
219
+ constructor(props: PropertiesFieldProps);
174
220
  /** Is this a an array property field */
175
221
  isArrayPropertiesField(): this is ArrayPropertiesField;
176
222
  /** Is this a an struct property field */
177
223
  isStructPropertiesField(): this is StructPropertiesField;
178
224
  clone(): PropertiesField;
179
- /** Serialize this object to JSON */
225
+ /**
226
+ * Serialize this object to JSON
227
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
228
+ */
180
229
  toJSON(): PropertiesFieldJSON;
181
230
  /** Serialize this object to compressed JSON */
182
231
  toCompressedJSON(classesMap: {
183
232
  [id: string]: CompressedClassInfoJSON;
184
233
  }): PropertiesFieldJSON<string>;
185
- /** Deserialize [[PropertiesField]] from JSON */
234
+ /**
235
+ * Deserialize [[PropertiesField]] from JSON.
236
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
237
+ */
186
238
  static fromJSON(json: PropertiesFieldJSON | undefined, categories: CategoryDescription[]): PropertiesField | undefined;
187
239
  /**
188
240
  * Deserialize a [[PropertiesField]] from compressed JSON.
@@ -202,22 +254,41 @@ export declare class PropertiesField extends Field {
202
254
  */
203
255
  matchesDescriptor(descriptor: FieldDescriptor): boolean;
204
256
  }
257
+ /**
258
+ * Props for creating [[ArrayPropertiesField]].
259
+ * @public
260
+ */
261
+ interface ArrayPropertiesFieldProps extends PropertiesFieldProps {
262
+ itemsField: PropertiesField;
263
+ }
205
264
  /**
206
265
  * Describes a content field that's based on one or more similar EC array properties.
207
266
  * @public
208
267
  */
209
268
  export declare class ArrayPropertiesField extends PropertiesField {
210
269
  itemsField: PropertiesField;
211
- constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, itemsField: PropertiesField, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
270
+ /**
271
+ * Creates an instance of [[ArrayPropertiesField]].
272
+ * @deprecated in 5.0. Use an overload with `ArrayPropertiesFieldProps` instead.
273
+ */
274
+ constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, itemsField: PropertiesField, isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
275
+ /** Creates an instance of [[ArrayPropertiesField]]. */
276
+ constructor(props: ArrayPropertiesFieldProps);
212
277
  isArrayPropertiesField(): this is ArrayPropertiesField;
213
278
  clone(): ArrayPropertiesField;
214
- /** Serialize this object to JSON */
279
+ /**
280
+ * Serialize this object to JSON.
281
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
282
+ */
215
283
  toJSON(): ArrayPropertiesFieldJSON;
216
284
  /** Serialize this object to compressed JSON */
217
285
  toCompressedJSON(classesMap: {
218
286
  [id: string]: CompressedClassInfoJSON;
219
287
  }): ArrayPropertiesFieldJSON<string>;
220
- /** Deserialize [[ArrayPropertiesField]] from JSON */
288
+ /**
289
+ * Deserialize [[ArrayPropertiesField]] from JSON.
290
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
291
+ */
221
292
  static fromJSON(json: ArrayPropertiesFieldJSON, categories: CategoryDescription[]): ArrayPropertiesField;
222
293
  /**
223
294
  * Deserialize an [[ArrayPropertiesField]] from compressed JSON.
@@ -227,22 +298,41 @@ export declare class ArrayPropertiesField extends PropertiesField {
227
298
  [id: string]: CompressedClassInfoJSON;
228
299
  }, categories: CategoryDescription[]): ArrayPropertiesField;
229
300
  }
301
+ /**
302
+ * Props for creating [[StructPropertiesField]].
303
+ * @public
304
+ */
305
+ interface StructPropertiesFieldProps extends PropertiesFieldProps {
306
+ memberFields: PropertiesField[];
307
+ }
230
308
  /**
231
309
  * Describes a content field that's based on one or more similar EC struct properties.
232
310
  * @public
233
311
  */
234
312
  export declare class StructPropertiesField extends PropertiesField {
235
313
  memberFields: PropertiesField[];
236
- constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, memberFields: PropertiesField[], isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
314
+ /**
315
+ * Creates an instance of [[StructPropertiesField]].
316
+ * @deprecated in 5.0. Use an overload with `StructPropertiesFieldProps` instead.
317
+ */
318
+ constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, memberFields: PropertiesField[], isReadonly: boolean, priority: number, properties: Property[], editor?: EditorDescription, renderer?: RendererDescription);
319
+ /** Creates an instance of [[StructPropertiesField]]. */
320
+ constructor(props: StructPropertiesFieldProps);
237
321
  isStructPropertiesField(): this is StructPropertiesField;
238
322
  clone(): StructPropertiesField;
239
- /** Serialize this object to JSON */
323
+ /**
324
+ * Serialize this object to JSON.
325
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
326
+ */
240
327
  toJSON(): StructPropertiesFieldJSON;
241
328
  /** Serialize this object to compressed JSON */
242
329
  toCompressedJSON(classesMap: {
243
330
  [id: string]: CompressedClassInfoJSON;
244
331
  }): StructPropertiesFieldJSON<string>;
245
- /** Deserialize [[StructPropertiesField]] from JSON */
332
+ /**
333
+ * Deserialize [[StructPropertiesField]] from JSON.
334
+ * @deprecated in 5.x. Use [[fromCompressedJSON]] instead.
335
+ */
246
336
  static fromJSON(json: StructPropertiesFieldJSON, categories: CategoryDescription[]): StructPropertiesField;
247
337
  /**
248
338
  * Deserialize a [[StructPropertiesField]] from compressed JSON.
@@ -252,6 +342,39 @@ export declare class StructPropertiesField extends PropertiesField {
252
342
  [id: string]: CompressedClassInfoJSON;
253
343
  }, categories: CategoryDescription[]): StructPropertiesField;
254
344
  }
345
+ /**
346
+ * Props for creating [[NestedContentField]].
347
+ * @public
348
+ */
349
+ interface NestedContentFieldProps extends FieldProps {
350
+ /** Information about an ECClass whose properties are nested inside this field */
351
+ contentClassInfo: ClassInfo;
352
+ /** Relationship path to [Primary class]($docs/presentation/content/Terminology#primary-class) */
353
+ pathToPrimaryClass: RelationshipPath;
354
+ /**
355
+ * Meaning of the relationship between the [primary class]($docs/presentation/content/Terminology#primary-class)
356
+ * and content class of this field.
357
+ *
358
+ * The value is set up through [[RelatedPropertiesSpecification.relationshipMeaning]] attribute when setting up
359
+ * presentation rules for creating the content.
360
+ */
361
+ relationshipMeaning?: RelationshipMeaning;
362
+ /**
363
+ * When content descriptor is requested in a polymorphic fashion, fields get created if at least one of the concrete classes
364
+ * has it. In certain situations it's necessary to know which concrete classes caused that and this attribute is
365
+ * here to help.
366
+ *
367
+ * **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`.
368
+ * When content descriptor is requested for class `A` polymorphically, it's going to contain fields for all properties of class `B`,
369
+ * class `C` and a nested content field for the `B -> D` relationship. The nested content field's `actualPrimaryClassIds` attribute
370
+ * will contain ID of class `B`, identifying that only this specific class has the relationship.
371
+ */
372
+ actualPrimaryClassIds?: Id64String[];
373
+ /** Contained nested fields */
374
+ nestedFields: Field[];
375
+ /** Flag specifying whether field should be expanded */
376
+ autoExpand?: boolean;
377
+ }
255
378
  /**
256
379
  * Describes a content field that contains [Nested content]($docs/presentation/content/Terminology#nested-content).
257
380
  *
@@ -286,7 +409,7 @@ export declare class NestedContentField extends Field {
286
409
  /** Flag specifying whether field should be expanded */
287
410
  autoExpand?: boolean;
288
411
  /**
289
- * Creates an instance of NestedContentField.
412
+ * Creates an instance of [[NestedContentField]].
290
413
  * @param category Category information
291
414
  * @param name Unique name
292
415
  * @param label Display label
@@ -300,8 +423,11 @@ export declare class NestedContentField extends Field {
300
423
  * @param autoExpand Flag specifying whether field should be expanded
301
424
  * @param relationshipMeaning RelationshipMeaning of the field
302
425
  * @param renderer Property renderer used to render values of this field
426
+ * @deprecated in 5.0. Use an overload with `NestedContentFieldProps` instead.
303
427
  */
304
- constructor(category: CategoryDescription, name: string, label: string, description: TypeDescription, isReadonly: boolean, priority: number, contentClassInfo: ClassInfo, pathToPrimaryClass: RelationshipPath, nestedFields: Field[], editor?: EditorDescription, autoExpand?: boolean, renderer?: RendererDescription);
428
+ constructor(category: CategoryDescription, name: string, label: string, type: TypeDescription, isReadonly: boolean, priority: number, contentClassInfo: ClassInfo, pathToPrimaryClass: RelationshipPath, nestedFields: Field[], editor?: EditorDescription, autoExpand?: boolean, renderer?: RendererDescription);
429
+ /** Creates an instance of [[NestedContentField]]. */
430
+ constructor(props: NestedContentFieldProps);
305
431
  clone(): NestedContentField;
306
432
  /**
307
433
  * Get field by its name
@@ -309,22 +435,19 @@ export declare class NestedContentField extends Field {
309
435
  * @param recurse Recurse into nested fields
310
436
  */
311
437
  getFieldByName(name: string, recurse?: boolean): Field | undefined;
312
- /** Serialize this object to JSON */
438
+ /**
439
+ * Serialize this object to JSON.
440
+ * @deprecated in 5.x. Use [[toCompressedJSON]] instead.
441
+ */
313
442
  toJSON(): NestedContentFieldJSON;
314
443
  /** Serialize this object to compressed JSON */
315
444
  toCompressedJSON(classesMap: {
316
445
  [id: string]: CompressedClassInfoJSON;
317
446
  }): NestedContentFieldJSON<string>;
318
- /**
319
- * Deserialize [[NestedContentField]] from JSON
320
- * @deprecated in 3.x. Use [[NestedContentField.fromCompressedJSON]]
321
- */
322
- static fromJSON(json: NestedContentFieldJSON | undefined, categories: CategoryDescription[]): NestedContentField | undefined;
323
447
  /** Deserialize a [[NestedContentField]] from compressed JSON. */
324
448
  static fromCompressedJSON(json: NestedContentFieldJSON<Id64String>, classesMap: {
325
449
  [id: string]: CompressedClassInfoJSON;
326
- }, categories: CategoryDescription[]): any;
327
- private static fromCommonJSON;
450
+ }, categories: CategoryDescription[]): NestedContentField;
328
451
  /** Resets parent of this field and all nested fields. */
329
452
  resetParentship(): void;
330
453
  /**
@@ -391,4 +514,5 @@ export interface PropertiesFieldDescriptor extends FieldDescriptorBase {
391
514
  name: string;
392
515
  }>;
393
516
  }
517
+ export {};
394
518
  //# sourceMappingURL=Fields.d.ts.map