@itwin/presentation-common 3.4.0-dev.50 → 3.4.0-dev.55

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 (459) hide show
  1. package/lib/cjs/assets/locales/en/BisCore.json +18 -18
  2. package/lib/cjs/assets/locales/en/ECPresentation.json +9 -9
  3. package/lib/cjs/assets/locales/en/RulesEngine.json +5 -5
  4. package/lib/cjs/presentation-common/AsyncTasks.d.ts +22 -22
  5. package/lib/cjs/presentation-common/AsyncTasks.js +38 -38
  6. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  7. package/lib/cjs/presentation-common/CommonLoggerCategory.d.ts +12 -12
  8. package/lib/cjs/presentation-common/CommonLoggerCategory.js +20 -20
  9. package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
  10. package/lib/cjs/presentation-common/Diagnostics.d.ts +125 -125
  11. package/lib/cjs/presentation-common/Diagnostics.js +72 -72
  12. package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
  13. package/lib/cjs/presentation-common/EC.d.ts +315 -315
  14. package/lib/cjs/presentation-common/EC.js +270 -270
  15. package/lib/cjs/presentation-common/EC.js.map +1 -1
  16. package/lib/cjs/presentation-common/ElementProperties.d.ts +123 -123
  17. package/lib/cjs/presentation-common/ElementProperties.js +9 -9
  18. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  19. package/lib/cjs/presentation-common/Error.d.ts +45 -45
  20. package/lib/cjs/presentation-common/Error.js +62 -62
  21. package/lib/cjs/presentation-common/Error.js.map +1 -1
  22. package/lib/cjs/presentation-common/KeySet.d.ts +146 -146
  23. package/lib/cjs/presentation-common/KeySet.js +418 -418
  24. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  25. package/lib/cjs/presentation-common/LabelDefinition.d.ts +79 -79
  26. package/lib/cjs/presentation-common/LabelDefinition.js +76 -76
  27. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  28. package/lib/cjs/presentation-common/LocalizationHelper.d.ts +29 -29
  29. package/lib/cjs/presentation-common/LocalizationHelper.js +110 -110
  30. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  31. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +37 -37
  32. package/lib/cjs/presentation-common/PresentationIpcInterface.js +12 -12
  33. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  34. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +242 -242
  35. package/lib/cjs/presentation-common/PresentationManagerOptions.js +23 -23
  36. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  37. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +181 -181
  38. package/lib/cjs/presentation-common/PresentationRpcInterface.js +102 -102
  39. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  40. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +26 -26
  41. package/lib/cjs/presentation-common/RegisteredRuleset.js +33 -33
  42. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  43. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +82 -82
  44. package/lib/cjs/presentation-common/RpcRequestsHandler.js +155 -155
  45. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  46. package/lib/cjs/presentation-common/RulesetVariables.d.ts +166 -166
  47. package/lib/cjs/presentation-common/RulesetVariables.js +55 -55
  48. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  49. package/lib/cjs/presentation-common/RulesetsFactory.d.ts +44 -44
  50. package/lib/cjs/presentation-common/RulesetsFactory.js +223 -226
  51. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  52. package/lib/cjs/presentation-common/Update.d.ts +194 -194
  53. package/lib/cjs/presentation-common/Update.js +196 -196
  54. package/lib/cjs/presentation-common/Update.js.map +1 -1
  55. package/lib/cjs/presentation-common/Utils.d.ts +64 -64
  56. package/lib/cjs/presentation-common/Utils.js +45 -45
  57. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  58. package/lib/cjs/presentation-common/content/Category.d.ts +49 -49
  59. package/lib/cjs/presentation-common/content/Category.js +49 -49
  60. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  61. package/lib/cjs/presentation-common/content/Content.d.ts +38 -38
  62. package/lib/cjs/presentation-common/content/Content.js +56 -56
  63. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  64. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +101 -101
  65. package/lib/cjs/presentation-common/content/ContentTraverser.js +420 -420
  66. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  67. package/lib/cjs/presentation-common/content/Descriptor.d.ts +240 -240
  68. package/lib/cjs/presentation-common/content/Descriptor.js +189 -189
  69. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  70. package/lib/cjs/presentation-common/content/DisplayTypes.d.ts +21 -21
  71. package/lib/cjs/presentation-common/content/DisplayTypes.js +29 -29
  72. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  73. package/lib/cjs/presentation-common/content/Editor.d.ts +15 -15
  74. package/lib/cjs/presentation-common/content/Editor.js +9 -9
  75. package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
  76. package/lib/cjs/presentation-common/content/Fields.d.ts +282 -282
  77. package/lib/cjs/presentation-common/content/Fields.js +394 -394
  78. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  79. package/lib/cjs/presentation-common/content/Item.d.ts +87 -87
  80. package/lib/cjs/presentation-common/content/Item.js +86 -86
  81. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  82. package/lib/cjs/presentation-common/content/Property.d.ts +51 -51
  83. package/lib/cjs/presentation-common/content/Property.js +36 -36
  84. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  85. package/lib/cjs/presentation-common/content/Renderer.d.ts +11 -11
  86. package/lib/cjs/presentation-common/content/Renderer.js +9 -9
  87. package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
  88. package/lib/cjs/presentation-common/content/TypeDescription.d.ts +72 -72
  89. package/lib/cjs/presentation-common/content/TypeDescription.js +23 -23
  90. package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
  91. package/lib/cjs/presentation-common/content/Value.d.ts +157 -157
  92. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  93. package/lib/cjs/presentation-common/content/Value.js +217 -203
  94. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  95. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +185 -185
  96. package/lib/cjs/presentation-common/hierarchy/Key.js +112 -112
  97. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  98. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +141 -141
  99. package/lib/cjs/presentation-common/hierarchy/Node.js +97 -97
  100. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  101. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +85 -85
  102. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +98 -98
  103. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  104. package/lib/cjs/presentation-common/rules/ClassSpecifications.d.ts +45 -45
  105. package/lib/cjs/presentation-common/rules/ClassSpecifications.js +9 -9
  106. package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
  107. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts +31 -31
  108. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js +9 -9
  109. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  110. package/lib/cjs/presentation-common/rules/RelationshipDirection.d.ts +13 -13
  111. package/lib/cjs/presentation-common/rules/RelationshipDirection.js +21 -21
  112. package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
  113. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts +53 -53
  114. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js +9 -9
  115. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  116. package/lib/cjs/presentation-common/rules/Rule.d.ts +74 -74
  117. package/lib/cjs/presentation-common/rules/Rule.js +35 -35
  118. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  119. package/lib/cjs/presentation-common/rules/Ruleset.d.ts +66 -66
  120. package/lib/cjs/presentation-common/rules/Ruleset.js +9 -9
  121. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  122. package/lib/cjs/presentation-common/rules/SchemasSpecification.d.ts +41 -41
  123. package/lib/cjs/presentation-common/rules/SchemasSpecification.js +9 -9
  124. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  125. package/lib/cjs/presentation-common/rules/Variables.d.ts +55 -55
  126. package/lib/cjs/presentation-common/rules/Variables.js +25 -25
  127. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  128. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +41 -41
  129. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +9 -9
  130. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  131. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +25 -25
  132. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +9 -9
  133. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  134. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts +30 -30
  135. package/lib/cjs/presentation-common/rules/content/ContentRule.js +9 -9
  136. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  137. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +55 -55
  138. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js +20 -20
  139. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  140. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +19 -19
  141. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +9 -9
  142. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  143. package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts +86 -86
  144. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js +9 -9
  145. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  146. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +28 -28
  147. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +9 -9
  148. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  149. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +25 -25
  150. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +9 -9
  151. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  152. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +57 -57
  153. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js +9 -9
  154. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  155. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.d.ts +17 -17
  156. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +9 -9
  157. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  158. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +107 -107
  159. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +9 -9
  160. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  161. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +105 -105
  162. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +21 -21
  163. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  164. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +93 -93
  165. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +43 -43
  166. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  167. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +44 -44
  168. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +9 -9
  169. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  170. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +36 -36
  171. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +9 -9
  172. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  173. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts +27 -27
  174. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js +9 -9
  175. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  176. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +200 -200
  177. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +51 -51
  178. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  179. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +29 -29
  180. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +9 -9
  181. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  182. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts +156 -156
  183. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js +25 -25
  184. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  185. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +40 -40
  186. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +9 -9
  187. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  188. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts +58 -58
  189. package/lib/cjs/presentation-common/rules/customization/SortingRule.js +9 -9
  190. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  191. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +48 -48
  192. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +9 -9
  193. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  194. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +15 -15
  195. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +9 -9
  196. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  197. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +97 -97
  198. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +22 -22
  199. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  200. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +31 -31
  201. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +9 -9
  202. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  203. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +76 -76
  204. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +19 -19
  205. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  206. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +39 -39
  207. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +9 -9
  208. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  209. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +50 -50
  210. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +9 -9
  211. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  212. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +27 -27
  213. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js +9 -9
  214. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  215. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +27 -27
  216. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +9 -9
  217. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  218. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +17 -17
  219. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +9 -9
  220. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  221. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +36 -36
  222. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +9 -9
  223. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  224. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +25 -25
  225. package/lib/cjs/presentation-common/selection/SelectionScope.js +9 -9
  226. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  227. package/lib/cjs/presentation-common.d.ts +110 -110
  228. package/lib/cjs/presentation-common.js +126 -126
  229. package/lib/cjs/presentation-common.js.map +1 -1
  230. package/lib/esm/presentation-common/AsyncTasks.d.ts +22 -22
  231. package/lib/esm/presentation-common/AsyncTasks.js +34 -34
  232. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  233. package/lib/esm/presentation-common/CommonLoggerCategory.d.ts +12 -12
  234. package/lib/esm/presentation-common/CommonLoggerCategory.js +17 -17
  235. package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
  236. package/lib/esm/presentation-common/Diagnostics.d.ts +125 -125
  237. package/lib/esm/presentation-common/Diagnostics.js +67 -67
  238. package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
  239. package/lib/esm/presentation-common/EC.d.ts +315 -315
  240. package/lib/esm/presentation-common/EC.js +267 -267
  241. package/lib/esm/presentation-common/EC.js.map +1 -1
  242. package/lib/esm/presentation-common/ElementProperties.d.ts +123 -123
  243. package/lib/esm/presentation-common/ElementProperties.js +8 -8
  244. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  245. package/lib/esm/presentation-common/Error.d.ts +45 -45
  246. package/lib/esm/presentation-common/Error.js +58 -58
  247. package/lib/esm/presentation-common/Error.js.map +1 -1
  248. package/lib/esm/presentation-common/KeySet.d.ts +146 -146
  249. package/lib/esm/presentation-common/KeySet.js +414 -414
  250. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  251. package/lib/esm/presentation-common/LabelDefinition.d.ts +79 -79
  252. package/lib/esm/presentation-common/LabelDefinition.js +73 -73
  253. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  254. package/lib/esm/presentation-common/LocalizationHelper.d.ts +29 -29
  255. package/lib/esm/presentation-common/LocalizationHelper.js +106 -106
  256. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  257. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +37 -37
  258. package/lib/esm/presentation-common/PresentationIpcInterface.js +9 -9
  259. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  260. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +242 -242
  261. package/lib/esm/presentation-common/PresentationManagerOptions.js +18 -18
  262. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  263. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +181 -181
  264. package/lib/esm/presentation-common/PresentationRpcInterface.js +98 -98
  265. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  266. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +26 -26
  267. package/lib/esm/presentation-common/RegisteredRuleset.js +29 -29
  268. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  269. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +82 -82
  270. package/lib/esm/presentation-common/RpcRequestsHandler.js +151 -151
  271. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  272. package/lib/esm/presentation-common/RulesetVariables.d.ts +166 -166
  273. package/lib/esm/presentation-common/RulesetVariables.js +52 -52
  274. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  275. package/lib/esm/presentation-common/RulesetsFactory.d.ts +44 -44
  276. package/lib/esm/presentation-common/RulesetsFactory.js +219 -222
  277. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  278. package/lib/esm/presentation-common/Update.d.ts +194 -194
  279. package/lib/esm/presentation-common/Update.js +193 -193
  280. package/lib/esm/presentation-common/Update.js.map +1 -1
  281. package/lib/esm/presentation-common/Utils.d.ts +64 -64
  282. package/lib/esm/presentation-common/Utils.js +41 -41
  283. package/lib/esm/presentation-common/Utils.js.map +1 -1
  284. package/lib/esm/presentation-common/content/Category.d.ts +49 -49
  285. package/lib/esm/presentation-common/content/Category.js +46 -46
  286. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  287. package/lib/esm/presentation-common/content/Content.d.ts +38 -38
  288. package/lib/esm/presentation-common/content/Content.js +52 -52
  289. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  290. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +101 -101
  291. package/lib/esm/presentation-common/content/ContentTraverser.js +411 -411
  292. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  293. package/lib/esm/presentation-common/content/Descriptor.d.ts +240 -240
  294. package/lib/esm/presentation-common/content/Descriptor.js +185 -185
  295. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  296. package/lib/esm/presentation-common/content/DisplayTypes.d.ts +21 -21
  297. package/lib/esm/presentation-common/content/DisplayTypes.js +26 -26
  298. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  299. package/lib/esm/presentation-common/content/Editor.d.ts +15 -15
  300. package/lib/esm/presentation-common/content/Editor.js +8 -8
  301. package/lib/esm/presentation-common/content/Editor.js.map +1 -1
  302. package/lib/esm/presentation-common/content/Fields.d.ts +282 -282
  303. package/lib/esm/presentation-common/content/Fields.js +387 -387
  304. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  305. package/lib/esm/presentation-common/content/Item.d.ts +87 -87
  306. package/lib/esm/presentation-common/content/Item.js +82 -82
  307. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  308. package/lib/esm/presentation-common/content/Property.d.ts +51 -51
  309. package/lib/esm/presentation-common/content/Property.js +33 -33
  310. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  311. package/lib/esm/presentation-common/content/Renderer.d.ts +11 -11
  312. package/lib/esm/presentation-common/content/Renderer.js +8 -8
  313. package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
  314. package/lib/esm/presentation-common/content/TypeDescription.d.ts +72 -72
  315. package/lib/esm/presentation-common/content/TypeDescription.js +20 -20
  316. package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
  317. package/lib/esm/presentation-common/content/Value.d.ts +157 -157
  318. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  319. package/lib/esm/presentation-common/content/Value.js +214 -200
  320. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  321. package/lib/esm/presentation-common/hierarchy/Key.d.ts +185 -185
  322. package/lib/esm/presentation-common/hierarchy/Key.js +109 -109
  323. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  324. package/lib/esm/presentation-common/hierarchy/Node.d.ts +141 -141
  325. package/lib/esm/presentation-common/hierarchy/Node.js +94 -94
  326. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  327. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +85 -85
  328. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +95 -95
  329. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  330. package/lib/esm/presentation-common/rules/ClassSpecifications.d.ts +45 -45
  331. package/lib/esm/presentation-common/rules/ClassSpecifications.js +8 -8
  332. package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
  333. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts +31 -31
  334. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js +8 -8
  335. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  336. package/lib/esm/presentation-common/rules/RelationshipDirection.d.ts +13 -13
  337. package/lib/esm/presentation-common/rules/RelationshipDirection.js +18 -18
  338. package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
  339. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts +53 -53
  340. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js +8 -8
  341. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  342. package/lib/esm/presentation-common/rules/Rule.d.ts +74 -74
  343. package/lib/esm/presentation-common/rules/Rule.js +32 -32
  344. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  345. package/lib/esm/presentation-common/rules/Ruleset.d.ts +66 -66
  346. package/lib/esm/presentation-common/rules/Ruleset.js +8 -8
  347. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  348. package/lib/esm/presentation-common/rules/SchemasSpecification.d.ts +41 -41
  349. package/lib/esm/presentation-common/rules/SchemasSpecification.js +8 -8
  350. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  351. package/lib/esm/presentation-common/rules/Variables.d.ts +55 -55
  352. package/lib/esm/presentation-common/rules/Variables.js +22 -22
  353. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  354. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +41 -41
  355. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +8 -8
  356. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  357. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +25 -25
  358. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +8 -8
  359. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  360. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts +30 -30
  361. package/lib/esm/presentation-common/rules/content/ContentRule.js +8 -8
  362. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  363. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +55 -55
  364. package/lib/esm/presentation-common/rules/content/ContentSpecification.js +17 -17
  365. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  366. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +19 -19
  367. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +8 -8
  368. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  369. package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts +86 -86
  370. package/lib/esm/presentation-common/rules/content/PropertySpecification.js +8 -8
  371. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  372. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +28 -28
  373. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +8 -8
  374. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  375. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +25 -25
  376. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +8 -8
  377. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  378. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +57 -57
  379. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js +8 -8
  380. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  381. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.d.ts +17 -17
  382. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +8 -8
  383. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  384. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +107 -107
  385. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +8 -8
  386. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  387. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +105 -105
  388. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +18 -18
  389. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  390. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +93 -93
  391. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +40 -40
  392. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  393. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +44 -44
  394. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +8 -8
  395. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  396. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +36 -36
  397. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +8 -8
  398. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  399. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts +27 -27
  400. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js +8 -8
  401. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  402. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +200 -200
  403. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +48 -48
  404. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  405. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +29 -29
  406. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +8 -8
  407. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  408. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts +156 -156
  409. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js +22 -22
  410. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  411. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +40 -40
  412. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +8 -8
  413. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  414. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts +58 -58
  415. package/lib/esm/presentation-common/rules/customization/SortingRule.js +8 -8
  416. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  417. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +48 -48
  418. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +8 -8
  419. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  420. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +15 -15
  421. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +8 -8
  422. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  423. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +97 -97
  424. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +19 -19
  425. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  426. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +31 -31
  427. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +8 -8
  428. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  429. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +76 -76
  430. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +16 -16
  431. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  432. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +39 -39
  433. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +8 -8
  434. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  435. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +50 -50
  436. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +8 -8
  437. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  438. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +27 -27
  439. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js +8 -8
  440. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  441. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +27 -27
  442. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +8 -8
  443. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  444. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +17 -17
  445. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +8 -8
  446. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  447. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +36 -36
  448. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +8 -8
  449. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  450. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +25 -25
  451. package/lib/esm/presentation-common/selection/SelectionScope.js +8 -8
  452. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  453. package/lib/esm/presentation-common.d.ts +110 -110
  454. package/lib/esm/presentation-common.js +114 -114
  455. package/lib/esm/presentation-common.js.map +1 -1
  456. package/lib/public/locales/en/BisCore.json +18 -18
  457. package/lib/public/locales/en/ECPresentation.json +9 -9
  458. package/lib/public/locales/en/RulesEngine.json +5 -5
  459. package/package.json +9 -9
@@ -1,201 +1,215 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module Content
7
- */
8
- import { InstanceKey } from "../EC";
9
- /** @public */
10
- export var Value;
11
- (function (Value) {
12
- /** Is the value a primitive */
13
- function isPrimitive(value) { return isPrimitiveValue(value); }
14
- Value.isPrimitive = isPrimitive;
15
- /** Is the value an array */
16
- function isArray(value) { return isArrayValue(value); }
17
- Value.isArray = isArray;
18
- /** Is the value a map / struct */
19
- function isMap(value) { return isMapValue(value); }
20
- Value.isMap = isMap;
21
- /** Is the value a nested content value */
22
- function isNestedContent(value) { return isNestedContentValue(value); }
23
- Value.isNestedContent = isNestedContent;
24
- /** Serialize [[Value]] to JSON */
25
- function fromJSON(json) {
26
- if (json === null)
27
- return undefined;
28
- if (isNestedContentValue(json))
29
- return json.map(NestedContentValue.fromJSON);
30
- if (isArrayValue(json))
31
- return valuesArrayFromJSON(json);
32
- if (isMapValue(json))
33
- return valuesMapFromJSON(json);
34
- return json;
35
- }
36
- Value.fromJSON = fromJSON;
37
- /** Deserialize [[Value]] from JSON */
38
- function toJSON(value) {
39
- if (undefined === value)
40
- return null;
41
- if (isNestedContentValue(value))
42
- return value.map(NestedContentValue.toJSON);
43
- if (isArrayValue(value))
44
- return valuesArrayToJSON(value);
45
- if (isMapValue(value))
46
- return valuesMapToJSON(value);
47
- return value;
48
- }
49
- Value.toJSON = toJSON;
50
- })(Value || (Value = {}));
51
- /** @public */
52
- export var DisplayValue;
53
- (function (DisplayValue) {
54
- /** Is the value a primitive */
55
- function isPrimitive(value) { return isPrimitiveValue(value); }
56
- DisplayValue.isPrimitive = isPrimitive;
57
- /** Is the value an array */
58
- function isArray(value) { return isArrayValue(value); }
59
- DisplayValue.isArray = isArray;
60
- /** Is the value a map / struct */
61
- function isMap(value) { return isMapValue(value); }
62
- DisplayValue.isMap = isMap;
63
- /** Serialize [[DisplayValue]] to JSON */
64
- function fromJSON(json) {
65
- if (json === null)
66
- return undefined;
67
- if (isArrayValue(json))
68
- return displayValuesArrayFromJSON(json);
69
- if (isMapValue(json))
70
- return displayValuesMapFromJSON(json);
71
- return json;
72
- }
73
- DisplayValue.fromJSON = fromJSON;
74
- /** Deserialize [[DisplayValue]] from JSON */
75
- function toJSON(value) {
76
- if (undefined === value)
77
- return null;
78
- if (isArrayValue(value))
79
- return displayValuesArrayToJSON(value);
80
- if (isMapValue(value))
81
- return displayValuesMapToJSON(value);
82
- return value;
83
- }
84
- DisplayValue.toJSON = toJSON;
85
- })(DisplayValue || (DisplayValue = {}));
86
- /** @public */
87
- export var NestedContentValue;
88
- (function (NestedContentValue) {
89
- /** Serialize [[NestedContentValue]] to JSON */
90
- function toJSON(json) {
91
- return {
92
- primaryKeys: json.primaryKeys.map(InstanceKey.toJSON),
93
- values: valuesMapToJSON(json.values),
94
- displayValues: displayValuesMapToJSON(json.displayValues),
95
- mergedFieldNames: json.mergedFieldNames,
96
- };
97
- }
98
- NestedContentValue.toJSON = toJSON;
99
- /** Deserialize [[NestedContentValue]] from JSON */
100
- function fromJSON(json) {
101
- return {
102
- primaryKeys: json.primaryKeys.map(InstanceKey.fromJSON),
103
- values: valuesMapFromJSON(json.values),
104
- displayValues: displayValuesMapFromJSON(json.displayValues),
105
- mergedFieldNames: json.mergedFieldNames,
106
- };
107
- }
108
- NestedContentValue.fromJSON = fromJSON;
109
- })(NestedContentValue || (NestedContentValue = {}));
110
- /** @public */
111
- export var DisplayValueGroup;
112
- (function (DisplayValueGroup) {
113
- /** Serialize [[DisplayValueGroup]] to JSON */
114
- function toJSON(group) {
115
- return {
116
- displayValue: DisplayValue.toJSON(group.displayValue),
117
- groupedRawValues: group.groupedRawValues.map(Value.toJSON),
118
- };
119
- }
120
- DisplayValueGroup.toJSON = toJSON;
121
- /** Deserialize [[DisplayValueGroup]] from JSON */
122
- function fromJSON(json) {
123
- return {
124
- displayValue: DisplayValue.fromJSON(json.displayValue),
125
- groupedRawValues: json.groupedRawValues.map(Value.fromJSON),
126
- };
127
- }
128
- DisplayValueGroup.fromJSON = fromJSON;
129
- })(DisplayValueGroup || (DisplayValueGroup = {}));
130
- function isNestedContentValue(v) {
131
- return (v !== undefined) && Array.isArray(v)
132
- && ((v.length === 0)
133
- || v[0].primaryKeys !== undefined
134
- && v[0].values !== undefined
135
- && v[0].displayValues !== undefined
136
- && v[0].mergedFieldNames !== undefined);
137
- }
138
- function isArrayValue(v) {
139
- // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.
140
- // we have other means to determine the type of value.
141
- return (v !== undefined) && Array.isArray(v);
142
- }
143
- function isMapValue(v) {
144
- return (v !== undefined) && (typeof v === "object") && !Array.isArray(v);
145
- }
146
- function isPrimitiveValue(v) {
147
- return !isArrayValue(v) && !isMapValue(v);
148
- }
149
- function valuesArrayFromJSON(json) {
150
- return json.map(Value.fromJSON);
151
- }
152
- function valuesArrayToJSON(values) {
153
- return values.map(Value.toJSON);
154
- }
155
- function valuesMapFromJSON(json) {
156
- const map = {};
157
- for (const key in json) {
158
- /* istanbul ignore else */
159
- if (json.hasOwnProperty(key)) {
160
- map[key] = Value.fromJSON(json[key]);
161
- }
162
- }
163
- return map;
164
- }
165
- function valuesMapToJSON(values) {
166
- const map = {};
167
- for (const key in values) {
168
- /* istanbul ignore else */
169
- if (values.hasOwnProperty(key)) {
170
- map[key] = Value.toJSON(values[key]);
171
- }
172
- }
173
- return map;
174
- }
175
- function displayValuesArrayFromJSON(json) {
176
- return json.map(DisplayValue.fromJSON);
177
- }
178
- function displayValuesArrayToJSON(values) {
179
- return values.map(DisplayValue.toJSON);
180
- }
181
- function displayValuesMapFromJSON(json) {
182
- const map = {};
183
- for (const key in json) {
184
- /* istanbul ignore else */
185
- if (json.hasOwnProperty(key)) {
186
- map[key] = DisplayValue.fromJSON(json[key]);
187
- }
188
- }
189
- return map;
190
- }
191
- function displayValuesMapToJSON(values) {
192
- const map = {};
193
- for (const key in values) {
194
- /* istanbul ignore else */
195
- if (values.hasOwnProperty(key)) {
196
- map[key] = DisplayValue.toJSON(values[key]);
197
- }
198
- }
199
- return map;
200
- }
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Content
7
+ */
8
+ import { InstanceKey } from "../EC";
9
+ /** @public */
10
+ export var Value;
11
+ (function (Value) {
12
+ /** Is the value a primitive */
13
+ function isPrimitive(value) {
14
+ return isPrimitiveValue(value);
15
+ }
16
+ Value.isPrimitive = isPrimitive;
17
+ /** Is the value an array */
18
+ function isArray(value) {
19
+ return isArrayValue(value);
20
+ }
21
+ Value.isArray = isArray;
22
+ /** Is the value a map / struct */
23
+ function isMap(value) {
24
+ return isMapValue(value);
25
+ }
26
+ Value.isMap = isMap;
27
+ /** Is the value a nested content value */
28
+ function isNestedContent(value) {
29
+ return isNestedContentValue(value);
30
+ }
31
+ Value.isNestedContent = isNestedContent;
32
+ /** Serialize [[Value]] to JSON */
33
+ function fromJSON(json) {
34
+ if (json === null)
35
+ return undefined;
36
+ if (isNestedContentValue(json))
37
+ return json.map(NestedContentValue.fromJSON);
38
+ if (isArrayValue(json))
39
+ return valuesArrayFromJSON(json);
40
+ if (isMapValue(json))
41
+ return valuesMapFromJSON(json);
42
+ return json;
43
+ }
44
+ Value.fromJSON = fromJSON;
45
+ /** Deserialize [[Value]] from JSON */
46
+ function toJSON(value) {
47
+ if (undefined === value)
48
+ return null;
49
+ if (isNestedContentValue(value))
50
+ return value.map(NestedContentValue.toJSON);
51
+ if (isArrayValue(value))
52
+ return valuesArrayToJSON(value);
53
+ if (isMapValue(value))
54
+ return valuesMapToJSON(value);
55
+ return value;
56
+ }
57
+ Value.toJSON = toJSON;
58
+ })(Value || (Value = {}));
59
+ /** @public */
60
+ export var DisplayValue;
61
+ (function (DisplayValue) {
62
+ /** Is the value a primitive */
63
+ function isPrimitive(value) {
64
+ return isPrimitiveValue(value);
65
+ }
66
+ DisplayValue.isPrimitive = isPrimitive;
67
+ /** Is the value an array */
68
+ function isArray(value) {
69
+ return isArrayValue(value);
70
+ }
71
+ DisplayValue.isArray = isArray;
72
+ /** Is the value a map / struct */
73
+ function isMap(value) {
74
+ return isMapValue(value);
75
+ }
76
+ DisplayValue.isMap = isMap;
77
+ /** Serialize [[DisplayValue]] to JSON */
78
+ function fromJSON(json) {
79
+ if (json === null)
80
+ return undefined;
81
+ if (isArrayValue(json))
82
+ return displayValuesArrayFromJSON(json);
83
+ if (isMapValue(json))
84
+ return displayValuesMapFromJSON(json);
85
+ return json;
86
+ }
87
+ DisplayValue.fromJSON = fromJSON;
88
+ /** Deserialize [[DisplayValue]] from JSON */
89
+ function toJSON(value) {
90
+ if (undefined === value)
91
+ return null;
92
+ if (isArrayValue(value))
93
+ return displayValuesArrayToJSON(value);
94
+ if (isMapValue(value))
95
+ return displayValuesMapToJSON(value);
96
+ return value;
97
+ }
98
+ DisplayValue.toJSON = toJSON;
99
+ })(DisplayValue || (DisplayValue = {}));
100
+ /** @public */
101
+ export var NestedContentValue;
102
+ (function (NestedContentValue) {
103
+ /** Serialize [[NestedContentValue]] to JSON */
104
+ function toJSON(json) {
105
+ return {
106
+ primaryKeys: json.primaryKeys.map(InstanceKey.toJSON),
107
+ values: valuesMapToJSON(json.values),
108
+ displayValues: displayValuesMapToJSON(json.displayValues),
109
+ mergedFieldNames: json.mergedFieldNames,
110
+ };
111
+ }
112
+ NestedContentValue.toJSON = toJSON;
113
+ /** Deserialize [[NestedContentValue]] from JSON */
114
+ function fromJSON(json) {
115
+ return {
116
+ primaryKeys: json.primaryKeys.map(InstanceKey.fromJSON),
117
+ values: valuesMapFromJSON(json.values),
118
+ displayValues: displayValuesMapFromJSON(json.displayValues),
119
+ mergedFieldNames: json.mergedFieldNames,
120
+ };
121
+ }
122
+ NestedContentValue.fromJSON = fromJSON;
123
+ })(NestedContentValue || (NestedContentValue = {}));
124
+ /** @public */
125
+ export var DisplayValueGroup;
126
+ (function (DisplayValueGroup) {
127
+ /** Serialize [[DisplayValueGroup]] to JSON */
128
+ function toJSON(group) {
129
+ return {
130
+ displayValue: DisplayValue.toJSON(group.displayValue),
131
+ groupedRawValues: group.groupedRawValues.map(Value.toJSON),
132
+ };
133
+ }
134
+ DisplayValueGroup.toJSON = toJSON;
135
+ /** Deserialize [[DisplayValueGroup]] from JSON */
136
+ function fromJSON(json) {
137
+ return {
138
+ displayValue: DisplayValue.fromJSON(json.displayValue),
139
+ groupedRawValues: json.groupedRawValues.map(Value.fromJSON),
140
+ };
141
+ }
142
+ DisplayValueGroup.fromJSON = fromJSON;
143
+ })(DisplayValueGroup || (DisplayValueGroup = {}));
144
+ function isNestedContentValue(v) {
145
+ return (v !== undefined) && Array.isArray(v)
146
+ && ((v.length === 0)
147
+ || v[0].primaryKeys !== undefined
148
+ && v[0].values !== undefined
149
+ && v[0].displayValues !== undefined
150
+ && v[0].mergedFieldNames !== undefined);
151
+ }
152
+ function isArrayValue(v) {
153
+ // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.
154
+ // we have other means to determine the type of value.
155
+ return (v !== undefined) && Array.isArray(v);
156
+ }
157
+ function isMapValue(v) {
158
+ return (v !== undefined) && (typeof v === "object") && !Array.isArray(v);
159
+ }
160
+ function isPrimitiveValue(v) {
161
+ return !isArrayValue(v) && !isMapValue(v);
162
+ }
163
+ function valuesArrayFromJSON(json) {
164
+ return json.map(Value.fromJSON);
165
+ }
166
+ function valuesArrayToJSON(values) {
167
+ return values.map(Value.toJSON);
168
+ }
169
+ function valuesMapFromJSON(json) {
170
+ const map = {};
171
+ for (const key in json) {
172
+ /* istanbul ignore else */
173
+ if (json.hasOwnProperty(key)) {
174
+ map[key] = Value.fromJSON(json[key]);
175
+ }
176
+ }
177
+ return map;
178
+ }
179
+ function valuesMapToJSON(values) {
180
+ const map = {};
181
+ for (const key in values) {
182
+ /* istanbul ignore else */
183
+ if (values.hasOwnProperty(key)) {
184
+ map[key] = Value.toJSON(values[key]);
185
+ }
186
+ }
187
+ return map;
188
+ }
189
+ function displayValuesArrayFromJSON(json) {
190
+ return json.map(DisplayValue.fromJSON);
191
+ }
192
+ function displayValuesArrayToJSON(values) {
193
+ return values.map(DisplayValue.toJSON);
194
+ }
195
+ function displayValuesMapFromJSON(json) {
196
+ const map = {};
197
+ for (const key in json) {
198
+ /* istanbul ignore else */
199
+ if (json.hasOwnProperty(key)) {
200
+ map[key] = DisplayValue.fromJSON(json[key]);
201
+ }
202
+ }
203
+ return map;
204
+ }
205
+ function displayValuesMapToJSON(values) {
206
+ const map = {};
207
+ for (const key in values) {
208
+ /* istanbul ignore else */
209
+ if (values.hasOwnProperty(key)) {
210
+ map[key] = DisplayValue.toJSON(values[key]);
211
+ }
212
+ }
213
+ return map;
214
+ }
201
215
  //# sourceMappingURL=Value.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.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MAAM,CAAC,CAAC;AACzC,CAAC;AACD,SAAS,wBAAwB,CAAC,IAA0B;IAC1D,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC5B,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AACD,SAAS,sBAAsB,CAAC,MAAwB;IACtD,MAAM,GAAG,GAAyB,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,0BAA0B;QAC1B,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC9B,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,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 { InstanceKey, InstanceKeyJSON } from \"../EC\";\r\nimport { ValuesDictionary } from \"../Utils\";\r\n\r\n/**\r\n * Raw value type\r\n * @public\r\n */\r\nexport type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NestedContentValue[];\r\n\r\n/** @public */\r\nexport namespace Value { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: Value): value is string | number | boolean | undefined { return isPrimitiveValue(value); }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: Value): value is ValuesArray { return isArrayValue(value); }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: Value): value is ValuesMap { return isMapValue(value); }\r\n\r\n /** Is the value a nested content value */\r\n export function isNestedContent(value: Value): value is NestedContentValue[] { return isNestedContentValue(value); }\r\n\r\n /** Serialize [[Value]] to JSON */\r\n export function fromJSON(json: ValueJSON): Value {\r\n if (json === null)\r\n return undefined;\r\n if (isNestedContentValue(json))\r\n return json.map(NestedContentValue.fromJSON);\r\n if (isArrayValue(json))\r\n return valuesArrayFromJSON(json);\r\n if (isMapValue(json))\r\n return valuesMapFromJSON(json);\r\n return json;\r\n }\r\n\r\n /** Deserialize [[Value]] from JSON */\r\n export function toJSON(value: Value): ValueJSON {\r\n if (undefined === value)\r\n return null;\r\n if (isNestedContentValue(value))\r\n return value.map(NestedContentValue.toJSON);\r\n if (isArrayValue(value))\r\n return valuesArrayToJSON(value);\r\n if (isMapValue(value))\r\n return valuesMapToJSON(value);\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * A map of raw values\r\n * @public\r\n */\r\nexport interface ValuesMap extends ValuesDictionary<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * An array of raw values\r\n * @public\r\n */\r\nexport interface ValuesArray extends Array<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Display value type.\r\n * @public\r\n */\r\nexport type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;\r\n\r\n/** @public */\r\nexport namespace DisplayValue { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Is the value a primitive */\r\n export function isPrimitive(value: DisplayValue): value is string | undefined { return isPrimitiveValue(value); }\r\n\r\n /** Is the value an array */\r\n export function isArray(value: DisplayValue): value is DisplayValuesArray { return isArrayValue(value); }\r\n\r\n /** Is the value a map / struct */\r\n export function isMap(value: DisplayValue): value is DisplayValuesMap { return isMapValue(value); }\r\n\r\n /** Serialize [[DisplayValue]] to JSON */\r\n export function fromJSON(json: DisplayValueJSON): DisplayValue {\r\n if (json === null)\r\n return undefined;\r\n if (isArrayValue(json))\r\n return displayValuesArrayFromJSON(json);\r\n if (isMapValue(json))\r\n return displayValuesMapFromJSON(json);\r\n return json;\r\n }\r\n\r\n /** Deserialize [[DisplayValue]] from JSON */\r\n export function toJSON(value: DisplayValue): DisplayValueJSON {\r\n if (undefined === value)\r\n return null;\r\n if (isArrayValue(value))\r\n return displayValuesArrayToJSON(value);\r\n if (isMapValue(value))\r\n return displayValuesMapToJSON(value);\r\n return value;\r\n }\r\n}\r\n\r\n/**\r\n * A map of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesMap extends ValuesDictionary<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * An array of display values\r\n * @public\r\n */\r\nexport interface DisplayValuesArray extends Array<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * Data structure that describes nested content value.\r\n * @public\r\n */\r\nexport interface NestedContentValue {\r\n /** Keys of instances whose content is contained in this value */\r\n primaryKeys: InstanceKey[];\r\n /** Content values map */\r\n values: ValuesDictionary<Value>;\r\n /** Content display values map */\r\n displayValues: ValuesDictionary<DisplayValue>;\r\n /** Names of fields whose values are merged */\r\n mergedFieldNames: string[];\r\n}\r\n\r\n/** @public */\r\nexport namespace NestedContentValue {\r\n /** Serialize [[NestedContentValue]] to JSON */\r\n export function toJSON(json: NestedContentValue): NestedContentValueJSON {\r\n return {\r\n primaryKeys: json.primaryKeys.map(InstanceKey.toJSON),\r\n values: valuesMapToJSON(json.values),\r\n displayValues: displayValuesMapToJSON(json.displayValues),\r\n mergedFieldNames: json.mergedFieldNames,\r\n };\r\n }\r\n\r\n /** Deserialize [[NestedContentValue]] from JSON */\r\n export function fromJSON(json: NestedContentValueJSON): NestedContentValue {\r\n return {\r\n primaryKeys: json.primaryKeys.map(InstanceKey.fromJSON),\r\n values: valuesMapFromJSON(json.values),\r\n displayValues: displayValuesMapFromJSON(json.displayValues),\r\n mergedFieldNames: json.mergedFieldNames,\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * JSON representation of [[Value]]\r\n * @public\r\n */\r\nexport type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NestedContentValueJSON[];\r\n\r\n/**\r\n * JSON representation of [[ValuesMap]]\r\n * @public\r\n */\r\nexport interface ValuesMapJSON extends ValuesDictionary<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[ValuesArray]]\r\n * @public\r\n */\r\nexport interface ValuesArrayJSON extends Array<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[DisplayValue]]\r\n * @public\r\n */\r\nexport type DisplayValueJSON = string | null | DisplayValuesMapJSON | DisplayValuesArrayJSON;\r\n\r\n/**\r\n * JSON representation of [[DisplayValuesMap]]\r\n * @public\r\n */\r\nexport interface DisplayValuesMapJSON extends ValuesDictionary<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[DisplayValuesArray]]\r\n * @public\r\n */\r\nexport interface DisplayValuesArrayJSON extends Array<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\r\n\r\n/**\r\n * JSON representation of [[NestedContentValue]]\r\n * @public\r\n */\r\nexport interface NestedContentValueJSON {\r\n primaryKeys: InstanceKeyJSON[];\r\n values: ValuesDictionary<ValueJSON>;\r\n displayValues: ValuesDictionary<DisplayValueJSON>;\r\n mergedFieldNames: string[];\r\n}\r\n\r\n/**\r\n * A group of raw values and their common display value.\r\n * @public\r\n */\r\nexport interface DisplayValueGroup {\r\n /** Common display value for all grouped raw values */\r\n displayValue: DisplayValue;\r\n /** A list of grouped raw values */\r\n groupedRawValues: Value[];\r\n}\r\n\r\n/**\r\n * JSON representation of [[DisplayValueGroup]].\r\n * @public\r\n */\r\nexport interface DisplayValueGroupJSON {\r\n displayValue: DisplayValueJSON;\r\n groupedRawValues: ValueJSON[];\r\n}\r\n\r\n/** @public */\r\nexport namespace DisplayValueGroup {\r\n /** Serialize [[DisplayValueGroup]] to JSON */\r\n export function toJSON(group: DisplayValueGroup): DisplayValueGroupJSON {\r\n return {\r\n displayValue: DisplayValue.toJSON(group.displayValue),\r\n groupedRawValues: group.groupedRawValues.map(Value.toJSON),\r\n };\r\n }\r\n\r\n /** Deserialize [[DisplayValueGroup]] from JSON */\r\n export function fromJSON(json: DisplayValueGroupJSON): DisplayValueGroup {\r\n return {\r\n displayValue: DisplayValue.fromJSON(json.displayValue),\r\n groupedRawValues: json.groupedRawValues.map(Value.fromJSON),\r\n };\r\n }\r\n}\r\n\r\nfunction isNestedContentValue(v: Value | ValueJSON): v is NestedContentValue[] | NestedContentValueJSON[] {\r\n return (v !== undefined) && Array.isArray(v)\r\n && ((v.length === 0)\r\n || (v[0] as NestedContentValue).primaryKeys !== undefined\r\n && (v[0] as NestedContentValue).values !== undefined\r\n && (v[0] as NestedContentValue).displayValues !== undefined\r\n && (v[0] as NestedContentValue).mergedFieldNames !== undefined);\r\n}\r\nfunction isArrayValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesArray | ValuesArrayJSON | DisplayValuesArray | DisplayValuesArrayJSON {\r\n // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.\r\n // we have other means to determine the type of value.\r\n return (v !== undefined) && Array.isArray(v);\r\n}\r\nfunction isMapValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesMap | ValuesMapJSON | DisplayValuesMap | DisplayValuesMapJSON {\r\n return (v !== undefined) && (typeof v === \"object\") && !Array.isArray(v);\r\n}\r\nfunction isPrimitiveValue(v: Value | DisplayValue): v is string | number | boolean | undefined {\r\n return !isArrayValue(v) && !isMapValue(v);\r\n}\r\n\r\nfunction valuesArrayFromJSON(json: ValuesArrayJSON): ValuesArray {\r\n return json.map(Value.fromJSON);\r\n}\r\nfunction valuesArrayToJSON(values: ValuesArray): ValuesArrayJSON {\r\n return values.map(Value.toJSON);\r\n}\r\nfunction valuesMapFromJSON(json: ValuesMapJSON): ValuesMap {\r\n const map: ValuesMap = {};\r\n for (const key in json) {\r\n /* istanbul ignore else */\r\n if (json.hasOwnProperty(key)) {\r\n map[key] = Value.fromJSON(json[key]);\r\n }\r\n }\r\n return map;\r\n}\r\nfunction valuesMapToJSON(values: ValuesMap): ValuesMapJSON {\r\n const map: ValuesMapJSON = {};\r\n for (const key in values) {\r\n /* istanbul ignore else */\r\n if (values.hasOwnProperty(key)) {\r\n map[key] = Value.toJSON(values[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n\r\nfunction displayValuesArrayFromJSON(json: DisplayValuesArrayJSON): DisplayValuesArray {\r\n return json.map(DisplayValue.fromJSON);\r\n}\r\nfunction displayValuesArrayToJSON(values: DisplayValuesArray): DisplayValuesArrayJSON {\r\n return values.map(DisplayValue.toJSON);\r\n}\r\nfunction displayValuesMapFromJSON(json: DisplayValuesMapJSON): DisplayValuesMap {\r\n const map: DisplayValuesMap = {};\r\n for (const key in json) {\r\n /* istanbul ignore else */\r\n if (json.hasOwnProperty(key)) {\r\n map[key] = DisplayValue.fromJSON(json[key]);\r\n }\r\n }\r\n return map;\r\n}\r\nfunction displayValuesMapToJSON(values: DisplayValuesMap): DisplayValuesMapJSON {\r\n const map: DisplayValuesMapJSON = {};\r\n for (const key in values) {\r\n /* istanbul ignore else */\r\n if (values.hasOwnProperty(key)) {\r\n map[key] = DisplayValue.toJSON(values[key]);\r\n }\r\n }\r\n return map;\r\n}\r\n"]}
1
+ {"version":3,"file":"Value.js","sourceRoot":"","sources":["../../../../src/presentation-common/content/Value.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAmB,MAAM,OAAO,CAAC;AASrD,cAAc;AACd,MAAM,KAAW,KAAK,CA8CrB;AA9CD,WAAiB,KAAK;IACpB,+BAA+B;IAC/B,SAAgB,WAAW,CAAC,KAAY;QACt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,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AACD,SAAS,sBAAsB,CAAC,MAAwB;IACtD,MAAM,GAAG,GAAyB,EAAE,CAAC;IACrC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,0BAA0B;QAC1B,IAAI,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC9B,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;SAC7C;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC","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 { InstanceKey, InstanceKeyJSON } from \"../EC\";\nimport { ValuesDictionary } from \"../Utils\";\n\n/**\n * Raw value type\n * @public\n */\nexport type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NestedContentValue[];\n\n/** @public */\nexport namespace Value { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Is the value a primitive */\n export function isPrimitive(value: Value): value is string | number | boolean | undefined {\n return isPrimitiveValue(value);\n }\n\n /** Is the value an array */\n export function isArray(value: Value): value is ValuesArray {\n return isArrayValue(value);\n }\n\n /** Is the value a map / struct */\n export function isMap(value: Value): value is ValuesMap {\n return isMapValue(value);\n }\n\n /** Is the value a nested content value */\n export function isNestedContent(value: Value): value is NestedContentValue[] {\n return isNestedContentValue(value);\n }\n\n /** Serialize [[Value]] to JSON */\n export function fromJSON(json: ValueJSON): Value {\n if (json === null)\n return undefined;\n if (isNestedContentValue(json))\n return json.map(NestedContentValue.fromJSON);\n if (isArrayValue(json))\n return valuesArrayFromJSON(json);\n if (isMapValue(json))\n return valuesMapFromJSON(json);\n return json;\n }\n\n /** Deserialize [[Value]] from JSON */\n export function toJSON(value: Value): ValueJSON {\n if (undefined === value)\n return null;\n if (isNestedContentValue(value))\n return value.map(NestedContentValue.toJSON);\n if (isArrayValue(value))\n return valuesArrayToJSON(value);\n if (isMapValue(value))\n return valuesMapToJSON(value);\n return value;\n }\n}\n\n/**\n * A map of raw values\n * @public\n */\nexport interface ValuesMap extends ValuesDictionary<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * An array of raw values\n * @public\n */\nexport interface ValuesArray extends Array<Value> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * Display value type.\n * @public\n */\nexport type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;\n\n/** @public */\nexport namespace DisplayValue { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Is the value a primitive */\n export function isPrimitive(value: DisplayValue): value is string | undefined {\n return isPrimitiveValue(value);\n }\n\n /** Is the value an array */\n export function isArray(value: DisplayValue): value is DisplayValuesArray {\n return isArrayValue(value);\n }\n\n /** Is the value a map / struct */\n export function isMap(value: DisplayValue): value is DisplayValuesMap {\n return isMapValue(value);\n }\n\n /** Serialize [[DisplayValue]] to JSON */\n export function fromJSON(json: DisplayValueJSON): DisplayValue {\n if (json === null)\n return undefined;\n if (isArrayValue(json))\n return displayValuesArrayFromJSON(json);\n if (isMapValue(json))\n return displayValuesMapFromJSON(json);\n return json;\n }\n\n /** Deserialize [[DisplayValue]] from JSON */\n export function toJSON(value: DisplayValue): DisplayValueJSON {\n if (undefined === value)\n return null;\n if (isArrayValue(value))\n return displayValuesArrayToJSON(value);\n if (isMapValue(value))\n return displayValuesMapToJSON(value);\n return value;\n }\n}\n\n/**\n * A map of display values\n * @public\n */\nexport interface DisplayValuesMap extends ValuesDictionary<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * An array of display values\n * @public\n */\nexport interface DisplayValuesArray extends Array<DisplayValue> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * Data structure that describes nested content value.\n * @public\n */\nexport interface NestedContentValue {\n /** Keys of instances whose content is contained in this value */\n primaryKeys: InstanceKey[];\n /** Content values map */\n values: ValuesDictionary<Value>;\n /** Content display values map */\n displayValues: ValuesDictionary<DisplayValue>;\n /** Names of fields whose values are merged */\n mergedFieldNames: string[];\n}\n\n/** @public */\nexport namespace NestedContentValue {\n /** Serialize [[NestedContentValue]] to JSON */\n export function toJSON(json: NestedContentValue): NestedContentValueJSON {\n return {\n primaryKeys: json.primaryKeys.map(InstanceKey.toJSON),\n values: valuesMapToJSON(json.values),\n displayValues: displayValuesMapToJSON(json.displayValues),\n mergedFieldNames: json.mergedFieldNames,\n };\n }\n\n /** Deserialize [[NestedContentValue]] from JSON */\n export function fromJSON(json: NestedContentValueJSON): NestedContentValue {\n return {\n primaryKeys: json.primaryKeys.map(InstanceKey.fromJSON),\n values: valuesMapFromJSON(json.values),\n displayValues: displayValuesMapFromJSON(json.displayValues),\n mergedFieldNames: json.mergedFieldNames,\n };\n }\n}\n\n/**\n * JSON representation of [[Value]]\n * @public\n */\nexport type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NestedContentValueJSON[];\n\n/**\n * JSON representation of [[ValuesMap]]\n * @public\n */\nexport interface ValuesMapJSON extends ValuesDictionary<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * JSON representation of [[ValuesArray]]\n * @public\n */\nexport interface ValuesArrayJSON extends Array<ValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * JSON representation of [[DisplayValue]]\n * @public\n */\nexport type DisplayValueJSON = string | null | DisplayValuesMapJSON | DisplayValuesArrayJSON;\n\n/**\n * JSON representation of [[DisplayValuesMap]]\n * @public\n */\nexport interface DisplayValuesMapJSON extends ValuesDictionary<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * JSON representation of [[DisplayValuesArray]]\n * @public\n */\nexport interface DisplayValuesArrayJSON extends Array<DisplayValueJSON> { } // eslint-disable-line @typescript-eslint/no-empty-interface\n\n/**\n * JSON representation of [[NestedContentValue]]\n * @public\n */\nexport interface NestedContentValueJSON {\n primaryKeys: InstanceKeyJSON[];\n values: ValuesDictionary<ValueJSON>;\n displayValues: ValuesDictionary<DisplayValueJSON>;\n mergedFieldNames: string[];\n}\n\n/**\n * A group of raw values and their common display value.\n * @public\n */\nexport interface DisplayValueGroup {\n /** Common display value for all grouped raw values */\n displayValue: DisplayValue;\n /** A list of grouped raw values */\n groupedRawValues: Value[];\n}\n\n/**\n * JSON representation of [[DisplayValueGroup]].\n * @public\n */\nexport interface DisplayValueGroupJSON {\n displayValue: DisplayValueJSON;\n groupedRawValues: ValueJSON[];\n}\n\n/** @public */\nexport namespace DisplayValueGroup {\n /** Serialize [[DisplayValueGroup]] to JSON */\n export function toJSON(group: DisplayValueGroup): DisplayValueGroupJSON {\n return {\n displayValue: DisplayValue.toJSON(group.displayValue),\n groupedRawValues: group.groupedRawValues.map(Value.toJSON),\n };\n }\n\n /** Deserialize [[DisplayValueGroup]] from JSON */\n export function fromJSON(json: DisplayValueGroupJSON): DisplayValueGroup {\n return {\n displayValue: DisplayValue.fromJSON(json.displayValue),\n groupedRawValues: json.groupedRawValues.map(Value.fromJSON),\n };\n }\n}\n\nfunction isNestedContentValue(v: Value | ValueJSON): v is NestedContentValue[] | NestedContentValueJSON[] {\n return (v !== undefined) && Array.isArray(v)\n && ((v.length === 0)\n || (v[0] as NestedContentValue).primaryKeys !== undefined\n && (v[0] as NestedContentValue).values !== undefined\n && (v[0] as NestedContentValue).displayValues !== undefined\n && (v[0] as NestedContentValue).mergedFieldNames !== undefined);\n}\nfunction isArrayValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesArray | ValuesArrayJSON | DisplayValuesArray | DisplayValuesArrayJSON {\n // note: we don't guarantee by 100% that v is ValuesArray | DisplayValuesArray, but merely make compiler happy.\n // we have other means to determine the type of value.\n return (v !== undefined) && Array.isArray(v);\n}\nfunction isMapValue(v: Value | ValueJSON | DisplayValue | DisplayValueJSON): v is ValuesMap | ValuesMapJSON | DisplayValuesMap | DisplayValuesMapJSON {\n return (v !== undefined) && (typeof v === \"object\") && !Array.isArray(v);\n}\nfunction isPrimitiveValue(v: Value | DisplayValue): v is string | number | boolean | undefined {\n return !isArrayValue(v) && !isMapValue(v);\n}\n\nfunction valuesArrayFromJSON(json: ValuesArrayJSON): ValuesArray {\n return json.map(Value.fromJSON);\n}\nfunction valuesArrayToJSON(values: ValuesArray): ValuesArrayJSON {\n return values.map(Value.toJSON);\n}\nfunction valuesMapFromJSON(json: ValuesMapJSON): ValuesMap {\n const map: ValuesMap = {};\n for (const key in json) {\n /* istanbul ignore else */\n if (json.hasOwnProperty(key)) {\n map[key] = Value.fromJSON(json[key]);\n }\n }\n return map;\n}\nfunction valuesMapToJSON(values: ValuesMap): ValuesMapJSON {\n const map: ValuesMapJSON = {};\n for (const key in values) {\n /* istanbul ignore else */\n if (values.hasOwnProperty(key)) {\n map[key] = Value.toJSON(values[key]);\n }\n }\n return map;\n}\n\nfunction displayValuesArrayFromJSON(json: DisplayValuesArrayJSON): DisplayValuesArray {\n return json.map(DisplayValue.fromJSON);\n}\nfunction displayValuesArrayToJSON(values: DisplayValuesArray): DisplayValuesArrayJSON {\n return values.map(DisplayValue.toJSON);\n}\nfunction displayValuesMapFromJSON(json: DisplayValuesMapJSON): DisplayValuesMap {\n const map: DisplayValuesMap = {};\n for (const key in json) {\n /* istanbul ignore else */\n if (json.hasOwnProperty(key)) {\n map[key] = DisplayValue.fromJSON(json[key]);\n }\n }\n return map;\n}\nfunction displayValuesMapToJSON(values: DisplayValuesMap): DisplayValuesMapJSON {\n const map: DisplayValuesMapJSON = {};\n for (const key in values) {\n /* istanbul ignore else */\n if (values.hasOwnProperty(key)) {\n map[key] = DisplayValue.toJSON(values[key]);\n }\n }\n return map;\n}\n"]}