@itwin/appui-abstract 4.0.0-dev.9 → 4.0.0-dev.90

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 (277) hide show
  1. package/CHANGELOG.md +144 -1
  2. package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +30 -30
  3. package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -1
  4. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +79 -78
  5. package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -1
  6. package/lib/cjs/appui-abstract/UiAdmin.d.ts +221 -221
  7. package/lib/cjs/appui-abstract/UiAdmin.js +224 -224
  8. package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
  9. package/lib/cjs/appui-abstract/UiItemsManager.d.ts +113 -113
  10. package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +1 -1
  11. package/lib/cjs/appui-abstract/UiItemsManager.js +193 -198
  12. package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
  13. package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +29 -28
  14. package/lib/cjs/appui-abstract/UiItemsProvider.d.ts.map +1 -1
  15. package/lib/cjs/appui-abstract/UiItemsProvider.js +9 -9
  16. package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -1
  17. package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts +91 -91
  18. package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts.map +1 -1
  19. package/lib/cjs/appui-abstract/backstage/BackstageItem.js +70 -70
  20. package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -1
  21. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.d.ts +38 -38
  22. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js +133 -133
  23. package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
  24. package/lib/cjs/appui-abstract/common/KeyboardKey.d.ts +51 -51
  25. package/lib/cjs/appui-abstract/common/KeyboardKey.js +63 -63
  26. package/lib/cjs/appui-abstract/content/ContentLayoutProps.d.ts +62 -62
  27. package/lib/cjs/appui-abstract/content/ContentLayoutProps.js +9 -9
  28. package/lib/cjs/appui-abstract/content/StandardContentLayouts.d.ts +19 -19
  29. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js +108 -108
  30. package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  31. package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts +76 -76
  32. package/lib/cjs/appui-abstract/dialogs/DialogItem.js +67 -67
  33. package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
  34. package/lib/cjs/appui-abstract/dialogs/UiDataProvider.d.ts +55 -55
  35. package/lib/cjs/appui-abstract/dialogs/UiDataProvider.js +66 -66
  36. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.d.ts +97 -97
  37. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js +175 -175
  38. package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  39. package/lib/cjs/appui-abstract/items/AbstractItemProps.d.ts +53 -53
  40. package/lib/cjs/appui-abstract/items/AbstractItemProps.d.ts.map +1 -1
  41. package/lib/cjs/appui-abstract/items/AbstractItemProps.js +9 -9
  42. package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.d.ts +20 -20
  43. package/lib/cjs/appui-abstract/items/AbstractMenuItemProps.js +9 -9
  44. package/lib/cjs/appui-abstract/items/AbstractToolbarProps.d.ts +13 -13
  45. package/lib/cjs/appui-abstract/items/AbstractToolbarProps.js +9 -9
  46. package/lib/cjs/appui-abstract/items/BadgeType.d.ts +14 -14
  47. package/lib/cjs/appui-abstract/items/BadgeType.js +22 -22
  48. package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.d.ts +27 -27
  49. package/lib/cjs/appui-abstract/items/ConditionalBooleanValue.js +60 -60
  50. package/lib/cjs/appui-abstract/items/ConditionalStringValue.d.ts +29 -29
  51. package/lib/cjs/appui-abstract/items/ConditionalStringValue.js +62 -62
  52. package/lib/cjs/appui-abstract/items/ProvidedItem.d.ts +11 -11
  53. package/lib/cjs/appui-abstract/items/ProvidedItem.js +9 -9
  54. package/lib/cjs/appui-abstract/items/RelativePosition.d.ts +18 -18
  55. package/lib/cjs/appui-abstract/items/RelativePosition.js +26 -26
  56. package/lib/cjs/appui-abstract/items/StageUsage.d.ts +16 -16
  57. package/lib/cjs/appui-abstract/items/StageUsage.js +24 -24
  58. package/lib/cjs/appui-abstract/notification/MessagePresenter.d.ts +42 -42
  59. package/lib/cjs/appui-abstract/notification/MessagePresenter.js +24 -24
  60. package/lib/cjs/appui-abstract/notification/MessageSeverity.d.ts +15 -15
  61. package/lib/cjs/appui-abstract/notification/MessageSeverity.js +23 -23
  62. package/lib/cjs/appui-abstract/properties/Description.d.ts +124 -127
  63. package/lib/cjs/appui-abstract/properties/Description.d.ts.map +1 -1
  64. package/lib/cjs/appui-abstract/properties/Description.js +196 -196
  65. package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
  66. package/lib/cjs/appui-abstract/properties/EditorParams.d.ts +260 -260
  67. package/lib/cjs/appui-abstract/properties/EditorParams.d.ts.map +1 -1
  68. package/lib/cjs/appui-abstract/properties/EditorParams.js +106 -106
  69. package/lib/cjs/appui-abstract/properties/PrimitiveTypes.d.ts +60 -60
  70. package/lib/cjs/appui-abstract/properties/PrimitiveTypes.js +9 -9
  71. package/lib/cjs/appui-abstract/properties/Record.d.ts +57 -57
  72. package/lib/cjs/appui-abstract/properties/Record.js +78 -78
  73. package/lib/cjs/appui-abstract/properties/StandardEditorNames.d.ts +22 -22
  74. package/lib/cjs/appui-abstract/properties/StandardEditorNames.js +30 -30
  75. package/lib/cjs/appui-abstract/properties/StandardTypeNames.d.ts +30 -30
  76. package/lib/cjs/appui-abstract/properties/StandardTypeNames.js +39 -39
  77. package/lib/cjs/appui-abstract/properties/Value.d.ts +49 -49
  78. package/lib/cjs/appui-abstract/properties/Value.d.ts.map +1 -1
  79. package/lib/cjs/appui-abstract/properties/Value.js +20 -20
  80. package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.d.ts +22 -22
  81. package/lib/cjs/appui-abstract/quantity/BaseQuantityDescription.js +48 -48
  82. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts +128 -128
  83. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts.map +1 -1
  84. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js +87 -87
  85. package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  86. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.d.ts +39 -39
  87. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js +135 -135
  88. package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
  89. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts +121 -121
  90. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
  91. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js +64 -64
  92. package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  93. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.d.ts +45 -45
  94. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js +235 -235
  95. package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
  96. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts +29 -17
  97. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
  98. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js +51 -32
  99. package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  100. package/lib/cjs/appui-abstract/utils/PointProps.d.ts +10 -10
  101. package/lib/cjs/appui-abstract/utils/PointProps.js +9 -9
  102. package/lib/cjs/appui-abstract/utils/UiError.d.ts +12 -12
  103. package/lib/cjs/appui-abstract/utils/UiError.js +22 -22
  104. package/lib/cjs/appui-abstract/utils/UiEvent.d.ts +9 -9
  105. package/lib/cjs/appui-abstract/utils/UiEvent.js +17 -17
  106. package/lib/cjs/appui-abstract/utils/UiEventDispatcher.d.ts +46 -46
  107. package/lib/cjs/appui-abstract/utils/UiEventDispatcher.js +131 -131
  108. package/lib/cjs/appui-abstract/utils/callbacks.d.ts +20 -20
  109. package/lib/cjs/appui-abstract/utils/callbacks.d.ts.map +1 -1
  110. package/lib/cjs/appui-abstract/utils/callbacks.js +9 -9
  111. package/lib/cjs/appui-abstract/utils/filter/charCode.d.ts +416 -416
  112. package/lib/cjs/appui-abstract/utils/filter/charCode.js +6 -6
  113. package/lib/cjs/appui-abstract/utils/filter/filters.d.ts +98 -98
  114. package/lib/cjs/appui-abstract/utils/filter/filters.d.ts.map +1 -1
  115. package/lib/cjs/appui-abstract/utils/filter/filters.js +709 -709
  116. package/lib/cjs/appui-abstract/utils/filter/filters.js.map +1 -1
  117. package/lib/cjs/appui-abstract/utils/filter/map.d.ts +59 -59
  118. package/lib/cjs/appui-abstract/utils/filter/map.js +402 -404
  119. package/lib/cjs/appui-abstract/utils/filter/map.js.map +1 -1
  120. package/lib/cjs/appui-abstract/utils/filter/strings.d.ts +20 -20
  121. package/lib/cjs/appui-abstract/utils/filter/strings.js +78 -78
  122. package/lib/cjs/appui-abstract/utils/filter/strings.js.map +1 -1
  123. package/lib/cjs/appui-abstract/utils/isLetter.d.ts +9 -9
  124. package/lib/cjs/appui-abstract/utils/isLetter.js +19 -19
  125. package/lib/cjs/appui-abstract/utils/misc.d.ts +11 -11
  126. package/lib/cjs/appui-abstract/utils/misc.js +36 -36
  127. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +86 -69
  128. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -1
  129. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js +9 -9
  130. package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
  131. package/lib/cjs/appui-abstract/widget/StagePanel.d.ts +36 -21
  132. package/lib/cjs/appui-abstract/widget/StagePanel.d.ts.map +1 -1
  133. package/lib/cjs/appui-abstract/widget/StagePanel.js +46 -30
  134. package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
  135. package/lib/cjs/appui-abstract/widget/WidgetState.d.ts +19 -19
  136. package/lib/cjs/appui-abstract/widget/WidgetState.js +27 -27
  137. package/lib/cjs/appui-abstract.d.ts +103 -103
  138. package/lib/cjs/appui-abstract.js +123 -119
  139. package/lib/cjs/appui-abstract.js.map +1 -1
  140. package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +30 -30
  141. package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -1
  142. package/lib/esm/appui-abstract/BaseUiItemsProvider.js +75 -74
  143. package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -1
  144. package/lib/esm/appui-abstract/UiAdmin.d.ts +221 -221
  145. package/lib/esm/appui-abstract/UiAdmin.js +220 -219
  146. package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
  147. package/lib/esm/appui-abstract/UiItemsManager.d.ts +113 -113
  148. package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +1 -1
  149. package/lib/esm/appui-abstract/UiItemsManager.js +190 -194
  150. package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
  151. package/lib/esm/appui-abstract/UiItemsProvider.d.ts +29 -28
  152. package/lib/esm/appui-abstract/UiItemsProvider.d.ts.map +1 -1
  153. package/lib/esm/appui-abstract/UiItemsProvider.js +8 -8
  154. package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -1
  155. package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts +91 -91
  156. package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts.map +1 -1
  157. package/lib/esm/appui-abstract/backstage/BackstageItem.js +65 -64
  158. package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -1
  159. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.d.ts +38 -38
  160. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js +129 -129
  161. package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
  162. package/lib/esm/appui-abstract/common/KeyboardKey.d.ts +51 -51
  163. package/lib/esm/appui-abstract/common/KeyboardKey.js +59 -59
  164. package/lib/esm/appui-abstract/content/ContentLayoutProps.d.ts +62 -62
  165. package/lib/esm/appui-abstract/content/ContentLayoutProps.js +8 -8
  166. package/lib/esm/appui-abstract/content/StandardContentLayouts.d.ts +19 -19
  167. package/lib/esm/appui-abstract/content/StandardContentLayouts.js +105 -104
  168. package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
  169. package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts +76 -76
  170. package/lib/esm/appui-abstract/dialogs/DialogItem.js +63 -63
  171. package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
  172. package/lib/esm/appui-abstract/dialogs/UiDataProvider.d.ts +55 -55
  173. package/lib/esm/appui-abstract/dialogs/UiDataProvider.js +61 -61
  174. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.d.ts +97 -97
  175. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js +171 -170
  176. package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
  177. package/lib/esm/appui-abstract/items/AbstractItemProps.d.ts +53 -53
  178. package/lib/esm/appui-abstract/items/AbstractItemProps.d.ts.map +1 -1
  179. package/lib/esm/appui-abstract/items/AbstractItemProps.js +8 -8
  180. package/lib/esm/appui-abstract/items/AbstractMenuItemProps.d.ts +20 -20
  181. package/lib/esm/appui-abstract/items/AbstractMenuItemProps.js +8 -8
  182. package/lib/esm/appui-abstract/items/AbstractToolbarProps.d.ts +13 -13
  183. package/lib/esm/appui-abstract/items/AbstractToolbarProps.js +8 -8
  184. package/lib/esm/appui-abstract/items/BadgeType.d.ts +14 -14
  185. package/lib/esm/appui-abstract/items/BadgeType.js +19 -19
  186. package/lib/esm/appui-abstract/items/ConditionalBooleanValue.d.ts +27 -27
  187. package/lib/esm/appui-abstract/items/ConditionalBooleanValue.js +56 -56
  188. package/lib/esm/appui-abstract/items/ConditionalStringValue.d.ts +29 -29
  189. package/lib/esm/appui-abstract/items/ConditionalStringValue.js +58 -58
  190. package/lib/esm/appui-abstract/items/ProvidedItem.d.ts +11 -11
  191. package/lib/esm/appui-abstract/items/ProvidedItem.js +8 -8
  192. package/lib/esm/appui-abstract/items/RelativePosition.d.ts +18 -18
  193. package/lib/esm/appui-abstract/items/RelativePosition.js +23 -23
  194. package/lib/esm/appui-abstract/items/StageUsage.d.ts +16 -16
  195. package/lib/esm/appui-abstract/items/StageUsage.js +21 -21
  196. package/lib/esm/appui-abstract/notification/MessagePresenter.d.ts +42 -42
  197. package/lib/esm/appui-abstract/notification/MessagePresenter.js +21 -21
  198. package/lib/esm/appui-abstract/notification/MessageSeverity.d.ts +15 -15
  199. package/lib/esm/appui-abstract/notification/MessageSeverity.js +20 -20
  200. package/lib/esm/appui-abstract/properties/Description.d.ts +124 -127
  201. package/lib/esm/appui-abstract/properties/Description.d.ts.map +1 -1
  202. package/lib/esm/appui-abstract/properties/Description.js +192 -192
  203. package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
  204. package/lib/esm/appui-abstract/properties/EditorParams.d.ts +260 -260
  205. package/lib/esm/appui-abstract/properties/EditorParams.d.ts.map +1 -1
  206. package/lib/esm/appui-abstract/properties/EditorParams.js +97 -97
  207. package/lib/esm/appui-abstract/properties/PrimitiveTypes.d.ts +60 -60
  208. package/lib/esm/appui-abstract/properties/PrimitiveTypes.js +8 -8
  209. package/lib/esm/appui-abstract/properties/Record.d.ts +57 -57
  210. package/lib/esm/appui-abstract/properties/Record.js +74 -74
  211. package/lib/esm/appui-abstract/properties/StandardEditorNames.d.ts +22 -22
  212. package/lib/esm/appui-abstract/properties/StandardEditorNames.js +27 -27
  213. package/lib/esm/appui-abstract/properties/StandardTypeNames.d.ts +30 -30
  214. package/lib/esm/appui-abstract/properties/StandardTypeNames.js +36 -36
  215. package/lib/esm/appui-abstract/properties/Value.d.ts +49 -49
  216. package/lib/esm/appui-abstract/properties/Value.d.ts.map +1 -1
  217. package/lib/esm/appui-abstract/properties/Value.js +17 -17
  218. package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.d.ts +22 -22
  219. package/lib/esm/appui-abstract/quantity/BaseQuantityDescription.js +44 -44
  220. package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts +128 -128
  221. package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts.map +1 -1
  222. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js +81 -80
  223. package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
  224. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.d.ts +39 -39
  225. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js +131 -131
  226. package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
  227. package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts +121 -121
  228. package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
  229. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js +61 -60
  230. package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
  231. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.d.ts +45 -45
  232. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js +231 -231
  233. package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
  234. package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts +29 -17
  235. package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
  236. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js +48 -28
  237. package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
  238. package/lib/esm/appui-abstract/utils/PointProps.d.ts +10 -10
  239. package/lib/esm/appui-abstract/utils/PointProps.js +8 -8
  240. package/lib/esm/appui-abstract/utils/UiError.d.ts +12 -12
  241. package/lib/esm/appui-abstract/utils/UiError.js +18 -18
  242. package/lib/esm/appui-abstract/utils/UiEvent.d.ts +9 -9
  243. package/lib/esm/appui-abstract/utils/UiEvent.js +13 -13
  244. package/lib/esm/appui-abstract/utils/UiEventDispatcher.d.ts +46 -46
  245. package/lib/esm/appui-abstract/utils/UiEventDispatcher.js +126 -126
  246. package/lib/esm/appui-abstract/utils/callbacks.d.ts +20 -20
  247. package/lib/esm/appui-abstract/utils/callbacks.d.ts.map +1 -1
  248. package/lib/esm/appui-abstract/utils/callbacks.js +8 -8
  249. package/lib/esm/appui-abstract/utils/filter/charCode.d.ts +416 -416
  250. package/lib/esm/appui-abstract/utils/filter/charCode.js +5 -5
  251. package/lib/esm/appui-abstract/utils/filter/filters.d.ts +98 -98
  252. package/lib/esm/appui-abstract/utils/filter/filters.d.ts.map +1 -1
  253. package/lib/esm/appui-abstract/utils/filter/filters.js +694 -694
  254. package/lib/esm/appui-abstract/utils/filter/filters.js.map +1 -1
  255. package/lib/esm/appui-abstract/utils/filter/map.d.ts +59 -59
  256. package/lib/esm/appui-abstract/utils/filter/map.js +397 -399
  257. package/lib/esm/appui-abstract/utils/filter/map.js.map +1 -1
  258. package/lib/esm/appui-abstract/utils/filter/strings.d.ts +20 -20
  259. package/lib/esm/appui-abstract/utils/filter/strings.js +70 -70
  260. package/lib/esm/appui-abstract/utils/filter/strings.js.map +1 -1
  261. package/lib/esm/appui-abstract/utils/isLetter.d.ts +9 -9
  262. package/lib/esm/appui-abstract/utils/isLetter.js +15 -15
  263. package/lib/esm/appui-abstract/utils/misc.d.ts +11 -11
  264. package/lib/esm/appui-abstract/utils/misc.js +31 -31
  265. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +86 -69
  266. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -1
  267. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js +8 -8
  268. package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
  269. package/lib/esm/appui-abstract/widget/StagePanel.d.ts +36 -21
  270. package/lib/esm/appui-abstract/widget/StagePanel.d.ts.map +1 -1
  271. package/lib/esm/appui-abstract/widget/StagePanel.js +43 -27
  272. package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
  273. package/lib/esm/appui-abstract/widget/WidgetState.d.ts +19 -19
  274. package/lib/esm/appui-abstract/widget/WidgetState.js +24 -24
  275. package/lib/esm/appui-abstract.d.ts +103 -103
  276. package/lib/esm/appui-abstract.js +107 -107
  277. package/package.json +24 -16
@@ -1,136 +1,136 @@
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 StatusBar
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.StatusBarItemsManager = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- const ConditionalBooleanValue_1 = require("../items/ConditionalBooleanValue");
13
- const ConditionalStringValue_1 = require("../items/ConditionalStringValue");
14
- const isInstance = (args) => {
15
- return !Array.isArray(args);
16
- };
17
- /**
18
- * Controls status bar items.
19
- * @internal
20
- */
21
- class StatusBarItemsManager {
22
- constructor(items) {
23
- this._items = [];
24
- /** Event raised when StatusBar items are changed.
25
- * @internal
26
- */
27
- this.onItemsChanged = new core_bentley_1.BeEvent();
28
- if (items)
29
- this.loadItemsInternal(items, true, false);
30
- }
31
- loadItemsInternal(items, processConditions, sendItemChanged) {
32
- if (processConditions && items) {
33
- const eventIds = StatusBarItemsManager.getSyncIdsOfInterest(items);
34
- if (0 !== eventIds.length) {
35
- const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));
36
- // istanbul ignore else
37
- if (itemsUpdated)
38
- items = updatedItems;
39
- }
40
- }
41
- this._items = items;
42
- if (sendItemChanged)
43
- this.onItemsChanged.raiseEvent({ items });
44
- }
45
- /** load items but do not fire onItemsChanged
46
- * @internal
47
- */
48
- loadItems(items) {
49
- this.loadItemsInternal(items, true, false);
50
- }
51
- /** Get an array of the StatusBar items */
52
- get items() {
53
- return this._items;
54
- }
55
- set items(items) {
56
- // istanbul ignore else
57
- if (items !== this._items)
58
- this.loadItemsInternal(items, true, true);
59
- }
60
- add(itemOrItems) {
61
- let itemsToAdd;
62
- if (isInstance(itemOrItems))
63
- itemsToAdd = [itemOrItems];
64
- else {
65
- itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);
66
- }
67
- itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);
68
- if (itemsToAdd.length === 0)
69
- return;
70
- const items = [
71
- ...this._items,
72
- ...itemsToAdd,
73
- ];
74
- this.items = items;
75
- }
76
- /** Remove StatusBar items based on id */
77
- remove(itemIdOrItemIds) {
78
- const items = this._items.filter((item) => {
79
- return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);
80
- });
81
- this.items = items;
82
- }
83
- /** @internal */
84
- removeAll() {
85
- this._items = [];
86
- }
87
- static getSyncIdsOfInterest(items) {
88
- const eventIds = new Set();
89
- items.forEach((item) => {
90
- for (const [, entry] of Object.entries(item)) {
91
- if (entry instanceof ConditionalBooleanValue_1.ConditionalBooleanValue) {
92
- entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
93
- }
94
- else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue_1.ConditionalStringValue) {
95
- entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
96
- }
97
- }
98
- });
99
- return [...eventIds.values()];
100
- }
101
- internalRefreshAffectedItems(items, eventIds) {
102
- // istanbul ignore next
103
- if (0 === eventIds.size)
104
- return { itemsUpdated: false, updatedItems: [] };
105
- let updateRequired = false;
106
- const newItems = [];
107
- for (const item of items) {
108
- const updatedItem = { ...item };
109
- for (const [, entry] of Object.entries(updatedItem)) {
110
- if (entry instanceof ConditionalBooleanValue_1.ConditionalBooleanValue) {
111
- // istanbul ignore else
112
- if (ConditionalBooleanValue_1.ConditionalBooleanValue.refreshValue(entry, eventIds))
113
- updateRequired = true;
114
- }
115
- else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue_1.ConditionalStringValue) {
116
- // istanbul ignore else
117
- if (ConditionalStringValue_1.ConditionalStringValue.refreshValue(entry, eventIds))
118
- updateRequired = true;
119
- }
120
- }
121
- newItems.push(updatedItem);
122
- }
123
- return { itemsUpdated: updateRequired, updatedItems: newItems };
124
- }
125
- refreshAffectedItems(eventIds) {
126
- // istanbul ignore next
127
- if (0 === eventIds.size)
128
- return;
129
- const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);
130
- // istanbul ignore else
131
- if (itemsUpdated)
132
- this.loadItemsInternal(updatedItems, false, true);
133
- }
134
- }
135
- exports.StatusBarItemsManager = StatusBarItemsManager;
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 StatusBar
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.StatusBarItemsManager = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ const ConditionalBooleanValue_1 = require("../items/ConditionalBooleanValue");
13
+ const ConditionalStringValue_1 = require("../items/ConditionalStringValue");
14
+ const isInstance = (args) => {
15
+ return !Array.isArray(args);
16
+ };
17
+ /**
18
+ * Controls status bar items.
19
+ * @internal
20
+ */
21
+ class StatusBarItemsManager {
22
+ constructor(items) {
23
+ this._items = [];
24
+ /** Event raised when StatusBar items are changed.
25
+ * @internal
26
+ */
27
+ this.onItemsChanged = new core_bentley_1.BeEvent();
28
+ if (items)
29
+ this.loadItemsInternal(items, true, false);
30
+ }
31
+ loadItemsInternal(items, processConditions, sendItemChanged) {
32
+ if (processConditions && items) {
33
+ const eventIds = StatusBarItemsManager.getSyncIdsOfInterest(items);
34
+ if (0 !== eventIds.length) {
35
+ const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));
36
+ // istanbul ignore else
37
+ if (itemsUpdated)
38
+ items = updatedItems;
39
+ }
40
+ }
41
+ this._items = items;
42
+ if (sendItemChanged)
43
+ this.onItemsChanged.raiseEvent({ items });
44
+ }
45
+ /** load items but do not fire onItemsChanged
46
+ * @internal
47
+ */
48
+ loadItems(items) {
49
+ this.loadItemsInternal(items, true, false);
50
+ }
51
+ /** Get an array of the StatusBar items */
52
+ get items() {
53
+ return this._items;
54
+ }
55
+ set items(items) {
56
+ // istanbul ignore else
57
+ if (items !== this._items)
58
+ this.loadItemsInternal(items, true, true);
59
+ }
60
+ add(itemOrItems) {
61
+ let itemsToAdd;
62
+ if (isInstance(itemOrItems))
63
+ itemsToAdd = [itemOrItems];
64
+ else {
65
+ itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);
66
+ }
67
+ itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);
68
+ if (itemsToAdd.length === 0)
69
+ return;
70
+ const items = [
71
+ ...this._items,
72
+ ...itemsToAdd,
73
+ ];
74
+ this.items = items;
75
+ }
76
+ /** Remove StatusBar items based on id */
77
+ remove(itemIdOrItemIds) {
78
+ const items = this._items.filter((item) => {
79
+ return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);
80
+ });
81
+ this.items = items;
82
+ }
83
+ /** @internal */
84
+ removeAll() {
85
+ this._items = [];
86
+ }
87
+ static getSyncIdsOfInterest(items) {
88
+ const eventIds = new Set();
89
+ items.forEach((item) => {
90
+ for (const [, entry] of Object.entries(item)) {
91
+ if (entry instanceof ConditionalBooleanValue_1.ConditionalBooleanValue) {
92
+ entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
93
+ }
94
+ else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue_1.ConditionalStringValue) {
95
+ entry.syncEventIds.forEach((eventId) => eventIds.add(eventId.toLowerCase()));
96
+ }
97
+ }
98
+ });
99
+ return [...eventIds.values()];
100
+ }
101
+ internalRefreshAffectedItems(items, eventIds) {
102
+ // istanbul ignore next
103
+ if (0 === eventIds.size)
104
+ return { itemsUpdated: false, updatedItems: [] };
105
+ let updateRequired = false;
106
+ const newItems = [];
107
+ for (const item of items) {
108
+ const updatedItem = { ...item };
109
+ for (const [, entry] of Object.entries(updatedItem)) {
110
+ if (entry instanceof ConditionalBooleanValue_1.ConditionalBooleanValue) {
111
+ // istanbul ignore else
112
+ if (ConditionalBooleanValue_1.ConditionalBooleanValue.refreshValue(entry, eventIds))
113
+ updateRequired = true;
114
+ }
115
+ else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue_1.ConditionalStringValue) {
116
+ // istanbul ignore else
117
+ if (ConditionalStringValue_1.ConditionalStringValue.refreshValue(entry, eventIds))
118
+ updateRequired = true;
119
+ }
120
+ }
121
+ newItems.push(updatedItem);
122
+ }
123
+ return { itemsUpdated: updateRequired, updatedItems: newItems };
124
+ }
125
+ refreshAffectedItems(eventIds) {
126
+ // istanbul ignore next
127
+ if (0 === eventIds.size)
128
+ return;
129
+ const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);
130
+ // istanbul ignore else
131
+ if (itemsUpdated)
132
+ this.loadItemsInternal(updatedItems, false, true);
133
+ }
134
+ }
135
+ exports.StatusBarItemsManager = StatusBarItemsManager;
136
136
  //# sourceMappingURL=StatusBarItemsManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBarItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAC9C,8EAA2E;AAC3E,4EAAyE;AAOzE,MAAM,UAAU,GAAG,CAAgB,IAAwB,EAAa,EAAE;IACxE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AASF;;;GAGG;AACH,MAAa,qBAAqB;IAGhC,YAAY,KAA0C;QAF9C,WAAM,GAAuC,EAAE,CAAC;QAOxD;;WAEG;QACa,mBAAc,GAAG,IAAI,sBAAO,EAA6C,CAAC;QAPxF,IAAI,KAAK;YACP,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAOO,iBAAiB,CAAC,KAAyC,EAAE,iBAA0B,EAAE,eAAwB;QACvH,IAAI,iBAAiB,IAAI,KAAK,EAAE;YAC9B,MAAM,QAAQ,GAAG,qBAAqB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACnE,IAAI,CAAC,KAAK,QAAQ,CAAC,MAAM,EAAE;gBACzB,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAEnG,uBAAuB;gBACvB,IAAI,YAAY;oBACd,KAAK,GAAG,YAAY,CAAC;aACxB;SACF;QAED,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,eAAe;YACjB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,SAAS,CAAC,KAAyC;QACxD,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAA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AAM,QAAQ,GAA0B,EAAE,CAAC;QAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACxB,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YAEhC,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;gBACnD,IAAI,KAAK,YAAY,iDAAuB,EAAE;oBAC5C,uBAAuB;oBACvB,IAAI,iDAAuB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACvD,cAAc,GAAG,IAAI,CAAC;iBACzB;qBAAM,0BAA0B,CAAC,IAAI,KAAK,YAAY,+CAAsB,EAAE;oBAC7E,uBAAuB;oBACvB,IAAI,+CAAsB,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;wBACtD,cAAc,GAAG,IAAI,CAAC;iBACzB;aACF;YAED,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC;IAEM,oBAAoB,CAAC,QAAqB;QAC/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;YACrB,OAAO;QAET,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE/F,uBAAuB;QACvB,IAAI,YAAY;YACd,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AArID,sDAqIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { CommonStatusBarItem, StatusBarItemId } from \"./StatusBarItem\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\r\n\r\nconst isInstance = <T extends any>(args: InstanceOrArray<T>): args is T => {\r\n return !Array.isArray(args);\r\n};\r\n\r\n/** Arguments of [[StatusBarItemsManager.onChanged]] event.\r\n * @internal\r\n */\r\nexport interface StatusBarItemsChangedArgs {\r\n readonly items: ReadonlyArray<CommonStatusBarItem>;\r\n}\r\n\r\n/**\r\n * Controls status bar items.\r\n * @internal\r\n */\r\nexport class StatusBarItemsManager {\r\n private _items: ReadonlyArray<CommonStatusBarItem> = [];\r\n\r\n constructor(items?: ReadonlyArray<CommonStatusBarItem>) {\r\n if (items)\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Event raised when StatusBar items are changed.\r\n * @internal\r\n */\r\n public readonly onItemsChanged = new BeEvent<(args: StatusBarItemsChangedArgs) => void>();\r\n\r\n private loadItemsInternal(items: ReadonlyArray<CommonStatusBarItem>, processConditions: boolean, sendItemChanged: boolean) {\r\n if (processConditions && items) {\r\n const eventIds = StatusBarItemsManager.getSyncIdsOfInterest(items);\r\n if (0 !== eventIds.length) {\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n items = updatedItems;\r\n }\r\n }\r\n\r\n this._items = items;\r\n if (sendItemChanged)\r\n this.onItemsChanged.raiseEvent({ items });\r\n }\r\n\r\n /** load items but do not fire onItemsChanged\r\n * @internal\r\n */\r\n public loadItems(items: ReadonlyArray<CommonStatusBarItem>) {\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Get an array of the StatusBar items */\r\n public get items(): ReadonlyArray<CommonStatusBarItem> {\r\n return this._items;\r\n }\r\n\r\n public set items(items: ReadonlyArray<CommonStatusBarItem>) {\r\n // istanbul ignore else\r\n if (items !== this._items)\r\n this.loadItemsInternal(items, true, true);\r\n }\r\n\r\n public add(itemOrItems: CommonStatusBarItem | ReadonlyArray<CommonStatusBarItem>) {\r\n let itemsToAdd;\r\n if (isInstance(itemOrItems))\r\n itemsToAdd = [itemOrItems];\r\n else {\r\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\r\n }\r\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\r\n if (itemsToAdd.length === 0)\r\n return;\r\n const items = [\r\n ...this._items,\r\n ...itemsToAdd,\r\n ];\r\n this.items = items;\r\n }\r\n\r\n /** Remove StatusBar items based on id */\r\n public remove(itemIdOrItemIds: StatusBarItemId | ReadonlyArray<StatusBarItemId\r\n >) {\r\n const items = this._items.filter((item) => {\r\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\r\n });\r\n this.items = items;\r\n }\r\n\r\n /** @internal */\r\n public removeAll() {\r\n this._items = [];\r\n }\r\n\r\n public static getSyncIdsOfInterest(items: readonly CommonStatusBarItem[]): string[] {\r\n const eventIds = new Set<string>();\r\n items.forEach((item) => {\r\n for (const [, entry] of Object.entries(item)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n }\r\n }\r\n });\r\n return [...eventIds.values()];\r\n }\r\n\r\n private internalRefreshAffectedItems(items: readonly CommonStatusBarItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: CommonStatusBarItem[] } {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return { itemsUpdated: false, updatedItems: [] };\r\n\r\n let updateRequired = false;\r\n\r\n const newItems: CommonStatusBarItem[] = [];\r\n for (const item of items) {\r\n const updatedItem = { ...item };\r\n\r\n for (const [, entry] of Object.entries(updatedItem)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n // istanbul ignore else\r\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n // istanbul ignore else\r\n if (ConditionalStringValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n }\r\n }\r\n\r\n newItems.push(updatedItem);\r\n }\r\n\r\n return { itemsUpdated: updateRequired, updatedItems: newItems };\r\n }\r\n\r\n public refreshAffectedItems(eventIds: Set<string>) {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return;\r\n\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n this.loadItemsInternal(updatedItems, false, true);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"StatusBarItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-abstract/statusbar/StatusBarItemsManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAC9C,8EAA2E;AAC3E,4EAAyE;AAOzE,MAAM,UAAU,GAAG,CAAI,IAAwB,EAAa,EAAE;IAC5D,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AASF;;;GAGG;AACH,MAAa,qBAAqB;IAGhC,YAAY,KAA0C;QAF9C,WAAM,GAAuC,EAAE,CAAC;QAOxD;;WAEG;QACa,mBAAc,GAAG,IAAI,sBAAO,EAA6C,CAAC;QAPxF,IAAI,KAAK;YACP,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,IAA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I,CAAC;iBACzB;aACF;YAED,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC5B;QAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;IAClE,CAAC;IAEM,oBAAoB,CAAC,QAAqB;QAC/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI;YACrB,OAAO;QAET,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAE/F,uBAAuB;QACvB,IAAI,YAAY;YACd,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AArID,sDAqIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module StatusBar\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { ConditionalBooleanValue } from \"../items/ConditionalBooleanValue\";\r\nimport { ConditionalStringValue } from \"../items/ConditionalStringValue\";\r\nimport { CommonStatusBarItem, StatusBarItemId } from \"./StatusBarItem\";\r\n\r\n/* eslint-disable deprecation/deprecation */\r\n\r\ntype InstanceOrArray<T> = T | ReadonlyArray<T>;\r\n\r\nconst isInstance = <T>(args: InstanceOrArray<T>): args is T => {\r\n return !Array.isArray(args);\r\n};\r\n\r\n/** Arguments of [[StatusBarItemsManager.onChanged]] event.\r\n * @internal\r\n */\r\nexport interface StatusBarItemsChangedArgs {\r\n readonly items: ReadonlyArray<CommonStatusBarItem>;\r\n}\r\n\r\n/**\r\n * Controls status bar items.\r\n * @internal\r\n */\r\nexport class StatusBarItemsManager {\r\n private _items: ReadonlyArray<CommonStatusBarItem> = [];\r\n\r\n constructor(items?: ReadonlyArray<CommonStatusBarItem>) {\r\n if (items)\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Event raised when StatusBar items are changed.\r\n * @internal\r\n */\r\n public readonly onItemsChanged = new BeEvent<(args: StatusBarItemsChangedArgs) => void>();\r\n\r\n private loadItemsInternal(items: ReadonlyArray<CommonStatusBarItem>, processConditions: boolean, sendItemChanged: boolean) {\r\n if (processConditions && items) {\r\n const eventIds = StatusBarItemsManager.getSyncIdsOfInterest(items);\r\n if (0 !== eventIds.length) {\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(items, new Set(eventIds));\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n items = updatedItems;\r\n }\r\n }\r\n\r\n this._items = items;\r\n if (sendItemChanged)\r\n this.onItemsChanged.raiseEvent({ items });\r\n }\r\n\r\n /** load items but do not fire onItemsChanged\r\n * @internal\r\n */\r\n public loadItems(items: ReadonlyArray<CommonStatusBarItem>) {\r\n this.loadItemsInternal(items, true, false);\r\n }\r\n\r\n /** Get an array of the StatusBar items */\r\n public get items(): ReadonlyArray<CommonStatusBarItem> {\r\n return this._items;\r\n }\r\n\r\n public set items(items: ReadonlyArray<CommonStatusBarItem>) {\r\n // istanbul ignore else\r\n if (items !== this._items)\r\n this.loadItemsInternal(items, true, true);\r\n }\r\n\r\n public add(itemOrItems: CommonStatusBarItem | ReadonlyArray<CommonStatusBarItem>) {\r\n let itemsToAdd;\r\n if (isInstance(itemOrItems))\r\n itemsToAdd = [itemOrItems];\r\n else {\r\n itemsToAdd = itemOrItems.filter((itemToAdd, index) => itemOrItems.findIndex((item) => item.id === itemToAdd.id) === index);\r\n }\r\n itemsToAdd = itemsToAdd.filter((itemToAdd) => this._items.find((item) => item.id === itemToAdd.id) === undefined);\r\n if (itemsToAdd.length === 0)\r\n return;\r\n const items = [\r\n ...this._items,\r\n ...itemsToAdd,\r\n ];\r\n this.items = items;\r\n }\r\n\r\n /** Remove StatusBar items based on id */\r\n public remove(itemIdOrItemIds: StatusBarItemId | ReadonlyArray<StatusBarItemId\r\n >) {\r\n const items = this._items.filter((item) => {\r\n return isInstance(itemIdOrItemIds) ? item.id !== itemIdOrItemIds : !itemIdOrItemIds.find((itemId) => itemId === item.id);\r\n });\r\n this.items = items;\r\n }\r\n\r\n /** @internal */\r\n public removeAll() {\r\n this._items = [];\r\n }\r\n\r\n public static getSyncIdsOfInterest(items: readonly CommonStatusBarItem[]): string[] {\r\n const eventIds = new Set<string>();\r\n items.forEach((item) => {\r\n for (const [, entry] of Object.entries(item)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n entry.syncEventIds.forEach((eventId: string) => eventIds.add(eventId.toLowerCase()));\r\n }\r\n }\r\n });\r\n return [...eventIds.values()];\r\n }\r\n\r\n private internalRefreshAffectedItems(items: readonly CommonStatusBarItem[], eventIds: Set<string>): { itemsUpdated: boolean, updatedItems: CommonStatusBarItem[] } {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return { itemsUpdated: false, updatedItems: [] };\r\n\r\n let updateRequired = false;\r\n\r\n const newItems: CommonStatusBarItem[] = [];\r\n for (const item of items) {\r\n const updatedItem = { ...item };\r\n\r\n for (const [, entry] of Object.entries(updatedItem)) {\r\n if (entry instanceof ConditionalBooleanValue) {\r\n // istanbul ignore else\r\n if (ConditionalBooleanValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n } else /* istanbul ignore else */ if (entry instanceof ConditionalStringValue) {\r\n // istanbul ignore else\r\n if (ConditionalStringValue.refreshValue(entry, eventIds))\r\n updateRequired = true;\r\n }\r\n }\r\n\r\n newItems.push(updatedItem);\r\n }\r\n\r\n return { itemsUpdated: updateRequired, updatedItems: newItems };\r\n }\r\n\r\n public refreshAffectedItems(eventIds: Set<string>) {\r\n // istanbul ignore next\r\n if (0 === eventIds.size)\r\n return;\r\n\r\n const { itemsUpdated, updatedItems } = this.internalRefreshAffectedItems(this.items, eventIds);\r\n\r\n // istanbul ignore else\r\n if (itemsUpdated)\r\n this.loadItemsInternal(updatedItems, false, true);\r\n }\r\n}\r\n"]}
@@ -1,122 +1,122 @@
1
- /** @packageDocumentation
2
- * @module Toolbar
3
- */
4
- import { BadgeType } from "../items/BadgeType";
5
- import { ConditionalBooleanValue } from "../items/ConditionalBooleanValue";
6
- import { ConditionalStringValue } from "../items/ConditionalStringValue";
7
- import { ProvidedItem } from "../items/ProvidedItem";
8
- /** Used to specify the usage of the toolbar which determine the toolbar position.
9
- * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.
10
- * @public
11
- */
12
- export declare enum ToolbarUsage {
13
- /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */
14
- ContentManipulation = 0,
15
- /** Manipulate view/camera - in ninezone this is in top right of content area. */
16
- ViewNavigation = 1
17
- }
18
- /** Used to specify the orientation of the toolbar.
19
- * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.
20
- * @public
21
- */
22
- export declare enum ToolbarOrientation {
23
- /** Horizontal toolbar. */
24
- Horizontal = 0,
25
- /** Vertical toolbar. */
26
- Vertical = 1
27
- }
28
- /** Describes the data needed to insert a UI items into an existing set of UI items.
29
- * @public
30
- */
31
- export interface ToolbarItem extends ProvidedItem {
32
- /** can be used by application to store miscellaneous data. */
33
- readonly applicationData?: any;
34
- /** Describes badge. Renders no badge if not specified. */
35
- readonly badgeType?: BadgeType;
36
- /** Optional description */
37
- readonly description?: string | ConditionalStringValue;
38
- /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */
39
- readonly id: string;
40
- /** optional data to used by item implementor. */
41
- readonly internalData?: Map<string, any>;
42
- /** Defines if the item is active (shown with an active stripe/bar). */
43
- readonly isActive?: boolean;
44
- /** Describes if the item is visible or hidden. The default is for the item to be visible. */
45
- readonly isHidden?: boolean | ConditionalBooleanValue;
46
- /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */
47
- readonly isDisabled?: boolean | ConditionalBooleanValue;
48
- /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars
49
- * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars
50
- * the icon is usually changed to denote the state of a toggle.
51
- */
52
- readonly isPressed?: boolean;
53
- /** Specifies the item's grouping value. Items are sorted by group and then item priority. When
54
- * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This
55
- * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.
56
- */
57
- readonly groupPriority?: number;
58
- /** Priority within a toolbar or group. */
59
- readonly itemPriority: number;
60
- /** Optional parent tool group to add tool. */
61
- readonly parentToolGroupId?: string;
62
- }
63
- /** Describes the data needed to insert an action button into a toolbar.
64
- * @public
65
- */
66
- export interface ActionButton extends ToolbarItem {
67
- /** Name of icon WebFont entry or if specifying an imported SVG symbol use "webSvg:" prefix to imported symbol Id. */
68
- readonly icon: string | ConditionalStringValue;
69
- /** label, shown as tool tip on a button or an item label in a group. */
70
- readonly label: string | ConditionalStringValue;
71
- /** function to run when the button is pressed. */
72
- readonly execute: () => void;
73
- }
74
- /** Describes the data needed to insert a group button into a toolbar.
75
- * @public
76
- */
77
- export interface GroupButton extends ToolbarItem {
78
- /** Name of icon WebFont entry or if specifying an imported SVG symbol use "webSvg:" prefix to imported symbol Id. */
79
- readonly icon: string | ConditionalStringValue;
80
- /** label, shown as tool tip on group button or a group button label in a group panel. */
81
- readonly label: string | ConditionalStringValue;
82
- /** label shown as the title in at top of group panel. */
83
- readonly panelLabel?: string | ConditionalStringValue;
84
- /** children of the group */
85
- readonly items: ReadonlyArray<ActionButton | GroupButton>;
86
- }
87
- /** Describes the data needed to insert a custom button into a toolbar.
88
- * @public
89
- */
90
- export interface CustomButtonDefinition extends ToolbarItem {
91
- /** Name of icon WebFont entry or if specifying an imported SVG symbol use "webSvg:" prefix to imported symbol Id. */
92
- readonly icon?: string | ConditionalStringValue;
93
- /** label, shown as tool tip on group button or a group button label in a group panel. */
94
- readonly label?: string | ConditionalStringValue;
95
- /** parameter that marks data as being a custom definition. */
96
- readonly isCustom: true;
97
- }
98
- /** Any Button Type that can be inserted into a toolbar.
99
- * @public
100
- */
101
- export declare type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;
102
- /** Type for Toolbar Item Id
103
- * @deprecated in 3.6.
104
- * @public
105
- */
106
- export declare type ToolbarItemId = CommonToolbarItem["id"];
107
- /** Helper class to create Abstract StatusBar Item definitions.
108
- * @public
109
- */
110
- export declare class ToolbarItemUtilities {
111
- /** Creates an Action Button */
112
- static createActionButton: (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton> | undefined) => ActionButton;
113
- /** Creates a Group button. */
114
- static createGroupButton: (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton> | undefined) => GroupButton;
115
- /** ActionButton type guard. */
116
- static isActionButton(item: CommonToolbarItem): item is ActionButton;
117
- /** GroupButton type guard. */
118
- static isGroupButton(item: CommonToolbarItem): item is GroupButton;
119
- /** CustomButtonDefinition type guard. */
120
- static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition;
121
- }
1
+ /** @packageDocumentation
2
+ * @module Toolbar
3
+ */
4
+ import { BadgeType } from "../items/BadgeType";
5
+ import { ConditionalBooleanValue } from "../items/ConditionalBooleanValue";
6
+ import { ConditionalStringValue } from "../items/ConditionalStringValue";
7
+ import { ProvidedItem } from "../items/ProvidedItem";
8
+ /** Used to specify the usage of the toolbar which determine the toolbar position.
9
+ * @deprecated in 3.6. Use [ToolbarUsage]($appui-react) instead.
10
+ * @public
11
+ */
12
+ export declare enum ToolbarUsage {
13
+ /** Contains tools to Create Update and Delete content - in ninezone this is in top left of content area. */
14
+ ContentManipulation = 0,
15
+ /** Manipulate view/camera - in ninezone this is in top right of content area. */
16
+ ViewNavigation = 1
17
+ }
18
+ /** Used to specify the orientation of the toolbar.
19
+ * @deprecated in 3.6. Use [ToolbarOrientation]($appui-react) instead.
20
+ * @public
21
+ */
22
+ export declare enum ToolbarOrientation {
23
+ /** Horizontal toolbar. */
24
+ Horizontal = 0,
25
+ /** Vertical toolbar. */
26
+ Vertical = 1
27
+ }
28
+ /** Describes the data needed to insert a UI items into an existing set of UI items.
29
+ * @public
30
+ */
31
+ export interface ToolbarItem extends ProvidedItem {
32
+ /** can be used by application to store miscellaneous data. */
33
+ readonly applicationData?: any;
34
+ /** Describes badge. Renders no badge if not specified. */
35
+ readonly badgeType?: BadgeType;
36
+ /** Optional description */
37
+ readonly description?: string | ConditionalStringValue;
38
+ /** Require uniqueId for the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */
39
+ readonly id: string;
40
+ /** optional data to used by item implementor. */
41
+ readonly internalData?: Map<string, any>;
42
+ /** Defines if the item is active (shown with an active stripe/bar). */
43
+ readonly isActive?: boolean;
44
+ /** Describes if the item is visible or hidden. The default is for the item to be visible. */
45
+ readonly isHidden?: boolean | ConditionalBooleanValue;
46
+ /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */
47
+ readonly isDisabled?: boolean | ConditionalBooleanValue;
48
+ /** Describes if the item should appear pressed (used for displaying toggle state). This property is NOT used by Toolbars
49
+ * constructed using the `ToolbarWithOverflow` component, which are used in AppUi 2.0 and later. For these later toolbars
50
+ * the icon is usually changed to denote the state of a toggle.
51
+ */
52
+ readonly isPressed?: boolean;
53
+ /** Specifies the item's grouping value. Items are sorted by group and then item priority. When
54
+ * group priority changes a separator is inserted. It is recommended using values 10 through 100, incrementing by 10. This
55
+ * allows extensions enough gaps to insert their own groups. If the value is not specified a groupPriority of 0 is used.
56
+ */
57
+ readonly groupPriority?: number;
58
+ /** Priority within a toolbar or group. */
59
+ readonly itemPriority: number;
60
+ /** Optional parent tool group to add tool. */
61
+ readonly parentToolGroupId?: string;
62
+ }
63
+ /** Describes the data needed to insert an action button into a toolbar.
64
+ * @public
65
+ */
66
+ export interface ActionButton extends ToolbarItem {
67
+ /** Name of icon WebFont entry or if specifying an imported SVG symbol use "webSvg:" prefix to imported symbol Id. */
68
+ readonly icon: string | ConditionalStringValue;
69
+ /** label, shown as tool tip on a button or an item label in a group. */
70
+ readonly label: string | ConditionalStringValue;
71
+ /** function to run when the button is pressed. */
72
+ readonly execute: () => void;
73
+ }
74
+ /** Describes the data needed to insert a group button into a toolbar.
75
+ * @public
76
+ */
77
+ export interface GroupButton extends ToolbarItem {
78
+ /** Name of icon WebFont entry or if specifying an imported SVG symbol use "webSvg:" prefix to imported symbol Id. */
79
+ readonly icon: string | ConditionalStringValue;
80
+ /** label, shown as tool tip on group button or a group button label in a group panel. */
81
+ readonly label: string | ConditionalStringValue;
82
+ /** label shown as the title in at top of group panel. */
83
+ readonly panelLabel?: string | ConditionalStringValue;
84
+ /** children of the group */
85
+ readonly items: ReadonlyArray<ActionButton | GroupButton>;
86
+ }
87
+ /** Describes the data needed to insert a custom button into a toolbar.
88
+ * @public
89
+ */
90
+ export interface CustomButtonDefinition extends ToolbarItem {
91
+ /** Name of icon WebFont entry or if specifying an imported SVG symbol use "webSvg:" prefix to imported symbol Id. */
92
+ readonly icon?: string | ConditionalStringValue;
93
+ /** label, shown as tool tip on group button or a group button label in a group panel. */
94
+ readonly label?: string | ConditionalStringValue;
95
+ /** parameter that marks data as being a custom definition. */
96
+ readonly isCustom: true;
97
+ }
98
+ /** Any Button Type that can be inserted into a toolbar.
99
+ * @public
100
+ */
101
+ export type CommonToolbarItem = ActionButton | GroupButton | CustomButtonDefinition;
102
+ /** Type for Toolbar Item Id
103
+ * @deprecated in 3.6. Please use `ToolbarItem["id"]` from @itwin/appui-react.
104
+ * @public
105
+ */
106
+ export type ToolbarItemId = CommonToolbarItem["id"];
107
+ /** Helper class to create Abstract StatusBar Item definitions.
108
+ * @public
109
+ */
110
+ export declare class ToolbarItemUtilities {
111
+ /** Creates an Action Button */
112
+ static createActionButton: (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, execute: () => void, overrides?: Partial<ActionButton>) => ActionButton;
113
+ /** Creates a Group button. */
114
+ static createGroupButton: (id: string, itemPriority: number, icon: string | ConditionalStringValue, label: string | ConditionalStringValue, items: ReadonlyArray<ActionButton | GroupButton>, overrides?: Partial<GroupButton>) => GroupButton;
115
+ /** ActionButton type guard. */
116
+ static isActionButton(item: CommonToolbarItem): item is ActionButton;
117
+ /** GroupButton type guard. */
118
+ static isGroupButton(item: CommonToolbarItem): item is GroupButton;
119
+ /** CustomButtonDefinition type guard. */
120
+ static isCustomDefinition(item: CommonToolbarItem): item is CustomButtonDefinition;
121
+ }
122
122
  //# sourceMappingURL=ToolbarItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-abstract/toolbars/ToolbarItem.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD;;;GAGG;AACH,oBAAY,YAAY;IACtB,4GAA4G;IAC5G,mBAAmB,IAAI;IACvB,iFAAiF;IACjF,cAAc,IAAI;CACnB;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,0BAA0B;IAC1B,UAAU,IAAI;IACd,wBAAwB;IACxB,QAAQ,IAAI;CACb;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC/C,8DAA8D;IAC9D,QAAQ,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CA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