@itwin/appui-react 5.18.0 → 5.20.0

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 (250) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/appui-react/UiFramework.js +20 -13
  3. package/lib/appui-react/UiFramework.js.map +1 -1
  4. package/lib/appui-react/accudraw/AccuDrawPopupManager.js +1 -1
  5. package/lib/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
  6. package/lib/appui-react/accudraw/AccuDrawWidget.js +1 -1
  7. package/lib/appui-react/accudraw/AccuDrawWidget.js.map +1 -1
  8. package/lib/appui-react/accudraw/Calculator.js +92 -98
  9. package/lib/appui-react/accudraw/Calculator.js.map +1 -1
  10. package/lib/appui-react/accudraw/CalculatorEngine.js +130 -129
  11. package/lib/appui-react/accudraw/CalculatorEngine.js.map +1 -1
  12. package/lib/appui-react/accudraw/CalculatorPopup.js +9 -12
  13. package/lib/appui-react/accudraw/CalculatorPopup.js.map +1 -1
  14. package/lib/appui-react/accudraw/FrameworkAccuDraw.js +39 -38
  15. package/lib/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
  16. package/lib/appui-react/accudraw/MenuButton.js +20 -20
  17. package/lib/appui-react/accudraw/MenuButton.js.map +1 -1
  18. package/lib/appui-react/accudraw/MenuButtonPopup.js +9 -12
  19. package/lib/appui-react/accudraw/MenuButtonPopup.js.map +1 -1
  20. package/lib/appui-react/backstage/BackstageItemsManager.js +5 -5
  21. package/lib/appui-react/backstage/BackstageItemsManager.js.map +1 -1
  22. package/lib/appui-react/backstage/BackstageManager.js +1 -3
  23. package/lib/appui-react/backstage/BackstageManager.js.map +1 -1
  24. package/lib/appui-react/backstage/InternalBackstageManager.js +3 -5
  25. package/lib/appui-react/backstage/InternalBackstageManager.js.map +1 -1
  26. package/lib/appui-react/childwindow/InternalChildWindowManager.js +30 -32
  27. package/lib/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
  28. package/lib/appui-react/configurableui/ActivityTracker.js +33 -33
  29. package/lib/appui-react/configurableui/ActivityTracker.js.map +1 -1
  30. package/lib/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
  31. package/lib/appui-react/configurableui/ConfigurableUiControl.js +8 -0
  32. package/lib/appui-react/configurableui/ConfigurableUiControl.js.map +1 -1
  33. package/lib/appui-react/configurableui/InternalConfigurableUiManager.js +8 -8
  34. package/lib/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
  35. package/lib/appui-react/configurableui/TimeTracker.js +25 -27
  36. package/lib/appui-react/configurableui/TimeTracker.js.map +1 -1
  37. package/lib/appui-react/content/ContentControl.js +2 -1
  38. package/lib/appui-react/content/ContentControl.js.map +1 -1
  39. package/lib/appui-react/content/ContentGroup.js +8 -4
  40. package/lib/appui-react/content/ContentGroup.js.map +1 -1
  41. package/lib/appui-react/content/ContentLayout.js +47 -38
  42. package/lib/appui-react/content/ContentLayout.js.map +1 -1
  43. package/lib/appui-react/content/IModelViewport.js +28 -23
  44. package/lib/appui-react/content/IModelViewport.js.map +1 -1
  45. package/lib/appui-react/content/InternalContentLayoutManager.js +1 -1
  46. package/lib/appui-react/content/InternalContentLayoutManager.js.map +1 -1
  47. package/lib/appui-react/content/InternalContentViewManager.js +9 -8
  48. package/lib/appui-react/content/InternalContentViewManager.js.map +1 -1
  49. package/lib/appui-react/content/StandardContentLayouts.js +141 -141
  50. package/lib/appui-react/content/StandardContentLayouts.js.map +1 -1
  51. package/lib/appui-react/content/ViewportContentControl.js +25 -22
  52. package/lib/appui-react/content/ViewportContentControl.js.map +1 -1
  53. package/lib/appui-react/cursor/CursorInformation.js +7 -6
  54. package/lib/appui-react/cursor/CursorInformation.js.map +1 -1
  55. package/lib/appui-react/cursor/cursorpopup/CursorPopup.js +9 -9
  56. package/lib/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
  57. package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js +7 -7
  58. package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
  59. package/lib/appui-react/dialog/DialogManagerBase.js +18 -19
  60. package/lib/appui-react/dialog/DialogManagerBase.js.map +1 -1
  61. package/lib/appui-react/dialog/InternalContentDialogManager.js +7 -7
  62. package/lib/appui-react/dialog/InternalContentDialogManager.js.map +1 -1
  63. package/lib/appui-react/dialog/InternalModalDialogManager.js +4 -4
  64. package/lib/appui-react/dialog/InternalModalDialogManager.js.map +1 -1
  65. package/lib/appui-react/dialog/InternalModelessDialogManager.js +6 -6
  66. package/lib/appui-react/dialog/InternalModelessDialogManager.js.map +1 -1
  67. package/lib/appui-react/dialog/ModelessDialog.js +3 -3
  68. package/lib/appui-react/dialog/ModelessDialog.js.map +1 -1
  69. package/lib/appui-react/feedback/ElementTooltip.js +3 -1
  70. package/lib/appui-react/feedback/ElementTooltip.js.map +1 -1
  71. package/lib/appui-react/feedback/ValidationTextbox.js +25 -25
  72. package/lib/appui-react/feedback/ValidationTextbox.js.map +1 -1
  73. package/lib/appui-react/frontstage/FrontstageDef.js +28 -10
  74. package/lib/appui-react/frontstage/FrontstageDef.js.map +1 -1
  75. package/lib/appui-react/frontstage/InternalFrontstageManager.js +96 -96
  76. package/lib/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
  77. package/lib/appui-react/frontstage/ModalFrontstage.js +5 -5
  78. package/lib/appui-react/frontstage/ModalFrontstage.js.map +1 -1
  79. package/lib/appui-react/frontstage/ModalSettingsStage.js +5 -4
  80. package/lib/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
  81. package/lib/appui-react/frontstage/StandardFrontstageProvider.js +1 -0
  82. package/lib/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
  83. package/lib/appui-react/keyboardshortcut/InternalKeyboardShortcut.js +22 -22
  84. package/lib/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
  85. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js +11 -9
  86. package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
  87. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js +17 -20
  88. package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js.map +1 -1
  89. package/lib/appui-react/layout/backstage/Backstage.js +11 -14
  90. package/lib/appui-react/layout/backstage/Backstage.js.map +1 -1
  91. package/lib/appui-react/layout/base/DragManager.js +6 -7
  92. package/lib/appui-react/layout/base/DragManager.js.map +1 -1
  93. package/lib/appui-react/layout/base/SafeAreaInsets.js +8 -8
  94. package/lib/appui-react/layout/base/SafeAreaInsets.js.map +1 -1
  95. package/lib/appui-react/layout/popup/Tooltip.js +8 -11
  96. package/lib/appui-react/layout/popup/Tooltip.js.map +1 -1
  97. package/lib/appui-react/layout/state/NineZoneStateReducer.d.ts.map +1 -1
  98. package/lib/appui-react/layout/state/NineZoneStateReducer.js +8 -4
  99. package/lib/appui-react/layout/state/NineZoneStateReducer.js.map +1 -1
  100. package/lib/appui-react/layout/widget/Overflow.d.ts.map +1 -1
  101. package/lib/appui-react/layout/widget/Overflow.js +11 -17
  102. package/lib/appui-react/layout/widget/Overflow.js.map +1 -1
  103. package/lib/appui-react/layout/widget/Overflow.scss +3 -48
  104. package/lib/appui-react/layout/widget/Tab.d.ts.map +1 -1
  105. package/lib/appui-react/layout/widget/Tab.js +7 -5
  106. package/lib/appui-react/layout/widget/Tab.js.map +1 -1
  107. package/lib/appui-react/messages/InputField.js +21 -24
  108. package/lib/appui-react/messages/InputField.js.map +1 -1
  109. package/lib/appui-react/messages/MessageManager.js +39 -38
  110. package/lib/appui-react/messages/MessageManager.js.map +1 -1
  111. package/lib/appui-react/messages/Pointer.js +38 -38
  112. package/lib/appui-react/messages/Pointer.js.map +1 -1
  113. package/lib/appui-react/messages/ReactNotifyMessageDetails.js +6 -0
  114. package/lib/appui-react/messages/ReactNotifyMessageDetails.js.map +1 -1
  115. package/lib/appui-react/messages/StatusMessageManager.js +2 -4
  116. package/lib/appui-react/messages/StatusMessageManager.js.map +1 -1
  117. package/lib/appui-react/navigationaids/CubeNavigationAidControl.js +1 -1
  118. package/lib/appui-react/navigationaids/CubeNavigationAidControl.js.map +1 -1
  119. package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js +1 -1
  120. package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js.map +1 -1
  121. package/lib/appui-react/navigationaids/NavigationAidControl.js +1 -0
  122. package/lib/appui-react/navigationaids/NavigationAidControl.js.map +1 -1
  123. package/lib/appui-react/navigationaids/SheetNavigationAid.js +55 -54
  124. package/lib/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
  125. package/lib/appui-react/navigationaids/SheetsModalFrontstage.js +22 -20
  126. package/lib/appui-react/navigationaids/SheetsModalFrontstage.js.map +1 -1
  127. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js +15 -14
  128. package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
  129. package/lib/appui-react/pickers/ListPicker.js +28 -28
  130. package/lib/appui-react/pickers/ListPicker.js.map +1 -1
  131. package/lib/appui-react/pickers/ViewSelector.js +87 -86
  132. package/lib/appui-react/pickers/ViewSelector.js.map +1 -1
  133. package/lib/appui-react/popup/CardPopup.js +18 -21
  134. package/lib/appui-react/popup/CardPopup.js.map +1 -1
  135. package/lib/appui-react/popup/HTMLElementPopup.js +9 -12
  136. package/lib/appui-react/popup/HTMLElementPopup.js.map +1 -1
  137. package/lib/appui-react/popup/InputEditorPopup.js +18 -20
  138. package/lib/appui-react/popup/InputEditorPopup.js.map +1 -1
  139. package/lib/appui-react/popup/PopupManager.js +22 -25
  140. package/lib/appui-react/popup/PopupManager.js.map +1 -1
  141. package/lib/appui-react/popup/ToolSettingsPopup.js +17 -17
  142. package/lib/appui-react/popup/ToolSettingsPopup.js.map +1 -1
  143. package/lib/appui-react/popup/ToolbarPopup.js +18 -21
  144. package/lib/appui-react/popup/ToolbarPopup.js.map +1 -1
  145. package/lib/appui-react/redux/ReducerRegistry.js +2 -0
  146. package/lib/appui-react/redux/ReducerRegistry.js.map +1 -1
  147. package/lib/appui-react/redux/StateManager.js +4 -1
  148. package/lib/appui-react/redux/StateManager.js.map +1 -1
  149. package/lib/appui-react/selection/HideIsolateEmphasizeManager.js +7 -3
  150. package/lib/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
  151. package/lib/appui-react/shared/ActionButtonItemDef.js +13 -6
  152. package/lib/appui-react/shared/ActionButtonItemDef.js.map +1 -1
  153. package/lib/appui-react/shared/CommandItemDef.js +3 -3
  154. package/lib/appui-react/shared/CommandItemDef.js.map +1 -1
  155. package/lib/appui-react/shared/CustomItemDef.js +4 -2
  156. package/lib/appui-react/shared/CustomItemDef.js.map +1 -1
  157. package/lib/appui-react/shared/ItemDefBase.js +13 -5
  158. package/lib/appui-react/shared/ItemDefBase.js.map +1 -1
  159. package/lib/appui-react/shared/MenuItem.js +6 -1
  160. package/lib/appui-react/shared/MenuItem.js.map +1 -1
  161. package/lib/appui-react/shared/ToolItemDef.js +1 -1
  162. package/lib/appui-react/shared/ToolItemDef.js.map +1 -1
  163. package/lib/appui-react/stagepanels/StagePanelDef.js +4 -3
  164. package/lib/appui-react/stagepanels/StagePanelDef.js.map +1 -1
  165. package/lib/appui-react/statusbar/StatusBarItemsManager.js +5 -5
  166. package/lib/appui-react/statusbar/StatusBarItemsManager.js.map +1 -1
  167. package/lib/appui-react/statusfields/ViewAttributes.js +16 -16
  168. package/lib/appui-react/statusfields/ViewAttributes.js.map +1 -1
  169. package/lib/appui-react/statusfields/tileloading/TileLoadingIndicator.js +35 -33
  170. package/lib/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
  171. package/lib/appui-react/syncui/InternalSyncUiEventDispatcher.js +7 -0
  172. package/lib/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -1
  173. package/lib/appui-react/syncui/SyncUiEventDispatcher.js +4 -3
  174. package/lib/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
  175. package/lib/appui-react/timeline/AnalysisAnimationProvider.js +9 -8
  176. package/lib/appui-react/timeline/AnalysisAnimationProvider.js.map +1 -1
  177. package/lib/appui-react/timeline/ScheduleAnimationProvider.js +13 -12
  178. package/lib/appui-react/timeline/ScheduleAnimationProvider.js.map +1 -1
  179. package/lib/appui-react/timeline/SolarTimelineDataProvider.js +6 -5
  180. package/lib/appui-react/timeline/SolarTimelineDataProvider.js.map +1 -1
  181. package/lib/appui-react/toolbar/GroupItem.js +11 -5
  182. package/lib/appui-react/toolbar/GroupItem.js.map +1 -1
  183. package/lib/appui-react/toolbar/ToolbarItemsManager.js +7 -7
  184. package/lib/appui-react/toolbar/ToolbarItemsManager.js.map +1 -1
  185. package/lib/appui-react/tools/FrameworkToolAdmin.js +5 -1
  186. package/lib/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
  187. package/lib/appui-react/tools/KeyinPaletteTools.js +2 -2
  188. package/lib/appui-react/tools/KeyinPaletteTools.js.map +1 -1
  189. package/lib/appui-react/tools/OpenSettingsTool.js +2 -2
  190. package/lib/appui-react/tools/OpenSettingsTool.js.map +1 -1
  191. package/lib/appui-react/tools/RestoreLayoutTool.js +4 -4
  192. package/lib/appui-react/tools/RestoreLayoutTool.js.map +1 -1
  193. package/lib/appui-react/tools/ToolSettingsTools.js +2 -2
  194. package/lib/appui-react/tools/ToolSettingsTools.js.map +1 -1
  195. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js +15 -18
  196. package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
  197. package/lib/appui-react/toolsettings/InternalToolSettingsManager.js +8 -8
  198. package/lib/appui-react/toolsettings/InternalToolSettingsManager.js.map +1 -1
  199. package/lib/appui-react/toolsettings/ToolInformation.js +2 -0
  200. package/lib/appui-react/toolsettings/ToolInformation.js.map +1 -1
  201. package/lib/appui-react/toolsettings/ToolUiProvider.js +3 -0
  202. package/lib/appui-react/toolsettings/ToolUiProvider.js.map +1 -1
  203. package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js +1 -0
  204. package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
  205. package/lib/appui-react/ui-items-provider/BaseUiItemsProvider.js +2 -0
  206. package/lib/appui-react/ui-items-provider/BaseUiItemsProvider.js.map +1 -1
  207. package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js +1 -0
  208. package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js.map +1 -1
  209. package/lib/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +1 -0
  210. package/lib/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
  211. package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js +1 -0
  212. package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js.map +1 -1
  213. package/lib/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js +1 -0
  214. package/lib/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js.map +1 -1
  215. package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js +1 -0
  216. package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js.map +1 -1
  217. package/lib/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -0
  218. package/lib/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
  219. package/lib/appui-react/ui-items-provider/UiItemsManager.js +3 -3
  220. package/lib/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
  221. package/lib/appui-react/uiadmin/FrameworkUiAdmin.js +1 -4
  222. package/lib/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
  223. package/lib/appui-react/uiprovider/ComponentGenerator.js +2 -0
  224. package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
  225. package/lib/appui-react/uistate/AppUiSettings.js +41 -33
  226. package/lib/appui-react/uistate/AppUiSettings.js.map +1 -1
  227. package/lib/appui-react/utils/InternalUiShowHideManager.js +13 -14
  228. package/lib/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
  229. package/lib/appui-react/widgets/StatusBarWidgetComposerControl.js +2 -5
  230. package/lib/appui-react/widgets/StatusBarWidgetComposerControl.js.map +1 -1
  231. package/lib/appui-react/widgets/WidgetControl.js +2 -0
  232. package/lib/appui-react/widgets/WidgetControl.js.map +1 -1
  233. package/lib/appui-react/widgets/WidgetDef.js +28 -7
  234. package/lib/appui-react/widgets/WidgetDef.js.map +1 -1
  235. package/lib/appui-react/widgets/WidgetHost.js +4 -4
  236. package/lib/appui-react/widgets/WidgetHost.js.map +1 -1
  237. package/lib/appui-react/widgets/WidgetManager.js +5 -7
  238. package/lib/appui-react/widgets/WidgetManager.js.map +1 -1
  239. package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
  240. package/lib/cjs/appui-react/layout/widget/Overflow.scss +3 -48
  241. package/lib/esm/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
  242. package/lib/esm/appui-react/layout/widget/Overflow.scss +3 -48
  243. package/package.json +10 -11
  244. package/lib/appui-react/layout/widget/Menu.d.ts +0 -16
  245. package/lib/appui-react/layout/widget/Menu.d.ts.map +0 -1
  246. package/lib/appui-react/layout/widget/Menu.js +0 -21
  247. package/lib/appui-react/layout/widget/Menu.js.map +0 -1
  248. package/lib/appui-react/layout/widget/Menu.scss +0 -12
  249. package/lib/cjs/appui-react/layout/widget/Menu.scss +0 -12
  250. package/lib/esm/appui-react/layout/widget/Menu.scss +0 -12
@@ -14,6 +14,7 @@ import { BaseUiItemsProvider } from "./BaseUiItemsProvider.js";
14
14
  */
15
15
  // eslint-disable-next-line @typescript-eslint/no-deprecated
16
16
  export class StandardStatusbarItemsProvider extends BaseUiItemsProvider {
17
+ uiItemsProvider;
17
18
  constructor(providerId, _defaultItems, isSupportedStage) {
18
19
  // eslint-disable-next-line @typescript-eslint/no-deprecated
19
20
  super(providerId, isSupportedStage);
@@ -1 +1 @@
1
- {"version":3,"file":"StandardStatusbarItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-react/ui-items-provider/StandardStatusbarItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,OAAO,8BAA+B,SAAQ,mBAAmB;IAErE,YACE,UAAkB,EAClB,aAAiD,EACjD,gBAIY;QAEZ,4DAA4D;QAC5D,KAAK,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,gCAAgC,CAAC,aAAa,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,QAAQ,CACpB,UAAkB,EAClB,YAAoC,EACpC,gBAIY;QAEZ,4DAA4D;QAC5D,MAAM,QAAQ,GAAG,IAAI,8BAA8B,CACjD,UAAU,EACV,YAAY,EACZ,gBAAgB,CACjB,CAAC;QACF,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEe,6BAA6B,CAC3C,QAAgB,EAChB,WAAmB,EACnB,aAAmB;QAEnB,4DAA4D;QAC5D,OAAO,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAC/C,QAAQ,EACR,WAAW,EACX,aAAa,CACd,CAAC;IACJ,CAAC;CACF","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 type { DefaultStatusbarItems } from \"./StandardStatusbarUiItemsProvider.js\";\nimport { StandardStatusbarUiItemsProvider } from \"./StandardStatusbarUiItemsProvider.js\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem.js\";\nimport { UiItemsManager } from \"./UiItemsManager.js\";\nimport { BaseUiItemsProvider } from \"./BaseUiItemsProvider.js\";\n\n/** Provide standard status bar fields.\n * @public\n * @deprecated in 4.17.0. Use {@link StandardStatusbarUiItemsProvider} instead. Supported frontstages can be specified when registering the provider.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class StandardStatusbarItemsProvider extends BaseUiItemsProvider {\n private uiItemsProvider: StandardStatusbarUiItemsProvider;\n constructor(\n providerId: string,\n _defaultItems?: DefaultStatusbarItems | undefined,\n isSupportedStage?: (\n stageId: string,\n stageUsage: string,\n stageAppData?: any\n ) => boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n super(providerId, isSupportedStage);\n this.uiItemsProvider = new StandardStatusbarUiItemsProvider(_defaultItems);\n }\n\n /**\n * static function to register the StandardStatusbarItemsProvider\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\n * to set up custom stage with their own subset of standard status bar items.\n * @param defaultItems - if undefined all available item are provided to stage except for activityCenter. If defined only those\n * specific tool buttons are shown.\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\n */\n public static register(\n providerId: string,\n defaultItems?: DefaultStatusbarItems,\n isSupportedStage?: (\n stageId: string,\n stageUsage: string,\n stageAppData?: any\n ) => boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const provider = new StandardStatusbarItemsProvider(\n providerId,\n defaultItems,\n isSupportedStage\n );\n UiItemsManager.register(provider);\n return provider;\n }\n\n public override provideStatusBarItemsInternal(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.uiItemsProvider.provideStatusBarItems(\n _stageId,\n _stageUsage,\n _stageAppData\n );\n }\n}\n"]}
1
+ {"version":3,"file":"StandardStatusbarItemsProvider.js","sourceRoot":"","sources":["../../../src/appui-react/ui-items-provider/StandardStatusbarItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;GAGG;AACH,4DAA4D;AAC5D,MAAM,OAAO,8BAA+B,SAAQ,mBAAmB;IAC7D,eAAe,CAAmC;IAC1D,YACE,UAAkB,EAClB,aAAiD,EACjD,gBAIY;QAEZ,4DAA4D;QAC5D,KAAK,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,gCAAgC,CAAC,aAAa,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;OAQG;IACI,MAAM,CAAC,QAAQ,CACpB,UAAkB,EAClB,YAAoC,EACpC,gBAIY;QAEZ,4DAA4D;QAC5D,MAAM,QAAQ,GAAG,IAAI,8BAA8B,CACjD,UAAU,EACV,YAAY,EACZ,gBAAgB,CACjB,CAAC;QACF,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEe,6BAA6B,CAC3C,QAAgB,EAChB,WAAmB,EACnB,aAAmB;QAEnB,4DAA4D;QAC5D,OAAO,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAC/C,QAAQ,EACR,WAAW,EACX,aAAa,CACd,CAAC;IACJ,CAAC;CACF","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 type { DefaultStatusbarItems } from \"./StandardStatusbarUiItemsProvider.js\";\nimport { StandardStatusbarUiItemsProvider } from \"./StandardStatusbarUiItemsProvider.js\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem.js\";\nimport { UiItemsManager } from \"./UiItemsManager.js\";\nimport { BaseUiItemsProvider } from \"./BaseUiItemsProvider.js\";\n\n/** Provide standard status bar fields.\n * @public\n * @deprecated in 4.17.0. Use {@link StandardStatusbarUiItemsProvider} instead. Supported frontstages can be specified when registering the provider.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class StandardStatusbarItemsProvider extends BaseUiItemsProvider {\n private uiItemsProvider: StandardStatusbarUiItemsProvider;\n constructor(\n providerId: string,\n _defaultItems?: DefaultStatusbarItems | undefined,\n isSupportedStage?: (\n stageId: string,\n stageUsage: string,\n stageAppData?: any\n ) => boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n super(providerId, isSupportedStage);\n this.uiItemsProvider = new StandardStatusbarUiItemsProvider(_defaultItems);\n }\n\n /**\n * static function to register the StandardStatusbarItemsProvider\n * @param providerId - unique identifier for this instance of the provider. This is required in case separate packages want\n * to set up custom stage with their own subset of standard status bar items.\n * @param defaultItems - if undefined all available item are provided to stage except for activityCenter. If defined only those\n * specific tool buttons are shown.\n * @param isSupportedStage - optional function that will be called to determine if tools should be added to current stage. If not set and\n * the current stage's `usage` is set to `StageUsage.General` then the provider will add items to frontstage.\n */\n public static register(\n providerId: string,\n defaultItems?: DefaultStatusbarItems,\n isSupportedStage?: (\n stageId: string,\n stageUsage: string,\n stageAppData?: any\n ) => boolean\n ) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const provider = new StandardStatusbarItemsProvider(\n providerId,\n defaultItems,\n isSupportedStage\n );\n UiItemsManager.register(provider);\n return provider;\n }\n\n public override provideStatusBarItemsInternal(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.uiItemsProvider.provideStatusBarItems(\n _stageId,\n _stageUsage,\n _stageAppData\n );\n }\n}\n"]}
@@ -20,6 +20,7 @@ import { StatusBarSection } from "../statusbar/StatusBarItem.js";
20
20
  * @public
21
21
  */
22
22
  export class StandardStatusbarUiItemsProvider {
23
+ _defaultItems;
23
24
  get id() {
24
25
  return "appui-react:StandardStatusbarUiItemsProvider";
25
26
  }
@@ -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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAmBjE;;GAEG;AACH,MAAM,OAAO,gCAAgC;IAC3C,IAAW,EAAE;QACX,OAAO,8CAA8C,CAAC;IACxD,CAAC;IAED,gKAAgK;IAChK,YAAoB,aAAqC;QAArC,kBAAa,GAAb,aAAa,CAAwB;IAAG,CAAC;IAE7D,+GAA+G;IACxG,qBAAqB,CAC1B,QAAgB,EAChB,WAAmB,EACnB,aAAmB;QAEnB,OAAO,IAAI,CAAC,iBAAiB,EAAqB,CAAC;IAC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ACjC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;YAC5D,cAAc,CAAC,IAAI,CACjB,sBAAsB,CAAC,gBAAgB,CAAC;gBACtC,EAAE,EAAE,oBAAoB;gBACxB,OAAO,EAAE,gBAAgB,CAAC,KAAK;gBAC/B,YAAY,EAAE,EAAE;gBAChB,4DAA4D;gBAC5D,OAAO,EAAE,oBAAC,kBAAkB,OAAG;aAChC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF","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.js\";\nimport { ToolAssistanceField } from \"../statusfields/toolassistance/ToolAssistanceField.js\";\nimport { MessageCenterField } from \"../statusfields/message-center/MessageCenterField.js\";\nimport { ActivityCenterField } from \"../statusfields/ActivityCenter.js\";\nimport { SnapModeField } from \"../statusfields/SnapMode.js\";\nimport { SelectionInfoField } from \"../statusfields/SelectionInfo.js\";\nimport { TileLoadingIndicator } from \"../statusfields/tileloading/TileLoadingIndicator.js\";\nimport { SelectionScopeField } from \"../statusfields/SelectionScope.js\";\nimport { StatusBarSeparator } from \"../statusbar/Separator.js\";\nimport type { UiItemsProvider } from \"./UiItemsProvider.js\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem.js\";\nimport { StatusBarSection } from \"../statusbar/StatusBarItem.js\";\n\n/** Defines what items to include from the provider.\n * @note When this object is used, only explicitly enabled items will be added to the status bar. I.e. `{ messageCenter: true }` will only add message center field to the 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/** Provides standard status bar items.\n * @public\n */\nexport class StandardStatusbarUiItemsProvider implements UiItemsProvider {\n public get id(): string {\n return \"appui-react:StandardStatusbarUiItemsProvider\";\n }\n\n /** Creates a provider. If the `defaultItems` argument is not set, all default fields are added. Otherwise, only the fields that are set to `true` are added. */\n constructor(private _defaultItems?: DefaultStatusbarItems) {}\n\n /** @deprecated in 4.17.0. Property of a deprecated interface {@link UiItemsProvider.provideStatusBarItems}. */\n public provideStatusBarItems(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n return this.getStatusBarItems() as StatusBarItem[];\n }\n\n public getStatusBarItems(): readonly StatusBarItem[] {\n const statusBarItems: StatusBarItem[] = [];\n if (!this._defaultItems || this._defaultItems.messageCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.MessageCenter\",\n section: StatusBarSection.Left,\n itemPriority: 10,\n content: <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 id: \"uifw.PreToolAssistance\",\n section: StatusBarSection.Left,\n itemPriority: 15,\n content: <StatusBarSeparator />,\n })\n );\n\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.ToolAssistance\",\n section: StatusBarSection.Left,\n itemPriority: 20,\n content: <ToolAssistanceField />,\n })\n );\n\n if (!this._defaultItems || this._defaultItems.postToolAssistanceSeparator)\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.PostToolAssistance\",\n section: StatusBarSection.Left,\n itemPriority: 25,\n content: <StatusBarSeparator />,\n })\n );\n }\n if (this._defaultItems?.activityCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.ActivityCenter\",\n section: StatusBarSection.Left,\n itemPriority: 30,\n content: <ActivityCenterField />,\n })\n );\n }\n if (!this._defaultItems || this._defaultItems.accuSnapModePicker) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.SnapMode\",\n section: StatusBarSection.Center,\n itemPriority: 10,\n content: <SnapModeField />,\n })\n );\n }\n\n if (!this._defaultItems || this._defaultItems.tileLoadIndicator) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.TileLoadIndicator\",\n section: StatusBarSection.Right,\n itemPriority: 10,\n content: <TileLoadingIndicator />,\n })\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionScope) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.SelectionScope\",\n section: StatusBarSection.Right,\n itemPriority: 20,\n content: <SelectionScopeField />,\n })\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionInfo) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.SelectionInfo\",\n section: StatusBarSection.Right,\n itemPriority: 30,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n content: <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,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAC;AAC1F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gBAChB,OAAO,EAAE,oBAAC,aAAa,OAAG;aAC3B,CAAC,CACH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;YAChE,cAAc,CAAC,IAAI,CACjB,sBAAsB,CAAC,gBAAgB,CAAC;gBACtC,EAAE,EAAE,wBAAwB;gBAC5B,OAAO,EAAE,gBAAgB,CAAC,KAAK;gBAC/B,YAAY,EAAE,EAAE;gBAChB,OAAO,EAAE,oBAAC,oBAAoB,OAAG;aAClC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;YAC7D,cAAc,CAAC,IAAI,CACjB,sBAAsB,CAAC,gBAAgB,CAAC;gBACtC,EAAE,EAAE,qBAAqB;gBACzB,OAAO,EAAE,gBAAgB,CAAC,KAAK;gBAC/B,YAAY,EAAE,EAAE;gBAChB,OAAO,EAAE,oBAAC,mBAAmB,OAAG;aACjC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;YAC5D,cAAc,CAAC,IAAI,CACjB,sBAAsB,CAAC,gBAAgB,CAAC;gBACtC,EAAE,EAAE,oBAAoB;gBACxB,OAAO,EAAE,gBAAgB,CAAC,KAAK;gBAC/B,YAAY,EAAE,EAAE;gBAChB,4DAA4D;gBAC5D,OAAO,EAAE,oBAAC,kBAAkB,OAAG;aAChC,CAAC,CACH,CAAC;QACJ,CAAC;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF","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.js\";\nimport { ToolAssistanceField } from \"../statusfields/toolassistance/ToolAssistanceField.js\";\nimport { MessageCenterField } from \"../statusfields/message-center/MessageCenterField.js\";\nimport { ActivityCenterField } from \"../statusfields/ActivityCenter.js\";\nimport { SnapModeField } from \"../statusfields/SnapMode.js\";\nimport { SelectionInfoField } from \"../statusfields/SelectionInfo.js\";\nimport { TileLoadingIndicator } from \"../statusfields/tileloading/TileLoadingIndicator.js\";\nimport { SelectionScopeField } from \"../statusfields/SelectionScope.js\";\nimport { StatusBarSeparator } from \"../statusbar/Separator.js\";\nimport type { UiItemsProvider } from \"./UiItemsProvider.js\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem.js\";\nimport { StatusBarSection } from \"../statusbar/StatusBarItem.js\";\n\n/** Defines what items to include from the provider.\n * @note When this object is used, only explicitly enabled items will be added to the status bar. I.e. `{ messageCenter: true }` will only add message center field to the 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/** Provides standard status bar items.\n * @public\n */\nexport class StandardStatusbarUiItemsProvider implements UiItemsProvider {\n public get id(): string {\n return \"appui-react:StandardStatusbarUiItemsProvider\";\n }\n\n /** Creates a provider. If the `defaultItems` argument is not set, all default fields are added. Otherwise, only the fields that are set to `true` are added. */\n constructor(private _defaultItems?: DefaultStatusbarItems) {}\n\n /** @deprecated in 4.17.0. Property of a deprecated interface {@link UiItemsProvider.provideStatusBarItems}. */\n public provideStatusBarItems(\n _stageId: string,\n _stageUsage: string,\n _stageAppData?: any\n ): StatusBarItem[] {\n return this.getStatusBarItems() as StatusBarItem[];\n }\n\n public getStatusBarItems(): readonly StatusBarItem[] {\n const statusBarItems: StatusBarItem[] = [];\n if (!this._defaultItems || this._defaultItems.messageCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.MessageCenter\",\n section: StatusBarSection.Left,\n itemPriority: 10,\n content: <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 id: \"uifw.PreToolAssistance\",\n section: StatusBarSection.Left,\n itemPriority: 15,\n content: <StatusBarSeparator />,\n })\n );\n\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.ToolAssistance\",\n section: StatusBarSection.Left,\n itemPriority: 20,\n content: <ToolAssistanceField />,\n })\n );\n\n if (!this._defaultItems || this._defaultItems.postToolAssistanceSeparator)\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.PostToolAssistance\",\n section: StatusBarSection.Left,\n itemPriority: 25,\n content: <StatusBarSeparator />,\n })\n );\n }\n if (this._defaultItems?.activityCenter) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.ActivityCenter\",\n section: StatusBarSection.Left,\n itemPriority: 30,\n content: <ActivityCenterField />,\n })\n );\n }\n if (!this._defaultItems || this._defaultItems.accuSnapModePicker) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.SnapMode\",\n section: StatusBarSection.Center,\n itemPriority: 10,\n content: <SnapModeField />,\n })\n );\n }\n\n if (!this._defaultItems || this._defaultItems.tileLoadIndicator) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.TileLoadIndicator\",\n section: StatusBarSection.Right,\n itemPriority: 10,\n content: <TileLoadingIndicator />,\n })\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionScope) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.SelectionScope\",\n section: StatusBarSection.Right,\n itemPriority: 20,\n content: <SelectionScopeField />,\n })\n );\n }\n\n if (!this._defaultItems || this._defaultItems.selectionInfo) {\n statusBarItems.push(\n StatusBarItemUtilities.createCustomItem({\n id: \"uifw.SelectionInfo\",\n section: StatusBarSection.Right,\n itemPriority: 30,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n content: <SelectionInfoField />,\n })\n );\n }\n\n return statusBarItems;\n }\n}\n"]}
@@ -12,6 +12,9 @@ import { createAbstractUiItemsManagerAdapter, createGetPropertyAdapter, } from "
12
12
  * @public
13
13
  */
14
14
  export class UiItemsManager {
15
+ static _registeredUiItemsProviders = new Map();
16
+ static _onUiProviderRegisteredEvent = new BeUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
17
+ static _abstractAdapter = createAbstractUiItemsManagerAdapter();
15
18
  /** For use in unit testing
16
19
  * @internal
17
20
  */
@@ -243,9 +246,6 @@ export class UiItemsManager {
243
246
  return getUniqueItems(items);
244
247
  }
245
248
  }
246
- UiItemsManager._registeredUiItemsProviders = new Map();
247
- UiItemsManager._onUiProviderRegisteredEvent = new BeUiEvent(); // eslint-disable-line @typescript-eslint/no-deprecated
248
- UiItemsManager._abstractAdapter = createAbstractUiItemsManagerAdapter();
249
249
  function getUniqueItems(items) {
250
250
  const uniqueItems = [];
251
251
  items.forEach((item) => {
@@ -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,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAUxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EACL,mCAAmC,EACnC,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AA2CrC;;GAEG;AACH,MAAM,OAAO,cAAc;IAOz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B,GAAG,mCAAmC,EAAE,CAAC;AAqV1E,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.js\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation.js\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection.js\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem.js\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem.js\";\nimport type {\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { Widget } from \"../widgets/Widget.js\";\nimport type { ProviderItem } from \"./ProviderItem.js\";\nimport type { UiItemsProvider } from \"./UiItemsProvider.js\";\nimport {\n createAbstractUiItemsManagerAdapter,\n createGetPropertyAdapter,\n} from \"./AbstractUiItemsManager.js\";\n\n/** UiItemsProvider register event args.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\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>(); // eslint-disable-line @typescript-eslint/no-deprecated\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) {\n this._abstractAdapter.clearAllProviders();\n }\n\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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 // eslint-disable-next-line @typescript-eslint/no-deprecated\n private static sendRegisteredEvent(args: UiItemsProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);\n }\n\n /**\n * Registers an {@link UiItemsProvider}.\n * Optional overrides can be specified to limit when the provider is allowed to provide items.\n */\n public static register(\n uiProvider: UiItemsProvider,\n overrides?: UiItemsProviderOverrides\n ): void {\n const providerId = overrides?.providerId ?? uiProvider.id;\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiItemsManager\"),\n `UiItemsProvider '${providerId}' is already registered`\n );\n return;\n }\n\n // Using the same structure to support layout agnostic methods i.e. `getToolbarItems`.\n UiItemsManager._registeredUiItemsProviders.set(providerId, {\n provider: uiProvider,\n overrides,\n });\n\n if (this._abstractAdapter) {\n return this._abstractAdapter.register(uiProvider, overrides);\n }\n\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiItemsManager\"),\n `UiItemsProvider '${uiProvider.id}' registered as '${providerId}'`\n );\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n\n /** Unregisters a specific {@link UiItemsProvider}. */\n public static unregister(providerId: string): void {\n const provider = UiItemsManager.getUiItemsProvider(providerId);\n if (!provider) return;\n\n UiItemsManager._registeredUiItemsProviders.delete(providerId);\n if (this._abstractAdapter) {\n this._abstractAdapter.unregister(providerId);\n }\n\n provider.onUnregister?.();\n\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiItemsManager\"),\n `UiItemsProvider '${providerId}' unregistered`\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 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 /** Returns registered toolbar items configured for the standard layout that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideToolbarItems} are returned by this method.\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 /** Returns registered toolbar items that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are not returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideToolbarItems} are not returned by this method.\n */\n public static getToolbarItems(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<ToolbarItem>> {\n const items: ProviderItem<ToolbarItem>[] = [];\n // Not using `AbstractUiItemsManager`, since there's no way to check if provider items are allowed.\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 providerItems =\n uiProvider.getToolbarItems?.().map((item) => ({\n ...item,\n providerId,\n })) ?? [];\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Returns registered status bar items that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideStatusBarItems} are returned by this method.\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 /** Returns registered backstage items.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideBackstageItems} are returned by this method.\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 /** Returns registered widgets that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are not returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideWidgets} are not returned by this method.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<Widget>>;\n /** Returns registered widgets configured for the standard layout that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideWidgets} are returned by this method.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n section?: StagePanelSection\n ): ReadonlyArray<ProviderItem<Widget>>;\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\n // If location is not specified, return all registered widgets.\n if (location === undefined) {\n // Not using `AbstractUiItemsManager`, since there's no way to check if provider items are allowed.\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 providerItems =\n uiProvider.getWidgets?.().map((item) => ({\n ...item,\n providerId,\n })) ?? [];\n items.push(...providerItems);\n });\n return getUniqueItems(items);\n }\n\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,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAUxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,OAAO,EACL,mCAAmC,EACnC,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AA2CrC;;GAEG;AACH,MAAM,OAAO,cAAc;IACjB,MAAM,CAAC,2BAA2B,GACxC,IAAI,GAAG,EAA+B,CAAC;IACjC,MAAM,CAAC,4BAA4B,GACzC,IAAI,SAAS,EAAsC,CAAC,C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AAQ,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.js\";\nimport type { StagePanelLocation } from \"../stagepanels/StagePanelLocation.js\";\nimport type { StagePanelSection } from \"../stagepanels/StagePanelSection.js\";\nimport type { StatusBarItem } from \"../statusbar/StatusBarItem.js\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem.js\";\nimport type {\n ToolbarOrientation,\n ToolbarUsage,\n} from \"../toolbar/ToolbarItem.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { Widget } from \"../widgets/Widget.js\";\nimport type { ProviderItem } from \"./ProviderItem.js\";\nimport type { UiItemsProvider } from \"./UiItemsProvider.js\";\nimport {\n createAbstractUiItemsManagerAdapter,\n createGetPropertyAdapter,\n} from \"./AbstractUiItemsManager.js\";\n\n/** UiItemsProvider register event args.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\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>(); // eslint-disable-line @typescript-eslint/no-deprecated\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) {\n this._abstractAdapter.clearAllProviders();\n }\n\n UiItemsManager._registeredUiItemsProviders.clear();\n }\n\n /** Event raised any time a UiProvider is registered or unregistered. */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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 // eslint-disable-next-line @typescript-eslint/no-deprecated\n private static sendRegisteredEvent(args: UiItemsProviderRegisteredEventArgs) {\n UiItemsManager.onUiProviderRegisteredEvent.raiseEvent(args);\n }\n\n /**\n * Registers an {@link UiItemsProvider}.\n * Optional overrides can be specified to limit when the provider is allowed to provide items.\n */\n public static register(\n uiProvider: UiItemsProvider,\n overrides?: UiItemsProviderOverrides\n ): void {\n const providerId = overrides?.providerId ?? uiProvider.id;\n if (UiItemsManager.getUiItemsProvider(providerId)) {\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiItemsManager\"),\n `UiItemsProvider '${providerId}' is already registered`\n );\n return;\n }\n\n // Using the same structure to support layout agnostic methods i.e. `getToolbarItems`.\n UiItemsManager._registeredUiItemsProviders.set(providerId, {\n provider: uiProvider,\n overrides,\n });\n\n if (this._abstractAdapter) {\n return this._abstractAdapter.register(uiProvider, overrides);\n }\n\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiItemsManager\"),\n `UiItemsProvider '${uiProvider.id}' registered as '${providerId}'`\n );\n UiItemsManager.sendRegisteredEvent({ providerId });\n }\n\n /** Unregisters a specific {@link UiItemsProvider}. */\n public static unregister(providerId: string): void {\n const provider = UiItemsManager.getUiItemsProvider(providerId);\n if (!provider) return;\n\n UiItemsManager._registeredUiItemsProviders.delete(providerId);\n if (this._abstractAdapter) {\n this._abstractAdapter.unregister(providerId);\n }\n\n provider.onUnregister?.();\n\n Logger.logInfo(\n UiFramework.loggerCategory(\"UiItemsManager\"),\n `UiItemsProvider '${providerId}' unregistered`\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 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 /** Returns registered toolbar items configured for the standard layout that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideToolbarItems} are returned by this method.\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 /** Returns registered toolbar items that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are not returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideToolbarItems} are not returned by this method.\n */\n public static getToolbarItems(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<ToolbarItem>> {\n const items: ProviderItem<ToolbarItem>[] = [];\n // Not using `AbstractUiItemsManager`, since there's no way to check if provider items are allowed.\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 providerItems =\n uiProvider.getToolbarItems?.().map((item) => ({\n ...item,\n providerId,\n })) ?? [];\n items.push(...providerItems);\n });\n\n return getUniqueItems(items);\n }\n\n /** Returns registered status bar items that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideStatusBarItems} are returned by this method.\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 /** Returns registered backstage items.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideBackstageItems} are returned by this method.\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 /** Returns registered widgets that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are not returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideWidgets} are not returned by this method.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string\n ): ReadonlyArray<ProviderItem<Widget>>;\n /** Returns registered widgets configured for the standard layout that match the specified frontstage id and usage.\n * @note Items registered in `UiItemsManager` of `@itwin/appui-abstract` are returned by this method.\n * @note Items returned by {@link UiItemsProvider.provideWidgets} are returned by this method.\n */\n public static getWidgets(\n stageId: string,\n stageUsage: string,\n location: StagePanelLocation,\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n section?: StagePanelSection\n ): ReadonlyArray<ProviderItem<Widget>>;\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\n // If location is not specified, return all registered widgets.\n if (location === undefined) {\n // Not using `AbstractUiItemsManager`, since there's no way to check if provider items are allowed.\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 providerItems =\n uiProvider.getWidgets?.().map((item) => ({\n ...item,\n providerId,\n })) ?? [];\n items.push(...providerItems);\n });\n return getUniqueItems(items);\n }\n\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"]}
@@ -25,10 +25,7 @@ import { mapToPlacement } from "../utils/Placement.js";
25
25
  * @public
26
26
  */
27
27
  export class FrameworkUiAdmin extends UiAdmin {
28
- constructor() {
29
- super(...arguments);
30
- this._localizedKeyinPreference = KeyinFieldLocalization.NonLocalized;
31
- }
28
+ _localizedKeyinPreference = KeyinFieldLocalization.NonLocalized;
32
29
  /**
33
30
  * @deprecated in 4.11.0. Gathering and filtering of keyins is now left up to the user.
34
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAejD,OAAO,EAAE,gBA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OAAO;QACL,GAAG,IAAI;QACP,KAAK,EAAE,IAAI,CAAC,SAAS;KACtB,CAAC;AACJ,CAAC;AAMD,SAAS,YAAY,CAAC,EAAE,OAAO,EAAqB;IAClD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE/C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QACvB,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,GAAG,EAAE;YACV,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,6BAAK,GAAG,EAAE,GAAG,GAAI,CAAC;AAC3B,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 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 CommonToolbarItem,\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 { CursorInformation } from \"../cursor/CursorInformation.js\";\nimport { PopupManager } from \"../popup/PopupManager.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { KeyinEntry } from \"../keyins/Keyins.js\";\nimport {\n getKeyinsFromToolList,\n KeyinFieldLocalization,\n} from \"../keyins/Keyins.js\";\nimport { mapToPlacement } from \"../utils/Placement.js\";\nimport type { ToolbarProps } from \"../toolbar/Toolbar.js\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem.js\";\nimport type { CursorMenuItemProps } from \"../shared/MenuItem.js\";\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 /**\n * @deprecated in 4.11.0. Gathering and filtering of keyins is now left up to the user.\n */\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY.\n * @deprecated in 4.11.0. Please use {@link CursorInformation.cursorPosition}\n */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home\n * @deprecated in 4.11.0. Please use {@link UiFramework.keyboardShortcuts().isFocusOnHome}\n */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home\n * @deprecated in 4.11.0. Please use {@link UiFramework.keyboardShortcuts().setFocusToHome}\n */\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 * @deprecated in 4.11.0. Use {@link UiFramework.openContextMenu}\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.openContextMenu(\n items as CursorMenuItemProps[],\n location,\n htmlElement\n );\n }\n\n /**\n * @deprecated in 4.11.0. Construct your own {@link KeyinEntry[]} via {@link @itwin/core-frontend#IModelApp.tools.getToolList}.\n */\n public getKeyins(): KeyinEntry[] {\n const tools = IModelApp.tools.getToolList();\n return getKeyinsFromToolList(tools);\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 * @deprecated in 4.11.0. Use {@link UiFramework.showKeyinPalette}. Please note, the use of feature flags to control whether the KeyinPalette can be opened has been deprecated.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n const tools = IModelApp.tools.getToolList();\n const keyIns = getKeyinsFromToolList(tools);\n\n return UiFramework.showKeyinPalette(keyIns, htmlElement);\n }\n\n /**\n * Hides the Key-in Palette.\n * @deprecated in 4.11.0. Use {@link UiFramework.hideKeyinPalette}\n */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return UiFramework.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 * @deprecated in 4.11.0. Please use {@link UiFramework.showToolbar}.\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 placement = mapToPlacement(relativePosition);\n\n return UiFramework.showToolbar(\n toolbarProps,\n location,\n offset,\n onItemExecuted,\n onCancel,\n placement,\n htmlElement\n );\n }\n\n /** Hides the toolbar.\n * @deprecated in 4.11.0. Please use {@link UiFramework.hideToolbar}.\n */\n public override hideToolbar(): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Please use {@link UiFramework.showMenuButton}.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showMenuButton(\n id,\n menuItemsProps as CursorMenuItemProps[],\n location,\n htmlElement\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 * @deprecated in 4.11.0. Please use {@link UiFramework.hideMenuButton}.\n */\n public override hideMenuButton(id: string): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Use {@link UiFramework.showCalculator}.\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 return UiFramework.showCalculator(\n initialValue,\n resultIcon,\n location,\n onOk,\n onCancel,\n htmlElement\n );\n }\n\n /** Hides the calculator.\n * @deprecated in 4.11.0. Use {@link UiFramework.hideCalculator}.\n */\n public override hideCalculator(): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Use {@link UiFramework.showAngleEditor}.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showAngleEditor(\n initialValue,\n location,\n onCommit,\n onCancel,\n htmlElement\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 * @deprecated in 4.11.0. Use {@link UiFramework.showDimensionEditor(\"length\")}.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showDimensionEditor(\n \"length\",\n initialValue,\n location,\n onCommit,\n onCancel,\n htmlElement\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 * @deprecated in 4.11.0. Use {@link UiFramework.showDimensionEditor(\"height\")}.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showDimensionEditor(\n \"height\",\n initialValue,\n location,\n onCommit,\n onCancel,\n htmlElement\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 return UiFramework.showInputEditor({\n initialValue,\n propertyDescription,\n location,\n onCommit,\n onCancel,\n anchorElement: htmlElement,\n });\n }\n\n /** Hides the input editor.*/\n public override hideInputEditor(): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Use {@link UiFramework.showComponent}\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 // eslint-disable-next-line @typescript-eslint/no-deprecated\n const el = anchorElement ?? UiFramework.controls.getWrapperElement();\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n location,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /**\n * Hides the HTML Element.\n * @deprecated in 4.11.0. Use {@link UiFramework.hideComponent}\n */\n public override hideHTMLElement(): boolean {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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 placement = mapToPlacement(relativePosition);\n return UiFramework.showCard(\n <CardRenderer content={content} />,\n title,\n toolbarProps\n ? AbstractToolbarPropsToToolbarProps(toolbarProps)\n : { items: [] },\n location,\n offset,\n onItemExecuted,\n onCancel,\n placement,\n anchorElement\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 placement = mapToPlacement(relativePosition);\n return UiFramework.showCard(\n content,\n title,\n toolbarProps\n ? AbstractToolbarPropsToToolbarProps(toolbarProps)\n : { items: [] },\n location,\n offset,\n onItemExecuted,\n onCancel,\n placement,\n anchorElement\n );\n }\n\n /**\n * Hides the Card.\n * */\n public override hideCard(): boolean {\n return UiFramework.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 placement = mapToPlacement(relativePosition);\n return UiFramework.openToolSettingsPopup(\n dataProvider,\n location,\n offset,\n onCancel,\n placement,\n anchorElement\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return UiFramework.closeToolSettingsPopup();\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 return UiFramework.openDialog(\n uiDataProvider,\n title,\n isModal,\n id,\n optionalProps\n );\n }\n\n /** Closes the Tool Settings Ui popup.*/\n public override closeDialog(dialogId: string): boolean {\n return UiFramework.closeDialog(dialogId);\n }\n}\n\n// utility functions to wean off appui-abstract\nfunction AbstractToolbarPropsToToolbarProps(\n props: AbstractToolbarProps\n): ToolbarProps {\n return {\n items: props.items.map(CommonToolbarItemToToolBarItem),\n itemId: props.toolbarId,\n };\n}\n\nfunction CommonToolbarItemToToolBarItem(item: CommonToolbarItem): ToolbarItem {\n return {\n ...item,\n badge: item.badgeType,\n };\n}\n\ninterface CardRendererProps {\n content: HTMLElement;\n}\n\nfunction CardRenderer({ content }: CardRendererProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n const el = ref.current;\n el?.appendChild(content);\n return () => {\n el?.removeChild(content);\n };\n }, [content]);\n\n return <div ref={ref} />;\n}\n"]}
1
+ {"version":3,"file":"FrameworkUiAdmin.js","sourceRoot":"","sources":["../../../src/appui-react/uiadmin/FrameworkUiAdmin.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC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C;AACJ,CAAC;AAED,SAAS,8BAA8B,CAAC,IAAuB;IAC7D,OAAO;QACL,GAAG,IAAI;QACP,KAAK,EAAE,IAAI,CAAC,SAAS;KACtB,CAAC;AACJ,CAAC;AAMD,SAAS,YAAY,CAAC,EAAE,OAAO,EAAqB;IAClD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE/C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QACvB,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,GAAG,EAAE;YACV,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,6BAAK,GAAG,EAAE,GAAG,GAAI,CAAC;AAC3B,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 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 CommonToolbarItem,\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 { CursorInformation } from \"../cursor/CursorInformation.js\";\nimport { PopupManager } from \"../popup/PopupManager.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { KeyinEntry } from \"../keyins/Keyins.js\";\nimport {\n getKeyinsFromToolList,\n KeyinFieldLocalization,\n} from \"../keyins/Keyins.js\";\nimport { mapToPlacement } from \"../utils/Placement.js\";\nimport type { ToolbarProps } from \"../toolbar/Toolbar.js\";\nimport type { ToolbarItem } from \"../toolbar/ToolbarItem.js\";\nimport type { CursorMenuItemProps } from \"../shared/MenuItem.js\";\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 /**\n * @deprecated in 4.11.0. Gathering and filtering of keyins is now left up to the user.\n */\n public get localizedKeyinPreference(): KeyinFieldLocalization {\n return this._localizedKeyinPreference;\n }\n\n public set localizedKeyinPreference(preference: KeyinFieldLocalization) {\n this._localizedKeyinPreference = preference;\n }\n\n /** Gets the cursor X and Y position, which is mouseEvent.pageX and mouseEvent.pageY.\n * @deprecated in 4.11.0. Please use {@link CursorInformation.cursorPosition}\n */\n public override get cursorPosition(): XAndY {\n return CursorInformation.cursorPosition;\n }\n\n /** Determines if focus is set to Home\n * @deprecated in 4.11.0. Please use {@link UiFramework.keyboardShortcuts().isFocusOnHome}\n */\n public override get isFocusOnHome(): boolean {\n return UiFramework.keyboardShortcuts.isFocusOnHome;\n }\n\n /** Sets focus to Home\n * @deprecated in 4.11.0. Please use {@link UiFramework.keyboardShortcuts().setFocusToHome}\n */\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 * @deprecated in 4.11.0. Use {@link UiFramework.openContextMenu}\n */\n public override showContextMenu(\n items: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.openContextMenu(\n items as CursorMenuItemProps[],\n location,\n htmlElement\n );\n }\n\n /**\n * @deprecated in 4.11.0. Construct your own {@link KeyinEntry[]} via {@link @itwin/core-frontend#IModelApp.tools.getToolList}.\n */\n public getKeyins(): KeyinEntry[] {\n const tools = IModelApp.tools.getToolList();\n return getKeyinsFromToolList(tools);\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 * @deprecated in 4.11.0. Use {@link UiFramework.showKeyinPalette}. Please note, the use of feature flags to control whether the KeyinPalette can be opened has been deprecated.\n */\n public override showKeyinPalette(htmlElement?: HTMLElement): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n const tools = IModelApp.tools.getToolList();\n const keyIns = getKeyinsFromToolList(tools);\n\n return UiFramework.showKeyinPalette(keyIns, htmlElement);\n }\n\n /**\n * Hides the Key-in Palette.\n * @deprecated in 4.11.0. Use {@link UiFramework.hideKeyinPalette}\n */\n public override hideKeyinPalette(): boolean {\n if (!this.featureFlags.allowKeyinPalette) return false;\n\n return UiFramework.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 * @deprecated in 4.11.0. Please use {@link UiFramework.showToolbar}.\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 placement = mapToPlacement(relativePosition);\n\n return UiFramework.showToolbar(\n toolbarProps,\n location,\n offset,\n onItemExecuted,\n onCancel,\n placement,\n htmlElement\n );\n }\n\n /** Hides the toolbar.\n * @deprecated in 4.11.0. Please use {@link UiFramework.hideToolbar}.\n */\n public override hideToolbar(): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Please use {@link UiFramework.showMenuButton}.\n */\n public override showMenuButton(\n id: string,\n menuItemsProps: AbstractMenuItemProps[],\n location: XAndY,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showMenuButton(\n id,\n menuItemsProps as CursorMenuItemProps[],\n location,\n htmlElement\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 * @deprecated in 4.11.0. Please use {@link UiFramework.hideMenuButton}.\n */\n public override hideMenuButton(id: string): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Use {@link UiFramework.showCalculator}.\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 return UiFramework.showCalculator(\n initialValue,\n resultIcon,\n location,\n onOk,\n onCancel,\n htmlElement\n );\n }\n\n /** Hides the calculator.\n * @deprecated in 4.11.0. Use {@link UiFramework.hideCalculator}.\n */\n public override hideCalculator(): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Use {@link UiFramework.showAngleEditor}.\n */\n public override showAngleEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showAngleEditor(\n initialValue,\n location,\n onCommit,\n onCancel,\n htmlElement\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 * @deprecated in 4.11.0. Use {@link UiFramework.showDimensionEditor(\"length\")}.\n */\n public override showLengthEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showDimensionEditor(\n \"length\",\n initialValue,\n location,\n onCommit,\n onCancel,\n htmlElement\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 * @deprecated in 4.11.0. Use {@link UiFramework.showDimensionEditor(\"height\")}.\n */\n public override showHeightEditor(\n initialValue: number,\n location: XAndY,\n onCommit: OnNumberCommitFunc,\n onCancel: OnCancelFunc,\n htmlElement?: HTMLElement\n ): boolean {\n return UiFramework.showDimensionEditor(\n \"height\",\n initialValue,\n location,\n onCommit,\n onCancel,\n htmlElement\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 return UiFramework.showInputEditor({\n initialValue,\n propertyDescription,\n location,\n onCommit,\n onCancel,\n anchorElement: htmlElement,\n });\n }\n\n /** Hides the input editor.*/\n public override hideInputEditor(): boolean {\n return UiFramework.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 * @deprecated in 4.11.0. Use {@link UiFramework.showComponent}\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 // eslint-disable-next-line @typescript-eslint/no-deprecated\n const el = anchorElement ?? UiFramework.controls.getWrapperElement();\n\n if (relativePosition === undefined)\n relativePosition = RelativePosition.TopRight;\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return PopupManager.showHTMLElement(\n displayElement,\n el,\n location,\n offset,\n onCancel,\n relativePosition\n );\n }\n\n /**\n * Hides the HTML Element.\n * @deprecated in 4.11.0. Use {@link UiFramework.hideComponent}\n */\n public override hideHTMLElement(): boolean {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\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 placement = mapToPlacement(relativePosition);\n return UiFramework.showCard(\n <CardRenderer content={content} />,\n title,\n toolbarProps\n ? AbstractToolbarPropsToToolbarProps(toolbarProps)\n : { items: [] },\n location,\n offset,\n onItemExecuted,\n onCancel,\n placement,\n anchorElement\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 placement = mapToPlacement(relativePosition);\n return UiFramework.showCard(\n content,\n title,\n toolbarProps\n ? AbstractToolbarPropsToToolbarProps(toolbarProps)\n : { items: [] },\n location,\n offset,\n onItemExecuted,\n onCancel,\n placement,\n anchorElement\n );\n }\n\n /**\n * Hides the Card.\n * */\n public override hideCard(): boolean {\n return UiFramework.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 placement = mapToPlacement(relativePosition);\n return UiFramework.openToolSettingsPopup(\n dataProvider,\n location,\n offset,\n onCancel,\n placement,\n anchorElement\n );\n }\n\n /** Closes the Tool Settings Ui popup. */\n public override closeToolSettingsPopup(): boolean {\n return UiFramework.closeToolSettingsPopup();\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 return UiFramework.openDialog(\n uiDataProvider,\n title,\n isModal,\n id,\n optionalProps\n );\n }\n\n /** Closes the Tool Settings Ui popup.*/\n public override closeDialog(dialogId: string): boolean {\n return UiFramework.closeDialog(dialogId);\n }\n}\n\n// utility functions to wean off appui-abstract\nfunction AbstractToolbarPropsToToolbarProps(\n props: AbstractToolbarProps\n): ToolbarProps {\n return {\n items: props.items.map(CommonToolbarItemToToolBarItem),\n itemId: props.toolbarId,\n };\n}\n\nfunction CommonToolbarItemToToolBarItem(item: CommonToolbarItem): ToolbarItem {\n return {\n ...item,\n badge: item.badgeType,\n };\n}\n\ninterface CardRendererProps {\n content: HTMLElement;\n}\n\nfunction CardRenderer({ content }: CardRendererProps) {\n const ref = React.useRef<HTMLDivElement>(null);\n\n React.useEffect(() => {\n const el = ref.current;\n el?.appendChild(content);\n return () => {\n el?.removeChild(content);\n };\n }, [content]);\n\n return <div ref={ref} />;\n}\n"]}
@@ -122,6 +122,8 @@ function PropertyEditor(props) {
122
122
  * @public
123
123
  */
124
124
  export class ComponentGenerator {
125
+ _uiDataProvider;
126
+ _onCancel;
125
127
  constructor(_uiDataProvider, _onCancel) {
126
128
  this._uiDataProvider = _uiDataProvider;
127
129
  this._onCancel = _onCancel;
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentGenerator.js","sourceRoot":"","sources":["../../../src/appui-react/uiprovider/ComponentGenerator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mEAAmE,CAAC;AAE9G,OAAO,EAAE,2BAA2B,EAAE,MAAM,mEAAmE,CAAC;AAChH,OAAO,EACL,WAAW,EACX,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,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,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC1D,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,uEAAuE;IACvE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,cAAc,CAAC,2BAA2B,CAAC,WAAW,CAAC,CAAC,IAAI,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ChE,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxC,OAAO,eAAe,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAExC,MAAM,UAAU,GAAG,uBAAuB;QACxC,CAAC,CAAC,4DAA4D;QAC9D,CAAC,CAAC,6BAA6B,CAAC;IAClC,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU;QACvB,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;QACvC,KAAK,CACF,CACP,CAAC;AACJ,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 \"./DefaultDialogGridContainer.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n BaseDialogItem,\n DialogItem,\n DialogItemValue,\n DialogPropertySyncItem,\n DialogRow,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n UiLayoutDataProvider,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"@itwin/components-react\";\nimport { EditorContainer, PropertyRecordEditor } from \"@itwin/components-react\";\nimport { assert, Logger } from \"@itwin/core-bentley\";\nimport { Label } from \"@itwin/itwinui-react\";\nimport { useToolSettingsNewEditors } from \"../preview/tool-settings-new-editors/useToolSettingsNewEditors.js\";\nimport type { ToolSettingsEntry } from \"../widget-panels/ToolSettings.js\";\nimport { useLockButtonPropertyRecord } from \"../preview/tool-settings-lock-button/useToolSettingsLockButton.js\";\nimport {\n LockContext,\n PropertyEditorProvider,\n} from \"../editors/LockProvider.js\";\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 || item.property.name;\n }, [item]);\n\n // listen for tool sync property events and update the isDisabled state\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem) => syncItem.propertyName === item.property.name\n );\n if (mySyncItem) {\n setIsDisabled(!!mySyncItem.isDisabled);\n }\n });\n }, [uiDataProvider, item]);\n\n const className = classnames(\n \"uifw-default-label\",\n !!isLeftmostRecord && \"uifw-default-narrow-only-display\"\n );\n return (\n <Label\n className={className}\n htmlFor={item.property.name}\n disabled={isDisabled}\n >\n {displayLabel}:\n </Label>\n );\n}\n\nfunction PropertyEditor(props: {\n uiDataProvider: UiLayoutDataProvider;\n // Property or a lock property.\n initialItem: BaseDialogItem;\n // If a lock property is rendered, this prop contains the property name of the property that the lock property locks.\n itemPropertyName: string;\n isLock?: boolean;\n setFocus?: boolean;\n onCancel?: () => void;\n}) {\n const {\n uiDataProvider,\n initialItem,\n itemPropertyName,\n isLock = false,\n setFocus,\n onCancel,\n } = props;\n const getLatestRecordValue = React.useCallback(\n (initial: BaseDialogItem) => {\n let newRecord = UiLayoutDataProvider.getPropertyRecord(initial);\n\n const foundItem = isLock\n ? uiDataProvider.items.find(\n (item) => item.lockProperty?.property.name === initial.property.name\n )\n : uiDataProvider.items.find(\n (item) => item.property.name === initial.property.name\n );\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 },\n [isLock, uiDataProvider.items]\n );\n\n const currentRecord = getLatestRecordValue(initialItem);\n const [_propertyRecord, setPropertyRecord] = React.useState(currentRecord);\n const propertyRecord = useLockButtonPropertyRecord(_propertyRecord, isLock);\n\n // monitor tool for sync UI events\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === initialItem.property.name\n );\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 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, propertyRecord, initialItem.property.name]);\n\n React.useEffect(() => {\n return uiDataProvider.onItemsReloadedEvent.addListener(() => {\n const newItem = findDialogItem(\n uiDataProvider,\n initialItem.property.name,\n isLock\n );\n if (!newItem) return;\n setPropertyRecord(getLatestRecordValue(newItem));\n });\n }, [uiDataProvider, initialItem.property.name, getLatestRecordValue, isLock]);\n\n const className = React.useMemo(\n () => (isLock ? \"uifw-default-property-lock\" : \"uifw-default-editor\"),\n [isLock]\n );\n const handleCommit = React.useCallback(\n (commit: PropertyUpdatedArgs) => {\n // UiLayoutDataProvider supports only primitive property types\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 const handleCancel = () => {};\n\n const useNewEditors = useToolSettingsNewEditors();\n\n const lockPropertyName = isLock ? initialItem.property.name : undefined;\n return (\n <PropertyEditorProvider\n uiDataProvider={uiDataProvider}\n itemPropertyName={itemPropertyName ?? initialItem.property.name}\n lockPropertyName={lockPropertyName}\n >\n <div key={initialItem.property.name} className={className}>\n {useNewEditors ? (\n <PropertyRecordEditor\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n editorSystem=\"new\"\n size=\"small\"\n />\n ) : (\n <EditorContainer\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n />\n )}\n </div>\n </PropertyEditorProvider>\n );\n}\n\n/** Utility methods to generate react ui from DialogRow specs\n * @public\n */\nexport class ComponentGenerator {\n constructor(\n private _uiDataProvider: UiLayoutDataProvider,\n private _onCancel?: () => void\n ) {}\n\n public get uiDataProvider() {\n return this._uiDataProvider;\n }\n\n private getEditor(\n item: BaseDialogItem,\n isLock = false,\n setFocus = false,\n itemPropertyName?: string\n ): React.ReactNode {\n return (\n <PropertyEditor\n key={item.property.name}\n uiDataProvider={this.uiDataProvider}\n initialItem={item}\n itemPropertyName={itemPropertyName ?? item.property.name}\n isLock={isLock}\n setFocus={setFocus}\n onCancel={this._onCancel}\n />\n );\n }\n\n private generateRowWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): React.ReactNode {\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): React.ReactNode => this.getEditor(item))}\n </div>\n </div>\n );\n }\n\n private generateEntryWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\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): React.ReactNode => 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 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 return (\n <LeftLockAndLabel\n key={`lock-${record.property.name}`}\n lockEditor={lockEditor}\n label={label}\n multiplePropertiesOnRow={multiplePropertiesOnRow}\n itemPropertyName={rowItem.property.name}\n />\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(\n (item: DialogItem, index: number): React.ReactNode =>\n this.getInlineLabelAndEditor(item, index === 0)\n )}\n </div>\n );\n }\n\n private getDivForRow(row: DialogRow): React.ReactNode {\n if (row.items.length === 1) 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\nfunction findDialogItem(\n uiDataProvider: UiLayoutDataProvider,\n propertyName: string,\n isLock: boolean\n) {\n const dialogItem = uiDataProvider.items.find((item) => {\n if (isLock) {\n return item.lockProperty?.property.name === propertyName;\n }\n return item.property.name === propertyName;\n });\n return isLock ? dialogItem?.lockProperty : dialogItem;\n}\n\ninterface LeftLockAndLabelProps {\n lockEditor?: React.ReactNode;\n label?: React.ReactNode;\n multiplePropertiesOnRow: boolean;\n itemPropertyName: string;\n}\n\nfunction LeftLockAndLabel(props: LeftLockAndLabelProps) {\n const { lockEditor, label, multiplePropertiesOnRow, itemPropertyName } =\n props;\n const { lockDecorations } = React.useContext(LockContext) ?? {};\n const lockDecoration = React.useMemo(() => {\n return lockDecorations?.[itemPropertyName];\n }, [lockDecorations, itemPropertyName]);\n\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 className={classNames}>\n {lockDecoration ? undefined : lockEditor}\n {label}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ComponentGenerator.js","sourceRoot":"","sources":["../../../src/appui-react/uiprovider/ComponentGenerator.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,mCAAmC,CAAC;AAC3C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mEAAmE,CAAC;AAE9G,OAAO,EAAE,2BAA2B,EAAE,MAAM,mEAAmE,CAAC;AAChH,OAAO,EACL,WAAW,EACX,sBAAsB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,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,E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AU,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC;AACxD,CAAC;AASD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,GACpE,KAAK,CAAC;IACR,MAAM,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAChE,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxC,OAAO,eAAe,EAAE,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC,EAAE,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAExC,MAAM,UAAU,GAAG,uBAAuB;QACxC,CAAC,CAAC,4DAA4D;QAC9D,CAAC,CAAC,6BAA6B,CAAC;IAClC,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU;QACvB,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU;QACvC,KAAK,CACF,CACP,CAAC;AACJ,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 \"./DefaultDialogGridContainer.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport type {\n BaseDialogItem,\n DialogItem,\n DialogItemValue,\n DialogPropertySyncItem,\n DialogRow,\n} from \"@itwin/appui-abstract\";\nimport {\n PropertyValueFormat,\n UiLayoutDataProvider,\n} from \"@itwin/appui-abstract\";\nimport type { PropertyUpdatedArgs } from \"@itwin/components-react\";\nimport { EditorContainer, PropertyRecordEditor } from \"@itwin/components-react\";\nimport { assert, Logger } from \"@itwin/core-bentley\";\nimport { Label } from \"@itwin/itwinui-react\";\nimport { useToolSettingsNewEditors } from \"../preview/tool-settings-new-editors/useToolSettingsNewEditors.js\";\nimport type { ToolSettingsEntry } from \"../widget-panels/ToolSettings.js\";\nimport { useLockButtonPropertyRecord } from \"../preview/tool-settings-lock-button/useToolSettingsLockButton.js\";\nimport {\n LockContext,\n PropertyEditorProvider,\n} from \"../editors/LockProvider.js\";\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 || item.property.name;\n }, [item]);\n\n // listen for tool sync property events and update the isDisabled state\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem) => syncItem.propertyName === item.property.name\n );\n if (mySyncItem) {\n setIsDisabled(!!mySyncItem.isDisabled);\n }\n });\n }, [uiDataProvider, item]);\n\n const className = classnames(\n \"uifw-default-label\",\n !!isLeftmostRecord && \"uifw-default-narrow-only-display\"\n );\n return (\n <Label\n className={className}\n htmlFor={item.property.name}\n disabled={isDisabled}\n >\n {displayLabel}:\n </Label>\n );\n}\n\nfunction PropertyEditor(props: {\n uiDataProvider: UiLayoutDataProvider;\n // Property or a lock property.\n initialItem: BaseDialogItem;\n // If a lock property is rendered, this prop contains the property name of the property that the lock property locks.\n itemPropertyName: string;\n isLock?: boolean;\n setFocus?: boolean;\n onCancel?: () => void;\n}) {\n const {\n uiDataProvider,\n initialItem,\n itemPropertyName,\n isLock = false,\n setFocus,\n onCancel,\n } = props;\n const getLatestRecordValue = React.useCallback(\n (initial: BaseDialogItem) => {\n let newRecord = UiLayoutDataProvider.getPropertyRecord(initial);\n\n const foundItem = isLock\n ? uiDataProvider.items.find(\n (item) => item.lockProperty?.property.name === initial.property.name\n )\n : uiDataProvider.items.find(\n (item) => item.property.name === initial.property.name\n );\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 },\n [isLock, uiDataProvider.items]\n );\n\n const currentRecord = getLatestRecordValue(initialItem);\n const [_propertyRecord, setPropertyRecord] = React.useState(currentRecord);\n const propertyRecord = useLockButtonPropertyRecord(_propertyRecord, isLock);\n\n // monitor tool for sync UI events\n React.useEffect(() => {\n return uiDataProvider.onSyncPropertiesChangeEvent.addListener((args) => {\n const mySyncItem = args.properties.find(\n (syncItem: DialogPropertySyncItem) =>\n syncItem.propertyName === initialItem.property.name\n );\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 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, propertyRecord, initialItem.property.name]);\n\n React.useEffect(() => {\n return uiDataProvider.onItemsReloadedEvent.addListener(() => {\n const newItem = findDialogItem(\n uiDataProvider,\n initialItem.property.name,\n isLock\n );\n if (!newItem) return;\n setPropertyRecord(getLatestRecordValue(newItem));\n });\n }, [uiDataProvider, initialItem.property.name, getLatestRecordValue, isLock]);\n\n const className = React.useMemo(\n () => (isLock ? \"uifw-default-property-lock\" : \"uifw-default-editor\"),\n [isLock]\n );\n const handleCommit = React.useCallback(\n (commit: PropertyUpdatedArgs) => {\n // UiLayoutDataProvider supports only primitive property types\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 const handleCancel = () => {};\n\n const useNewEditors = useToolSettingsNewEditors();\n\n const lockPropertyName = isLock ? initialItem.property.name : undefined;\n return (\n <PropertyEditorProvider\n uiDataProvider={uiDataProvider}\n itemPropertyName={itemPropertyName ?? initialItem.property.name}\n lockPropertyName={lockPropertyName}\n >\n <div key={initialItem.property.name} className={className}>\n {useNewEditors ? (\n <PropertyRecordEditor\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n editorSystem=\"new\"\n size=\"small\"\n />\n ) : (\n <EditorContainer\n key={initialItem.property.name}\n propertyRecord={propertyRecord}\n setFocus={setFocus}\n onCommit={handleCommit}\n onCancel={onCancel ?? handleCancel}\n />\n )}\n </div>\n </PropertyEditorProvider>\n );\n}\n\n/** Utility methods to generate react ui from DialogRow specs\n * @public\n */\nexport class ComponentGenerator {\n constructor(\n private _uiDataProvider: UiLayoutDataProvider,\n private _onCancel?: () => void\n ) {}\n\n public get uiDataProvider() {\n return this._uiDataProvider;\n }\n\n private getEditor(\n item: BaseDialogItem,\n isLock = false,\n setFocus = false,\n itemPropertyName?: string\n ): React.ReactNode {\n return (\n <PropertyEditor\n key={item.property.name}\n uiDataProvider={this.uiDataProvider}\n initialItem={item}\n itemPropertyName={itemPropertyName ?? item.property.name}\n isLock={isLock}\n setFocus={setFocus}\n onCancel={this._onCancel}\n />\n );\n }\n\n private generateRowWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): React.ReactNode {\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): React.ReactNode => this.getEditor(item))}\n </div>\n </div>\n );\n }\n\n private generateEntryWithButtonGroupEditors(\n row: DialogRow,\n rowIndex: number\n ): ToolSettingsEntry {\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): React.ReactNode => 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 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 return (\n <LeftLockAndLabel\n key={`lock-${record.property.name}`}\n lockEditor={lockEditor}\n label={label}\n multiplePropertiesOnRow={multiplePropertiesOnRow}\n itemPropertyName={rowItem.property.name}\n />\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(\n (item: DialogItem, index: number): React.ReactNode =>\n this.getInlineLabelAndEditor(item, index === 0)\n )}\n </div>\n );\n }\n\n private getDivForRow(row: DialogRow): React.ReactNode {\n if (row.items.length === 1) 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\nfunction findDialogItem(\n uiDataProvider: UiLayoutDataProvider,\n propertyName: string,\n isLock: boolean\n) {\n const dialogItem = uiDataProvider.items.find((item) => {\n if (isLock) {\n return item.lockProperty?.property.name === propertyName;\n }\n return item.property.name === propertyName;\n });\n return isLock ? dialogItem?.lockProperty : dialogItem;\n}\n\ninterface LeftLockAndLabelProps {\n lockEditor?: React.ReactNode;\n label?: React.ReactNode;\n multiplePropertiesOnRow: boolean;\n itemPropertyName: string;\n}\n\nfunction LeftLockAndLabel(props: LeftLockAndLabelProps) {\n const { lockEditor, label, multiplePropertiesOnRow, itemPropertyName } =\n props;\n const { lockDecorations } = React.useContext(LockContext) ?? {};\n const lockDecoration = React.useMemo(() => {\n return lockDecorations?.[itemPropertyName];\n }, [lockDecorations, itemPropertyName]);\n\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 className={classNames}>\n {lockDecoration ? undefined : lockEditor}\n {label}\n </div>\n );\n}\n"]}