@itwin/presentation-common 4.0.0-dev.10 → 4.0.0-dev.101

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 (557) hide show
  1. package/CHANGELOG.md +61 -1
  2. package/Ruleset.schema.json +15 -0
  3. package/lib/cjs/assets/locales/en/Presentation.json +19 -0
  4. package/lib/cjs/assets/locales/en-PSEUDO/Presentation.json +19 -0
  5. package/lib/cjs/presentation-common/AsyncTasks.d.ts +22 -22
  6. package/lib/cjs/presentation-common/AsyncTasks.js +38 -38
  7. package/lib/cjs/presentation-common/AsyncTasks.js.map +1 -1
  8. package/lib/cjs/presentation-common/CommonLoggerCategory.d.ts +12 -12
  9. package/lib/cjs/presentation-common/CommonLoggerCategory.js +20 -20
  10. package/lib/cjs/presentation-common/CommonLoggerCategory.js.map +1 -1
  11. package/lib/cjs/presentation-common/Diagnostics.d.ts +125 -125
  12. package/lib/cjs/presentation-common/Diagnostics.d.ts.map +1 -1
  13. package/lib/cjs/presentation-common/Diagnostics.js +72 -72
  14. package/lib/cjs/presentation-common/Diagnostics.js.map +1 -1
  15. package/lib/cjs/presentation-common/EC.d.ts +347 -350
  16. package/lib/cjs/presentation-common/EC.d.ts.map +1 -1
  17. package/lib/cjs/presentation-common/EC.js +290 -290
  18. package/lib/cjs/presentation-common/EC.js.map +1 -1
  19. package/lib/cjs/presentation-common/ElementProperties.d.ts +123 -123
  20. package/lib/cjs/presentation-common/ElementProperties.d.ts.map +1 -1
  21. package/lib/cjs/presentation-common/ElementProperties.js +9 -9
  22. package/lib/cjs/presentation-common/ElementProperties.js.map +1 -1
  23. package/lib/cjs/presentation-common/Error.d.ts +47 -45
  24. package/lib/cjs/presentation-common/Error.d.ts.map +1 -1
  25. package/lib/cjs/presentation-common/Error.js +64 -62
  26. package/lib/cjs/presentation-common/Error.js.map +1 -1
  27. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts +93 -93
  28. package/lib/cjs/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  29. package/lib/cjs/presentation-common/InstanceFilterDefinition.js +9 -9
  30. package/lib/cjs/presentation-common/InstanceFilterDefinition.js.map +1 -1
  31. package/lib/cjs/presentation-common/KeySet.d.ts +146 -146
  32. package/lib/cjs/presentation-common/KeySet.d.ts.map +1 -1
  33. package/lib/cjs/presentation-common/KeySet.js +428 -428
  34. package/lib/cjs/presentation-common/KeySet.js.map +1 -1
  35. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts +20 -0
  36. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
  37. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js +125 -0
  38. package/lib/cjs/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
  39. package/lib/cjs/presentation-common/LabelDefinition.d.ts +93 -87
  40. package/lib/cjs/presentation-common/LabelDefinition.d.ts.map +1 -1
  41. package/lib/cjs/presentation-common/LabelDefinition.js +78 -73
  42. package/lib/cjs/presentation-common/LabelDefinition.js.map +1 -1
  43. package/lib/cjs/presentation-common/LocalizationHelper.d.ts +29 -29
  44. package/lib/cjs/presentation-common/LocalizationHelper.d.ts.map +1 -1
  45. package/lib/cjs/presentation-common/LocalizationHelper.js +113 -110
  46. package/lib/cjs/presentation-common/LocalizationHelper.js.map +1 -1
  47. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts +27 -40
  48. package/lib/cjs/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  49. package/lib/cjs/presentation-common/PresentationIpcInterface.js +12 -12
  50. package/lib/cjs/presentation-common/PresentationIpcInterface.js.map +1 -1
  51. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts +279 -261
  52. package/lib/cjs/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  53. package/lib/cjs/presentation-common/PresentationManagerOptions.js +23 -23
  54. package/lib/cjs/presentation-common/PresentationManagerOptions.js.map +1 -1
  55. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts +186 -186
  56. package/lib/cjs/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  57. package/lib/cjs/presentation-common/PresentationRpcInterface.js +108 -104
  58. package/lib/cjs/presentation-common/PresentationRpcInterface.js.map +1 -1
  59. package/lib/cjs/presentation-common/RegisteredRuleset.d.ts +26 -26
  60. package/lib/cjs/presentation-common/RegisteredRuleset.js +33 -33
  61. package/lib/cjs/presentation-common/RegisteredRuleset.js.map +1 -1
  62. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts +82 -83
  63. package/lib/cjs/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  64. package/lib/cjs/presentation-common/RpcRequestsHandler.js +166 -171
  65. package/lib/cjs/presentation-common/RpcRequestsHandler.js.map +1 -1
  66. package/lib/cjs/presentation-common/RulesetVariables.d.ts +171 -171
  67. package/lib/cjs/presentation-common/RulesetVariables.d.ts.map +1 -1
  68. package/lib/cjs/presentation-common/RulesetVariables.js +55 -55
  69. package/lib/cjs/presentation-common/RulesetVariables.js.map +1 -1
  70. package/lib/cjs/presentation-common/RulesetsFactory.d.ts +44 -44
  71. package/lib/cjs/presentation-common/RulesetsFactory.d.ts.map +1 -1
  72. package/lib/cjs/presentation-common/RulesetsFactory.js +223 -223
  73. package/lib/cjs/presentation-common/RulesetsFactory.js.map +1 -1
  74. package/lib/cjs/presentation-common/Update.d.ts +150 -213
  75. package/lib/cjs/presentation-common/Update.d.ts.map +1 -1
  76. package/lib/cjs/presentation-common/Update.js +114 -226
  77. package/lib/cjs/presentation-common/Update.js.map +1 -1
  78. package/lib/cjs/presentation-common/Utils.d.ts +62 -62
  79. package/lib/cjs/presentation-common/Utils.d.ts.map +1 -1
  80. package/lib/cjs/presentation-common/Utils.js +43 -43
  81. package/lib/cjs/presentation-common/Utils.js.map +1 -1
  82. package/lib/cjs/presentation-common/content/Category.d.ts +49 -49
  83. package/lib/cjs/presentation-common/content/Category.js +48 -48
  84. package/lib/cjs/presentation-common/content/Category.js.map +1 -1
  85. package/lib/cjs/presentation-common/content/Content.d.ts +38 -38
  86. package/lib/cjs/presentation-common/content/Content.js +56 -56
  87. package/lib/cjs/presentation-common/content/Content.js.map +1 -1
  88. package/lib/cjs/presentation-common/content/ContentTraverser.d.ts +271 -271
  89. package/lib/cjs/presentation-common/content/ContentTraverser.js +437 -439
  90. package/lib/cjs/presentation-common/content/ContentTraverser.js.map +1 -1
  91. package/lib/cjs/presentation-common/content/Descriptor.d.ts +328 -328
  92. package/lib/cjs/presentation-common/content/Descriptor.js +191 -193
  93. package/lib/cjs/presentation-common/content/Descriptor.js.map +1 -1
  94. package/lib/cjs/presentation-common/content/DisplayTypes.d.ts +21 -21
  95. package/lib/cjs/presentation-common/content/DisplayTypes.js +29 -29
  96. package/lib/cjs/presentation-common/content/DisplayTypes.js.map +1 -1
  97. package/lib/cjs/presentation-common/content/Editor.d.ts +15 -15
  98. package/lib/cjs/presentation-common/content/Editor.js +9 -9
  99. package/lib/cjs/presentation-common/content/Editor.js.map +1 -1
  100. package/lib/cjs/presentation-common/content/Fields.d.ts +298 -301
  101. package/lib/cjs/presentation-common/content/Fields.d.ts.map +1 -1
  102. package/lib/cjs/presentation-common/content/Fields.js +393 -397
  103. package/lib/cjs/presentation-common/content/Fields.js.map +1 -1
  104. package/lib/cjs/presentation-common/content/Item.d.ts +85 -85
  105. package/lib/cjs/presentation-common/content/Item.d.ts.map +1 -1
  106. package/lib/cjs/presentation-common/content/Item.js +84 -84
  107. package/lib/cjs/presentation-common/content/Item.js.map +1 -1
  108. package/lib/cjs/presentation-common/content/Property.d.ts +57 -57
  109. package/lib/cjs/presentation-common/content/Property.d.ts.map +1 -1
  110. package/lib/cjs/presentation-common/content/Property.js +40 -40
  111. package/lib/cjs/presentation-common/content/Property.js.map +1 -1
  112. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
  113. package/lib/cjs/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
  114. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js +139 -0
  115. package/lib/cjs/presentation-common/content/PropertyValueFormatter.js.map +1 -0
  116. package/lib/cjs/presentation-common/content/Renderer.d.ts +11 -11
  117. package/lib/cjs/presentation-common/content/Renderer.js +9 -9
  118. package/lib/cjs/presentation-common/content/Renderer.js.map +1 -1
  119. package/lib/cjs/presentation-common/content/TypeDescription.d.ts +72 -72
  120. package/lib/cjs/presentation-common/content/TypeDescription.d.ts.map +1 -1
  121. package/lib/cjs/presentation-common/content/TypeDescription.js +23 -23
  122. package/lib/cjs/presentation-common/content/TypeDescription.js.map +1 -1
  123. package/lib/cjs/presentation-common/content/Value.d.ts +204 -189
  124. package/lib/cjs/presentation-common/content/Value.d.ts.map +1 -1
  125. package/lib/cjs/presentation-common/content/Value.js +281 -273
  126. package/lib/cjs/presentation-common/content/Value.js.map +1 -1
  127. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.d.ts +37 -37
  128. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js +31 -31
  129. package/lib/cjs/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  130. package/lib/cjs/presentation-common/hierarchy/Key.d.ts +246 -246
  131. package/lib/cjs/presentation-common/hierarchy/Key.d.ts.map +1 -1
  132. package/lib/cjs/presentation-common/hierarchy/Key.js +121 -121
  133. package/lib/cjs/presentation-common/hierarchy/Key.js.map +1 -1
  134. package/lib/cjs/presentation-common/hierarchy/Node.d.ts +154 -154
  135. package/lib/cjs/presentation-common/hierarchy/Node.d.ts.map +1 -1
  136. package/lib/cjs/presentation-common/hierarchy/Node.js +106 -106
  137. package/lib/cjs/presentation-common/hierarchy/Node.js.map +1 -1
  138. package/lib/cjs/presentation-common/hierarchy/NodePathElement.d.ts +96 -96
  139. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js +122 -122
  140. package/lib/cjs/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  141. package/lib/cjs/presentation-common/rules/ClassSpecifications.d.ts +45 -45
  142. package/lib/cjs/presentation-common/rules/ClassSpecifications.js +9 -9
  143. package/lib/cjs/presentation-common/rules/ClassSpecifications.js.map +1 -1
  144. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.d.ts +31 -31
  145. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js +9 -9
  146. package/lib/cjs/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  147. package/lib/cjs/presentation-common/rules/RelationshipDirection.d.ts +13 -13
  148. package/lib/cjs/presentation-common/rules/RelationshipDirection.js +21 -21
  149. package/lib/cjs/presentation-common/rules/RelationshipDirection.js.map +1 -1
  150. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts +56 -56
  151. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  152. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js +9 -9
  153. package/lib/cjs/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  154. package/lib/cjs/presentation-common/rules/Rule.d.ts +76 -76
  155. package/lib/cjs/presentation-common/rules/Rule.js +35 -35
  156. package/lib/cjs/presentation-common/rules/Rule.js.map +1 -1
  157. package/lib/cjs/presentation-common/rules/Ruleset.d.ts +65 -65
  158. package/lib/cjs/presentation-common/rules/Ruleset.js +9 -9
  159. package/lib/cjs/presentation-common/rules/Ruleset.js.map +1 -1
  160. package/lib/cjs/presentation-common/rules/SchemasSpecification.d.ts +41 -41
  161. package/lib/cjs/presentation-common/rules/SchemasSpecification.js +9 -9
  162. package/lib/cjs/presentation-common/rules/SchemasSpecification.js.map +1 -1
  163. package/lib/cjs/presentation-common/rules/Variables.d.ts +58 -58
  164. package/lib/cjs/presentation-common/rules/Variables.js +25 -25
  165. package/lib/cjs/presentation-common/rules/Variables.js.map +1 -1
  166. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +41 -41
  167. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +9 -9
  168. package/lib/cjs/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  169. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +25 -25
  170. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +9 -9
  171. package/lib/cjs/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  172. package/lib/cjs/presentation-common/rules/content/ContentRule.d.ts +30 -30
  173. package/lib/cjs/presentation-common/rules/content/ContentRule.js +9 -9
  174. package/lib/cjs/presentation-common/rules/content/ContentRule.js.map +1 -1
  175. package/lib/cjs/presentation-common/rules/content/ContentSpecification.d.ts +58 -58
  176. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js +20 -20
  177. package/lib/cjs/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  178. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +19 -19
  179. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +9 -9
  180. package/lib/cjs/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  181. package/lib/cjs/presentation-common/rules/content/PropertySpecification.d.ts +86 -86
  182. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js +9 -9
  183. package/lib/cjs/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  184. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +28 -28
  185. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +9 -9
  186. package/lib/cjs/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  187. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +25 -25
  188. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +9 -9
  189. package/lib/cjs/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  190. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts +64 -57
  191. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  192. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js +9 -9
  193. package/lib/cjs/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  194. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.d.ts +17 -17
  195. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +9 -9
  196. package/lib/cjs/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  197. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +107 -107
  198. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.map +1 -1
  199. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +9 -9
  200. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  201. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +108 -108
  202. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +21 -21
  203. package/lib/cjs/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  204. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +96 -96
  205. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +43 -43
  206. package/lib/cjs/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  207. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.d.ts +44 -44
  208. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js +9 -9
  209. package/lib/cjs/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  210. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.d.ts +36 -36
  211. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js +9 -9
  212. package/lib/cjs/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  213. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.d.ts +27 -27
  214. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js +9 -9
  215. package/lib/cjs/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  216. package/lib/cjs/presentation-common/rules/customization/GroupingRule.d.ts +207 -207
  217. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js +51 -51
  218. package/lib/cjs/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  219. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.d.ts +29 -29
  220. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js +9 -9
  221. package/lib/cjs/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  222. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts +158 -158
  223. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  224. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js +25 -25
  225. package/lib/cjs/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  226. package/lib/cjs/presentation-common/rules/customization/LabelOverride.d.ts +40 -40
  227. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js +9 -9
  228. package/lib/cjs/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  229. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts +58 -58
  230. package/lib/cjs/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  231. package/lib/cjs/presentation-common/rules/customization/SortingRule.js +9 -9
  232. package/lib/cjs/presentation-common/rules/customization/SortingRule.js.map +1 -1
  233. package/lib/cjs/presentation-common/rules/customization/StyleOverride.d.ts +48 -48
  234. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js +9 -9
  235. package/lib/cjs/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  236. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +14 -14
  237. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js +9 -9
  238. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  239. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +98 -98
  240. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  241. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js +21 -21
  242. package/lib/cjs/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  243. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +31 -31
  244. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js +9 -9
  245. package/lib/cjs/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  246. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +79 -79
  247. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +19 -19
  248. package/lib/cjs/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  249. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +39 -39
  250. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +9 -9
  251. package/lib/cjs/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  252. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts +50 -50
  253. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
  254. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js +9 -9
  255. package/lib/cjs/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  256. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +27 -27
  257. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js +9 -9
  258. package/lib/cjs/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  259. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +27 -27
  260. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +9 -9
  261. package/lib/cjs/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  262. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.d.ts +16 -16
  263. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js +9 -9
  264. package/lib/cjs/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  265. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.d.ts +35 -35
  266. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js +9 -9
  267. package/lib/cjs/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  268. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts +38 -38
  269. package/lib/cjs/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  270. package/lib/cjs/presentation-common/selection/SelectionScope.js +9 -9
  271. package/lib/cjs/presentation-common/selection/SelectionScope.js.map +1 -1
  272. package/lib/cjs/presentation-common.d.ts +114 -112
  273. package/lib/cjs/presentation-common.d.ts.map +1 -1
  274. package/lib/cjs/presentation-common.js +134 -128
  275. package/lib/cjs/presentation-common.js.map +1 -1
  276. package/lib/esm/presentation-common/AsyncTasks.d.ts +22 -22
  277. package/lib/esm/presentation-common/AsyncTasks.js +34 -34
  278. package/lib/esm/presentation-common/AsyncTasks.js.map +1 -1
  279. package/lib/esm/presentation-common/CommonLoggerCategory.d.ts +12 -12
  280. package/lib/esm/presentation-common/CommonLoggerCategory.js +17 -17
  281. package/lib/esm/presentation-common/CommonLoggerCategory.js.map +1 -1
  282. package/lib/esm/presentation-common/Diagnostics.d.ts +125 -125
  283. package/lib/esm/presentation-common/Diagnostics.d.ts.map +1 -1
  284. package/lib/esm/presentation-common/Diagnostics.js +67 -67
  285. package/lib/esm/presentation-common/Diagnostics.js.map +1 -1
  286. package/lib/esm/presentation-common/EC.d.ts +347 -350
  287. package/lib/esm/presentation-common/EC.d.ts.map +1 -1
  288. package/lib/esm/presentation-common/EC.js +287 -287
  289. package/lib/esm/presentation-common/EC.js.map +1 -1
  290. package/lib/esm/presentation-common/ElementProperties.d.ts +123 -123
  291. package/lib/esm/presentation-common/ElementProperties.d.ts.map +1 -1
  292. package/lib/esm/presentation-common/ElementProperties.js +8 -8
  293. package/lib/esm/presentation-common/ElementProperties.js.map +1 -1
  294. package/lib/esm/presentation-common/Error.d.ts +47 -45
  295. package/lib/esm/presentation-common/Error.d.ts.map +1 -1
  296. package/lib/esm/presentation-common/Error.js +60 -58
  297. package/lib/esm/presentation-common/Error.js.map +1 -1
  298. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts +93 -93
  299. package/lib/esm/presentation-common/InstanceFilterDefinition.d.ts.map +1 -1
  300. package/lib/esm/presentation-common/InstanceFilterDefinition.js +8 -8
  301. package/lib/esm/presentation-common/InstanceFilterDefinition.js.map +1 -1
  302. package/lib/esm/presentation-common/KeySet.d.ts +146 -146
  303. package/lib/esm/presentation-common/KeySet.d.ts.map +1 -1
  304. package/lib/esm/presentation-common/KeySet.js +424 -424
  305. package/lib/esm/presentation-common/KeySet.js.map +1 -1
  306. package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts +20 -0
  307. package/lib/esm/presentation-common/KoqPropertyValueFormatter.d.ts.map +1 -0
  308. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js +121 -0
  309. package/lib/esm/presentation-common/KoqPropertyValueFormatter.js.map +1 -0
  310. package/lib/esm/presentation-common/LabelDefinition.d.ts +93 -87
  311. package/lib/esm/presentation-common/LabelDefinition.d.ts.map +1 -1
  312. package/lib/esm/presentation-common/LabelDefinition.js +75 -70
  313. package/lib/esm/presentation-common/LabelDefinition.js.map +1 -1
  314. package/lib/esm/presentation-common/LocalizationHelper.d.ts +29 -29
  315. package/lib/esm/presentation-common/LocalizationHelper.d.ts.map +1 -1
  316. package/lib/esm/presentation-common/LocalizationHelper.js +109 -106
  317. package/lib/esm/presentation-common/LocalizationHelper.js.map +1 -1
  318. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts +27 -40
  319. package/lib/esm/presentation-common/PresentationIpcInterface.d.ts.map +1 -1
  320. package/lib/esm/presentation-common/PresentationIpcInterface.js +9 -9
  321. package/lib/esm/presentation-common/PresentationIpcInterface.js.map +1 -1
  322. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts +279 -261
  323. package/lib/esm/presentation-common/PresentationManagerOptions.d.ts.map +1 -1
  324. package/lib/esm/presentation-common/PresentationManagerOptions.js +18 -18
  325. package/lib/esm/presentation-common/PresentationManagerOptions.js.map +1 -1
  326. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts +186 -186
  327. package/lib/esm/presentation-common/PresentationRpcInterface.d.ts.map +1 -1
  328. package/lib/esm/presentation-common/PresentationRpcInterface.js +105 -100
  329. package/lib/esm/presentation-common/PresentationRpcInterface.js.map +1 -1
  330. package/lib/esm/presentation-common/RegisteredRuleset.d.ts +26 -26
  331. package/lib/esm/presentation-common/RegisteredRuleset.js +29 -29
  332. package/lib/esm/presentation-common/RegisteredRuleset.js.map +1 -1
  333. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts +82 -83
  334. package/lib/esm/presentation-common/RpcRequestsHandler.d.ts.map +1 -1
  335. package/lib/esm/presentation-common/RpcRequestsHandler.js +162 -167
  336. package/lib/esm/presentation-common/RpcRequestsHandler.js.map +1 -1
  337. package/lib/esm/presentation-common/RulesetVariables.d.ts +171 -171
  338. package/lib/esm/presentation-common/RulesetVariables.d.ts.map +1 -1
  339. package/lib/esm/presentation-common/RulesetVariables.js +52 -52
  340. package/lib/esm/presentation-common/RulesetVariables.js.map +1 -1
  341. package/lib/esm/presentation-common/RulesetsFactory.d.ts +44 -44
  342. package/lib/esm/presentation-common/RulesetsFactory.d.ts.map +1 -1
  343. package/lib/esm/presentation-common/RulesetsFactory.js +219 -219
  344. package/lib/esm/presentation-common/RulesetsFactory.js.map +1 -1
  345. package/lib/esm/presentation-common/Update.d.ts +150 -213
  346. package/lib/esm/presentation-common/Update.d.ts.map +1 -1
  347. package/lib/esm/presentation-common/Update.js +111 -223
  348. package/lib/esm/presentation-common/Update.js.map +1 -1
  349. package/lib/esm/presentation-common/Utils.d.ts +62 -62
  350. package/lib/esm/presentation-common/Utils.d.ts.map +1 -1
  351. package/lib/esm/presentation-common/Utils.js +39 -39
  352. package/lib/esm/presentation-common/Utils.js.map +1 -1
  353. package/lib/esm/presentation-common/content/Category.d.ts +49 -49
  354. package/lib/esm/presentation-common/content/Category.js +45 -45
  355. package/lib/esm/presentation-common/content/Category.js.map +1 -1
  356. package/lib/esm/presentation-common/content/Content.d.ts +38 -38
  357. package/lib/esm/presentation-common/content/Content.js +52 -52
  358. package/lib/esm/presentation-common/content/Content.js.map +1 -1
  359. package/lib/esm/presentation-common/content/ContentTraverser.d.ts +271 -271
  360. package/lib/esm/presentation-common/content/ContentTraverser.js +427 -429
  361. package/lib/esm/presentation-common/content/ContentTraverser.js.map +1 -1
  362. package/lib/esm/presentation-common/content/Descriptor.d.ts +328 -328
  363. package/lib/esm/presentation-common/content/Descriptor.js +187 -189
  364. package/lib/esm/presentation-common/content/Descriptor.js.map +1 -1
  365. package/lib/esm/presentation-common/content/DisplayTypes.d.ts +21 -21
  366. package/lib/esm/presentation-common/content/DisplayTypes.js +26 -26
  367. package/lib/esm/presentation-common/content/DisplayTypes.js.map +1 -1
  368. package/lib/esm/presentation-common/content/Editor.d.ts +15 -15
  369. package/lib/esm/presentation-common/content/Editor.js +8 -8
  370. package/lib/esm/presentation-common/content/Editor.js.map +1 -1
  371. package/lib/esm/presentation-common/content/Fields.d.ts +298 -301
  372. package/lib/esm/presentation-common/content/Fields.d.ts.map +1 -1
  373. package/lib/esm/presentation-common/content/Fields.js +386 -390
  374. package/lib/esm/presentation-common/content/Fields.js.map +1 -1
  375. package/lib/esm/presentation-common/content/Item.d.ts +85 -85
  376. package/lib/esm/presentation-common/content/Item.d.ts.map +1 -1
  377. package/lib/esm/presentation-common/content/Item.js +80 -80
  378. package/lib/esm/presentation-common/content/Item.js.map +1 -1
  379. package/lib/esm/presentation-common/content/Property.d.ts +57 -57
  380. package/lib/esm/presentation-common/content/Property.d.ts.map +1 -1
  381. package/lib/esm/presentation-common/content/Property.js +37 -37
  382. package/lib/esm/presentation-common/content/Property.js.map +1 -1
  383. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts +29 -0
  384. package/lib/esm/presentation-common/content/PropertyValueFormatter.d.ts.map +1 -0
  385. package/lib/esm/presentation-common/content/PropertyValueFormatter.js +134 -0
  386. package/lib/esm/presentation-common/content/PropertyValueFormatter.js.map +1 -0
  387. package/lib/esm/presentation-common/content/Renderer.d.ts +11 -11
  388. package/lib/esm/presentation-common/content/Renderer.js +8 -8
  389. package/lib/esm/presentation-common/content/Renderer.js.map +1 -1
  390. package/lib/esm/presentation-common/content/TypeDescription.d.ts +72 -72
  391. package/lib/esm/presentation-common/content/TypeDescription.d.ts.map +1 -1
  392. package/lib/esm/presentation-common/content/TypeDescription.js +20 -20
  393. package/lib/esm/presentation-common/content/TypeDescription.js.map +1 -1
  394. package/lib/esm/presentation-common/content/Value.d.ts +204 -189
  395. package/lib/esm/presentation-common/content/Value.d.ts.map +1 -1
  396. package/lib/esm/presentation-common/content/Value.js +278 -270
  397. package/lib/esm/presentation-common/content/Value.js.map +1 -1
  398. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.d.ts +37 -37
  399. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js +28 -28
  400. package/lib/esm/presentation-common/hierarchy/HierarchyLevel.js.map +1 -1
  401. package/lib/esm/presentation-common/hierarchy/Key.d.ts +246 -246
  402. package/lib/esm/presentation-common/hierarchy/Key.d.ts.map +1 -1
  403. package/lib/esm/presentation-common/hierarchy/Key.js +118 -118
  404. package/lib/esm/presentation-common/hierarchy/Key.js.map +1 -1
  405. package/lib/esm/presentation-common/hierarchy/Node.d.ts +154 -154
  406. package/lib/esm/presentation-common/hierarchy/Node.d.ts.map +1 -1
  407. package/lib/esm/presentation-common/hierarchy/Node.js +103 -103
  408. package/lib/esm/presentation-common/hierarchy/Node.js.map +1 -1
  409. package/lib/esm/presentation-common/hierarchy/NodePathElement.d.ts +96 -96
  410. package/lib/esm/presentation-common/hierarchy/NodePathElement.js +119 -119
  411. package/lib/esm/presentation-common/hierarchy/NodePathElement.js.map +1 -1
  412. package/lib/esm/presentation-common/rules/ClassSpecifications.d.ts +45 -45
  413. package/lib/esm/presentation-common/rules/ClassSpecifications.js +8 -8
  414. package/lib/esm/presentation-common/rules/ClassSpecifications.js.map +1 -1
  415. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.d.ts +31 -31
  416. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js +8 -8
  417. package/lib/esm/presentation-common/rules/RelatedInstanceSpecification.js.map +1 -1
  418. package/lib/esm/presentation-common/rules/RelationshipDirection.d.ts +13 -13
  419. package/lib/esm/presentation-common/rules/RelationshipDirection.js +18 -18
  420. package/lib/esm/presentation-common/rules/RelationshipDirection.js.map +1 -1
  421. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts +56 -56
  422. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.d.ts.map +1 -1
  423. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js +8 -8
  424. package/lib/esm/presentation-common/rules/RelationshipPathSpecification.js.map +1 -1
  425. package/lib/esm/presentation-common/rules/Rule.d.ts +76 -76
  426. package/lib/esm/presentation-common/rules/Rule.js +32 -32
  427. package/lib/esm/presentation-common/rules/Rule.js.map +1 -1
  428. package/lib/esm/presentation-common/rules/Ruleset.d.ts +65 -65
  429. package/lib/esm/presentation-common/rules/Ruleset.js +8 -8
  430. package/lib/esm/presentation-common/rules/Ruleset.js.map +1 -1
  431. package/lib/esm/presentation-common/rules/SchemasSpecification.d.ts +41 -41
  432. package/lib/esm/presentation-common/rules/SchemasSpecification.js +8 -8
  433. package/lib/esm/presentation-common/rules/SchemasSpecification.js.map +1 -1
  434. package/lib/esm/presentation-common/rules/Variables.d.ts +58 -58
  435. package/lib/esm/presentation-common/rules/Variables.js +22 -22
  436. package/lib/esm/presentation-common/rules/Variables.js.map +1 -1
  437. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.d.ts +41 -41
  438. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js +8 -8
  439. package/lib/esm/presentation-common/rules/content/ContentInstancesOfSpecificClassesSpecification.js.map +1 -1
  440. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.d.ts +25 -25
  441. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js +8 -8
  442. package/lib/esm/presentation-common/rules/content/ContentRelatedInstancesSpecification.js.map +1 -1
  443. package/lib/esm/presentation-common/rules/content/ContentRule.d.ts +30 -30
  444. package/lib/esm/presentation-common/rules/content/ContentRule.js +8 -8
  445. package/lib/esm/presentation-common/rules/content/ContentRule.js.map +1 -1
  446. package/lib/esm/presentation-common/rules/content/ContentSpecification.d.ts +58 -58
  447. package/lib/esm/presentation-common/rules/content/ContentSpecification.js +17 -17
  448. package/lib/esm/presentation-common/rules/content/ContentSpecification.js.map +1 -1
  449. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.d.ts +19 -19
  450. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js +8 -8
  451. package/lib/esm/presentation-common/rules/content/DefaultPropertyCategoryOverride.js.map +1 -1
  452. package/lib/esm/presentation-common/rules/content/PropertySpecification.d.ts +86 -86
  453. package/lib/esm/presentation-common/rules/content/PropertySpecification.js +8 -8
  454. package/lib/esm/presentation-common/rules/content/PropertySpecification.js.map +1 -1
  455. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.d.ts +28 -28
  456. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js +8 -8
  457. package/lib/esm/presentation-common/rules/content/SelectedNodeInstancesSpecification.js.map +1 -1
  458. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.d.ts +25 -25
  459. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js +8 -8
  460. package/lib/esm/presentation-common/rules/content/modifiers/CalculatedPropertiesSpecification.js.map +1 -1
  461. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts +64 -57
  462. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.d.ts.map +1 -1
  463. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js +8 -8
  464. package/lib/esm/presentation-common/rules/content/modifiers/ContentModifier.js.map +1 -1
  465. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.d.ts +17 -17
  466. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js +8 -8
  467. package/lib/esm/presentation-common/rules/content/modifiers/CustomRendererSpecification.js.map +1 -1
  468. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts +107 -107
  469. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.d.ts.map +1 -1
  470. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js +8 -8
  471. package/lib/esm/presentation-common/rules/content/modifiers/PropertyCategorySpecification.js.map +1 -1
  472. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.d.ts +108 -108
  473. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js +18 -18
  474. package/lib/esm/presentation-common/rules/content/modifiers/PropertyEditorsSpecification.js.map +1 -1
  475. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.d.ts +96 -96
  476. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js +40 -40
  477. package/lib/esm/presentation-common/rules/content/modifiers/RelatedPropertiesSpecification.js.map +1 -1
  478. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.d.ts +44 -44
  479. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js +8 -8
  480. package/lib/esm/presentation-common/rules/customization/CheckBoxRule.js.map +1 -1
  481. package/lib/esm/presentation-common/rules/customization/CustomizationRule.d.ts +36 -36
  482. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js +8 -8
  483. package/lib/esm/presentation-common/rules/customization/CustomizationRule.js.map +1 -1
  484. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.d.ts +27 -27
  485. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js +8 -8
  486. package/lib/esm/presentation-common/rules/customization/ExtendedDataRule.js.map +1 -1
  487. package/lib/esm/presentation-common/rules/customization/GroupingRule.d.ts +207 -207
  488. package/lib/esm/presentation-common/rules/customization/GroupingRule.js +48 -48
  489. package/lib/esm/presentation-common/rules/customization/GroupingRule.js.map +1 -1
  490. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.d.ts +29 -29
  491. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js +8 -8
  492. package/lib/esm/presentation-common/rules/customization/ImageIdOverride.js.map +1 -1
  493. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts +158 -158
  494. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.d.ts.map +1 -1
  495. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js +22 -22
  496. package/lib/esm/presentation-common/rules/customization/InstanceLabelOverride.js.map +1 -1
  497. package/lib/esm/presentation-common/rules/customization/LabelOverride.d.ts +40 -40
  498. package/lib/esm/presentation-common/rules/customization/LabelOverride.js +8 -8
  499. package/lib/esm/presentation-common/rules/customization/LabelOverride.js.map +1 -1
  500. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts +58 -58
  501. package/lib/esm/presentation-common/rules/customization/SortingRule.d.ts.map +1 -1
  502. package/lib/esm/presentation-common/rules/customization/SortingRule.js +8 -8
  503. package/lib/esm/presentation-common/rules/customization/SortingRule.js.map +1 -1
  504. package/lib/esm/presentation-common/rules/customization/StyleOverride.d.ts +48 -48
  505. package/lib/esm/presentation-common/rules/customization/StyleOverride.js +8 -8
  506. package/lib/esm/presentation-common/rules/customization/StyleOverride.js.map +1 -1
  507. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.d.ts +14 -14
  508. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js +8 -8
  509. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeRule.js.map +1 -1
  510. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts +98 -98
  511. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.d.ts.map +1 -1
  512. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js +18 -18
  513. package/lib/esm/presentation-common/rules/hierarchy/ChildNodeSpecification.js.map +1 -1
  514. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.d.ts +31 -31
  515. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js +8 -8
  516. package/lib/esm/presentation-common/rules/hierarchy/CustomNodeSpecification.js.map +1 -1
  517. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.d.ts +79 -79
  518. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js +16 -16
  519. package/lib/esm/presentation-common/rules/hierarchy/CustomQueryInstanceNodesSpecification.js.map +1 -1
  520. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.d.ts +39 -39
  521. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js +8 -8
  522. package/lib/esm/presentation-common/rules/hierarchy/InstanceNodesOfSpecificClassesSpecification.js.map +1 -1
  523. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts +50 -50
  524. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.d.ts.map +1 -1
  525. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js +8 -8
  526. package/lib/esm/presentation-common/rules/hierarchy/NavigationRule.js.map +1 -1
  527. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.d.ts +27 -27
  528. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js +8 -8
  529. package/lib/esm/presentation-common/rules/hierarchy/NodeArtifactsRule.js.map +1 -1
  530. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.d.ts +27 -27
  531. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js +8 -8
  532. package/lib/esm/presentation-common/rules/hierarchy/RelatedInstanceNodesSpecification.js.map +1 -1
  533. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.d.ts +16 -16
  534. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js +8 -8
  535. package/lib/esm/presentation-common/rules/hierarchy/RootNodeRule.js.map +1 -1
  536. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.d.ts +35 -35
  537. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js +8 -8
  538. package/lib/esm/presentation-common/rules/hierarchy/SubCondition.js.map +1 -1
  539. package/lib/esm/presentation-common/selection/SelectionScope.d.ts +38 -38
  540. package/lib/esm/presentation-common/selection/SelectionScope.d.ts.map +1 -1
  541. package/lib/esm/presentation-common/selection/SelectionScope.js +8 -8
  542. package/lib/esm/presentation-common/selection/SelectionScope.js.map +1 -1
  543. package/lib/esm/presentation-common.d.ts +114 -112
  544. package/lib/esm/presentation-common.d.ts.map +1 -1
  545. package/lib/esm/presentation-common.js +118 -116
  546. package/lib/esm/presentation-common.js.map +1 -1
  547. package/lib/public/locales/en/Presentation.json +19 -0
  548. package/package.json +19 -18
  549. package/lib/cjs/assets/locales/en/BisCore.json +0 -18
  550. package/lib/cjs/assets/locales/en/ECPresentation.json +0 -9
  551. package/lib/cjs/assets/locales/en/RulesEngine.json +0 -6
  552. package/lib/cjs/assets/locales/en-PSEUDO/BisCore.json +0 -18
  553. package/lib/cjs/assets/locales/en-PSEUDO/ECPresentation.json +0 -9
  554. package/lib/cjs/assets/locales/en-PSEUDO/RulesEngine.json +0 -6
  555. package/lib/public/locales/en/BisCore.json +0 -18
  556. package/lib/public/locales/en/ECPresentation.json +0 -9
  557. package/lib/public/locales/en/RulesEngine.json +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"KeySet.js","sourceRoot":"","sources":["../../../src/presentation-common/KeySet.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4F;AAG5F,mCAAgE;AAChE,yCAAuD;AAQvD,cAAc;AACd,IAAiB,GAAG,CAenB;AAfD,WAAiB,GAAG;IAClB,+CAA+C;IAC/C,SAAgB,SAAS,CAAC,GAAQ;QAChC,OAAO,CAAC,CAAE,GAAe,CAAC,IAAI,CAAC;IACjC,CAAC;IAFe,aAAS,YAExB,CAAA;IAED,oDAAoD;IACpD,SAAgB,aAAa,CAAC,GAAQ;QACpC,OAAO,CAAC,CAAE,GAAmB,CAAC,SAAS,IAAI,CAAC,CAAE,GAAmB,CAAC,EAAE,CAAC;IACvE,CAAC;IAFe,iBAAa,gBAE5B,CAAA;IAED,oDAAoD;IACpD,SAAgB,aAAa,CAAC,GAAQ;QACpC,OAAO,CAAC,CAAE,GAAmB,CAAC,aAAa,IAAI,CAAC,CAAE,GAAmB,CAAC,EAAE,CAAC;IAC3E,CAAC;IAFe,iBAAa,gBAE5B,CAAA;AACH,CAAC,EAfgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAenB;AAoBD;;;;;GAKG;AACH,MAAa,MAAM;IAOjB;;;OAGG;IACH,YAAY,MAAa;QACvB,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,MAAM;YACR,IAAI,CAAC,GAAG,CAAC,MAAM,C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------------------------------------------------------------------------------\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 Core\r\n */\r\n\r\nimport { CompressedId64Set, Guid, GuidString, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { EntityProps } from \"@itwin/core-common\";\r\nimport { InstanceId, InstanceKey } from \"./EC\";\r\nimport { PresentationError, PresentationStatus } from \"./Error\";\r\nimport { NodeKey, NodeKeyJSON } from \"./hierarchy/Key\";\r\n\r\n/**\r\n * A single key that identifies something in an iTwin.js application\r\n * @public\r\n */\r\nexport type Key = Readonly<NodeKey> | Readonly<InstanceKey> | Readonly<EntityProps>;\r\n\r\n/** @public */\r\nexport namespace Key { // eslint-disable-line @typescript-eslint/no-redeclare\r\n /** Check if the supplied key is a `NodeKey` */\r\n export function isNodeKey(key: Key): key is NodeKey {\r\n return !!(key as NodeKey).type;\r\n }\r\n\r\n /** Check if the supplied key is an `InstanceKey` */\r\n export function isInstanceKey(key: Key): key is InstanceKey {\r\n return !!(key as InstanceKey).className && !!(key as InstanceKey).id;\r\n }\r\n\r\n /** Check if the supplied key is an `EntityProps` */\r\n export function isEntityProps(key: Key): key is EntityProps {\r\n return !!(key as EntityProps).classFullName && !!(key as EntityProps).id;\r\n }\r\n}\r\n\r\n/**\r\n * A type for multiple keys that identify something in iModel.js application\r\n * @public\r\n */\r\nexport type Keys = ReadonlyArray<Key> | Readonly<KeySet>;\r\n\r\n/**\r\n * A data structure of serialized [[KeySet]]\r\n * @public\r\n */\r\nexport interface KeySetJSON {\r\n /** JSON representation of a list of instance keys */\r\n instanceKeys: Array<[string, string]>;\r\n /** An array of serialized node keys */\r\n // eslint-disable-next-line deprecation/deprecation\r\n nodeKeys: NodeKeyJSON[];\r\n}\r\n\r\n/**\r\n * A class that holds multiple [[Key]] objects. It's basically\r\n * used as a container that holds multiple keys of different types.\r\n *\r\n * @public\r\n */\r\nexport class KeySet {\r\n // note: all keys are stored as strings because we need ability to find them by value\r\n private _instanceKeys: Map<string, Set<string>>; // lower case class name => instance ids\r\n private _lowerCaseMap: Map<string, string>; // lower case class name => most recent class name\r\n private _nodeKeys: Set<string>;\r\n private _guid!: GuidString;\r\n\r\n /**\r\n * Creates an instance of KeySet.\r\n * @param source Optional source to initialize from.\r\n */\r\n constructor(source?: Keys) {\r\n this._instanceKeys = new Map();\r\n this._lowerCaseMap = new Map();\r\n this._nodeKeys = new Set();\r\n this.recalculateGuid();\r\n if (source)\r\n this.add(source);\r\n }\r\n\r\n private recalculateGuid() {\r\n // empty keyset should have empty guid, otherwise use a random guid value\r\n this._guid = this.isEmpty ? Guid.empty : Guid.createValue();\r\n }\r\n\r\n /**\r\n * Get a GUID that identifies changes in this keyset. The value\r\n * does not uniquely identify contents of the keyset, but it can be\r\n * used to check whether keyset has changed.\r\n */\r\n public get guid(): GuidString { return this._guid; }\r\n\r\n /**\r\n * Get a map of instance keys stored in this KeySet\r\n *\r\n * **Warning**: getting instance keys might be expensive for\r\n * large KeySets.\r\n */\r\n public get instanceKeys(): Map<string, Set<InstanceId>> {\r\n const map = new Map<string, Set<InstanceId>>();\r\n for (const entry of this._instanceKeys)\r\n map.set(this._lowerCaseMap.get(entry[\"0\"])!, new Set([...entry[\"1\"]].map((key: string) => Id64.fromJSON(key))));\r\n return map;\r\n }\r\n\r\n /**\r\n * Get instance keys count\r\n */\r\n public get instanceKeysCount(): number {\r\n let count = 0;\r\n this._instanceKeys.forEach((set: Set<string>) => count += set.size);\r\n return count;\r\n }\r\n\r\n /**\r\n * Get a set of node keys stored in this KeySet\r\n *\r\n * **Warning**: getting node keys might be expensive for\r\n * large KeySets.\r\n */\r\n public get nodeKeys(): Set<NodeKey> {\r\n const set = new Set<NodeKey>();\r\n for (const serialized of this._nodeKeys) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n const key = NodeKey.fromJSON(JSON.parse(serialized));\r\n set.add(key);\r\n }\r\n return set;\r\n }\r\n\r\n /**\r\n * Get node keys count\r\n */\r\n public get nodeKeysCount(): number {\r\n return this._nodeKeys.size;\r\n }\r\n\r\n private isKeySet(set: Keys | Key): set is Readonly<KeySet> {\r\n return !!(set as KeySet)._nodeKeys && !!(set as KeySet)._instanceKeys;\r\n }\r\n\r\n private isKeysArray(keys: Keys | Key): keys is ReadonlyArray<Key> {\r\n return Array.isArray(keys);\r\n }\r\n\r\n /**\r\n * Clear this KeySet.\r\n * @returns itself\r\n */\r\n public clear(): KeySet {\r\n if (this.isEmpty)\r\n return this;\r\n\r\n this._instanceKeys = new Map();\r\n this._lowerCaseMap = new Map();\r\n this._nodeKeys = new Set();\r\n this.recalculateGuid();\r\n return this;\r\n }\r\n\r\n private addKeySet(keyset: Readonly<KeySet>, pred?: (key: Key) => boolean): void {\r\n for (const key of (keyset as any)._nodeKeys) {\r\n // eslint-disable-next-line deprecation/deprecation\r\n if (!pred || pred(NodeKey.fromJSON(JSON.parse(key))))\r\n this._nodeKeys.add(key);\r\n }\r\n for (const entry of (keyset as any)._instanceKeys) {\r\n let set = this._instanceKeys.get(entry[\"0\"]);\r\n const className = (keyset as KeySet)._lowerCaseMap.get(entry[\"0\"])!;\r\n if (!set) {\r\n set = new Set();\r\n this._instanceKeys.set(entry[\"0\"], set);\r\n this._lowerCaseMap.set(entry[\"0\"], className);\r\n }\r\n entry[\"1\"].forEach((id: Id64String) => {\r\n if (!pred || pred({ className, id }))\r\n set!.add(id);\r\n });\r\n }\r\n }\r\n\r\n private addKeySetJSON(keyset: Readonly<KeySetJSON>): void {\r\n for (const key of keyset.nodeKeys)\r\n this._nodeKeys.add(JSON.stringify(key));\r\n for (const entry of keyset.instanceKeys) {\r\n const lcClassName = entry[\"0\"].toLowerCase();\r\n const idsJson: string | Id64String[] = entry[\"1\"];\r\n const ids: Set<Id64String> =\r\n typeof idsJson === \"string\"\r\n ? idsJson === Id64.invalid\r\n ? new Set([Id64.invalid])\r\n : CompressedId64Set.decompressSet(idsJson)\r\n : new Set(idsJson);\r\n this._instanceKeys.set(lcClassName, ids);\r\n this._lowerCaseMap.set(lcClassName, entry[\"0\"]);\r\n }\r\n }\r\n\r\n /**\r\n * Add a key or keys to this KeySet.\r\n * @param value A key or keys to add.\r\n * @param pred An optional predicate function that indicates whether a key should be added\r\n * @returns itself\r\n */\r\n public add(value: Keys | Key, pred?: (key: Key) => boolean): KeySet {\r\n if (!value)\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\r\n const sizeBefore = this.size;\r\n if (this.isKeySet(value)) {\r\n this.addKeySet(value, pred);\r\n } else if (this.isKeysArray(value)) {\r\n value.forEach((key) => this.add(key, pred));\r\n } else if (!pred || pred(value)) {\r\n if (Key.isEntityProps(value)) {\r\n this.add({ className: value.classFullName, id: Id64.fromJSON(value.id) } as InstanceKey);\r\n } else if (Key.isInstanceKey(value)) {\r\n const lcClassName = value.className.toLowerCase();\r\n if (!this._instanceKeys.has(lcClassName)) {\r\n this._instanceKeys.set(lcClassName, new Set());\r\n this._lowerCaseMap.set(lcClassName, value.className);\r\n }\r\n this._lowerCaseMap.set(lcClassName, value.className);\r\n this._instanceKeys.get(lcClassName)!.add(value.id);\r\n } else if (Key.isNodeKey(value)) {\r\n this._nodeKeys.add(JSON.stringify(value));\r\n } else {\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\r\n }\r\n }\r\n if (this.size !== sizeBefore)\r\n this.recalculateGuid();\r\n return this;\r\n }\r\n\r\n private deleteKeySet(keyset: Readonly<KeySet>): void {\r\n for (const key of (keyset as any)._nodeKeys)\r\n this._nodeKeys.delete(key);\r\n for (const entry of (keyset as any)._instanceKeys) {\r\n const set = this._instanceKeys.get(entry[\"0\"].toLowerCase());\r\n if (set) {\r\n entry[\"1\"].forEach((key: string) => {\r\n set.delete(key);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a key or keys from this KeySet.\r\n * @param value A key or keys to delete.\r\n * @returns itself\r\n */\r\n public delete(value: Keys | Key): KeySet {\r\n if (!value)\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\r\n const sizeBefore = this.size;\r\n if (this.isKeySet(value)) {\r\n this.deleteKeySet(value);\r\n } else if (this.isKeysArray(value)) {\r\n for (const key of value)\r\n this.delete(key);\r\n } else if (Key.isEntityProps(value)) {\r\n this.delete({ className: value.classFullName, id: value.id! } as InstanceKey);\r\n } else if (Key.isInstanceKey(value)) {\r\n const set = this._instanceKeys.get(value.className.toLowerCase());\r\n if (set)\r\n set.delete(value.id);\r\n } else if (Key.isNodeKey(value)) {\r\n this._nodeKeys.delete(JSON.stringify(value));\r\n } else {\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\r\n }\r\n if (this.size !== sizeBefore)\r\n this.recalculateGuid();\r\n return this;\r\n }\r\n\r\n /**\r\n * Check if this KeySet contains the specified key.\r\n * @param value The key to check.\r\n */\r\n public has(value: Key): boolean {\r\n if (!value)\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\r\n if (Key.isEntityProps(value))\r\n return this.has({ className: value.classFullName, id: value.id! } as InstanceKey);\r\n if (Key.isInstanceKey(value)) {\r\n const set = this._instanceKeys.get(value.className.toLowerCase());\r\n return !!(set && set.has(value.id));\r\n }\r\n if (Key.isNodeKey(value))\r\n return this._nodeKeys.has(JSON.stringify(value));\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\r\n }\r\n\r\n private hasKeySet(readonlyKeys: Readonly<KeySet>, checkType: \"all\" | \"any\"): boolean {\r\n // note: cast-away read-onlyness to access private members...\r\n const keys = readonlyKeys as KeySet;\r\n\r\n if (checkType === \"all\") {\r\n if (this._nodeKeys.size < keys._nodeKeys.size || this._instanceKeys.size < keys._instanceKeys.size)\r\n return false;\r\n if ([...keys._nodeKeys].some((key) => !this._nodeKeys.has(key)))\r\n return false;\r\n for (const otherEntry of keys._instanceKeys) {\r\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"].toLowerCase());\r\n if (!thisEntryKeys || thisEntryKeys.size < otherEntry[\"1\"].size)\r\n return false;\r\n if ([...otherEntry[\"1\"]].some((key) => !thisEntryKeys.has(key)))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // \"any\" check type\r\n if ([...keys._nodeKeys].some((key) => this._nodeKeys.has(key)))\r\n return true;\r\n for (const otherEntry of keys._instanceKeys) {\r\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"].toLowerCase());\r\n if (thisEntryKeys && [...otherEntry[\"1\"]].some((key) => thisEntryKeys.has(key)))\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n private hasKeysArray(keys: ReadonlyArray<Key>, checkType: \"all\" | \"any\"): boolean {\r\n if (checkType === \"all\") {\r\n if (this.size < keys.length)\r\n return false;\r\n for (const key of keys) {\r\n if (!this.has(key))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n // \"any\" check type\r\n for (const key of keys) {\r\n if (this.has(key))\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Check if this KeySet contains all the specified keys.\r\n * @param keys The keys to check.\r\n */\r\n public hasAll(keys: Keys): boolean {\r\n if (!keys)\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${keys}`);\r\n if (this.isKeySet(keys))\r\n return this.hasKeySet(keys, \"all\");\r\n if (this.isKeysArray(keys))\r\n return this.hasKeysArray(keys, \"all\");\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: keys = ${keys}`);\r\n }\r\n\r\n /**\r\n * Check if this KeySet contains any of the specified keys.\r\n * @param keys The keys to check.\r\n */\r\n public hasAny(keys: Keys): boolean {\r\n if (!keys)\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${keys}`);\r\n if (this.isKeySet(keys))\r\n return this.hasKeySet(keys, \"any\");\r\n if (this.isKeysArray(keys))\r\n return this.hasKeysArray(keys, \"any\");\r\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: keys = ${keys}`);\r\n }\r\n\r\n /**\r\n * Get the number of keys stored in this KeySet.\r\n */\r\n public get size(): number {\r\n const nodeKeysCount = this._nodeKeys.size;\r\n let instanceIdsCount = 0;\r\n for (const set of this._instanceKeys.values())\r\n instanceIdsCount += set.size;\r\n return nodeKeysCount + instanceIdsCount;\r\n }\r\n\r\n /**\r\n * Is this KeySet currently empty.\r\n */\r\n public get isEmpty(): boolean {\r\n return 0 === this.size;\r\n }\r\n\r\n /** Iterate over all keys in this keyset. */\r\n public some(callback: (key: Key) => boolean) {\r\n for (const entry of this._instanceKeys) {\r\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase())!;\r\n if (some(entry[1], (id: Id64String) => callback({ className, id })))\r\n return true;\r\n }\r\n // eslint-disable-next-line deprecation/deprecation\r\n return some(this._nodeKeys, (serializedKey: string) => callback(NodeKey.fromJSON(JSON.parse(serializedKey))));\r\n }\r\n\r\n /** Iterate over all keys in this keyset. */\r\n public forEach(callback: (key: InstanceKey | NodeKey, index: number) => void) {\r\n let index = 0;\r\n this._instanceKeys.forEach((ids: Set<Id64String>, className: string) => {\r\n const recentClassName = this._lowerCaseMap.get(className.toLowerCase())!;\r\n ids.forEach((id: Id64String) => callback({ className: recentClassName, id }, index++));\r\n });\r\n this._nodeKeys.forEach((serializedKey: string) => {\r\n // eslint-disable-next-line deprecation/deprecation\r\n callback(NodeKey.fromJSON(JSON.parse(serializedKey)), index++);\r\n });\r\n }\r\n\r\n /** Iterate over all keys in this keyset in batches */\r\n public forEachBatch(batchSize: number, callback: (batch: KeySet, index: number) => void) {\r\n const size = this.size;\r\n const count = Math.ceil(size / batchSize);\r\n if (1 === count) {\r\n callback(this, 0);\r\n return;\r\n }\r\n let batch = new KeySet();\r\n let batchIndex = 0;\r\n let currBatchSize = 0;\r\n this.forEach((key, index) => {\r\n batch.add(key);\r\n ++currBatchSize;\r\n if (currBatchSize === batchSize || index === (size - 1)) {\r\n callback(batch, batchIndex++);\r\n batch = new KeySet();\r\n currBatchSize = 0;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Serializes this KeySet to JSON\r\n * @public\r\n */\r\n public toJSON(): KeySetJSON {\r\n const instanceKeys: [string, string][] = [];\r\n for (const entry of this._instanceKeys.entries()) {\r\n if (entry[\"1\"].size > 0) {\r\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase());\r\n const compressedIds = CompressedId64Set.sortAndCompress(entry[\"1\"]);\r\n instanceKeys.push([className!, compressedIds.length > 0 ? compressedIds : Id64.invalid]);\r\n }\r\n }\r\n // eslint-disable-next-line deprecation/deprecation\r\n const nodeKeys: NodeKeyJSON[] = [];\r\n for (const serializedKey of this._nodeKeys.values())\r\n nodeKeys.push(JSON.parse(serializedKey));\r\n return {\r\n instanceKeys,\r\n nodeKeys,\r\n };\r\n }\r\n\r\n /**\r\n * Creates a KeySet from JSON\r\n * @public\r\n */\r\n public static fromJSON(json: KeySetJSON): KeySet {\r\n const keyset = new KeySet();\r\n keyset.addKeySetJSON(json);\r\n return keyset;\r\n }\r\n}\r\n\r\nconst some = <TItem>(set: Set<TItem>, cb: (item: TItem) => boolean) => {\r\n for (const item of set) {\r\n if (cb(item))\r\n return true;\r\n }\r\n return false;\r\n};\r\n"]}
1
+ {"version":3,"file":"KeySet.js","sourceRoot":"","sources":["../../../src/presentation-common/KeySet.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4F;AAG5F,mCAAgE;AAChE,yCAAuD;AAQvD,cAAc;AACd,IAAiB,GAAG,CAenB;AAfD,WAAiB,GAAG;IAClB,+CAA+C;IAC/C,SAAgB,SAAS,CAAC,GAAQ;QAChC,OAAO,CAAC,CAAE,GAAe,CAAC,IAAI,CAAC;IACjC,CAAC;IAFe,aAAS,YAExB,CAAA;IAED,oDAAoD;IACpD,SAAgB,aAAa,CAAC,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ACD,mDAAmD;QACnD,MAAM,QAAQ,GAAkB,EAAE,CAAC;QACnC,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YACjD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QAC3C,OAAO;YACL,YAAY;YACZ,QAAQ;SACT,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,IAAgB;QACrC,MAAM,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QAC5B,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAxZD,wBAwZC;AAED,MAAM,IAAI,GAAG,CAAQ,GAAe,EAAE,EAA4B,EAAE,EAAE;IACpE,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE;QACtB,IAAI,EAAE,CAAC,IAAI,CAAC;YACV,OAAO,IAAI,CAAC;KACf;IACD,OAAO,KAAK,CAAC;AACf,CAAC,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 Core\n */\n\nimport { CompressedId64Set, Guid, GuidString, Id64, Id64String } from \"@itwin/core-bentley\";\nimport { EntityProps } from \"@itwin/core-common\";\nimport { InstanceId, InstanceKey } from \"./EC\";\nimport { PresentationError, PresentationStatus } from \"./Error\";\nimport { NodeKey, NodeKeyJSON } from \"./hierarchy/Key\";\n\n/**\n * A single key that identifies something in an iTwin.js application\n * @public\n */\nexport type Key = Readonly<NodeKey> | Readonly<InstanceKey> | Readonly<EntityProps>;\n\n/** @public */\nexport namespace Key { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Check if the supplied key is a `NodeKey` */\n export function isNodeKey(key: Key): key is NodeKey {\n return !!(key as NodeKey).type;\n }\n\n /** Check if the supplied key is an `InstanceKey` */\n export function isInstanceKey(key: Key): key is InstanceKey {\n return !!(key as InstanceKey).className && !!(key as InstanceKey).id;\n }\n\n /** Check if the supplied key is an `EntityProps` */\n export function isEntityProps(key: Key): key is EntityProps {\n return !!(key as EntityProps).classFullName && !!(key as EntityProps).id;\n }\n}\n\n/**\n * A type for multiple keys that identify something in iModel.js application\n * @public\n */\nexport type Keys = ReadonlyArray<Key> | Readonly<KeySet>;\n\n/**\n * A data structure of serialized [[KeySet]]\n * @public\n */\nexport interface KeySetJSON {\n /** JSON representation of a list of instance keys */\n instanceKeys: Array<[string, string]>;\n /** An array of serialized node keys */\n // eslint-disable-next-line deprecation/deprecation\n nodeKeys: NodeKeyJSON[];\n}\n\n/**\n * A class that holds multiple [[Key]] objects. It's basically\n * used as a container that holds multiple keys of different types.\n *\n * @public\n */\nexport class KeySet {\n // note: all keys are stored as strings because we need ability to find them by value\n private _instanceKeys: Map<string, Set<string>>; // lower case class name => instance ids\n private _lowerCaseMap: Map<string, string>; // lower case class name => most recent class name\n private _nodeKeys: Set<string>;\n private _guid!: GuidString;\n\n /**\n * Creates an instance of KeySet.\n * @param source Optional source to initialize from.\n */\n constructor(source?: Keys) {\n this._instanceKeys = new Map();\n this._lowerCaseMap = new Map();\n this._nodeKeys = new Set();\n this.recalculateGuid();\n if (source)\n this.add(source);\n }\n\n private recalculateGuid() {\n // empty keyset should have empty guid, otherwise use a random guid value\n this._guid = this.isEmpty ? Guid.empty : Guid.createValue();\n }\n\n /**\n * Get a GUID that identifies changes in this keyset. The value\n * does not uniquely identify contents of the keyset, but it can be\n * used to check whether keyset has changed.\n */\n public get guid(): GuidString { return this._guid; }\n\n /**\n * Get a map of instance keys stored in this KeySet\n *\n * **Warning**: getting instance keys might be expensive for\n * large KeySets.\n */\n public get instanceKeys(): Map<string, Set<InstanceId>> {\n const map = new Map<string, Set<InstanceId>>();\n for (const entry of this._instanceKeys)\n map.set(this._lowerCaseMap.get(entry[\"0\"])!, new Set([...entry[\"1\"]].map((key: string) => Id64.fromJSON(key))));\n return map;\n }\n\n /**\n * Get instance keys count\n */\n public get instanceKeysCount(): number {\n let count = 0;\n this._instanceKeys.forEach((set: Set<string>) => count += set.size);\n return count;\n }\n\n /**\n * Get a set of node keys stored in this KeySet\n *\n * **Warning**: getting node keys might be expensive for\n * large KeySets.\n */\n public get nodeKeys(): Set<NodeKey> {\n const set = new Set<NodeKey>();\n for (const serialized of this._nodeKeys) {\n // eslint-disable-next-line deprecation/deprecation\n const key = NodeKey.fromJSON(JSON.parse(serialized));\n set.add(key);\n }\n return set;\n }\n\n /**\n * Get node keys count\n */\n public get nodeKeysCount(): number {\n return this._nodeKeys.size;\n }\n\n private isKeySet(set: Keys | Key): set is Readonly<KeySet> {\n return !!(set as KeySet)._nodeKeys && !!(set as KeySet)._instanceKeys;\n }\n\n private isKeysArray(keys: Keys | Key): keys is ReadonlyArray<Key> {\n return Array.isArray(keys);\n }\n\n /**\n * Clear this KeySet.\n * @returns itself\n */\n public clear(): KeySet {\n if (this.isEmpty)\n return this;\n\n this._instanceKeys = new Map();\n this._lowerCaseMap = new Map();\n this._nodeKeys = new Set();\n this.recalculateGuid();\n return this;\n }\n\n private addKeySet(keyset: Readonly<KeySet>, pred?: (key: Key) => boolean): void {\n for (const key of (keyset as any)._nodeKeys) {\n // eslint-disable-next-line deprecation/deprecation\n if (!pred || pred(NodeKey.fromJSON(JSON.parse(key))))\n this._nodeKeys.add(key);\n }\n for (const entry of (keyset as any)._instanceKeys) {\n let set = this._instanceKeys.get(entry[\"0\"]);\n const className = (keyset as KeySet)._lowerCaseMap.get(entry[\"0\"])!;\n if (!set) {\n set = new Set();\n this._instanceKeys.set(entry[\"0\"], set);\n this._lowerCaseMap.set(entry[\"0\"], className);\n }\n entry[\"1\"].forEach((id: Id64String) => {\n if (!pred || pred({ className, id }))\n set!.add(id);\n });\n }\n }\n\n private addKeySetJSON(keyset: Readonly<KeySetJSON>): void {\n for (const key of keyset.nodeKeys)\n this._nodeKeys.add(JSON.stringify(key));\n for (const entry of keyset.instanceKeys) {\n const lcClassName = entry[\"0\"].toLowerCase();\n const idsJson: string | Id64String[] = entry[\"1\"];\n const ids: Set<Id64String> =\n typeof idsJson === \"string\"\n ? idsJson === Id64.invalid\n ? new Set([Id64.invalid])\n : CompressedId64Set.decompressSet(idsJson)\n : new Set(idsJson);\n this._instanceKeys.set(lcClassName, ids);\n this._lowerCaseMap.set(lcClassName, entry[\"0\"]);\n }\n }\n\n /**\n * Add a key or keys to this KeySet.\n * @param value A key or keys to add.\n * @param pred An optional predicate function that indicates whether a key should be added\n * @returns itself\n */\n public add(value: Keys | Key, pred?: (key: Key) => boolean): KeySet {\n if (!value)\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\n const sizeBefore = this.size;\n if (this.isKeySet(value)) {\n this.addKeySet(value, pred);\n } else if (this.isKeysArray(value)) {\n value.forEach((key) => this.add(key, pred));\n } else if (!pred || pred(value)) {\n if (Key.isEntityProps(value)) {\n this.add({ className: value.classFullName, id: Id64.fromJSON(value.id) } as InstanceKey);\n } else if (Key.isInstanceKey(value)) {\n const lcClassName = value.className.toLowerCase();\n if (!this._instanceKeys.has(lcClassName)) {\n this._instanceKeys.set(lcClassName, new Set());\n this._lowerCaseMap.set(lcClassName, value.className);\n }\n this._lowerCaseMap.set(lcClassName, value.className);\n this._instanceKeys.get(lcClassName)!.add(value.id);\n } else if (Key.isNodeKey(value)) {\n this._nodeKeys.add(JSON.stringify(value));\n } else {\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\n }\n }\n if (this.size !== sizeBefore)\n this.recalculateGuid();\n return this;\n }\n\n private deleteKeySet(keyset: Readonly<KeySet>): void {\n for (const key of (keyset as any)._nodeKeys)\n this._nodeKeys.delete(key);\n for (const entry of (keyset as any)._instanceKeys) {\n const set = this._instanceKeys.get(entry[\"0\"].toLowerCase());\n if (set) {\n entry[\"1\"].forEach((key: string) => {\n set.delete(key);\n });\n }\n }\n }\n\n /**\n * Deletes a key or keys from this KeySet.\n * @param value A key or keys to delete.\n * @returns itself\n */\n public delete(value: Keys | Key): KeySet {\n if (!value)\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\n const sizeBefore = this.size;\n if (this.isKeySet(value)) {\n this.deleteKeySet(value);\n } else if (this.isKeysArray(value)) {\n for (const key of value)\n this.delete(key);\n } else if (Key.isEntityProps(value)) {\n this.delete({ className: value.classFullName, id: value.id! } as InstanceKey);\n } else if (Key.isInstanceKey(value)) {\n const set = this._instanceKeys.get(value.className.toLowerCase());\n if (set)\n set.delete(value.id);\n } else if (Key.isNodeKey(value)) {\n this._nodeKeys.delete(JSON.stringify(value));\n } else {\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\n }\n if (this.size !== sizeBefore)\n this.recalculateGuid();\n return this;\n }\n\n /**\n * Check if this KeySet contains the specified key.\n * @param value The key to check.\n */\n public has(value: Key): boolean {\n if (!value)\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\n if (Key.isEntityProps(value))\n return this.has({ className: value.classFullName, id: value.id! } as InstanceKey);\n if (Key.isInstanceKey(value)) {\n const set = this._instanceKeys.get(value.className.toLowerCase());\n return !!(set && set.has(value.id));\n }\n if (Key.isNodeKey(value))\n return this._nodeKeys.has(JSON.stringify(value));\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${value}`);\n }\n\n private hasKeySet(readonlyKeys: Readonly<KeySet>, checkType: \"all\" | \"any\"): boolean {\n // note: cast-away read-onlyness to access private members...\n const keys = readonlyKeys as KeySet;\n\n if (checkType === \"all\") {\n if (this._nodeKeys.size < keys._nodeKeys.size || this._instanceKeys.size < keys._instanceKeys.size)\n return false;\n if ([...keys._nodeKeys].some((key) => !this._nodeKeys.has(key)))\n return false;\n for (const otherEntry of keys._instanceKeys) {\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"].toLowerCase());\n if (!thisEntryKeys || thisEntryKeys.size < otherEntry[\"1\"].size)\n return false;\n if ([...otherEntry[\"1\"]].some((key) => !thisEntryKeys.has(key)))\n return false;\n }\n return true;\n }\n\n // \"any\" check type\n if ([...keys._nodeKeys].some((key) => this._nodeKeys.has(key)))\n return true;\n for (const otherEntry of keys._instanceKeys) {\n const thisEntryKeys = this._instanceKeys.get(otherEntry[\"0\"].toLowerCase());\n if (thisEntryKeys && [...otherEntry[\"1\"]].some((key) => thisEntryKeys.has(key)))\n return true;\n }\n return false;\n }\n\n private hasKeysArray(keys: ReadonlyArray<Key>, checkType: \"all\" | \"any\"): boolean {\n if (checkType === \"all\") {\n if (this.size < keys.length)\n return false;\n for (const key of keys) {\n if (!this.has(key))\n return false;\n }\n return true;\n }\n\n // \"any\" check type\n for (const key of keys) {\n if (this.has(key))\n return true;\n }\n return false;\n }\n\n /**\n * Check if this KeySet contains all the specified keys.\n * @param keys The keys to check.\n */\n public hasAll(keys: Keys): boolean {\n if (!keys)\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${keys}`);\n if (this.isKeySet(keys))\n return this.hasKeySet(keys, \"all\");\n if (this.isKeysArray(keys))\n return this.hasKeysArray(keys, \"all\");\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: keys = ${keys}`);\n }\n\n /**\n * Check if this KeySet contains any of the specified keys.\n * @param keys The keys to check.\n */\n public hasAny(keys: Keys): boolean {\n if (!keys)\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: value = ${keys}`);\n if (this.isKeySet(keys))\n return this.hasKeySet(keys, \"any\");\n if (this.isKeysArray(keys))\n return this.hasKeysArray(keys, \"any\");\n throw new PresentationError(PresentationStatus.InvalidArgument, `Invalid argument: keys = ${keys}`);\n }\n\n /**\n * Get the number of keys stored in this KeySet.\n */\n public get size(): number {\n const nodeKeysCount = this._nodeKeys.size;\n let instanceIdsCount = 0;\n for (const set of this._instanceKeys.values())\n instanceIdsCount += set.size;\n return nodeKeysCount + instanceIdsCount;\n }\n\n /**\n * Is this KeySet currently empty.\n */\n public get isEmpty(): boolean {\n return 0 === this.size;\n }\n\n /** Iterate over all keys in this keyset. */\n public some(callback: (key: Key) => boolean) {\n for (const entry of this._instanceKeys) {\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase())!;\n if (some(entry[1], (id: Id64String) => callback({ className, id })))\n return true;\n }\n // eslint-disable-next-line deprecation/deprecation\n return some(this._nodeKeys, (serializedKey: string) => callback(NodeKey.fromJSON(JSON.parse(serializedKey))));\n }\n\n /** Iterate over all keys in this keyset. */\n public forEach(callback: (key: InstanceKey | NodeKey, index: number) => void) {\n let index = 0;\n this._instanceKeys.forEach((ids: Set<Id64String>, className: string) => {\n const recentClassName = this._lowerCaseMap.get(className.toLowerCase())!;\n ids.forEach((id: Id64String) => callback({ className: recentClassName, id }, index++));\n });\n this._nodeKeys.forEach((serializedKey: string) => {\n // eslint-disable-next-line deprecation/deprecation\n callback(NodeKey.fromJSON(JSON.parse(serializedKey)), index++);\n });\n }\n\n /** Iterate over all keys in this keyset in batches */\n public forEachBatch(batchSize: number, callback: (batch: KeySet, index: number) => void) {\n const size = this.size;\n const count = Math.ceil(size / batchSize);\n if (1 === count) {\n callback(this, 0);\n return;\n }\n let batch = new KeySet();\n let batchIndex = 0;\n let currBatchSize = 0;\n this.forEach((key, index) => {\n batch.add(key);\n ++currBatchSize;\n if (currBatchSize === batchSize || index === (size - 1)) {\n callback(batch, batchIndex++);\n batch = new KeySet();\n currBatchSize = 0;\n }\n });\n }\n\n /**\n * Serializes this KeySet to JSON\n * @public\n */\n public toJSON(): KeySetJSON {\n const instanceKeys: [string, string][] = [];\n for (const entry of this._instanceKeys.entries()) {\n if (entry[\"1\"].size > 0) {\n const className = this._lowerCaseMap.get(entry[\"0\"].toLowerCase());\n const compressedIds = CompressedId64Set.sortAndCompress(entry[\"1\"]);\n instanceKeys.push([className!, compressedIds.length > 0 ? compressedIds : Id64.invalid]);\n }\n }\n // eslint-disable-next-line deprecation/deprecation\n const nodeKeys: NodeKeyJSON[] = [];\n for (const serializedKey of this._nodeKeys.values())\n nodeKeys.push(JSON.parse(serializedKey));\n return {\n instanceKeys,\n nodeKeys,\n };\n }\n\n /**\n * Creates a KeySet from JSON\n * @public\n */\n public static fromJSON(json: KeySetJSON): KeySet {\n const keyset = new KeySet();\n keyset.addKeySetJSON(json);\n return keyset;\n }\n}\n\nconst some = <TItem>(set: Set<TItem>, cb: (item: TItem) => boolean) => {\n for (const item of set) {\n if (cb(item))\n return true;\n }\n return false;\n};\n"]}
@@ -0,0 +1,20 @@
1
+ /** @packageDocumentation
2
+ * @module Core
3
+ */
4
+ import { FormatterSpec, ParserSpec, UnitSystemKey } from "@itwin/core-quantity";
5
+ import { SchemaContext } from "@itwin/ecschema-metadata";
6
+ /** @alpha */
7
+ export interface FormatOptions {
8
+ koqName: string;
9
+ unitSystem?: UnitSystemKey;
10
+ }
11
+ /** @alpha */
12
+ export declare class KoqPropertyValueFormatter {
13
+ private _schemaContext;
14
+ private _unitsProvider;
15
+ constructor(_schemaContext: SchemaContext);
16
+ format(value: number, options: FormatOptions): Promise<string | undefined>;
17
+ getFormatterSpec(options: FormatOptions): Promise<FormatterSpec | undefined>;
18
+ getParserSpec(options: FormatOptions): Promise<ParserSpec | undefined>;
19
+ }
20
+ //# sourceMappingURL=KoqPropertyValueFormatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KoqPropertyValueFormatter.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAuB,aAAa,EAAE,UAAU,EAAiB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACpH,OAAO,EACyD,aAAa,EAE5E,MAAM,0BAA0B,CAAC;AAElC,aAAa;AACb,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,aAAa;AACb,qBAAa,yBAAyB;IAGxB,OAAO,CAAC,cAAc;IAFlC,OAAO,CAAC,cAAc,CAAgB;gBAElB,cAAc,EAAE,aAAa;IAIpC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAO5C,gBAAgB,CAAC,OAAO,EAAE,aAAa;IAUvC,aAAa,CAAC,OAAO,EAAE,aAAa;CASlD"}
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Core
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.KoqPropertyValueFormatter = void 0;
11
+ const core_quantity_1 = require("@itwin/core-quantity");
12
+ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
13
+ /** @alpha */
14
+ class KoqPropertyValueFormatter {
15
+ constructor(_schemaContext) {
16
+ this._schemaContext = _schemaContext;
17
+ this._unitsProvider = new ecschema_metadata_1.SchemaUnitProvider(_schemaContext);
18
+ }
19
+ async format(value, options) {
20
+ const formatterSpec = await this.getFormatterSpec(options);
21
+ if (!formatterSpec)
22
+ return undefined;
23
+ return formatterSpec.applyFormatting(value);
24
+ }
25
+ async getFormatterSpec(options) {
26
+ const formattingProps = await getFormattingProps(this._schemaContext, options);
27
+ if (!formattingProps)
28
+ return undefined;
29
+ const { formatProps, persistenceUnitName } = formattingProps;
30
+ const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);
31
+ const format = await core_quantity_1.Format.createFromJSON("", this._unitsProvider, formatProps);
32
+ return core_quantity_1.FormatterSpec.create("", format, this._unitsProvider, persistenceUnit);
33
+ }
34
+ async getParserSpec(options) {
35
+ const formattingProps = await getFormattingProps(this._schemaContext, options);
36
+ if (!formattingProps)
37
+ return undefined;
38
+ const { formatProps, persistenceUnitName } = formattingProps;
39
+ const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);
40
+ const format = await core_quantity_1.Format.createFromJSON("", this._unitsProvider, formatProps);
41
+ return core_quantity_1.ParserSpec.create(format, this._unitsProvider, persistenceUnit);
42
+ }
43
+ }
44
+ exports.KoqPropertyValueFormatter = KoqPropertyValueFormatter;
45
+ async function getFormattingProps(schemaLocater, options) {
46
+ const { koqName, unitSystem } = options;
47
+ const koq = await getKoq(schemaLocater, koqName);
48
+ if (!koq)
49
+ return undefined;
50
+ const persistenceUnit = await koq.persistenceUnit;
51
+ // istanbul ignore if
52
+ if (!persistenceUnit)
53
+ return undefined;
54
+ const formatProps = await getKoqFormatProps(koq, persistenceUnit, unitSystem);
55
+ if (!formatProps)
56
+ return undefined;
57
+ return { formatProps, persistenceUnitName: persistenceUnit.fullName };
58
+ }
59
+ async function getKoq(schemaLocater, fullName) {
60
+ const [schemaName, propKoqName] = fullName.split(":");
61
+ const schema = await schemaLocater.getSchema(new ecschema_metadata_1.SchemaKey(schemaName), ecschema_metadata_1.SchemaMatchType.Latest);
62
+ if (!schema)
63
+ return undefined;
64
+ return schema.getItem(propKoqName);
65
+ }
66
+ async function getKoqFormatProps(koq, persistenceUnit, unitSystem) {
67
+ const unitSystems = getUnitSystemGroupNames(unitSystem);
68
+ // use one of KOQ presentation format that matches requested unit system
69
+ const presentationFormat = await getKoqPresentationFormat(koq, unitSystems);
70
+ if (presentationFormat)
71
+ return (0, ecschema_metadata_1.getFormatProps)(presentationFormat);
72
+ // use persistence unit format if it matches requested unit system and matching presentation format was not found
73
+ const persistenceUnitSystem = await persistenceUnit.unitSystem;
74
+ if (persistenceUnitSystem && unitSystems.includes(persistenceUnitSystem.name.toUpperCase()))
75
+ return getPersistenceUnitFormatProps(persistenceUnit);
76
+ // use default presentation format if persistence unit does not match requested unit system
77
+ if (koq.defaultPresentationFormat)
78
+ return (0, ecschema_metadata_1.getFormatProps)(koq.defaultPresentationFormat);
79
+ return undefined;
80
+ }
81
+ async function getKoqPresentationFormat(koq, unitSystems) {
82
+ const presentationFormats = koq.presentationFormats;
83
+ for (const system of unitSystems) {
84
+ for (const format of presentationFormats) {
85
+ const unit = format.units && format.units[0][0];
86
+ // istanbul ignore if
87
+ if (!unit)
88
+ continue;
89
+ const currentUnitSystem = await unit.unitSystem;
90
+ if (currentUnitSystem && currentUnitSystem.name.toUpperCase() === system)
91
+ return format;
92
+ }
93
+ }
94
+ return undefined;
95
+ }
96
+ function getPersistenceUnitFormatProps(persistenceUnit) {
97
+ // Same as Format "DefaultRealU" in Formats ecschema
98
+ return {
99
+ formatTraits: ["keepSingleZero", "keepDecimalPoint", "showUnitLabel"],
100
+ precision: 6,
101
+ type: "Decimal",
102
+ uomSeparator: " ",
103
+ decimalSeparator: ".",
104
+ composite: {
105
+ units: [{
106
+ name: persistenceUnit.fullName,
107
+ label: persistenceUnit.label,
108
+ }],
109
+ },
110
+ };
111
+ }
112
+ function getUnitSystemGroupNames(unitSystem) {
113
+ switch (unitSystem) {
114
+ case "imperial":
115
+ return ["IMPERIAL", "USCUSTOM", "INTERNATIONAL", "FINANCE"];
116
+ case "metric":
117
+ return ["SI", "METRIC", "INTERNATIONAL", "FINANCE"];
118
+ case "usCustomary":
119
+ return ["USCUSTOM", "INTERNATIONAL", "FINANCE"];
120
+ case "usSurvey":
121
+ return ["USSURVEY", "USCUSTOM", "INTERNATIONAL", "FINANCE"];
122
+ }
123
+ return [];
124
+ }
125
+ //# sourceMappingURL=KoqPropertyValueFormatter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KoqPropertyValueFormatter.js","sourceRoot":"","sources":["../../../src/presentation-common/KoqPropertyValueFormatter.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAoH;AACpH,gEAGkC;AAQlC,aAAa;AACb,MAAa,yBAAyB;IAGpC,YAAoB,cAA6B;QAA7B,mBAAc,G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gB,EAAE,kBAAkB,EAAE,eAAe,CAAC;QACrE,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,GAAG;QACjB,gBAAgB,EAAE,GAAG;QACrB,SAAS,EAAE;YACT,KAAK,EAAE,CAAC;oBACN,IAAI,EAAE,eAAe,CAAC,QAAQ;oBAC9B,KAAK,EAAE,eAAe,CAAC,KAAK;iBAC7B,CAAC;SACH;KACF,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,UAA0B;IACzD,QAAQ,UAAU,EAAE;QAClB,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAC9D,KAAK,QAAQ;YACX,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QACtD,KAAK,aAAa;YAChB,OAAO,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;QAClD,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;KAC/D;IACD,OAAO,EAAE,CAAC;AACZ,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 Core\n */\n\nimport { Format, FormatProps, FormatterSpec, ParserSpec, UnitsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport {\n getFormatProps, InvertedUnit, ISchemaLocater, KindOfQuantity, SchemaContext, SchemaKey, SchemaMatchType, SchemaUnitProvider,\n Unit,\n} from \"@itwin/ecschema-metadata\";\n\n/** @alpha */\nexport interface FormatOptions {\n koqName: string;\n unitSystem?: UnitSystemKey;\n}\n\n/** @alpha */\nexport class KoqPropertyValueFormatter {\n private _unitsProvider: UnitsProvider;\n\n constructor(private _schemaContext: SchemaContext) {\n this._unitsProvider = new SchemaUnitProvider(_schemaContext);\n }\n\n public async format(value: number, options: FormatOptions) {\n const formatterSpec = await this.getFormatterSpec(options);\n if (!formatterSpec)\n return undefined;\n return formatterSpec.applyFormatting(value);\n }\n\n public async getFormatterSpec(options: FormatOptions) {\n const formattingProps = await getFormattingProps(this._schemaContext, options);\n if (!formattingProps)\n return undefined;\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\n return FormatterSpec.create(\"\", format, this._unitsProvider, persistenceUnit);\n }\n\n public async getParserSpec(options: FormatOptions) {\n const formattingProps = await getFormattingProps(this._schemaContext, options);\n if (!formattingProps)\n return undefined;\n const { formatProps, persistenceUnitName } = formattingProps;\n const persistenceUnit = await this._unitsProvider.findUnitByName(persistenceUnitName);\n const format = await Format.createFromJSON(\"\", this._unitsProvider, formatProps);\n return ParserSpec.create(format, this._unitsProvider, persistenceUnit);\n }\n}\n\ninterface FormattingProps {\n formatProps: FormatProps;\n persistenceUnitName: string;\n}\n\nasync function getFormattingProps(schemaLocater: ISchemaLocater, options: FormatOptions): Promise<FormattingProps | undefined> {\n const { koqName, unitSystem } = options;\n\n const koq = await getKoq(schemaLocater, koqName);\n if (!koq)\n return undefined;\n\n const persistenceUnit = await koq.persistenceUnit;\n // istanbul ignore if\n if (!persistenceUnit)\n return undefined;\n\n const formatProps = await getKoqFormatProps(koq, persistenceUnit, unitSystem);\n if (!formatProps)\n return undefined;\n\n return { formatProps, persistenceUnitName: persistenceUnit.fullName };\n}\n\nasync function getKoq(schemaLocater: ISchemaLocater, fullName: string) {\n const [schemaName, propKoqName] = fullName.split(\":\");\n const schema = await schemaLocater.getSchema(new SchemaKey(schemaName), SchemaMatchType.Latest);\n if (!schema)\n return undefined;\n\n return schema.getItem<KindOfQuantity>(propKoqName);\n}\n\nasync function getKoqFormatProps(koq: KindOfQuantity, persistenceUnit: Unit | InvertedUnit, unitSystem?: UnitSystemKey) {\n const unitSystems = getUnitSystemGroupNames(unitSystem);\n // use one of KOQ presentation format that matches requested unit system\n const presentationFormat = await getKoqPresentationFormat(koq, unitSystems);\n if (presentationFormat)\n return getFormatProps(presentationFormat);\n\n // use persistence unit format if it matches requested unit system and matching presentation format was not found\n const persistenceUnitSystem = await persistenceUnit.unitSystem;\n if (persistenceUnitSystem && unitSystems.includes(persistenceUnitSystem.name.toUpperCase()))\n return getPersistenceUnitFormatProps(persistenceUnit);\n\n // use default presentation format if persistence unit does not match requested unit system\n if (koq.defaultPresentationFormat)\n return getFormatProps(koq.defaultPresentationFormat);\n\n return undefined;\n}\n\nasync function getKoqPresentationFormat(koq: KindOfQuantity, unitSystems: string[]) {\n const presentationFormats = koq.presentationFormats;\n for (const system of unitSystems) {\n for (const format of presentationFormats) {\n const unit = format.units && format.units[0][0];\n // istanbul ignore if\n if (!unit)\n continue;\n\n const currentUnitSystem = await unit.unitSystem;\n if (currentUnitSystem && currentUnitSystem.name.toUpperCase() === system)\n return format;\n }\n }\n return undefined;\n}\n\nfunction getPersistenceUnitFormatProps(persistenceUnit: Unit | InvertedUnit): FormatProps {\n // Same as Format \"DefaultRealU\" in Formats ecschema\n return {\n formatTraits: [\"keepSingleZero\", \"keepDecimalPoint\", \"showUnitLabel\"],\n precision: 6,\n type: \"Decimal\",\n uomSeparator: \" \",\n decimalSeparator: \".\",\n composite: {\n units: [{\n name: persistenceUnit.fullName,\n label: persistenceUnit.label,\n }],\n },\n };\n}\n\nfunction getUnitSystemGroupNames(unitSystem?: UnitSystemKey) {\n switch (unitSystem) {\n case \"imperial\":\n return [\"IMPERIAL\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"];\n case \"metric\":\n return [\"SI\", \"METRIC\", \"INTERNATIONAL\", \"FINANCE\"];\n case \"usCustomary\":\n return [\"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"];\n case \"usSurvey\":\n return [\"USSURVEY\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"];\n }\n return [];\n}\n"]}
@@ -1,88 +1,94 @@
1
- /** @packageDocumentation
2
- * @module Hierarchies
3
- */
4
- /**
5
- * Data structure that describes raw composite label value.
6
- * @public
7
- */
8
- export interface LabelCompositeValue {
9
- separator: string;
10
- values: LabelDefinition[];
11
- }
12
- /**
13
- * JSON representation of [[LabelCompositeValue]]
14
- * @public
15
- * @deprecated in 3.x. Use [[LabelCompositeValue]].
16
- */
17
- export interface LabelCompositeValueJSON {
18
- separator: string;
19
- values: LabelDefinition[];
20
- }
21
- /** @public */
22
- export declare namespace LabelCompositeValue {
23
- /**
24
- * Serialize given [[LabelCompositeValue]] to JSON
25
- * @deprecated in 3.x. Use [[LabelCompositeValue]].
26
- */
27
- function toJSON(compositeValue: LabelCompositeValue): LabelCompositeValueJSON;
28
- /**
29
- * Deserialize [[LabelCompositeValue]] from JSON
30
- * @deprecated in 3.x. Use [[LabelCompositeValue]].
31
- */
32
- function fromJSON(json: LabelCompositeValueJSON): LabelCompositeValue;
33
- }
34
- /**
35
- * Type definition of label raw value.
36
- * @public
37
- */
38
- export declare type LabelRawValue = string | number | boolean | LabelCompositeValue;
39
- /**
40
- * JSON representation of [[LabelRawValue]]
41
- * @public
42
- * @deprecated in 3.x. Use [[LabelRawValue]].
43
- */
44
- export declare type LabelRawValueJSON = LabelRawValue;
45
- /**
46
- * Data structure that describes label definition.
47
- * @public
48
- */
49
- export interface LabelDefinition {
50
- /** Display value of label */
51
- displayValue: string;
52
- /** Raw value of label */
53
- rawValue: LabelRawValue;
54
- /** Type name of raw value */
55
- typeName: string;
56
- }
57
- /**
58
- * JSON representation of [[LabelDefinition]]
59
- * @public
60
- * @deprecated in 3.x. Use [[LabelDefinition]].
61
- */
62
- export interface LabelDefinitionJSON {
63
- displayValue: string;
64
- rawValue: LabelRawValue;
65
- typeName: string;
66
- }
67
- /** @public */
68
- export declare namespace LabelDefinition {
69
- /**
70
- * Serialize given [[LabelDefinition]] to JSON
71
- * @deprecated in 3.x. Use [[LabelDefinition]].
72
- */
73
- function toJSON(labelDefinition: LabelDefinition): LabelDefinitionJSON;
74
- /**
75
- * Deserialize [[LabelDefinition]] from JSON
76
- * @deprecated in 3.x. Use [[LabelDefinition]].
77
- */
78
- function fromJSON(json: LabelDefinitionJSON | string): LabelDefinition;
79
- /** @internal */
80
- const COMPOSITE_DEFINITION_TYPENAME = "composite";
81
- /** @internal */
82
- function isCompositeDefinition(def: LabelDefinition): def is LabelDefinition & {
83
- rawValue: LabelCompositeValue;
84
- };
85
- /** @internal */
86
- function fromLabelString(label: string): LabelDefinition;
87
- }
1
+ /** @packageDocumentation
2
+ * @module Hierarchies
3
+ */
4
+ /**
5
+ * Data structure that describes raw composite label value.
6
+ * @public
7
+ */
8
+ export interface LabelCompositeValue {
9
+ separator: string;
10
+ values: LabelDefinition[];
11
+ }
12
+ /**
13
+ * JSON representation of [[LabelCompositeValue]]
14
+ * @public
15
+ * @deprecated in 3.x. Use [[LabelCompositeValue]].
16
+ */
17
+ export interface LabelCompositeValueJSON {
18
+ separator: string;
19
+ values: LabelDefinition[];
20
+ }
21
+ /** @public */
22
+ export declare namespace LabelCompositeValue {
23
+ /**
24
+ * Serialize given [[LabelCompositeValue]] to JSON
25
+ * @deprecated in 3.x. Use [[LabelCompositeValue]].
26
+ */
27
+ function toJSON(compositeValue: LabelCompositeValue): LabelCompositeValueJSON;
28
+ /**
29
+ * Deserialize [[LabelCompositeValue]] from JSON
30
+ * @deprecated in 3.x. Use [[LabelCompositeValue]].
31
+ */
32
+ function fromJSON(json: LabelCompositeValueJSON): LabelCompositeValue;
33
+ }
34
+ /**
35
+ * Type definition of label raw value.
36
+ * @public
37
+ */
38
+ export type LabelRawValue = string | number | boolean | LabelCompositeValue;
39
+ /**
40
+ * JSON representation of [[LabelRawValue]]
41
+ * @public
42
+ * @deprecated in 3.x. Use [[LabelRawValue]].
43
+ */
44
+ export type LabelRawValueJSON = LabelRawValue;
45
+ /**
46
+ * Data structure that describes label definition.
47
+ * @public
48
+ */
49
+ export interface LabelDefinition {
50
+ /** Display value of label */
51
+ displayValue: string;
52
+ /** Raw value of label */
53
+ rawValue: LabelRawValue;
54
+ /** Type name of raw value */
55
+ typeName: string;
56
+ }
57
+ /**
58
+ * JSON representation of [[LabelDefinition]]
59
+ * @public
60
+ * @deprecated in 3.x. Use [[LabelDefinition]].
61
+ */
62
+ export interface LabelDefinitionJSON {
63
+ displayValue: string;
64
+ rawValue: LabelRawValue;
65
+ typeName: string;
66
+ }
67
+ /** @public */
68
+ export declare namespace LabelDefinition {
69
+ /**
70
+ * Serialize given [[LabelDefinition]] to JSON
71
+ * @deprecated in 3.x. Use [[LabelDefinition]].
72
+ */
73
+ function toJSON(labelDefinition: LabelDefinition): LabelDefinitionJSON;
74
+ /**
75
+ * Deserialize [[LabelDefinition]] from JSON
76
+ * @deprecated in 3.x. Use [[LabelDefinition]].
77
+ */
78
+ function fromJSON(json: LabelDefinitionJSON | string): LabelDefinition;
79
+ /** @internal */
80
+ const COMPOSITE_DEFINITION_TYPENAME = "composite";
81
+ /**
82
+ * Checks if provided [[LabelDefinition]] has raw value of type [[LabelCompositeValue]].
83
+ * @public
84
+ */
85
+ function isCompositeDefinition(def: LabelDefinition): def is LabelDefinition & {
86
+ rawValue: LabelCompositeValue;
87
+ };
88
+ /**
89
+ * Creates [[LabelDefinition]] from string value.
90
+ * @public
91
+ */
92
+ function fromLabelString(label: string): LabelDefinition;
93
+ }
88
94
  //# sourceMappingURL=LabelDefinition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LabelDefinition.d.ts","sourceRoot":"","sources":["../../../src/presentation-common/LabelDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,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