@itwin/appui-react 4.9.0 → 4.10.0-dev.1

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 (447) hide show
  1. package/lib/cjs/appui-react/UiFramework.js +4 -7
  2. package/lib/cjs/appui-react/UiFramework.js.map +1 -1
  3. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.d.ts +4 -2
  4. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
  5. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js +17 -29
  6. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  7. package/lib/cjs/appui-react/accudraw/AccuDrawFieldContainer.scss +10 -17
  8. package/lib/cjs/appui-react/accudraw/AccuDrawInputField.scss +2 -0
  9. package/lib/cjs/appui-react/accudraw/SquareButton.d.ts +3 -1
  10. package/lib/cjs/appui-react/accudraw/SquareButton.d.ts.map +1 -1
  11. package/lib/cjs/appui-react/accudraw/SquareButton.js +1 -4
  12. package/lib/cjs/appui-react/accudraw/SquareButton.js.map +1 -1
  13. package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +1 -2
  14. package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
  15. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +2 -2
  16. package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  17. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts +1 -1
  18. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  19. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +19 -15
  20. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  21. package/lib/cjs/appui-react/configurableui/{configurableui.scss → ConfigurableUiContent.scss} +14 -0
  22. package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
  23. package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  24. package/lib/cjs/appui-react/configurableui/TimeTracker.js +1 -2
  25. package/lib/cjs/appui-react/configurableui/TimeTracker.js.map +1 -1
  26. package/lib/cjs/appui-react/content/ContentLayout.js +9 -12
  27. package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
  28. package/lib/cjs/appui-react/content/DefaultViewOverlay.js +3 -4
  29. package/lib/cjs/appui-react/content/DefaultViewOverlay.js.map +1 -1
  30. package/lib/cjs/appui-react/content/FloatingViewportContent.js +1 -2
  31. package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
  32. package/lib/cjs/appui-react/content/IModelViewport.js +4 -7
  33. package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
  34. package/lib/cjs/appui-react/content/InternalContentLayoutManager.js +1 -2
  35. package/lib/cjs/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  36. package/lib/cjs/appui-react/content/InternalContentViewManager.js +2 -2
  37. package/lib/cjs/appui-react/content/InternalContentViewManager.js.map +1 -1
  38. package/lib/cjs/appui-react/content/split-pane/SplitPane.js +10 -12
  39. package/lib/cjs/appui-react/content/split-pane/SplitPane.js.map +1 -1
  40. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +2 -3
  41. package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  42. package/lib/cjs/appui-react/dialog/ContentDialog.js +3 -6
  43. package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
  44. package/lib/cjs/appui-react/dialog/DialogManagerBase.js +2 -3
  45. package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
  46. package/lib/cjs/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
  47. package/lib/cjs/appui-react/feedback/ElementTooltip.js +2 -3
  48. package/lib/cjs/appui-react/feedback/ElementTooltip.js.map +1 -1
  49. package/lib/cjs/appui-react/frontstage/FrontstageDef.js +10 -14
  50. package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
  51. package/lib/cjs/appui-react/frontstage/ModalFrontstage.d.ts +2 -4
  52. package/lib/cjs/appui-react/frontstage/ModalFrontstage.d.ts.map +1 -1
  53. package/lib/cjs/appui-react/frontstage/ModalFrontstage.js +2 -3
  54. package/lib/cjs/appui-react/frontstage/ModalFrontstage.js.map +1 -1
  55. package/lib/cjs/appui-react/frontstage/ModalFrontstage.scss +1 -1
  56. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +2 -3
  57. package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  58. package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +1 -2
  59. package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  60. package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js +7 -11
  61. package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
  62. package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js +7 -11
  63. package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
  64. package/lib/cjs/appui-react/hooks/useSolarDataProvider.js +8 -13
  65. package/lib/cjs/appui-react/hooks/useSolarDataProvider.js.map +1 -1
  66. package/lib/cjs/appui-react/layout/base/DragManager.js +1 -2
  67. package/lib/cjs/appui-react/layout/base/DragManager.js.map +1 -1
  68. package/lib/cjs/appui-react/layout/base/NineZone.js +1 -1
  69. package/lib/cjs/appui-react/layout/base/NineZone.js.map +1 -1
  70. package/lib/cjs/appui-react/layout/outline/TabOutline.js +1 -1
  71. package/lib/cjs/appui-react/layout/outline/TabOutline.js.map +1 -1
  72. package/lib/cjs/appui-react/layout/outline/WidgetOutline.js +1 -1
  73. package/lib/cjs/appui-react/layout/outline/WidgetOutline.js.map +1 -1
  74. package/lib/cjs/appui-react/layout/state/NineZoneStateReducer.js +12 -14
  75. package/lib/cjs/appui-react/layout/state/NineZoneStateReducer.js.map +1 -1
  76. package/lib/cjs/appui-react/layout/state/internal/NineZoneStateHelpers.js +1 -2
  77. package/lib/cjs/appui-react/layout/state/internal/NineZoneStateHelpers.js.map +1 -1
  78. package/lib/cjs/appui-react/layout/state/internal/TabStateHelpers.js +2 -3
  79. package/lib/cjs/appui-react/layout/state/internal/TabStateHelpers.js.map +1 -1
  80. package/lib/cjs/appui-react/layout/state/internal/WidgetStateHelpers.js +4 -4
  81. package/lib/cjs/appui-react/layout/state/internal/WidgetStateHelpers.js.map +1 -1
  82. package/lib/cjs/appui-react/layout/target/TitleBarTarget.js +1 -1
  83. package/lib/cjs/appui-react/layout/target/TitleBarTarget.js.map +1 -1
  84. package/lib/cjs/appui-react/layout/tool-settings/Docked.scss +1 -1
  85. package/lib/cjs/appui-react/layout/widget/Button.d.ts +2 -9
  86. package/lib/cjs/appui-react/layout/widget/Button.d.ts.map +1 -1
  87. package/lib/cjs/appui-react/layout/widget/Button.js.map +1 -1
  88. package/lib/cjs/appui-react/layout/widget/ContentRenderer.js +2 -2
  89. package/lib/cjs/appui-react/layout/widget/ContentRenderer.js.map +1 -1
  90. package/lib/cjs/appui-react/layout/widget/FloatingTab.js +5 -6
  91. package/lib/cjs/appui-react/layout/widget/FloatingTab.js.map +1 -1
  92. package/lib/cjs/appui-react/layout/widget/FloatingWidget.js +2 -4
  93. package/lib/cjs/appui-react/layout/widget/FloatingWidget.js.map +1 -1
  94. package/lib/cjs/appui-react/layout/widget/PanelWidget.js +1 -1
  95. package/lib/cjs/appui-react/layout/widget/PanelWidget.js.map +1 -1
  96. package/lib/cjs/appui-react/layout/widget/PreviewHorizontalPanelAlign.js +1 -1
  97. package/lib/cjs/appui-react/layout/widget/PreviewHorizontalPanelAlign.js.map +1 -1
  98. package/lib/cjs/appui-react/layout/widget/Tab.js +4 -4
  99. package/lib/cjs/appui-react/layout/widget/Tab.js.map +1 -1
  100. package/lib/cjs/appui-react/layout/widget/Widget.js +2 -2
  101. package/lib/cjs/appui-react/layout/widget/Widget.js.map +1 -1
  102. package/lib/cjs/appui-react/layout/widget/useIsToolSettingsTab.js +1 -1
  103. package/lib/cjs/appui-react/layout/widget/useIsToolSettingsTab.js.map +1 -1
  104. package/lib/cjs/appui-react/layout/widget-panels/PanelSections.js +5 -8
  105. package/lib/cjs/appui-react/layout/widget-panels/PanelSections.js.map +1 -1
  106. package/lib/cjs/appui-react/layout/widget-panels/useAnimatePanel.js +1 -2
  107. package/lib/cjs/appui-react/layout/widget-panels/useAnimatePanel.js.map +1 -1
  108. package/lib/cjs/appui-react/messages/InputField.d.ts.map +1 -1
  109. package/lib/cjs/appui-react/messages/InputField.js +2 -3
  110. package/lib/cjs/appui-react/messages/InputField.js.map +1 -1
  111. package/lib/cjs/appui-react/messages/MessageLabel.js +2 -2
  112. package/lib/cjs/appui-react/messages/MessageLabel.js.map +1 -1
  113. package/lib/cjs/appui-react/messages/MessageManager.d.ts +15 -5
  114. package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
  115. package/lib/cjs/appui-react/messages/MessageManager.js +23 -41
  116. package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
  117. package/lib/cjs/appui-react/messages/MessageRenderer.d.ts +8 -0
  118. package/lib/cjs/appui-react/messages/MessageRenderer.d.ts.map +1 -0
  119. package/lib/cjs/appui-react/messages/MessageRenderer.js +136 -0
  120. package/lib/cjs/appui-react/messages/MessageRenderer.js.map +1 -0
  121. package/lib/cjs/appui-react/messages/Pointer.d.ts +2 -2
  122. package/lib/cjs/appui-react/messages/Pointer.d.ts.map +1 -1
  123. package/lib/cjs/appui-react/messages/Pointer.js +5 -6
  124. package/lib/cjs/appui-react/messages/Pointer.js.map +1 -1
  125. package/lib/cjs/appui-react/messages/getToastCategory.d.ts +1 -1
  126. package/lib/cjs/appui-react/pickers/ViewSelector.js +5 -6
  127. package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
  128. package/lib/cjs/appui-react/popup/CardPopup.d.ts.map +1 -1
  129. package/lib/cjs/appui-react/popup/CardPopup.js +1 -2
  130. package/lib/cjs/appui-react/popup/CardPopup.js.map +1 -1
  131. package/lib/cjs/appui-react/popup/HTMLElementPopup.d.ts.map +1 -1
  132. package/lib/cjs/appui-react/popup/HTMLElementPopup.js +1 -2
  133. package/lib/cjs/appui-react/popup/HTMLElementPopup.js.map +1 -1
  134. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +1 -2
  135. package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  136. package/lib/cjs/appui-react/popup/PopupManager.js +1 -2
  137. package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
  138. package/lib/cjs/appui-react/preview/PreviewFeatures.js +1 -1
  139. package/lib/cjs/appui-react/preview/PreviewFeatures.js.map +1 -1
  140. package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.d.ts.map +1 -1
  141. package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.js +5 -5
  142. package/lib/cjs/appui-react/preview/widget-action-dropdown/MoreButton.js.map +1 -1
  143. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +2 -2
  144. package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  145. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
  146. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  147. package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.scss +1 -4
  148. package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +11 -16
  149. package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  150. package/lib/cjs/appui-react/statusbar/Indicator.js +1 -2
  151. package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -1
  152. package/lib/cjs/appui-react/statusbar/StatusBar.js +3 -5
  153. package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
  154. package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts +1 -1
  155. package/lib/cjs/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
  156. package/lib/cjs/appui-react/statusfields/MessageCenter.js +5 -4
  157. package/lib/cjs/appui-react/statusfields/MessageCenter.js.map +1 -1
  158. package/lib/cjs/appui-react/statusfields/SelectionScope.scss +1 -3
  159. package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.d.ts.map +1 -1
  160. package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.js +1 -1
  161. package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
  162. package/lib/cjs/appui-react/statusfields/tileloading/TileLoadingIndicator.scss +1 -1
  163. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  164. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +3 -2
  165. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  166. package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +3 -12
  167. package/lib/cjs/appui-react/theme/ThemeManager.d.ts.map +1 -1
  168. package/lib/cjs/appui-react/theme/ThemeManager.js +3 -1
  169. package/lib/cjs/appui-react/theme/ThemeManager.js.map +1 -1
  170. package/lib/cjs/appui-react/toolbar/ToolbarHelper.js +6 -4
  171. package/lib/cjs/appui-react/toolbar/ToolbarHelper.js.map +1 -1
  172. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js +3 -4
  173. package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  174. package/lib/cjs/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  175. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +18 -25
  176. package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  177. package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js +3 -2
  178. package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  179. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +20 -22
  180. package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  181. package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +9 -10
  182. package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  183. package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -2
  184. package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  185. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +8 -14
  186. package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  187. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
  188. package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  189. package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js +1 -1
  190. package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  191. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.d.ts +1 -0
  192. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
  193. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +19 -16
  194. package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  195. package/lib/cjs/appui-react/widget-panels/Content.js +8 -9
  196. package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
  197. package/lib/cjs/appui-react/widget-panels/Frontstage.js +10 -14
  198. package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
  199. package/lib/cjs/appui-react/widget-panels/StatusBar.js +1 -1
  200. package/lib/cjs/appui-react/widget-panels/StatusBar.js.map +1 -1
  201. package/lib/cjs/appui-react/widget-panels/Tab.js +1 -1
  202. package/lib/cjs/appui-react/widget-panels/Tab.js.map +1 -1
  203. package/lib/cjs/appui-react/widget-panels/ToolSettings.js +15 -23
  204. package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
  205. package/lib/cjs/appui-react/widget-panels/ToolSettings.scss +1 -1
  206. package/lib/cjs/appui-react/widget-panels/Toolbars.js +2 -3
  207. package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
  208. package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js +2 -2
  209. package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  210. package/lib/cjs/appui-react/widgets/WidgetDef.js +4 -5
  211. package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
  212. package/lib/cjs/appui-react/widgets/WidgetHost.js +2 -3
  213. package/lib/cjs/appui-react/widgets/WidgetHost.js.map +1 -1
  214. package/lib/cjs/appui-react/widgets/useWidget.js +1 -1
  215. package/lib/cjs/appui-react/widgets/useWidget.js.map +1 -1
  216. package/lib/esm/appui-react/UiFramework.js +4 -7
  217. package/lib/esm/appui-react/UiFramework.js.map +1 -1
  218. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.d.ts +4 -2
  219. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.d.ts.map +1 -1
  220. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js +17 -29
  221. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.js.map +1 -1
  222. package/lib/esm/appui-react/accudraw/AccuDrawFieldContainer.scss +10 -17
  223. package/lib/esm/appui-react/accudraw/AccuDrawInputField.scss +2 -0
  224. package/lib/esm/appui-react/accudraw/SquareButton.d.ts +3 -1
  225. package/lib/esm/appui-react/accudraw/SquareButton.d.ts.map +1 -1
  226. package/lib/esm/appui-react/accudraw/SquareButton.js +1 -4
  227. package/lib/esm/appui-react/accudraw/SquareButton.js.map +1 -1
  228. package/lib/esm/appui-react/backstage/BackstageComposerItem.js +1 -2
  229. package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
  230. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +2 -2
  231. package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  232. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts +1 -1
  233. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
  234. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +19 -15
  235. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
  236. package/lib/esm/appui-react/configurableui/{configurableui.scss → ConfigurableUiContent.scss} +14 -0
  237. package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
  238. package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  239. package/lib/esm/appui-react/configurableui/TimeTracker.js +1 -2
  240. package/lib/esm/appui-react/configurableui/TimeTracker.js.map +1 -1
  241. package/lib/esm/appui-react/content/ContentLayout.js +9 -12
  242. package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
  243. package/lib/esm/appui-react/content/DefaultViewOverlay.js +3 -4
  244. package/lib/esm/appui-react/content/DefaultViewOverlay.js.map +1 -1
  245. package/lib/esm/appui-react/content/FloatingViewportContent.js +1 -2
  246. package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
  247. package/lib/esm/appui-react/content/IModelViewport.js +4 -7
  248. package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
  249. package/lib/esm/appui-react/content/InternalContentLayoutManager.js +1 -2
  250. package/lib/esm/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  251. package/lib/esm/appui-react/content/InternalContentViewManager.js +2 -2
  252. package/lib/esm/appui-react/content/InternalContentViewManager.js.map +1 -1
  253. package/lib/esm/appui-react/content/split-pane/SplitPane.js +10 -12
  254. package/lib/esm/appui-react/content/split-pane/SplitPane.js.map +1 -1
  255. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +2 -3
  256. package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
  257. package/lib/esm/appui-react/dialog/ContentDialog.js +3 -6
  258. package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
  259. package/lib/esm/appui-react/dialog/DialogManagerBase.js +2 -3
  260. package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
  261. package/lib/esm/appui-react/feedback/ElementTooltip.d.ts.map +1 -1
  262. package/lib/esm/appui-react/feedback/ElementTooltip.js +3 -4
  263. package/lib/esm/appui-react/feedback/ElementTooltip.js.map +1 -1
  264. package/lib/esm/appui-react/frontstage/FrontstageDef.js +10 -14
  265. package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
  266. package/lib/esm/appui-react/frontstage/ModalFrontstage.d.ts +2 -4
  267. package/lib/esm/appui-react/frontstage/ModalFrontstage.d.ts.map +1 -1
  268. package/lib/esm/appui-react/frontstage/ModalFrontstage.js +2 -3
  269. package/lib/esm/appui-react/frontstage/ModalFrontstage.js.map +1 -1
  270. package/lib/esm/appui-react/frontstage/ModalFrontstage.scss +1 -1
  271. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +2 -3
  272. package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  273. package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +1 -2
  274. package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  275. package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js +7 -11
  276. package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
  277. package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js +7 -11
  278. package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
  279. package/lib/esm/appui-react/hooks/useSolarDataProvider.js +8 -13
  280. package/lib/esm/appui-react/hooks/useSolarDataProvider.js.map +1 -1
  281. package/lib/esm/appui-react/layout/base/DragManager.js +1 -2
  282. package/lib/esm/appui-react/layout/base/DragManager.js.map +1 -1
  283. package/lib/esm/appui-react/layout/base/NineZone.js +1 -1
  284. package/lib/esm/appui-react/layout/base/NineZone.js.map +1 -1
  285. package/lib/esm/appui-react/layout/outline/TabOutline.js +1 -1
  286. package/lib/esm/appui-react/layout/outline/TabOutline.js.map +1 -1
  287. package/lib/esm/appui-react/layout/outline/WidgetOutline.js +1 -1
  288. package/lib/esm/appui-react/layout/outline/WidgetOutline.js.map +1 -1
  289. package/lib/esm/appui-react/layout/state/NineZoneStateReducer.js +12 -14
  290. package/lib/esm/appui-react/layout/state/NineZoneStateReducer.js.map +1 -1
  291. package/lib/esm/appui-react/layout/state/internal/NineZoneStateHelpers.js +1 -2
  292. package/lib/esm/appui-react/layout/state/internal/NineZoneStateHelpers.js.map +1 -1
  293. package/lib/esm/appui-react/layout/state/internal/TabStateHelpers.js +2 -3
  294. package/lib/esm/appui-react/layout/state/internal/TabStateHelpers.js.map +1 -1
  295. package/lib/esm/appui-react/layout/state/internal/WidgetStateHelpers.js +4 -4
  296. package/lib/esm/appui-react/layout/state/internal/WidgetStateHelpers.js.map +1 -1
  297. package/lib/esm/appui-react/layout/target/TitleBarTarget.js +1 -1
  298. package/lib/esm/appui-react/layout/target/TitleBarTarget.js.map +1 -1
  299. package/lib/esm/appui-react/layout/tool-settings/Docked.scss +1 -1
  300. package/lib/esm/appui-react/layout/widget/Button.d.ts +2 -9
  301. package/lib/esm/appui-react/layout/widget/Button.d.ts.map +1 -1
  302. package/lib/esm/appui-react/layout/widget/Button.js.map +1 -1
  303. package/lib/esm/appui-react/layout/widget/ContentRenderer.js +2 -2
  304. package/lib/esm/appui-react/layout/widget/ContentRenderer.js.map +1 -1
  305. package/lib/esm/appui-react/layout/widget/FloatingTab.js +5 -6
  306. package/lib/esm/appui-react/layout/widget/FloatingTab.js.map +1 -1
  307. package/lib/esm/appui-react/layout/widget/FloatingWidget.js +2 -4
  308. package/lib/esm/appui-react/layout/widget/FloatingWidget.js.map +1 -1
  309. package/lib/esm/appui-react/layout/widget/PanelWidget.js +1 -1
  310. package/lib/esm/appui-react/layout/widget/PanelWidget.js.map +1 -1
  311. package/lib/esm/appui-react/layout/widget/PreviewHorizontalPanelAlign.js +1 -1
  312. package/lib/esm/appui-react/layout/widget/PreviewHorizontalPanelAlign.js.map +1 -1
  313. package/lib/esm/appui-react/layout/widget/Tab.js +4 -4
  314. package/lib/esm/appui-react/layout/widget/Tab.js.map +1 -1
  315. package/lib/esm/appui-react/layout/widget/Widget.js +2 -2
  316. package/lib/esm/appui-react/layout/widget/Widget.js.map +1 -1
  317. package/lib/esm/appui-react/layout/widget/useIsToolSettingsTab.js +1 -1
  318. package/lib/esm/appui-react/layout/widget/useIsToolSettingsTab.js.map +1 -1
  319. package/lib/esm/appui-react/layout/widget-panels/PanelSections.js +5 -8
  320. package/lib/esm/appui-react/layout/widget-panels/PanelSections.js.map +1 -1
  321. package/lib/esm/appui-react/layout/widget-panels/useAnimatePanel.js +1 -2
  322. package/lib/esm/appui-react/layout/widget-panels/useAnimatePanel.js.map +1 -1
  323. package/lib/esm/appui-react/messages/InputField.d.ts.map +1 -1
  324. package/lib/esm/appui-react/messages/InputField.js +3 -4
  325. package/lib/esm/appui-react/messages/InputField.js.map +1 -1
  326. package/lib/esm/appui-react/messages/MessageLabel.js +2 -2
  327. package/lib/esm/appui-react/messages/MessageLabel.js.map +1 -1
  328. package/lib/esm/appui-react/messages/MessageManager.d.ts +15 -5
  329. package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
  330. package/lib/esm/appui-react/messages/MessageManager.js +23 -41
  331. package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
  332. package/lib/esm/appui-react/messages/MessageRenderer.d.ts +8 -0
  333. package/lib/esm/appui-react/messages/MessageRenderer.d.ts.map +1 -0
  334. package/lib/esm/appui-react/messages/MessageRenderer.js +132 -0
  335. package/lib/esm/appui-react/messages/MessageRenderer.js.map +1 -0
  336. package/lib/esm/appui-react/messages/Pointer.d.ts +2 -2
  337. package/lib/esm/appui-react/messages/Pointer.d.ts.map +1 -1
  338. package/lib/esm/appui-react/messages/Pointer.js +6 -7
  339. package/lib/esm/appui-react/messages/Pointer.js.map +1 -1
  340. package/lib/esm/appui-react/messages/getToastCategory.d.ts +1 -1
  341. package/lib/esm/appui-react/pickers/ViewSelector.js +5 -6
  342. package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
  343. package/lib/esm/appui-react/popup/CardPopup.d.ts.map +1 -1
  344. package/lib/esm/appui-react/popup/CardPopup.js +2 -3
  345. package/lib/esm/appui-react/popup/CardPopup.js.map +1 -1
  346. package/lib/esm/appui-react/popup/HTMLElementPopup.d.ts.map +1 -1
  347. package/lib/esm/appui-react/popup/HTMLElementPopup.js +2 -3
  348. package/lib/esm/appui-react/popup/HTMLElementPopup.js.map +1 -1
  349. package/lib/esm/appui-react/popup/KeyinPalettePanel.js +1 -2
  350. package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
  351. package/lib/esm/appui-react/popup/PopupManager.js +1 -2
  352. package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
  353. package/lib/esm/appui-react/preview/PreviewFeatures.js +1 -1
  354. package/lib/esm/appui-react/preview/PreviewFeatures.js.map +1 -1
  355. package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.d.ts.map +1 -1
  356. package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.js +5 -5
  357. package/lib/esm/appui-react/preview/widget-action-dropdown/MoreButton.js.map +1 -1
  358. package/lib/esm/appui-react/selection/SelectionContextItemDef.js +2 -2
  359. package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
  360. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
  361. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
  362. package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.scss +1 -4
  363. package/lib/esm/appui-react/stagepanels/StagePanelDef.js +11 -16
  364. package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  365. package/lib/esm/appui-react/statusbar/Indicator.js +1 -2
  366. package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -1
  367. package/lib/esm/appui-react/statusbar/StatusBar.js +3 -5
  368. package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
  369. package/lib/esm/appui-react/statusfields/MessageCenter.d.ts +1 -1
  370. package/lib/esm/appui-react/statusfields/MessageCenter.d.ts.map +1 -1
  371. package/lib/esm/appui-react/statusfields/MessageCenter.js +6 -5
  372. package/lib/esm/appui-react/statusfields/MessageCenter.js.map +1 -1
  373. package/lib/esm/appui-react/statusfields/SelectionScope.scss +1 -3
  374. package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.d.ts.map +1 -1
  375. package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.js +1 -1
  376. package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
  377. package/lib/esm/appui-react/statusfields/tileloading/TileLoadingIndicator.scss +1 -1
  378. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.d.ts.map +1 -1
  379. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +3 -2
  380. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
  381. package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.scss +3 -12
  382. package/lib/esm/appui-react/theme/ThemeManager.d.ts.map +1 -1
  383. package/lib/esm/appui-react/theme/ThemeManager.js +3 -1
  384. package/lib/esm/appui-react/theme/ThemeManager.js.map +1 -1
  385. package/lib/esm/appui-react/toolbar/ToolbarHelper.js +6 -4
  386. package/lib/esm/appui-react/toolbar/ToolbarHelper.js.map +1 -1
  387. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js +3 -4
  388. package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
  389. package/lib/esm/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
  390. package/lib/esm/appui-react/tools/CoreToolDefinitions.js +15 -22
  391. package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
  392. package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js +3 -2
  393. package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  394. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +20 -22
  395. package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  396. package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +9 -10
  397. package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  398. package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -2
  399. package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  400. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +8 -14
  401. package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  402. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
  403. package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  404. package/lib/esm/appui-react/uiprovider/ComponentGenerator.js +1 -1
  405. package/lib/esm/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  406. package/lib/esm/appui-react/utils/InternalUiShowHideManager.d.ts +1 -0
  407. package/lib/esm/appui-react/utils/InternalUiShowHideManager.d.ts.map +1 -1
  408. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +19 -16
  409. package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  410. package/lib/esm/appui-react/widget-panels/Content.js +8 -9
  411. package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
  412. package/lib/esm/appui-react/widget-panels/Frontstage.js +10 -14
  413. package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
  414. package/lib/esm/appui-react/widget-panels/StatusBar.js +1 -1
  415. package/lib/esm/appui-react/widget-panels/StatusBar.js.map +1 -1
  416. package/lib/esm/appui-react/widget-panels/Tab.js +1 -1
  417. package/lib/esm/appui-react/widget-panels/Tab.js.map +1 -1
  418. package/lib/esm/appui-react/widget-panels/ToolSettings.js +15 -23
  419. package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
  420. package/lib/esm/appui-react/widget-panels/ToolSettings.scss +1 -1
  421. package/lib/esm/appui-react/widget-panels/Toolbars.js +2 -3
  422. package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
  423. package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js +2 -2
  424. package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
  425. package/lib/esm/appui-react/widgets/WidgetDef.js +4 -5
  426. package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
  427. package/lib/esm/appui-react/widgets/WidgetHost.js +2 -3
  428. package/lib/esm/appui-react/widgets/WidgetHost.js.map +1 -1
  429. package/lib/esm/appui-react/widgets/useWidget.js +1 -1
  430. package/lib/esm/appui-react/widgets/useWidget.js.map +1 -1
  431. package/package.json +12 -14
  432. package/lib/cjs/appui-react/messages/ActivityMessage.d.ts +0 -10
  433. package/lib/cjs/appui-react/messages/ActivityMessage.d.ts.map +0 -1
  434. package/lib/cjs/appui-react/messages/ActivityMessage.js +0 -92
  435. package/lib/cjs/appui-react/messages/ActivityMessage.js.map +0 -1
  436. package/lib/cjs/appui-react/messages/MessageSpan.d.ts +0 -15
  437. package/lib/cjs/appui-react/messages/MessageSpan.d.ts.map +0 -1
  438. package/lib/cjs/appui-react/messages/MessageSpan.js +0 -23
  439. package/lib/cjs/appui-react/messages/MessageSpan.js.map +0 -1
  440. package/lib/esm/appui-react/messages/ActivityMessage.d.ts +0 -10
  441. package/lib/esm/appui-react/messages/ActivityMessage.d.ts.map +0 -1
  442. package/lib/esm/appui-react/messages/ActivityMessage.js +0 -88
  443. package/lib/esm/appui-react/messages/ActivityMessage.js.map +0 -1
  444. package/lib/esm/appui-react/messages/MessageSpan.d.ts +0 -15
  445. package/lib/esm/appui-react/messages/MessageSpan.d.ts.map +0 -1
  446. package/lib/esm/appui-react/messages/MessageSpan.js +0 -18
  447. package/lib/esm/appui-react/messages/MessageSpan.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StandardContentToolsUiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,kFAAuF;AAEvF,8DAA8D;AAC9D,gFAA6E;AAC7E,iEAAoE;AACpE,4DAAyD;AAEzD,wDAA0E;AAC1E,sEAAyD;AA0BzD,SAAS,gBAAgB,CAAC,WAAgB,EAAE,YAAoB;IAC9D,IAAI,SAAS,KAAK,WAAW;QAAE,OAAO,YAAY,CAAC;IAEnD,uBAAuB;IACvB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,OAAO,WAAW,CAAC;KACpB;IAED,uBAAuB;IACvB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAa,mCAAmC;IAC9C,IAAW,EAAE;QACX,OAAO,iDAAiD,CAAC;IAC3D,CAAC;IAED,YAAoB,mBAAyC;QAAzC,wBAAmB,GAAnB,mBAAmB,CAAsB;IAAG,CAAC;IAE1D,mBAAmB,CACxB,QAAgB,EAChB,WAAmB,EACnB,YAA0B,EAC1B,kBAAsC,EACtC,YAAkB;;QAElB,MAAM,KAAK,GAAkB,EAAE,CAAC;QAEhC,IACE,YAAY,KAAK,0BAAY,CAAC,mBAAmB;YACjD,kBAAkB,KAAK,gCAAkB,CAAC,UAAU,EACpD;YACA,MAAM,2BAA2B,GAAG,gBAAgB,CAClD,MAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,mBAAmB,0CAAE,UAAU,0CACzC,2BAA2B,EAC/B,EAAE,CACH,CAAC;YACF,MAAM,sBAAsB,GAAG,gBAAgB,CAC7C,MAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,mBAAmB,0CAAE,UAAU,0CAAE,sBAAsB,EACrE,EAAE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,MAAM,EACvB,EAAE,EACF,oBAAC,mCAAmB,IAAC,cAAc,SAAG,CACvC,CACF,CAAC;SACH;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AApMD,kFAoMC","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 StandardUiItemsProvider\n */\n\nimport * as React from \"react\";\nimport { SelectionContextToolDefinitions } from \"../selection/SelectionContextItemDef\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport { StatusBarSection } from \"../statusbar/StatusBarItem\";\nimport { StatusBarItemUtilities } from \"../statusbar/StatusBarItemUtilities\";\nimport { SectionsStatusField } from \"../statusfields/SectionsField\";\nimport { ToolbarHelper } from \"../toolbar/ToolbarHelper\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem\";\nimport { ToolbarOrientation, ToolbarUsage } from \"../toolbar/ToolbarItem\";\nimport { CoreTools } from \"../tools/CoreToolDefinitions\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\n\n/**\n * Defines what tools to include from the provider. If any tools in the horizontal or vertical group are\n * specified then only those tools will be provided to stage.\n * @public\n */\nexport interface DefaultContentTools {\n horizontal?: {\n clearSelection?: boolean;\n clearDisplayOverrides?: boolean;\n /** if group then group button is shown to allow user to hide by element, category, model */\n hide?: \"group\" | \"element\";\n /** if group then group button is shown to allow user to isolate by element, category, model */\n isolate?: \"group\" | \"element\";\n /** only element is currently support for emphasize */\n emphasize?: \"element\";\n };\n vertical?: {\n selectElement?: boolean;\n measureGroup?: boolean;\n sectionGroup?: boolean;\n };\n}\n\nfunction getGroupPriority(potentialId: any, defaultValue: number) {\n if (undefined === potentialId) return defaultValue;\n\n // istanbul ignore else\n if (typeof potentialId === \"number\") {\n return potentialId;\n }\n\n // istanbul ignore next\n return defaultValue;\n}\n\n/**\n * @beta\n */\nexport class StandardContentToolsUiItemsProvider implements UiItemsProvider {\n public get id(): string {\n return \"appui-react:StandardContentToolsUiItemsProvider\";\n }\n\n constructor(private defaultContextTools?: DefaultContentTools) {}\n\n public provideToolbarItems(\n _stageId: string,\n _stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation,\n stageAppData?: any\n ): ToolbarItem[] {\n const items: ToolbarItem[] = [];\n\n if (\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Horizontal\n ) {\n const clearSelectionGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.horizontal\n ?.clearSelectionGroupPriority,\n 10\n );\n const overridesGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.horizontal?.overridesGroupPriority,\n 20\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.clearSelection\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 10,\n CoreTools.clearSelectionItemDef,\n { groupPriority: clearSelectionGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.clearDisplayOverrides\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 20,\n SelectionContextToolDefinitions.clearHideIsolateEmphasizeElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.hide\n ) {\n if (this.defaultContextTools?.horizontal?.hide === \"group\")\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 30,\n SelectionContextToolDefinitions.hideSectionToolGroup,\n { groupPriority: overridesGroupPriority }\n )\n );\n else\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 30,\n SelectionContextToolDefinitions.hideElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n }\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.isolate\n ) {\n if (this.defaultContextTools?.horizontal?.isolate === \"group\")\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 40,\n SelectionContextToolDefinitions.isolateSelectionToolGroup,\n { groupPriority: overridesGroupPriority }\n )\n );\n else\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 40,\n SelectionContextToolDefinitions.isolateElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n }\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.emphasize\n ) {\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 50,\n SelectionContextToolDefinitions.emphasizeElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n }\n } /* istanbul ignore else */ else if (\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Vertical\n ) {\n const selectElementGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.vertical?.selectElementGroupPriority,\n 10\n );\n const measureGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.vertical?.measureGroupPriority,\n 10\n );\n const selectionGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.vertical?.selectionGroupPriority,\n 10\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.vertical ||\n this.defaultContextTools.vertical.selectElement\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 10,\n CoreTools.selectElementCommand,\n { groupPriority: selectElementGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.vertical ||\n this.defaultContextTools.vertical.measureGroup\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 20,\n CoreTools.measureToolGroup,\n { groupPriority: measureGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.vertical ||\n this.defaultContextTools.vertical.sectionGroup\n ) {\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 30,\n CoreTools.sectionToolGroup,\n { groupPriority: selectionGroupPriority }\n )\n );\n }\n }\n return items;\n }\n\n public provideStatusBarItems(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n const statusBarItems: StatusBarItem[] = [];\n\n // if the sectionGroup tools are to be shown then we want the status field added to allow clearing or manipulation the section\n if (this.defaultContextTools?.vertical?.sectionGroup) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.Sections\",\n StatusBarSection.Center,\n 20,\n <SectionsStatusField hideWhenUnused />\n )\n );\n }\n\n return statusBarItems;\n }\n}\n"]}
1
+ {"version":3,"file":"StandardContentToolsUiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,kFAAuF;AAEvF,8DAA8D;AAC9D,gFAA6E;AAC7E,iEAAoE;AACpE,4DAAyD;AAEzD,wDAA0E;AAC1E,sEAAyD;AA0BzD,SAAS,gBAAgB,CAAC,WAAgB,EAAE,YAAoB;IAC9D,IAAI,SAAS,KAAK,WAAW;QAAE,OAAO,YAAY,CAAC;IAEnD,uBAAuB;IACvB,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,OAAO,WAAW,CAAC;KACpB;IAED,uBAAuB;IACvB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAa,mCAAmC;IAC9C,IAAW,EAAE;QACX,OAAO,iDAAiD,CAAC;IAC3D,CAAC;IAED,YAAoB,mBAAyC;QAAzC,wBAAmB,GAAnB,mBAAmB,CAAsB;IAAG,CAAC;IAE1D,mBAAmB,CACxB,QAAgB,EAChB,WAAmB,EACnB,YAA0B,EAC1B,kBAAsC,EACtC,YAAkB;QAElB,MAAM,KAAK,GAAkB,EAAE,CAAC;QAEhC,IACE,YAA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AE,QAAQ,EAAE,YAAY,EAAE;YACpD,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,eAAe,EACf,gCAAgB,CAAC,MAAM,EACvB,EAAE,EACF,oBAAC,mCAAmB,IAAC,cAAc,SAAG,CACvC,CACF,CAAC;SACH;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AApMD,kFAoMC","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 StandardUiItemsProvider\n */\n\nimport * as React from \"react\";\nimport { SelectionContextToolDefinitions } from \"../selection/SelectionContextItemDef\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport { StatusBarSection } from \"../statusbar/StatusBarItem\";\nimport { StatusBarItemUtilities } from \"../statusbar/StatusBarItemUtilities\";\nimport { SectionsStatusField } from \"../statusfields/SectionsField\";\nimport { ToolbarHelper } from \"../toolbar/ToolbarHelper\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem\";\nimport { ToolbarOrientation, ToolbarUsage } from \"../toolbar/ToolbarItem\";\nimport { CoreTools } from \"../tools/CoreToolDefinitions\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\n\n/**\n * Defines what tools to include from the provider. If any tools in the horizontal or vertical group are\n * specified then only those tools will be provided to stage.\n * @public\n */\nexport interface DefaultContentTools {\n horizontal?: {\n clearSelection?: boolean;\n clearDisplayOverrides?: boolean;\n /** if group then group button is shown to allow user to hide by element, category, model */\n hide?: \"group\" | \"element\";\n /** if group then group button is shown to allow user to isolate by element, category, model */\n isolate?: \"group\" | \"element\";\n /** only element is currently support for emphasize */\n emphasize?: \"element\";\n };\n vertical?: {\n selectElement?: boolean;\n measureGroup?: boolean;\n sectionGroup?: boolean;\n };\n}\n\nfunction getGroupPriority(potentialId: any, defaultValue: number) {\n if (undefined === potentialId) return defaultValue;\n\n // istanbul ignore else\n if (typeof potentialId === \"number\") {\n return potentialId;\n }\n\n // istanbul ignore next\n return defaultValue;\n}\n\n/**\n * @beta\n */\nexport class StandardContentToolsUiItemsProvider implements UiItemsProvider {\n public get id(): string {\n return \"appui-react:StandardContentToolsUiItemsProvider\";\n }\n\n constructor(private defaultContextTools?: DefaultContentTools) {}\n\n public provideToolbarItems(\n _stageId: string,\n _stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation,\n stageAppData?: any\n ): ToolbarItem[] {\n const items: ToolbarItem[] = [];\n\n if (\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Horizontal\n ) {\n const clearSelectionGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.horizontal\n ?.clearSelectionGroupPriority,\n 10\n );\n const overridesGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.horizontal?.overridesGroupPriority,\n 20\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.clearSelection\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 10,\n CoreTools.clearSelectionItemDef,\n { groupPriority: clearSelectionGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.clearDisplayOverrides\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 20,\n SelectionContextToolDefinitions.clearHideIsolateEmphasizeElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.hide\n ) {\n if (this.defaultContextTools?.horizontal?.hide === \"group\")\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 30,\n SelectionContextToolDefinitions.hideSectionToolGroup,\n { groupPriority: overridesGroupPriority }\n )\n );\n else\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 30,\n SelectionContextToolDefinitions.hideElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n }\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.isolate\n ) {\n if (this.defaultContextTools?.horizontal?.isolate === \"group\")\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 40,\n SelectionContextToolDefinitions.isolateSelectionToolGroup,\n { groupPriority: overridesGroupPriority }\n )\n );\n else\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 40,\n SelectionContextToolDefinitions.isolateElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n }\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.horizontal ||\n this.defaultContextTools.horizontal.emphasize\n ) {\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 50,\n SelectionContextToolDefinitions.emphasizeElementsItemDef,\n { groupPriority: overridesGroupPriority }\n )\n );\n }\n } /* istanbul ignore else */ else if (\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Vertical\n ) {\n const selectElementGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.vertical?.selectElementGroupPriority,\n 10\n );\n const measureGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.vertical?.measureGroupPriority,\n 10\n );\n const selectionGroupPriority = getGroupPriority(\n stageAppData?.defaultContentTools?.vertical?.selectionGroupPriority,\n 10\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.vertical ||\n this.defaultContextTools.vertical.selectElement\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 10,\n CoreTools.selectElementCommand,\n { groupPriority: selectElementGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.vertical ||\n this.defaultContextTools.vertical.measureGroup\n )\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 20,\n CoreTools.measureToolGroup,\n { groupPriority: measureGroupPriority }\n )\n );\n\n if (\n !this.defaultContextTools ||\n !this.defaultContextTools.vertical ||\n this.defaultContextTools.vertical.sectionGroup\n ) {\n items.push(\n ToolbarHelper.createToolbarItemFromItemDef(\n 30,\n CoreTools.sectionToolGroup,\n { groupPriority: selectionGroupPriority }\n )\n );\n }\n }\n return items;\n }\n\n public provideStatusBarItems(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n const statusBarItems: StatusBarItem[] = [];\n\n // if the sectionGroup tools are to be shown then we want the status field added to allow clearing or manipulation the section\n if (this.defaultContextTools?.vertical?.sectionGroup) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.Sections\",\n StatusBarSection.Center,\n 20,\n <SectionsStatusField hideWhenUnused />\n )\n );\n }\n\n return statusBarItems;\n }\n}\n"]}
@@ -31,7 +31,6 @@ class StandardStatusbarUiItemsProvider {
31
31
  this._defaultItems = _defaultItems;
32
32
  }
33
33
  provideStatusBarItems(_stageId, _stageUsage, _stageAppData) {
34
- var _a;
35
34
  const statusBarItems = [];
36
35
  if (!this._defaultItems || this._defaultItems.messageCenter) {
37
36
  statusBarItems.push(StatusBarItemUtilities_1.StatusBarItemUtilities.createCustomItem("uifw.MessageCenter", StatusBarItem_1.StatusBarSection.Left, 10, React.createElement(MessageCenter_1.MessageCenterField, null)));
@@ -43,7 +42,7 @@ class StandardStatusbarUiItemsProvider {
43
42
  if (!this._defaultItems || this._defaultItems.postToolAssistanceSeparator)
44
43
  statusBarItems.push(StatusBarItemUtilities_1.StatusBarItemUtilities.createCustomItem("uifw.PostToolAssistance", StatusBarItem_1.StatusBarSection.Left, 25, React.createElement(Separator_1.StatusBarSeparator, null)));
45
44
  }
46
- if ((_a = this._defaultItems) === null || _a === void 0 ? void 0 : _a.activityCenter) {
45
+ if (this._defaultItems?.activityCenter) {
47
46
  statusBarItems.push(StatusBarItemUtilities_1.StatusBarItemUtilities.createCustomItem("uifw.ActivityCenter", StatusBarItem_1.StatusBarSection.Left, 30, React.createElement(ActivityCenter_1.ActivityCenterField, null)));
48
47
  }
49
48
  if (!this._defaultItems || this._defaultItems.accuSnapModePicker) {
@@ -1 +1 @@
1
- {"version":3,"file":"StandardStatusbarUiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,gFAA6E;AAC7E,4FAAyF;AACzF,iEAAmE;AACnE,mEAAqE;AACrE,uDAAyD;AACzD,iEAAmE;AACnE,2FAAwF;AACxF,mEAAqE;AACrE,sDAA4D;AAG5D,8DAA8D;AAoB9D;;;GAGG;AACH,MAAa,gCAAgC;IAC3C,IAAW,EAAE;QACX,OAAO,8CAA8C,CAAC;IACxD,CAAC;IAED,YAAoB,aAAqC;QAArC,kBAAa,GAAb,aAAa,CAAwB;IAAG,CAAC;IAEtD,qBAAqB,CAC1B,QAAgB,EAChB,WAAmB,EACnB,aAAmB;;QAEnB,MAAM,cAAc,GAAoB,EAAE,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YAC3D,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,oBAAoB,EACpB,gCAAgB,CAAC,IAAI,EACrB,EAAE,EACF,oBAAC,kCAAkB,OAAG,CACvB,CACF,CAAC;SACH;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE;YAC5D,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,0BAA0B;gBACtE,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,wBAAwB,EACxB,gCAAgB,CAAC,IAAI,EACrB,EAAE,EACF,oBAAC,8BAAkB,OAAG,CACvB,CACF,CAAC;YA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,EACF,oBAAC,oCAAmB,OAAG,CACxB,CACF,CAAC;SACH;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YAC3D,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,oBAAoB,EACpB,gCAAgB,CAAC,KAAK,EACtB,EAAE,EACF,oBAAC,kCAAkB,OAAG,CACvB,CACF,CAAC;SACH;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AA7GD,4EA6GC","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 StandardUiItemsProvider\n */\n\nimport * as React from \"react\";\nimport { StatusBarItemUtilities } from \"../statusbar/StatusBarItemUtilities\";\nimport { ToolAssistanceField } from \"../statusfields/toolassistance/ToolAssistanceField\";\nimport { MessageCenterField } from \"../statusfields/MessageCenter\";\nimport { ActivityCenterField } from \"../statusfields/ActivityCenter\";\nimport { SnapModeField } from \"../statusfields/SnapMode\";\nimport { SelectionInfoField } from \"../statusfields/SelectionInfo\";\nimport { TileLoadingIndicator } from \"../statusfields/tileloading/TileLoadingIndicator\";\nimport { SelectionScopeField } from \"../statusfields/SelectionScope\";\nimport { StatusBarSeparator } from \"../statusbar/Separator\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport { StatusBarSection } from \"../statusbar/StatusBarItem\";\n\n/**\n * Defines what items to include from the provider. If any items are\n * specified then only those items will be added to statusbar.\n * @public\n */\nexport interface DefaultStatusbarItems {\n messageCenter?: boolean;\n preToolAssistanceSeparator?: boolean;\n toolAssistance?: boolean;\n postToolAssistanceSeparator?: boolean;\n /** Activity center field is hidden by default. */\n activityCenter?: boolean;\n accuSnapModePicker?: boolean;\n tileLoadIndicator?: boolean;\n selectionScope?: boolean;\n selectionInfo?: boolean;\n}\n\n/**\n * Provide standard statusbar fields for the SimpleStatusbarWidget\n * @beta\n */\nexport class StandardStatusbarUiItemsProvider implements UiItemsProvider {\n public get id(): string {\n return \"appui-react:StandardStatusbarUiItemsProvider\";\n }\n\n constructor(private _defaultItems?: DefaultStatusbarItems) {}\n\n public provideStatusBarItems(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n const statusBarItems: StatusBarItem[] = [];\n if (!this._defaultItems || this._defaultItems.messageCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.MessageCenter\",\n StatusBarSection.Left,\n 10,\n <MessageCenterField />\n )\n );\n }\n if (!this._defaultItems || this._defaultItems.toolAssistance) {\n if (!this._defaultItems || this._defaultItems.preToolAssistanceSeparator)\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.PreToolAssistance\",\n StatusBarSection.Left,\n 15,\n <StatusBarSeparator />\n )\n );\n\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.ToolAssistance\",\n StatusBarSection.Left,\n 20,\n <ToolAssistanceField />\n )\n );\n\n if (!this._defaultItems || this._defaultItems.postToolAssistanceSeparator)\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.PostToolAssistance\",\n StatusBarSection.Left,\n 25,\n <StatusBarSeparator />\n )\n );\n }\n if (this._defaultItems?.activityCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.ActivityCenter\",\n StatusBarSection.Left,\n 30,\n <ActivityCenterField />\n )\n );\n }\n if (!this._defaultItems || this._defaultItems.accuSnapModePicker) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.SnapMode\",\n StatusBarSection.Center,\n 10,\n <SnapModeField />\n )\n );\n }\n\n if (!this._defaultItems || this._defaultItems.tileLoadIndicator) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.TileLoadIndicator\",\n StatusBarSection.Right,\n 10,\n <TileLoadingIndicator />\n )\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionScope) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.SelectionScope\",\n StatusBarSection.Right,\n 20,\n <SelectionScopeField />\n )\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionInfo) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.SelectionInfo\",\n StatusBarSection.Right,\n 30,\n <SelectionInfoField />\n )\n );\n }\n\n return statusBarItems;\n }\n}\n"]}
1
+ {"version":3,"file":"StandardStatusbarUiItemsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,gFAA6E;AAC7E,4FAAyF;AACzF,iEAAmE;AACnE,mEAAqE;AACrE,uDAAyD;AACzD,iEAAmE;AACnE,2FAAwF;AACxF,mEAAqE;AACrE,sDAA4D;AAG5D,8DAA8D;AAoB9D;;;GAGG;AACH,MAAa,gCAAgC;IAC3C,IAAW,EAAE;QACX,OAAO,8CAA8C,CAAC;IACxD,CAAC;IAED,YAAoB,aAAqC;QAArC,kBAAa,GAAb,aAAa,CAAwB;IAAG,CAAC;IAEtD,qBAAqB,CAC1B,QAAgB,EAChB,WAAmB,EACnB,aAAmB;QAEnB,MAAM,cAAc,GAAoB,EAAE,CAAC;QAC3C,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YAC3D,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,oBAAoB,EACpB,gCAAgB,CAAC,IAAI,EACrB,EAAE,EACF,oBAAC,kCAAkB,OAAG,CACvB,CACF,CAAC;SACH;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,I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,CAAC,KAAK,EACtB,EAAE,EACF,oBAAC,2CAAoB,OAAG,CACzB,CACF,CAAC;SACH;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE;YAC5D,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,qBAAqB,EACrB,gCAAgB,CAAC,KAAK,EACtB,EAAE,EACF,oBAAC,oCAAmB,OAAG,CACxB,CACF,CAAC;SACH;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE;YAC3D,cAAc,CAAC,IAAI,CACjB,+CAAsB,CAAC,gBAAgB,CACrC,oBAAoB,EACpB,gCAAgB,CAAC,KAAK,EACtB,EAAE,EACF,oBAAC,kCAAkB,OAAG,CACvB,CACF,CAAC;SACH;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AA7GD,4EA6GC","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 StandardUiItemsProvider\n */\n\nimport * as React from \"react\";\nimport { StatusBarItemUtilities } from \"../statusbar/StatusBarItemUtilities\";\nimport { ToolAssistanceField } from \"../statusfields/toolassistance/ToolAssistanceField\";\nimport { MessageCenterField } from \"../statusfields/MessageCenter\";\nimport { ActivityCenterField } from \"../statusfields/ActivityCenter\";\nimport { SnapModeField } from \"../statusfields/SnapMode\";\nimport { SelectionInfoField } from \"../statusfields/SelectionInfo\";\nimport { TileLoadingIndicator } from \"../statusfields/tileloading/TileLoadingIndicator\";\nimport { SelectionScopeField } from \"../statusfields/SelectionScope\";\nimport { StatusBarSeparator } from \"../statusbar/Separator\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport { StatusBarSection } from \"../statusbar/StatusBarItem\";\n\n/**\n * Defines what items to include from the provider. If any items are\n * specified then only those items will be added to statusbar.\n * @public\n */\nexport interface DefaultStatusbarItems {\n messageCenter?: boolean;\n preToolAssistanceSeparator?: boolean;\n toolAssistance?: boolean;\n postToolAssistanceSeparator?: boolean;\n /** Activity center field is hidden by default. */\n activityCenter?: boolean;\n accuSnapModePicker?: boolean;\n tileLoadIndicator?: boolean;\n selectionScope?: boolean;\n selectionInfo?: boolean;\n}\n\n/**\n * Provide standard statusbar fields for the SimpleStatusbarWidget\n * @beta\n */\nexport class StandardStatusbarUiItemsProvider implements UiItemsProvider {\n public get id(): string {\n return \"appui-react:StandardStatusbarUiItemsProvider\";\n }\n\n constructor(private _defaultItems?: DefaultStatusbarItems) {}\n\n public provideStatusBarItems(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n const statusBarItems: StatusBarItem[] = [];\n if (!this._defaultItems || this._defaultItems.messageCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.MessageCenter\",\n StatusBarSection.Left,\n 10,\n <MessageCenterField />\n )\n );\n }\n if (!this._defaultItems || this._defaultItems.toolAssistance) {\n if (!this._defaultItems || this._defaultItems.preToolAssistanceSeparator)\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.PreToolAssistance\",\n StatusBarSection.Left,\n 15,\n <StatusBarSeparator />\n )\n );\n\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.ToolAssistance\",\n StatusBarSection.Left,\n 20,\n <ToolAssistanceField />\n )\n );\n\n if (!this._defaultItems || this._defaultItems.postToolAssistanceSeparator)\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.PostToolAssistance\",\n StatusBarSection.Left,\n 25,\n <StatusBarSeparator />\n )\n );\n }\n if (this._defaultItems?.activityCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.ActivityCenter\",\n StatusBarSection.Left,\n 30,\n <ActivityCenterField />\n )\n );\n }\n if (!this._defaultItems || this._defaultItems.accuSnapModePicker) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.SnapMode\",\n StatusBarSection.Center,\n 10,\n <SnapModeField />\n )\n );\n }\n\n if (!this._defaultItems || this._defaultItems.tileLoadIndicator) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.TileLoadIndicator\",\n StatusBarSection.Right,\n 10,\n <TileLoadingIndicator />\n )\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionScope) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.SelectionScope\",\n StatusBarSection.Right,\n 20,\n <SelectionScopeField />\n )\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionInfo) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem(\n \"uifw.SelectionInfo\",\n StatusBarSection.Right,\n 30,\n <SelectionInfoField />\n )\n );\n }\n\n return statusBarItems;\n }\n}\n"]}
@@ -57,10 +57,9 @@ class UiItemsManager {
57
57
  * @param providerId id of the UiItemsProvider to get
58
58
  */
59
59
  static getUiItemsProvider(providerId) {
60
- var _a;
61
60
  if (this._abstractAdapter)
62
61
  return this._abstractAdapter.getUiItemsProvider(providerId);
63
- return (_a = UiItemsManager._registeredUiItemsProviders.get(providerId)) === null || _a === void 0 ? void 0 : _a.provider;
62
+ return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;
64
63
  }
65
64
  static sendRegisteredEvent(args) {
66
65
  UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);
@@ -71,10 +70,9 @@ class UiItemsManager {
71
70
  * @param overrides the UI items provider to register.
72
71
  */
73
72
  static register(uiProvider, overrides) {
74
- var _a;
75
73
  if (this._abstractAdapter)
76
74
  return this._abstractAdapter.register(uiProvider, overrides);
77
- const providerId = (_a = overrides === null || overrides === void 0 ? void 0 : overrides.providerId) !== null && _a !== void 0 ? _a : uiProvider.id;
75
+ const providerId = overrides?.providerId ?? uiProvider.id;
78
76
  if (UiItemsManager.getUiItemsProvider(providerId)) {
79
77
  core_bentley_1.Logger.logInfo(UiFramework_1.UiFramework.loggerCategory(this), `UiItemsProvider (${providerId}) is already loaded`);
80
78
  }
@@ -104,11 +102,11 @@ class UiItemsManager {
104
102
  // istanbul ignore else
105
103
  const overrides = entry.overrides;
106
104
  if (undefined !== stageId &&
107
- (overrides === null || overrides === void 0 ? void 0 : overrides.stageIds) &&
105
+ overrides?.stageIds &&
108
106
  !overrides.stageIds.some((value) => value === stageId))
109
107
  return false;
110
108
  if (undefined !== stageUsage &&
111
- (overrides === null || overrides === void 0 ? void 0 : overrides.stageUsages) &&
109
+ overrides?.stageUsages &&
112
110
  !overrides.stageUsages.some((value) => value === stageUsage))
113
111
  return false;
114
112
  return true;
@@ -127,11 +125,10 @@ class UiItemsManager {
127
125
  }
128
126
  const items = [];
129
127
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
130
- var _a, _b;
131
128
  if (!this.allowItemsFromProvider(entry, stageId, stageUsage))
132
129
  return;
133
130
  const uiProvider = entry.provider;
134
- const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
131
+ const providerId = entry.overrides?.providerId ?? uiProvider.id;
135
132
  const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
136
133
  const providerItems = provider
137
134
  .provideToolbarItems(stageId, stageUsage, usage, orientation)
@@ -154,11 +151,10 @@ class UiItemsManager {
154
151
  }
155
152
  const items = [];
156
153
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
157
- var _a, _b;
158
154
  if (!this.allowItemsFromProvider(entry, stageId, stageUsage))
159
155
  return;
160
156
  const uiProvider = entry.provider;
161
- const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
157
+ const providerId = entry.overrides?.providerId ?? uiProvider.id;
162
158
  const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
163
159
  const providerItems = provider
164
160
  .provideStatusBarItems(stageId, stageUsage)
@@ -179,9 +175,8 @@ class UiItemsManager {
179
175
  }
180
176
  const items = [];
181
177
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
182
- var _a, _b;
183
178
  const uiProvider = entry.provider;
184
- const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
179
+ const providerId = entry.overrides?.providerId ?? uiProvider.id;
185
180
  const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
186
181
  // Note: We do not call this.allowItemsFromProvider here as backstage items
187
182
  // should not be considered stage specific.
@@ -207,9 +202,8 @@ class UiItemsManager {
207
202
  items.push(...abstractWidgets);
208
203
  }
209
204
  UiItemsManager._registeredUiItemsProviders.forEach((entry) => {
210
- var _a, _b;
211
205
  const uiProvider = entry.provider;
212
- const providerId = (_b = (_a = entry.overrides) === null || _a === void 0 ? void 0 : _a.providerId) !== null && _b !== void 0 ? _b : uiProvider.id;
206
+ const providerId = entry.overrides?.providerId ?? uiProvider.id;
213
207
  if (!this.allowItemsFromProvider(entry, stageId, stageUsage))
214
208
  return;
215
209
  const provider = (0, AbstractUiItemsManager_1.createGetPropertyAdapter)(uiProvider);
@@ -1 +1 @@
1
- {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAAwD;AAOxD,gDAA6C;AAI7C,qEAGkC;AA0ClC;;GAEG;AACH,MAAa,cAAc;IAOzB;;OAEG;IACI,MAAM,CAAC,kBAAkB,CAAC,kBAA2B;QAC1D,IAAI,kBAAkB,EAAE;YACtB,IAAI,CAAC,gBAAgB,GAAG,IAAA,4DAAmC,GAAE,CAAC;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Y,CAAC,EAAE,CAAC;YAAE,OAAO;QAC5E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,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 UiProvider\n */\n\nimport type { MarkRequired } from \"@itwin/core-bentley\";\nimport { BeUiEvent, Logger } from \"@itwin/core-bentley\";\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem\";\nimport type { ToolbarOrientation, ToolbarUsage } from \"../toolbar/ToolbarItem\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { Widget } from \"../widgets/Widget\";\nimport type { ProviderItem } from \"./ProviderItem\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\nimport {\n createAbstractUiItemsManagerAdapter,\n createGetPropertyAdapter,\n} from \"./AbstractUiItemsManager\";\n\n/** UiItemsProvider register event args.\n * @public\n */\nexport interface UiItemsProviderRegisteredEventArgs {\n providerId: string;\n}\n\n/** UiItemsProvider overrides allows the application that registers a provider to limit when it is allowed to provide items\n * @public\n */\nexport interface AllowedUiItemsProviderOverrides {\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages */\n providerId?: string;\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided */\n stageUsages?: string[];\n /** if specified then the current stage's Id will be compared before allowing any items to be provided */\n stageIds?: string[];\n}\n\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\n * items are allowed.\n * @public\n */\nexport type UiItemsProviderOverrides =\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageUsages\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageUsages\">\n | MarkRequired<\n AllowedUiItemsProviderOverrides,\n \"providerId\" | \"stageUsages\" | \"stageIds\"\n >;\n\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\ninterface UiItemProviderEntry {\n provider: UiItemsProvider;\n overrides?: UiItemsProviderOverrides;\n}\n\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\n * @public\n */\nexport class UiItemsManager {\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> =\n new Map<string, UiItemProviderEntry>();\n private static _onUiProviderRegisteredEvent =\n new BeUiEvent<UiItemsProviderRegisteredEventArgs>();\n private static _abstractAdapter = createAbstractUiItemsManagerAdapter();\n\n /** For use in unit testing\n * @internal\n */\n public static useAbstractAdapter(useAbstractAdapter: boolean) {\n if (useAbstractAdapter) {\n this._abstractAdapter = createAbstractUiItemsManagerAdapter();\n } else {\n this._abstractAdapter = undefined;\n }\n }\n\n /** For use in unit testing\n * @internal */\n public static clearAllProviders() {\n if (this._abstractAdapter) return this._abstractAdapter.clearAllProviders();\n\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n public static get onUiProviderRegisteredEvent(): BeUiEvent<UiItemsProviderRegisteredEventArgs> {\n if (this._abstractAdapter)\n return this._abstractAdapter.onUiProviderRegisteredEvent;\n\n return this._onUiProviderRegisteredEvent;\n }\n\n /** Return number of registered UiProvider. */\n public static get registeredProviderIds(): string[] {\n if (this._abstractAdapter)\n return this._abstractAdapter.registeredProviderIds;\n\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\n return ids;\n }\n\n /** Return true if there is any registered UiProvider. */\n public static get hasRegisteredProviders(): boolean {\n if (this._abstractAdapter)\n return this._abstractAdapter.hasRegisteredProviders;\n\n return this._registeredUiItemsProviders.size > 0;\n }\n\n /**\n * Retrieves a previously loaded UiItemsProvider.\n * @param providerId id of the UiItemsProvider to get\n */\n public static getUiItemsProvider(\n providerId: string\n ): UiItemsProvider | undefined {\n if (this._abstractAdapter)\n return this._abstractAdapter.getUiItemsProvider(providerId);\n\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\n }\n\n private static sendRegisteredEvent(args: UiItemsProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);\n }\n\n /**\n * Registers a UiItemsProvider with the UiItemsManager.\n * @param uiProvider the UI items provider to register.\n * @param overrides the UI items provider to register.\n */\n public static register(\n uiProvider: UiItemsProvider,\n overrides?: UiItemsProviderOverrides\n ): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.register(uiProvider, overrides);\n\n const providerId = overrides?.providerId ?? uiProvider.id;\n\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) is already loaded`\n );\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, {\n provider: uiProvider,\n overrides,\n });\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider ${uiProvider.id} registered as ${providerId} `\n );\n\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n }\n\n /** Remove a specific UiItemsProvider from the list of available providers. */\n public static unregister(providerId: string): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.unregister(providerId);\n\n const provider = UiItemsManager.getUiItemsProvider(providerId);\n if (!provider) return;\n\n provider.onUnregister && provider.onUnregister();\n\n UiItemsManager._registeredUiItemsProviders.delete(providerId);\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) unloaded`\n );\n\n // trigger a refresh of the ui\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n\n private static allowItemsFromProvider(\n entry: UiItemProviderEntry,\n stageId?: string,\n stageUsage?: string\n ) {\n // istanbul ignore else\n const overrides = entry.overrides;\n if (\n undefined !== stageId &&\n overrides?.stageIds &&\n !overrides.stageIds.some((value: string) => value === stageId)\n )\n return false;\n if (\n undefined !== stageUsage &&\n overrides?.stageUsages &&\n !overrides.stageUsages.some((value: string) => value === stageUsage)\n )\n return false;\n return true;\n }\n\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\n * an action or specify a registered ToolId into toolbar.\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param usage usage of the toolbar\n * @param orientation orientation of the toolbar\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\n */\n public static getToolbarButtonItems(\n stageId: string,\n stageUsage: string,\n usage: ToolbarUsage,\n orientation: ToolbarOrientation\n ): ReadonlyArray<ProviderItem<ToolbarItem>> {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getToolbarButtonItems(\n stageId,\n stageUsage,\n usage,\n orientation\n );\n }\n\n const items: ProviderItem<ToolbarItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n const providerItems = provider\n .provideToolbarItems(stageId, stageUsage, usage, orientation)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\n */\n public static getStatusBarItems(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<StatusBarItem>> {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getStatusBarItems(stageId, stageUsage);\n }\n\n const items: ProviderItem<StatusBarItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n\n const providerItems = provider\n .provideStatusBarItems(stageId, stageUsage)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\n */\n public static getBackstageItems(): ReadonlyArray<\n ProviderItem<BackstageItem>\n > {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getBackstageItems();\n }\n\n const items: ProviderItem<BackstageItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n // Note: We do not call this.allowItemsFromProvider here as backstage items\n // should not be considered stage specific.\n const providerItems = provider.provideBackstageItems().map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param location the location within the stage.\n * @param section the section within location.\n * @returns An array of widgets.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ): ReadonlyArray<ProviderItem<Widget>> {\n const items: ProviderItem<Widget>[] = [];\n if (this._abstractAdapter) {\n const abstractWidgets = this._abstractAdapter.getWidgets(\n stageId,\n stageUsage,\n location,\n section\n );\n items.push(...abstractWidgets);\n }\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const provider = createGetPropertyAdapter(uiProvider);\n const providerItems = provider\n .provideWidgets(stageId, stageUsage, location, section)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n}\n\nfunction getUniqueItems<T extends { id: string }>(items: readonly T[]) {\n const uniqueItems: T[] = [];\n items.forEach((item) => {\n if (uniqueItems.find((existingItem) => item.id === existingItem.id)) return;\n uniqueItems.push(item);\n });\n return uniqueItems;\n}\n"]}
1
+ {"version":3,"file":"UiItemsManager.js","sourceRoot":"","sources":["../../../../src/appui-react/ui-items-provider/UiItemsManager.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAGH,sDAAwD;AAOxD,gDAA6C;AAI7C,qEAGkC;AA0ClC;;GAEG;AACH,MAAa,cAAc;IAOzB;;OAEG;IACI,MAAM,CAAC,kBAAkB,CAAC,kBAA2B;QAC1D,IAAI,kBAAkB,EAAE;YACtB,IAAI,CAAC,gBAAgB,GAAG,IAAA,4DAAmC,GAAE,CAAC;SAC/D;aAAM;YACL,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;SACnC;IACH,CAAC;IAED;mBACe;IACR,MAAM,CAAC,iBAAiB;QAC7B,IAAI,IAAI,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAE5E,cAAc,CAAC,2BAA2B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAED,wEAAwE;IACjE,MAAM,KAAK,2BAA2B;QAC3C,IAAI,IAAI,CAAC,gBAAgB;YACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC,2BAA2B,CAAC;QAE3D,OAAO,IAAI,CAAC,4BAA4B,CAAC;IAC3C,CAAC;IAED,8CAA8C;IACvC,MAAM,K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I,EAAE,EAAE,CAAC,CAAC;gBACd,GAAG,IAAI;gBACP,UAAU;aACX,CAAC,CAAC,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;;AA5Rc,0CAA2B,GACxC,IAAI,GAAG,EAA+B,CAAC;AAC1B,2CAA4B,GACzC,IAAI,wBAAS,EAAsC,CAAC;AACvC,+BAAgB,GAAG,IAAA,4DAAmC,GAAE,CAAC;AAL7D,wCAAc;AAgS3B,SAAS,cAAc,CAA2B,KAAmB;IACnE,MAAM,WAAW,GAAQ,EAAE,CAAC;IAC5B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,YAAY,CAAC,EAAE,CAAC;YAAE,OAAO;QAC5E,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,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 UiProvider\n */\n\nimport type { MarkRequired } from \"@itwin/core-bentley\";\nimport { BeUiEvent, Logger } from \"@itwin/core-bentley\";\nimport type { BackstageItem } from \"../backstage/BackstageItem\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem\";\nimport type { ToolbarOrientation, ToolbarUsage } from \"../toolbar/ToolbarItem\";\nimport { UiFramework } from \"../UiFramework\";\nimport type { Widget } from \"../widgets/Widget\";\nimport type { ProviderItem } from \"./ProviderItem\";\nimport type { UiItemsProvider } from \"./UiItemsProvider\";\nimport {\n createAbstractUiItemsManagerAdapter,\n createGetPropertyAdapter,\n} from \"./AbstractUiItemsManager\";\n\n/** UiItemsProvider register event args.\n * @public\n */\nexport interface UiItemsProviderRegisteredEventArgs {\n providerId: string;\n}\n\n/** UiItemsProvider overrides allows the application that registers a provider to limit when it is allowed to provide items\n * @public\n */\nexport interface AllowedUiItemsProviderOverrides {\n /** allows providerId to be overridden in the items manager for cases where the same provider needs to provide different content to different stages */\n providerId?: string;\n /** if specified then the current stage's Usage will be compared before allowing any items to be provided */\n stageUsages?: string[];\n /** if specified then the current stage's Id will be compared before allowing any items to be provided */\n stageIds?: string[];\n}\n\n/** Allowed overrides applied to a UiItemsProvider the application that registers a provider to limit when it is allowed to provide items.\n * Note that if an override `providerId` is specified then either `stageIds` or `stageUsages` must be defined to limit when the provider's\n * items are allowed.\n * @public\n */\nexport type UiItemsProviderOverrides =\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageUsages\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"providerId\" | \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageIds\">\n | MarkRequired<AllowedUiItemsProviderOverrides, \"stageUsages\">\n | MarkRequired<\n AllowedUiItemsProviderOverrides,\n \"providerId\" | \"stageUsages\" | \"stageIds\"\n >;\n\n/** Interface that defines an instance of a UiItemsProvider and its application specified overrides. */\ninterface UiItemProviderEntry {\n provider: UiItemsProvider;\n overrides?: UiItemsProviderOverrides;\n}\n\n/** Controls registering of UiItemsProviders and calls the provider's methods when populating different parts of the User Interface.\n * @public\n */\nexport class UiItemsManager {\n private static _registeredUiItemsProviders: Map<string, UiItemProviderEntry> =\n new Map<string, UiItemProviderEntry>();\n private static _onUiProviderRegisteredEvent =\n new BeUiEvent<UiItemsProviderRegisteredEventArgs>();\n private static _abstractAdapter = createAbstractUiItemsManagerAdapter();\n\n /** For use in unit testing\n * @internal\n */\n public static useAbstractAdapter(useAbstractAdapter: boolean) {\n if (useAbstractAdapter) {\n this._abstractAdapter = createAbstractUiItemsManagerAdapter();\n } else {\n this._abstractAdapter = undefined;\n }\n }\n\n /** For use in unit testing\n * @internal */\n public static clearAllProviders() {\n if (this._abstractAdapter) return this._abstractAdapter.clearAllProviders();\n\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n public static get onUiProviderRegisteredEvent(): BeUiEvent<UiItemsProviderRegisteredEventArgs> {\n if (this._abstractAdapter)\n return this._abstractAdapter.onUiProviderRegisteredEvent;\n\n return this._onUiProviderRegisteredEvent;\n }\n\n /** Return number of registered UiProvider. */\n public static get registeredProviderIds(): string[] {\n if (this._abstractAdapter)\n return this._abstractAdapter.registeredProviderIds;\n\n const ids = [...UiItemsManager._registeredUiItemsProviders.keys()];\n return ids;\n }\n\n /** Return true if there is any registered UiProvider. */\n public static get hasRegisteredProviders(): boolean {\n if (this._abstractAdapter)\n return this._abstractAdapter.hasRegisteredProviders;\n\n return this._registeredUiItemsProviders.size > 0;\n }\n\n /**\n * Retrieves a previously loaded UiItemsProvider.\n * @param providerId id of the UiItemsProvider to get\n */\n public static getUiItemsProvider(\n providerId: string\n ): UiItemsProvider | undefined {\n if (this._abstractAdapter)\n return this._abstractAdapter.getUiItemsProvider(providerId);\n\n return UiItemsManager._registeredUiItemsProviders.get(providerId)?.provider;\n }\n\n private static sendRegisteredEvent(args: UiItemsProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);\n }\n\n /**\n * Registers a UiItemsProvider with the UiItemsManager.\n * @param uiProvider the UI items provider to register.\n * @param overrides the UI items provider to register.\n */\n public static register(\n uiProvider: UiItemsProvider,\n overrides?: UiItemsProviderOverrides\n ): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.register(uiProvider, overrides);\n\n const providerId = overrides?.providerId ?? uiProvider.id;\n\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) is already loaded`\n );\n } else {\n UiItemsManager._registeredUiItemsProviders.set(providerId, {\n provider: uiProvider,\n overrides,\n });\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider ${uiProvider.id} registered as ${providerId} `\n );\n\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n }\n\n /** Remove a specific UiItemsProvider from the list of available providers. */\n public static unregister(providerId: string): void {\n if (this._abstractAdapter)\n return this._abstractAdapter.unregister(providerId);\n\n const provider = UiItemsManager.getUiItemsProvider(providerId);\n if (!provider) return;\n\n provider.onUnregister && provider.onUnregister();\n\n UiItemsManager._registeredUiItemsProviders.delete(providerId);\n Logger.logInfo(\n UiFramework.loggerCategory(this),\n `UiItemsProvider (${providerId}) unloaded`\n );\n\n // trigger a refresh of the ui\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n\n private static allowItemsFromProvider(\n entry: UiItemProviderEntry,\n stageId?: string,\n stageUsage?: string\n ) {\n // istanbul ignore else\n const overrides = entry.overrides;\n if (\n undefined !== stageId &&\n overrides?.stageIds &&\n !overrides.stageIds.some((value: string) => value === stageId)\n )\n return false;\n if (\n undefined !== stageUsage &&\n overrides?.stageUsages &&\n !overrides.stageUsages.some((value: string) => value === stageUsage)\n )\n return false;\n return true;\n }\n\n /** Called when the application is populating a toolbar so that any registered UiItemsProvider can add tool buttons that either either execute\n * an action or specify a registered ToolId into toolbar.\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param usage usage of the toolbar\n * @param orientation orientation of the toolbar\n * @returns an array of error messages. The array will be empty if the load is successful, otherwise it is a list of one or more problems.\n */\n public static getToolbarButtonItems(\n stageId: string,\n stageUsage: string,\n usage: ToolbarUsage,\n orientation: ToolbarOrientation\n ): ReadonlyArray<ProviderItem<ToolbarItem>> {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getToolbarButtonItems(\n stageId,\n stageUsage,\n usage,\n orientation\n );\n }\n\n const items: ProviderItem<ToolbarItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n const providerItems = provider\n .provideToolbarItems(stageId, stageUsage, usage, orientation)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @returns An array of CommonStatusBarItem that will be used to create controls for the status bar.\n */\n public static getStatusBarItems(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<StatusBarItem>> {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getStatusBarItems(stageId, stageUsage);\n }\n\n const items: ProviderItem<StatusBarItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n\n const providerItems = provider\n .provideStatusBarItems(stageId, stageUsage)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the statusbar so that any registered UiItemsProvider can add status fields\n * @returns An array of BackstageItem that will be used to create controls for the backstage menu.\n */\n public static getBackstageItems(): ReadonlyArray<\n ProviderItem<BackstageItem>\n > {\n if (this._abstractAdapter) {\n return this._abstractAdapter.getBackstageItems();\n }\n\n const items: ProviderItem<BackstageItem>[] = [];\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n const provider = createGetPropertyAdapter(uiProvider);\n // Note: We do not call this.allowItemsFromProvider here as backstage items\n // should not be considered stage specific.\n const providerItems = provider.provideBackstageItems().map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Called when the application is populating the Stage Panels so that any registered UiItemsProvider can add widgets\n * @param stageId a string identifier of the active stage.\n * @param stageUsage the StageUsage of the active stage.\n * @param location the location within the stage.\n * @param section the section within location.\n * @returns An array of widgets.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n section?: StagePanelSection\n ): ReadonlyArray<ProviderItem<Widget>> {\n const items: ProviderItem<Widget>[] = [];\n if (this._abstractAdapter) {\n const abstractWidgets = this._abstractAdapter.getWidgets(\n stageId,\n stageUsage,\n location,\n section\n );\n items.push(...abstractWidgets);\n }\n\n UiItemsManager._registeredUiItemsProviders.forEach((entry) => {\n const uiProvider = entry.provider;\n const providerId = entry.overrides?.providerId ?? uiProvider.id;\n if (!this.allowItemsFromProvider(entry, stageId, stageUsage)) return;\n\n const provider = createGetPropertyAdapter(uiProvider);\n const providerItems = provider\n .provideWidgets(stageId, stageUsage, location, section)\n .map((item) => ({\n ...item,\n providerId,\n }));\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n}\n\nfunction getUniqueItems<T extends { id: string }>(items: readonly T[]) {\n const uniqueItems: T[] = [];\n items.forEach((item) => {\n if (uniqueItems.find((existingItem) => item.id === existingItem.id)) return;\n uniqueItems.push(item);\n });\n return uniqueItems;\n}\n"]}
@@ -90,7 +90,7 @@ class FrameworkUiAdmin extends appui_abstract_1.UiAdmin {
90
90
  /** Resolve location and parent element */
91
91
  resolveHtmlElement(location, htmlElement) {
92
92
  const position = location;
93
- const el = htmlElement !== null && htmlElement !== void 0 ? htmlElement : UiFramework_1.UiFramework.controls.getWrapperElement();
93
+ const el = htmlElement ?? UiFramework_1.UiFramework.controls.getWrapperElement();
94
94
  return { position, el };
95
95
  }
96
96
  getKeyins() {
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAE/B,wDAAiD;AAcjD,0DAAkE;AAClE,2EAAwE;AACxE,mEAAgE;AAChE,wDAAqD;AAGrD,gDAA6C;AAC7C,yEAAsE;AAEtE;;GAEG;AACH,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,iDAAiD;IACjD,mFAAY,CAAA;IACZ,6CAA6C;IAC7C,6EAAS,CAAA;IACT,mEAAmE;IACnE,mEAAI,CAAA;AACN,CAAC,EAPW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAOjC;AAcD;;;;;;;;;;GAUG;AACH,MAAa,gBAAiB,SAAQ,wBAAO;IAA7C;;QACU,8BAAyB,GAC/B,sBAAsB,CAAC,YAAY,CAAC;IAqkBxC,CAAC;IAnkBC,IAAW,wBAAwB;QACjC,OAAO,IAAI,CAAC,yBAAyB,CAAC;IACxC,CAAC;IACD,IAAW,wBAAwB,CAAC,UAAkC;QACpE,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC;IAC9C,CAAC;IAED,gBAAgB;IACA,aAAa,KAAI,CAAC;IAElC,wFAAwF;IACxF,IAAoB,cAAc;QAChC,OAAO,qCAAiB,CAAC,cAAc,CAAC;IAC1C,CAAC;IAED,yCAAyC;IACzC,IAAoB,aAAa;QAC/B,OAAO,yBAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC;IACrD,CAAC;IAED,yBAAyB;IACT,cAAc;QAC5B,yBAAW,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACa,eAAe,CAC7B,KAA8B,EAC9B,QAAe,EACf,WAAyB;QAEzB,IAAI,QAAQ,GA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,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvkBD,4CAukBC","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 Admin\n */\n\nimport * as React from \"react\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type {\n AbstractMenuItemProps,\n AbstractToolbarProps,\n DialogLayoutDataProvider,\n DialogProps,\n OnCancelFunc,\n OnItemExecutedFunc,\n OnNumberCommitFunc,\n OnValueCommitFunc,\n Primitives,\n PropertyDescription,\n PropertyRecord,\n} from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccuDrawPopupManager } from \"../accudraw/AccuDrawPopupManager\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport type { IMatch } from \"../utils/matchesWords\";\nimport type { CursorMenuData } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UiDataProvidedDialog } from \"../dialog/UiDataProvidedDialog\";\n\n/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.\n * @public\n */\nexport enum KeyinFieldLocalization {\n /** Include only non-localized key-in strings. */\n NonLocalized,\n /** Include only localized key-in strings. */\n Localized,\n /** Include localized and non-localized strings for each key-in. */\n Both,\n}\n\n/** Defines a keyin entry to show/filter in UI\n * @public\n */\nexport interface KeyinEntry {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** true if entry was loaded from key-in history */\n isHistory?: boolean;\n}\n\n/** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * This implementation uses themed react components that blends in AppUI look and feel.\n *\n * ```ts\n * await IModelApp.startup({\n * uiAdmin: new FrameworkUiAdmin()\n * });\n * ```\n * @public\n */\nexport class FrameworkUiAdmin extends UiAdmin {\n private _localizedKeyinPreference: KeyinFieldLocalization =\n KeyinFieldLocalization.NonLocalized;\n\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** @internal */\n public override onInitialized() {}\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY. */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home */\n public override setFocusToHome(): void {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }\n\n /** Show a context menu at a particular location.\n * @param items Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the overall window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n let position = location;\n let childWindowId: string | undefined;\n if (htmlElement) {\n const anchorOffset = htmlElement.getBoundingClientRect();\n position = {\n x: anchorOffset.left + location.x,\n y: anchorOffset.top + location.y,\n };\n childWindowId = UiFramework.childWindows.findId(\n htmlElement.ownerDocument.defaultView\n );\n }\n\n const offset = -8;\n position = { x: position.x + offset, y: position.y + offset };\n\n const cursorMenu: CursorMenuData = { position, items, childWindowId };\n UiFramework.openCursorMenu(cursorMenu);\n\n return true;\n }\n\n /** Resolve location and parent element */\n private resolveHtmlElement(\n location: XAndY,\n htmlElement?: HTMLElement\n ): { position: XAndY; el: HTMLElement } {\n const position = location;\n const el = htmlElement ?? UiFramework.controls.getWrapperElement();\n return { position, el };\n }\n\n public getKeyins(): KeyinEntry[] {\n const toolKeyins: KeyinEntry[] = [];\n const tools = IModelApp.tools.getToolList();\n for (const tool of tools) {\n switch (this.localizedKeyinPreference) {\n case KeyinFieldLocalization.Localized:\n toolKeyins.push({ value: tool.keyin });\n break;\n case KeyinFieldLocalization.Both:\n toolKeyins.push({ value: tool.keyin });\n // istanbul ignore else\n if (tool.keyin === tool.englishKeyin) break;\n // istanbul ignore next\n default: // eslint-disable-line no-fallthrough\n case KeyinFieldLocalization.NonLocalized:\n // istanbul ignore next\n if (\n KeyinFieldLocalization.NonLocalized ===\n this.localizedKeyinPreference ||\n (KeyinFieldLocalization.Both === this.localizedKeyinPreference &&\n tool.englishKeyin !== tool.keyin)\n )\n toolKeyins.push({ value: tool.englishKeyin });\n break;\n }\n }\n\n return toolKeyins;\n }\n\n /** Show the Key-in Palette to display key-in from all registered Tools.\n * @param htmlElement The HTMLElement that anchors the Popup. If undefined, the location is relative to the overall window.\n * @return true if the Command Palette was displayed, false if it could not be displayed.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n // istanbul ignore next\n const el = htmlElement\n ? htmlElement\n : UiFramework.controls.getWrapperElement();\n\n // istanbul ignore next\n const hidePopup = () => {\n IModelApp.uiAdmin.hideKeyinPalette();\n };\n\n return PopupManager.showKeyinPalette(\n this.getKeyins(),\n el,\n hidePopup,\n hidePopup\n );\n }\n\n /** Hides the Key-in Palette. */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return PopupManager.hideKeyinPalette();\n }\n\n /** Show a Toolbar at a particular location.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Toolbar, relative to the origin of htmlElement or the overall window.\n * @param offset Offset of the Toolbar from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public override showToolbar(\n toolbarProps: AbstractToolbarProps,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showToolbar(\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the toolbar. */\n public override hideToolbar(): boolean {\n return PopupManager.hideToolbar();\n }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @param menuItemsProps Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showMenuButton(\n id,\n el,\n position,\n menuItemsProps\n );\n }\n\n /** Hides a menu button.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public override hideMenuButton(id: string): boolean {\n return AccuDrawPopupManager.hideMenuButton(id);\n }\n\n /** Show a calculator at a particular location.\n * @param initialValue Value initially displayed in the calculator.\n * @param resultIcon Icon displayed to the left of the value.\n * @param location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param onOk Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showCalculator(\n initialValue: number,\n resultIcon: string,\n location: XAndY,\n onOk: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showCalculator(\n el,\n position,\n initialValue,\n resultIcon,\n onOk,\n onCancel\n );\n }\n\n /** Hides the calculator. */\n public override hideCalculator(): boolean {\n return AccuDrawPopupManager.hideCalculator();\n }\n\n /** Show an input editor for an angle value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showAngleEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showLengthEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showHeightEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param propertyDescription Description of the primitive value property\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showInputEditor(\n initialValue: Primitives.Value,\n propertyDescription: PropertyDescription,\n location: XAndY,\n onCommit: OnValueCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return PopupManager.showInputEditor(\n el,\n position,\n initialValue,\n propertyDescription,\n onCommit,\n onCancel\n );\n }\n\n /** Hides the input editor. */\n public override hideInputEditor(): boolean {\n return PopupManager.hideInputEditor();\n }\n\n /** Show an HTML element at a particular location.\n * @param displayElement The HTMLElement to display\n * @param location Location of the display element, relative to the origin of htmlElement or the window\n * @param offset Offset of the display element from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public override showHTMLElement(\n displayElement: HTMLElement,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the HTML Element. */\n public override hideHTMLElement(): boolean {\n return PopupManager.hideHTMLElement();\n }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param content The HTMLElement of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public override showCard(\n content: HTMLElement,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n content,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Show a Card containing React-based content, a title and a toolbar at a particular location.\n * @param content The React node of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showReactCard(\n content: React.ReactNode,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n const reactContent = { reactNode: content };\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n reactContent,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the Card. */\n public override hideCard(): boolean {\n return PopupManager.hideCard();\n }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param dataProvider The DialogLayoutDataProvider for the tool settings popup dialog.\n * @param location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param offset Offset of the tool settings from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openToolSettingsPopup(\n dataProvider: DialogLayoutDataProvider,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.openToolSettings(\n dataProvider,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return PopupManager.closeToolSettings();\n }\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param uiDataProvider The UiDataProvider for the tool settings\n * @param title Specify title for dialog.\n * @param isModal Specify if the dialog is opened as a modal or modeless.\n * @param id Id of the dialog that is used to close it.\n * @param optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openDialog(\n uiDataProvider: DialogLayoutDataProvider,\n title: string,\n isModal: boolean,\n id: string,\n optionalProps?: DialogProps\n ): boolean {\n if (isModal) {\n UiFramework.dialogs.modal.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n } else {\n UiFramework.dialogs.modeless.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n }\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeDialog(dialogId: string): boolean {\n // istanbul ignore else\n if (\n UiFramework.dialogs.modeless.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modeless.close(dialogId);\n return true;\n }\n\n // istanbul ignore else\n if (\n UiFramework.dialogs.modal.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modal.close();\n return true;\n }\n\n // istanbul ignore next\n return false;\n }\n}\n"]}
1
+ {"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;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AgB,EAChB,EAAU,EACV,aAA2B;QAE3B,IAAI,OAAO,EAAE;YACX,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAC5B,oBAAC,2CAAoB,IACnB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,KACF,aAAa,GACjB,EACF,EAAE,CACH,CAAC;YACF,OAAO,IAAI,CAAC;SACb;aAAM;YACL,yBAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAC/B,oBAAC,2CAAoB,IACnB,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,EAAE,EAAE,EAAE,KACF,aAAa,GACjB,EACF,EAAE,CACH,CAAC;YACF,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED,yCAAyC;IACzB,WAAW,CAAC,QAAgB;QAC1C,uBAAuB;QACvB,IACE,yBAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAC5C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,yBAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,IACE,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CACzC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,CAC/B,EACD;YACA,yBAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;SACb;QAED,uBAAuB;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvkBD,4CAukBC","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 Admin\n */\n\nimport * as React from \"react\";\nimport type { XAndY } from \"@itwin/core-geometry\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type {\n AbstractMenuItemProps,\n AbstractToolbarProps,\n DialogLayoutDataProvider,\n DialogProps,\n OnCancelFunc,\n OnItemExecutedFunc,\n OnNumberCommitFunc,\n OnValueCommitFunc,\n Primitives,\n PropertyDescription,\n PropertyRecord,\n} from \"@itwin/appui-abstract\";\nimport { RelativePosition, UiAdmin } from \"@itwin/appui-abstract\";\nimport { AccuDrawPopupManager } from \"../accudraw/AccuDrawPopupManager\";\nimport { CursorInformation } from \"../cursor/CursorInformation\";\nimport { PopupManager } from \"../popup/PopupManager\";\nimport type { IMatch } from \"../utils/matchesWords\";\nimport type { CursorMenuData } from \"../redux/SessionState\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UiDataProvidedDialog } from \"../dialog/UiDataProvidedDialog\";\n\n/** Controls whether localized and/or non-localized key-in strings appear in a KeyinField's auto-completion list.\n * @public\n */\nexport enum KeyinFieldLocalization {\n /** Include only non-localized key-in strings. */\n NonLocalized,\n /** Include only localized key-in strings. */\n Localized,\n /** Include localized and non-localized strings for each key-in. */\n Both,\n}\n\n/** Defines a keyin entry to show/filter in UI\n * @public\n */\nexport interface KeyinEntry {\n /** string that matched a filter string */\n value: string;\n /** define array of start and end positions of filter matches. */\n matches?: IMatch[];\n /** true if entry was loaded from key-in history */\n isHistory?: boolean;\n}\n\n/** Subclass of `UiAdmin` in `@itwin/core-frontend` to be used to initialize `IModelApp`.\n *\n * This implementation uses themed react components that blends in AppUI look and feel.\n *\n * ```ts\n * await IModelApp.startup({\n * uiAdmin: new FrameworkUiAdmin()\n * });\n * ```\n * @public\n */\nexport class FrameworkUiAdmin extends UiAdmin {\n private _localizedKeyinPreference: KeyinFieldLocalization =\n KeyinFieldLocalization.NonLocalized;\n\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** @internal */\n public override onInitialized() {}\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY. */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home */\n public override setFocusToHome(): void {\n UiFramework.keyboardShortcuts.setFocusToHome();\n }\n\n /** Show a context menu at a particular location.\n * @param items Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the overall window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n let position = location;\n let childWindowId: string | undefined;\n if (htmlElement) {\n const anchorOffset = htmlElement.getBoundingClientRect();\n position = {\n x: anchorOffset.left + location.x,\n y: anchorOffset.top + location.y,\n };\n childWindowId = UiFramework.childWindows.findId(\n htmlElement.ownerDocument.defaultView\n );\n }\n\n const offset = -8;\n position = { x: position.x + offset, y: position.y + offset };\n\n const cursorMenu: CursorMenuData = { position, items, childWindowId };\n UiFramework.openCursorMenu(cursorMenu);\n\n return true;\n }\n\n /** Resolve location and parent element */\n private resolveHtmlElement(\n location: XAndY,\n htmlElement?: HTMLElement\n ): { position: XAndY; el: HTMLElement } {\n const position = location;\n const el = htmlElement ?? UiFramework.controls.getWrapperElement();\n return { position, el };\n }\n\n public getKeyins(): KeyinEntry[] {\n const toolKeyins: KeyinEntry[] = [];\n const tools = IModelApp.tools.getToolList();\n for (const tool of tools) {\n switch (this.localizedKeyinPreference) {\n case KeyinFieldLocalization.Localized:\n toolKeyins.push({ value: tool.keyin });\n break;\n case KeyinFieldLocalization.Both:\n toolKeyins.push({ value: tool.keyin });\n // istanbul ignore else\n if (tool.keyin === tool.englishKeyin) break;\n // istanbul ignore next\n default: // eslint-disable-line no-fallthrough\n case KeyinFieldLocalization.NonLocalized:\n // istanbul ignore next\n if (\n KeyinFieldLocalization.NonLocalized ===\n this.localizedKeyinPreference ||\n (KeyinFieldLocalization.Both === this.localizedKeyinPreference &&\n tool.englishKeyin !== tool.keyin)\n )\n toolKeyins.push({ value: tool.englishKeyin });\n break;\n }\n }\n\n return toolKeyins;\n }\n\n /** Show the Key-in Palette to display key-in from all registered Tools.\n * @param htmlElement The HTMLElement that anchors the Popup. If undefined, the location is relative to the overall window.\n * @return true if the Command Palette was displayed, false if it could not be displayed.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n // istanbul ignore next\n const el = htmlElement\n ? htmlElement\n : UiFramework.controls.getWrapperElement();\n\n // istanbul ignore next\n const hidePopup = () => {\n IModelApp.uiAdmin.hideKeyinPalette();\n };\n\n return PopupManager.showKeyinPalette(\n this.getKeyins(),\n el,\n hidePopup,\n hidePopup\n );\n }\n\n /** Hides the Key-in Palette. */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return PopupManager.hideKeyinPalette();\n }\n\n /** Show a Toolbar at a particular location.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Toolbar, relative to the origin of htmlElement or the overall window.\n * @param offset Offset of the Toolbar from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Toolbar\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param htmlElement The HTMLElement that anchors the Toolbar. If undefined, the location is relative to the overall window.\n * @return true if the Toolbar was displayed, false if the Toolbar could not be displayed.\n */\n public override showToolbar(\n toolbarProps: AbstractToolbarProps,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showToolbar(\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the toolbar. */\n public override hideToolbar(): boolean {\n return PopupManager.hideToolbar();\n }\n\n /** Show a menu button at a particular location. A menu button opens a context menu.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @param menuItemsProps Properties of the menu items to display.\n * @param location Location of the context menu, relative to the origin of htmlElement or the window.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showMenuButton(\n id,\n el,\n position,\n menuItemsProps\n );\n }\n\n /** Hides a menu button.\n * @param id Id of the menu button. Multiple menu buttons may be displayed.\n * @return true if the menu was hidden, false if the menu could not be hidden.\n */\n public override hideMenuButton(id: string): boolean {\n return AccuDrawPopupManager.hideMenuButton(id);\n }\n\n /** Show a calculator at a particular location.\n * @param initialValue Value initially displayed in the calculator.\n * @param resultIcon Icon displayed to the left of the value.\n * @param location Location of the calculator, relative to the origin of htmlElement or the window.\n * @param onOk Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the menu was displayed, false if the menu could not be displayed.\n */\n public override showCalculator(\n initialValue: number,\n resultIcon: string,\n location: XAndY,\n onOk: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showCalculator(\n el,\n position,\n initialValue,\n resultIcon,\n onOk,\n onCancel\n );\n }\n\n /** Hides the calculator. */\n public override hideCalculator(): boolean {\n return AccuDrawPopupManager.hideCalculator();\n }\n\n /** Show an input editor for an angle value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showAngleEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a length value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showLengthEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a height value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return AccuDrawPopupManager.showHeightEditor(\n el,\n position,\n initialValue,\n onCommit,\n onCancel\n );\n }\n\n /** Show an input editor for a primitive value at a particular location.\n * @param initialValue Value initially displayed in the editor.\n * @param propertyDescription Description of the primitive value property\n * @param location Location of the editor, relative to the origin of htmlElement or the window.\n * @param onCommit Function called when the OK button or the Enter key is pressed.\n * @param onCancel Function called when the Cancel button or the Escape key is pressed.\n * @param htmlElement The HTMLElement that anchors the context menu. If undefined, the location is relative to the overall window.\n * @return true if the editor was displayed, false if the editor could not be displayed.\n */\n public override showInputEditor(\n initialValue: Primitives.Value,\n propertyDescription: PropertyDescription,\n location: XAndY,\n onCommit: OnValueCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, htmlElement);\n\n return PopupManager.showInputEditor(\n el,\n position,\n initialValue,\n propertyDescription,\n onCommit,\n onCancel\n );\n }\n\n /** Hides the input editor. */\n public override hideInputEditor(): boolean {\n return PopupManager.hideInputEditor();\n }\n\n /** Show an HTML element at a particular location.\n * @param displayElement The HTMLElement to display\n * @param location Location of the display element, relative to the origin of htmlElement or the window\n * @param offset Offset of the display element from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the display element\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the display element. If undefined, the location is relative to the overall window.\n * @return true if the display element was displayed, false if the display element could not be displayed.\n */\n public override showHTMLElement(\n displayElement: HTMLElement,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the HTML Element. */\n public override hideHTMLElement(): boolean {\n return PopupManager.hideHTMLElement();\n }\n\n /** Show a Card containing content, a title and a toolbar at a particular location.\n * @param content The HTMLElement of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public override showCard(\n content: HTMLElement,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n content,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Show a Card containing React-based content, a title and a toolbar at a particular location.\n * @param content The React node of the content to display\n * @param title Title to display at the top of the card.\n * @param toolbarProps Properties of the Toolbar to display.\n * @param location Location of the Card, relative to the origin of htmlElement or the window.\n * @param offset Offset of the Card from the location.\n * @param onItemExecuted Function invoked after a Toolbar item is executed\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the Card\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the Card. If undefined, the location is relative to the overall window.\n * @return true if the Card was displayed, false if the Card could not be displayed.\n */\n public showReactCard(\n content: React.ReactNode,\n title: string | PropertyRecord | undefined,\n toolbarProps: AbstractToolbarProps | undefined,\n location: XAndY,\n offset: XAndY,\n onItemExecuted: OnItemExecutedFunc,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n const reactContent = { reactNode: content };\n\n // istanbul ignore if\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.showCard(\n reactContent,\n title,\n toolbarProps,\n el,\n position,\n offset,\n onItemExecuted,\n onCancel,\n relativePosition\n );\n }\n\n /** Hides the Card. */\n public override hideCard(): boolean {\n return PopupManager.hideCard();\n }\n\n /** Opens a Tool Settings Ui popup at a particular location.\n * @param dataProvider The DialogLayoutDataProvider for the tool settings popup dialog.\n * @param location Location of the tool settings, relative to the origin of anchorElement or the window\n * @param offset Offset of the tool settings from the location\n * @param onCancel Function invoked when the Escape key is pressed or a click occurs outside the tool settings\n * @param relativePosition Position relative to the given location. Defaults to TopRight.\n * @param anchorElement The HTMLElement that anchors the tool settings. If undefined, the location is relative to the overall window.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openToolSettingsPopup(\n dataProvider: DialogLayoutDataProvider,\n location: XAndY,\n offset: XAndY,\n onCancel: OnCancelFunc,\n relativePosition?: RelativePosition,\n anchorElement?: HTMLElement\n ): boolean {\n const { position, el } = this.resolveHtmlElement(location, anchorElement);\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n return PopupManager.openToolSettings(\n dataProvider,\n el,\n position,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return PopupManager.closeToolSettings();\n }\n\n /** Opens a Dialog and automatically populates it using the properties defined by the UiDataProvider.\n * @param uiDataProvider The UiDataProvider for the tool settings\n * @param title Specify title for dialog.\n * @param isModal Specify if the dialog is opened as a modal or modeless.\n * @param id Id of the dialog that is used to close it.\n * @param optionalProps Optional props for Dialog construction.\n * @return true if the tool settings were displayed, false if the tool settings could not be displayed.\n */\n public override openDialog(\n uiDataProvider: DialogLayoutDataProvider,\n title: string,\n isModal: boolean,\n id: string,\n optionalProps?: DialogProps\n ): boolean {\n if (isModal) {\n UiFramework.dialogs.modal.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n } else {\n UiFramework.dialogs.modeless.open(\n <UiDataProvidedDialog\n uiDataProvider={uiDataProvider}\n title={title}\n isModal={isModal}\n id={id}\n {...optionalProps}\n />,\n id\n );\n return true;\n }\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeDialog(dialogId: string): boolean {\n // istanbul ignore else\n if (\n UiFramework.dialogs.modeless.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modeless.close(dialogId);\n return true;\n }\n\n // istanbul ignore else\n if (\n UiFramework.dialogs.modal.dialogs.findIndex(\n (info) => info.id === dialogId\n )\n ) {\n UiFramework.dialogs.modal.close();\n return true;\n }\n\n // istanbul ignore next\n return false;\n }\n}\n"]}
@@ -47,7 +47,7 @@ function PropertyEditor({ uiDataProvider, initialItem, isLock, setFocus, }) {
47
47
  let newRecord = appui_abstract_1.UiLayoutDataProvider.getPropertyRecord(initialItem);
48
48
  // istanbul ignore next
49
49
  const foundItem = isLock
50
- ? uiDataProvider.items.find((item) => { var _a; return ((_a = item.lockProperty) === null || _a === void 0 ? void 0 : _a.property.name) === initialItem.property.name; })
50
+ ? uiDataProvider.items.find((item) => item.lockProperty?.property.name === initialItem.property.name)
51
51
  : uiDataProvider.items.find((item) => item.property.name === initialItem.property.name);
52
52
  // istanbul ignore else
53
53
  if (foundItem) {
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentGenerator.js","sourceRoot":"","sources":["../../../../src/appui-react/uiprovider/ComponentGenerator.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,6CAA2C;AAC3C,2CAAoC;AACpC,+BAA+B;AAS/B,0DAG+B;AAE/B,8DAA0D;AAE1D,sDAAqD;AAErD,SAAS,WAAW,CAAC,EACnB,cAAc,EACd,IAAI,EACJ,gBAAgB,GAKjB;IACC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY;YAC/B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY;YAC5B,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IACpD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACX,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAC9B,GAAG,EAAE,CAAC,sBAAsB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAChD,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,uEAAuE;IACvE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,UAAU,GAAG,CAAC,IAAmC,EAAE,EAAE;YACzD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACrC,CAAC,QAAgC,EAAE,EAAE,CACnC,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAC/C,CAAC;YACF,uBAAuB;YACvB,IAAI,UAAU,EAAE;gBACd,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,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AC,mCAAmC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SAChE;aAAM;YACL,OAAO;gBACL,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBACvE,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;aACnC,CAAC;SACH;IACH,CAAC;IAED,6DAA6D;IACtD,sBAAsB;QAC3B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAc,EAAE,KAAa,EAAE,EAAE,CACpE,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAK,CAAC,CACtC,CAAC;IACJ,CAAC;CACF;AA3LD,gDA2LC","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 UiProvider\n */\n\nimport \"./DefaultDialogGridContainer.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n BaseDialogItem,\n DialogItem,\n DialogItemValue,\n DialogPropertySyncItem,\n DialogRow,\n SyncPropertiesChangeEventArgs,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n UiLayoutDataProvider,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"@itwin/components-react\";\nimport { EditorContainer } from \"@itwin/components-react\";\nimport type { ToolSettingsEntry } from \"../widget-panels/ToolSettings\";\nimport { assert, Logger } from \"@itwin/core-bentley\";\n\nfunction EditorLabel({\n uiDataProvider,\n item,\n isLeftmostRecord,\n}: {\n uiDataProvider: UiLayoutDataProvider;\n item: DialogItem;\n isLeftmostRecord?: boolean;\n}) {\n const [isDisabled, setIsDisabled] = React.useState(!!item.isDisabled);\n const displayLabel = React.useMemo(() => {\n return item.property.displayLabel\n ? item.property.displayLabel\n : /* istanbul ignore next */ item.property.name;\n }, [item]);\n const propertyId = React.useMemo(\n () => `dialogItemProperty-${item.property.name}`,\n [item]\n );\n\n // listen for tool sync property events and update the isDisabled state\n React.useEffect(() => {\n const handleSync = (args: SyncPropertiesChangeEventArgs) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === item.property.name\n );\n // istanbul ignore next\n if (mySyncItem) {\n setIsDisabled(!!mySyncItem.isDisabled);\n }\n };\n uiDataProvider.onSyncPropertiesChangeEvent.addListener(handleSync);\n return () => {\n uiDataProvider.onSyncPropertiesChangeEvent.removeListener(handleSync);\n };\n }, [uiDataProvider, item]);\n\n // istanbul ignore next\n const className = classnames(\n \"uifw-default-label\",\n isDisabled && \"uifw-label-disabled\",\n !!isLeftmostRecord && \"uifw-default-narrow-only-display\",\n !isLeftmostRecord && \"uifw-default-inline-label\"\n );\n return (\n <label className={className} htmlFor={propertyId}>\n {displayLabel}:\n </label>\n );\n}\n\nfunction PropertyEditor({\n uiDataProvider,\n initialItem,\n isLock,\n setFocus,\n}: {\n uiDataProvider: UiLayoutDataProvider;\n initialItem: BaseDialogItem;\n isLock?: boolean;\n setFocus?: boolean;\n}) {\n const getLatestRecordValue = React.useCallback(() => {\n let newRecord = UiLayoutDataProvider.getPropertyRecord(initialItem);\n\n // istanbul ignore next\n const foundItem = isLock\n ? uiDataProvider.items.find(\n (item) =>\n item.lockProperty?.property.name === initialItem.property.name\n )\n : uiDataProvider.items.find(\n (item) => item.property.name === initialItem.property.name\n );\n // istanbul ignore else\n if (foundItem) {\n if (isLock) {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.lockProperty!.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.lockProperty!.isDisabled;\n } else {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.isDisabled;\n }\n }\n return newRecord;\n }, [initialItem, isLock, uiDataProvider.items]);\n\n const currentRecord = getLatestRecordValue();\n const [propertyRecord, setPropertyRecord] = React.useState(currentRecord);\n\n // monitor tool for sync UI events\n React.useEffect(() => {\n const handleSync = (args: SyncPropertiesChangeEventArgs) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === initialItem.property.name\n );\n // istanbul ignore else\n if (mySyncItem) {\n const newPropertyValue = propertyRecord.copyWithNewValue(\n {\n value: mySyncItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n displayValue: mySyncItem.value.displayValue,\n },\n mySyncItem.property\n );\n\n if (mySyncItem.property) {\n // istanbul ignore else\n if (mySyncItem.property.name === mySyncItem.propertyName) {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n } else {\n Logger.logError(\n \"PropertyEditor\",\n `Error trying to replace propertyName=${mySyncItem.propertyName} with property named ${mySyncItem.property.name}`\n );\n }\n } else {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n }\n }\n };\n uiDataProvider.onSyncPropertiesChangeEvent.addListener(handleSync);\n return () => {\n uiDataProvider.onSyncPropertiesChangeEvent.removeListener(handleSync);\n };\n }, [uiDataProvider, propertyRecord, initialItem.property.name]);\n\n const className = React.useMemo(\n () => (isLock ? \"uifw-default-property-lock\" : \"uifw-default-editor\"),\n [isLock]\n );\n // istanbul ignore next\n const handleCommit = React.useCallback(\n (commit: PropertyUpdatedArgs) => {\n // UiLayoutDataProvider supports only primitive property types\n // istanbul ignore next\n assert(\n commit.newValue.valueFormat === PropertyValueFormat.Primitive &&\n commit.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n );\n const newPropertyValue = propertyRecord.copyWithNewValue(commit.newValue);\n const syncItem: DialogPropertySyncItem = {\n value: commit.newValue as DialogItemValue,\n propertyName: initialItem.property.name,\n isDisabled: newPropertyValue.isDisabled,\n };\n uiDataProvider.applyUiPropertyChange(syncItem);\n // Now have the uiDataProvider refetch the latest property values from the tool\n uiDataProvider.reloadDialogItems(true);\n },\n [initialItem.property.name, propertyRecord, uiDataProvider]\n );\n // istanbul ignore next\n const handleCancel = () => {};\n\n return (\n <div key={initialItem.property.name} className={className}>\n <EditorContainer\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={handleCancel}\n />\n </div>\n );\n}\n\n/** Utility methods to generate react ui from DialogRow specs\n * @internal\n */\nexport class ComponentGenerator {\n constructor(private _uiDataProvider: UiLayoutDataProvider) {}\n\n public get uiDataProvider() {\n return this._uiDataProvider;\n }\n\n private getEditor(\n item: BaseDialogItem,\n isLock = false,\n setFocus = false\n ): React.ReactNode {\n return (\n <PropertyEditor\n key={item.property.name}\n uiDataProvider={this.uiDataProvider}\n initialItem={item}\n isLock={isLock}\n setFocus={setFocus}\n />\n );\n }\n\n private generateRowWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): React.ReactNode {\n // istanbul ignore else\n if (1 === row.items.length) {\n return (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n );\n }\n\n return (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item) => this.getEditor(item))}\n </div>\n </div>\n );\n }\n\n private generateEntryWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n // istanbul ignore else\n if (1 === row.items.length) {\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n ),\n };\n }\n\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item) => this.getEditor(item))}\n </div>\n </div>\n ),\n };\n }\n\n private getEditorLabel(\n item: DialogItem,\n isLeftmostRecord = false\n ): React.ReactNode {\n return (\n <EditorLabel\n uiDataProvider={this.uiDataProvider}\n item={item}\n isLeftmostRecord={isLeftmostRecord}\n />\n );\n }\n\n private getLeftLockAndLabel(\n rowItem: DialogItem,\n multiplePropertiesOnRow: boolean\n ): React.ReactNode {\n const record = UiLayoutDataProvider.getPropertyRecord(rowItem);\n // istanbul ignore next\n const lockEditor = UiLayoutDataProvider.hasAssociatedLockProperty(rowItem)\n ? this.getEditor(rowItem.lockProperty!, true)\n : null;\n const label = UiLayoutDataProvider.editorWantsLabel(rowItem)\n ? this.getEditorLabel(rowItem)\n : null;\n const classNames = multiplePropertiesOnRow\n ? \"uifw-default-lock-and-label uifw-default-wide-only-display\"\n : \"uifw-default-lock-and-label\";\n return (\n <div key={`lock-${record.property.name}`} className={classNames}>\n {lockEditor}\n {label}\n </div>\n );\n }\n\n private getInlineLabelAndEditor(\n item: DialogItem,\n isLeftmostRecord: boolean\n ): React.ReactNode {\n const label = UiLayoutDataProvider.editorWantsLabel(item)\n ? this.getEditorLabel(item, isLeftmostRecord)\n : null;\n return (\n <div\n key={item.property.name}\n className=\"uifw-default-inline-label-and-editor\"\n >\n {label}\n {this.getEditor(item)}\n </div>\n );\n }\n\n private getRowWithMultipleEditors(row: DialogRow): React.ReactNode {\n return (\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item: DialogItem, index: number) =>\n this.getInlineLabelAndEditor(item, 0 === index)\n )}\n </div>\n );\n }\n\n private getDivForRow(row: DialogRow): React.ReactNode {\n if (1 === row.items.length) return this.getEditor(row.items[0]);\n return this.getRowWithMultipleEditors(row);\n }\n\n public getRow(row: DialogRow, rowIndex: number): React.ReactNode {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateRowWithButtonGroupEditors(row, rowIndex);\n } else {\n return (\n <React.Fragment key={rowIndex}>\n {this.getLeftLockAndLabel(row.items[0], row.items.length > 1)}\n {this.getDivForRow(row)}\n </React.Fragment>\n );\n }\n }\n\n public getToolSettingsEntry(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateEntryWithButtonGroupEditors(row, rowIndex);\n } else {\n return {\n labelNode: this.getLeftLockAndLabel(row.items[0], row.items.length > 1),\n editorNode: this.getDivForRow(row),\n };\n }\n }\n\n /** ToolSettingsEntries are used by the tool settings bar. */\n public getToolSettingsEntries(): ToolSettingsEntry[] {\n return this.uiDataProvider.rows.map((row: DialogRow, index: number) =>\n this.getToolSettingsEntry(row, index)\n );\n }\n}\n"]}
1
+ {"version":3,"file":"ComponentGenerator.js","sourceRoot":"","sources":["../../../../src/appui-react/uiprovider/ComponentGenerator.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,6CAA2C;AAC3C,2CAAoC;AACpC,+BAA+B;AAS/B,0DAG+B;AAE/B,8DAA0D;AAE1D,sDAAqD;AAErD,SAAS,WAAW,CAAC,EACnB,cAAc,EACd,IAAI,EACJ,gBAAgB,GAKjB;IACC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,YAAY;YAC/B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY;YAC5B,CAAC,CAAC,0BAA0B,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IACpD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACX,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,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AAE,QAAQ,CAAC,CAAC;SAC9D;aAAM;YACL,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,QAAQ;gBAC1B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC5D,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CACR,CAClB,CAAC;SACH;IACH,CAAC;IAEM,oBAAoB,CACzB,GAAc,EACd,QAAgB;QAEhB,IAAI,qCAAoB,CAAC,6BAA6B,CAAC,GAAG,CAAC,EAAE;YAC3D,OAAO,IAAI,CAAC,mCAAmC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SAChE;aAAM;YACL,OAAO;gBACL,SAAS,EAAE,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBACvE,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;aACnC,CAAC;SACH;IACH,CAAC;IAED,6DAA6D;IACtD,sBAAsB;QAC3B,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAc,EAAE,KAAa,EAAE,EAAE,CACpE,IAAI,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAK,CAAC,CACtC,CAAC;IACJ,CAAC;CACF;AA3LD,gDA2LC","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 UiProvider\n */\n\nimport \"./DefaultDialogGridContainer.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n BaseDialogItem,\n DialogItem,\n DialogItemValue,\n DialogPropertySyncItem,\n DialogRow,\n SyncPropertiesChangeEventArgs,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n UiLayoutDataProvider,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"@itwin/components-react\";\nimport { EditorContainer } from \"@itwin/components-react\";\nimport type { ToolSettingsEntry } from \"../widget-panels/ToolSettings\";\nimport { assert, Logger } from \"@itwin/core-bentley\";\n\nfunction EditorLabel({\n uiDataProvider,\n item,\n isLeftmostRecord,\n}: {\n uiDataProvider: UiLayoutDataProvider;\n item: DialogItem;\n isLeftmostRecord?: boolean;\n}) {\n const [isDisabled, setIsDisabled] = React.useState(!!item.isDisabled);\n const displayLabel = React.useMemo(() => {\n return item.property.displayLabel\n ? item.property.displayLabel\n : /* istanbul ignore next */ item.property.name;\n }, [item]);\n const propertyId = React.useMemo(\n () => `dialogItemProperty-${item.property.name}`,\n [item]\n );\n\n // listen for tool sync property events and update the isDisabled state\n React.useEffect(() => {\n const handleSync = (args: SyncPropertiesChangeEventArgs) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === item.property.name\n );\n // istanbul ignore next\n if (mySyncItem) {\n setIsDisabled(!!mySyncItem.isDisabled);\n }\n };\n uiDataProvider.onSyncPropertiesChangeEvent.addListener(handleSync);\n return () => {\n uiDataProvider.onSyncPropertiesChangeEvent.removeListener(handleSync);\n };\n }, [uiDataProvider, item]);\n\n // istanbul ignore next\n const className = classnames(\n \"uifw-default-label\",\n isDisabled && \"uifw-label-disabled\",\n !!isLeftmostRecord && \"uifw-default-narrow-only-display\",\n !isLeftmostRecord && \"uifw-default-inline-label\"\n );\n return (\n <label className={className} htmlFor={propertyId}>\n {displayLabel}:\n </label>\n );\n}\n\nfunction PropertyEditor({\n uiDataProvider,\n initialItem,\n isLock,\n setFocus,\n}: {\n uiDataProvider: UiLayoutDataProvider;\n initialItem: BaseDialogItem;\n isLock?: boolean;\n setFocus?: boolean;\n}) {\n const getLatestRecordValue = React.useCallback(() => {\n let newRecord = UiLayoutDataProvider.getPropertyRecord(initialItem);\n\n // istanbul ignore next\n const foundItem = isLock\n ? uiDataProvider.items.find(\n (item) =>\n item.lockProperty?.property.name === initialItem.property.name\n )\n : uiDataProvider.items.find(\n (item) => item.property.name === initialItem.property.name\n );\n // istanbul ignore else\n if (foundItem) {\n if (isLock) {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.lockProperty!.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.lockProperty!.isDisabled;\n } else {\n newRecord = newRecord.copyWithNewValue({\n value: foundItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n });\n newRecord.isDisabled = foundItem.isDisabled;\n }\n }\n return newRecord;\n }, [initialItem, isLock, uiDataProvider.items]);\n\n const currentRecord = getLatestRecordValue();\n const [propertyRecord, setPropertyRecord] = React.useState(currentRecord);\n\n // monitor tool for sync UI events\n React.useEffect(() => {\n const handleSync = (args: SyncPropertiesChangeEventArgs) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === initialItem.property.name\n );\n // istanbul ignore else\n if (mySyncItem) {\n const newPropertyValue = propertyRecord.copyWithNewValue(\n {\n value: mySyncItem.value.value,\n valueFormat: PropertyValueFormat.Primitive,\n displayValue: mySyncItem.value.displayValue,\n },\n mySyncItem.property\n );\n\n if (mySyncItem.property) {\n // istanbul ignore else\n if (mySyncItem.property.name === mySyncItem.propertyName) {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n } else {\n Logger.logError(\n \"PropertyEditor\",\n `Error trying to replace propertyName=${mySyncItem.propertyName} with property named ${mySyncItem.property.name}`\n );\n }\n } else {\n newPropertyValue.isDisabled = mySyncItem.isDisabled;\n setPropertyRecord(newPropertyValue);\n }\n }\n };\n uiDataProvider.onSyncPropertiesChangeEvent.addListener(handleSync);\n return () => {\n uiDataProvider.onSyncPropertiesChangeEvent.removeListener(handleSync);\n };\n }, [uiDataProvider, propertyRecord, initialItem.property.name]);\n\n const className = React.useMemo(\n () => (isLock ? \"uifw-default-property-lock\" : \"uifw-default-editor\"),\n [isLock]\n );\n // istanbul ignore next\n const handleCommit = React.useCallback(\n (commit: PropertyUpdatedArgs) => {\n // UiLayoutDataProvider supports only primitive property types\n // istanbul ignore next\n assert(\n commit.newValue.valueFormat === PropertyValueFormat.Primitive &&\n commit.propertyRecord.value.valueFormat ===\n PropertyValueFormat.Primitive\n );\n const newPropertyValue = propertyRecord.copyWithNewValue(commit.newValue);\n const syncItem: DialogPropertySyncItem = {\n value: commit.newValue as DialogItemValue,\n propertyName: initialItem.property.name,\n isDisabled: newPropertyValue.isDisabled,\n };\n uiDataProvider.applyUiPropertyChange(syncItem);\n // Now have the uiDataProvider refetch the latest property values from the tool\n uiDataProvider.reloadDialogItems(true);\n },\n [initialItem.property.name, propertyRecord, uiDataProvider]\n );\n // istanbul ignore next\n const handleCancel = () => {};\n\n return (\n <div key={initialItem.property.name} className={className}>\n <EditorContainer\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={handleCancel}\n />\n </div>\n );\n}\n\n/** Utility methods to generate react ui from DialogRow specs\n * @internal\n */\nexport class ComponentGenerator {\n constructor(private _uiDataProvider: UiLayoutDataProvider) {}\n\n public get uiDataProvider() {\n return this._uiDataProvider;\n }\n\n private getEditor(\n item: BaseDialogItem,\n isLock = false,\n setFocus = false\n ): React.ReactNode {\n return (\n <PropertyEditor\n key={item.property.name}\n uiDataProvider={this.uiDataProvider}\n initialItem={item}\n isLock={isLock}\n setFocus={setFocus}\n />\n );\n }\n\n private generateRowWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): React.ReactNode {\n // istanbul ignore else\n if (1 === row.items.length) {\n return (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n );\n }\n\n return (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item) => this.getEditor(item))}\n </div>\n </div>\n );\n }\n\n private generateEntryWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n // istanbul ignore else\n if (1 === row.items.length) {\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={row.items[0].property.name}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n {this.getEditor(row.items[0])}\n </div>\n ),\n };\n }\n\n return {\n labelNode: \"\",\n editorNode: (\n <div\n key={rowIndex}\n className=\"uifw-default-inline-editor-group uifw-default-center-across-width\"\n >\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item) => this.getEditor(item))}\n </div>\n </div>\n ),\n };\n }\n\n private getEditorLabel(\n item: DialogItem,\n isLeftmostRecord = false\n ): React.ReactNode {\n return (\n <EditorLabel\n uiDataProvider={this.uiDataProvider}\n item={item}\n isLeftmostRecord={isLeftmostRecord}\n />\n );\n }\n\n private getLeftLockAndLabel(\n rowItem: DialogItem,\n multiplePropertiesOnRow: boolean\n ): React.ReactNode {\n const record = UiLayoutDataProvider.getPropertyRecord(rowItem);\n // istanbul ignore next\n const lockEditor = UiLayoutDataProvider.hasAssociatedLockProperty(rowItem)\n ? this.getEditor(rowItem.lockProperty!, true)\n : null;\n const label = UiLayoutDataProvider.editorWantsLabel(rowItem)\n ? this.getEditorLabel(rowItem)\n : null;\n const classNames = multiplePropertiesOnRow\n ? \"uifw-default-lock-and-label uifw-default-wide-only-display\"\n : \"uifw-default-lock-and-label\";\n return (\n <div key={`lock-${record.property.name}`} className={classNames}>\n {lockEditor}\n {label}\n </div>\n );\n }\n\n private getInlineLabelAndEditor(\n item: DialogItem,\n isLeftmostRecord: boolean\n ): React.ReactNode {\n const label = UiLayoutDataProvider.editorWantsLabel(item)\n ? this.getEditorLabel(item, isLeftmostRecord)\n : null;\n return (\n <div\n key={item.property.name}\n className=\"uifw-default-inline-label-and-editor\"\n >\n {label}\n {this.getEditor(item)}\n </div>\n );\n }\n\n private getRowWithMultipleEditors(row: DialogRow): React.ReactNode {\n return (\n <div className=\"uifw-default-inline-editor-group\">\n {row.items.map((item: DialogItem, index: number) =>\n this.getInlineLabelAndEditor(item, 0 === index)\n )}\n </div>\n );\n }\n\n private getDivForRow(row: DialogRow): React.ReactNode {\n if (1 === row.items.length) return this.getEditor(row.items[0]);\n return this.getRowWithMultipleEditors(row);\n }\n\n public getRow(row: DialogRow, rowIndex: number): React.ReactNode {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateRowWithButtonGroupEditors(row, rowIndex);\n } else {\n return (\n <React.Fragment key={rowIndex}>\n {this.getLeftLockAndLabel(row.items[0], row.items.length > 1)}\n {this.getDivForRow(row)}\n </React.Fragment>\n );\n }\n }\n\n public getToolSettingsEntry(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\n if (UiLayoutDataProvider.onlyContainButtonGroupEditors(row)) {\n return this.generateEntryWithButtonGroupEditors(row, rowIndex);\n } else {\n return {\n labelNode: this.getLeftLockAndLabel(row.items[0], row.items.length > 1),\n editorNode: this.getDivForRow(row),\n };\n }\n }\n\n /** ToolSettingsEntries are used by the tool settings bar. */\n public getToolSettingsEntries(): ToolSettingsEntry[] {\n return this.uiDataProvider.rows.map((row: DialogRow, index: number) =>\n this.getToolSettingsEntry(row, index)\n );\n }\n}\n"]}