@itwin/appui-react 4.4.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/lib/cjs/appui-react/UiFramework.js +4 -7
- package/lib/cjs/appui-react/UiFramework.js.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +1 -2
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js +1 -1
- package/lib/cjs/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
- package/lib/cjs/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/TimeTracker.js +1 -2
- package/lib/cjs/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.js +9 -12
- package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/cjs/appui-react/content/DefaultViewOverlay.js +3 -4
- package/lib/cjs/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +1 -2
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +3 -6
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentLayoutManager.js +1 -2
- package/lib/cjs/appui-react/content/InternalContentLayoutManager.js.map +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.js +1 -1
- package/lib/cjs/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/cjs/appui-react/content/split-pane/SplitPane.js +10 -12
- package/lib/cjs/appui-react/content/split-pane/SplitPane.js.map +1 -1
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js +2 -3
- package/lib/cjs/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/cjs/appui-react/dialog/ContentDialog.js +3 -6
- package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js +2 -3
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +17 -7
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts +2 -0
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js +2 -0
- package/lib/cjs/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js +2 -3
- package/lib/cjs/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js +1 -2
- package/lib/cjs/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js +7 -11
- package/lib/cjs/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js +7 -11
- package/lib/cjs/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useSolarDataProvider.js +8 -13
- package/lib/cjs/appui-react/hooks/useSolarDataProvider.js.map +1 -1
- package/lib/cjs/appui-react/messages/ActivityMessage.js +5 -7
- package/lib/cjs/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/cjs/appui-react/pickers/ViewSelector.js +5 -6
- package/lib/cjs/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js +1 -2
- package/lib/cjs/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/cjs/appui-react/popup/PopupManager.js +1 -2
- package/lib/cjs/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.js +2 -2
- package/lib/cjs/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
- package/lib/cjs/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +5 -7
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/Indicator.js +1 -2
- package/lib/cjs/appui-react/statusbar/Indicator.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBar.js +3 -5
- package/lib/cjs/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
- package/lib/cjs/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/Toolbar.d.ts +1 -1
- package/lib/cjs/appui-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/Toolbar.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarHelper.d.ts +6 -3
- package/lib/cjs/appui-react/toolbar/ToolbarHelper.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarHelper.js +53 -80
- package/lib/cjs/appui-react/toolbar/ToolbarHelper.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.d.ts +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/cjs/appui-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js +3 -4
- package/lib/cjs/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +10 -17
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js +3 -2
- package/lib/cjs/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js +12 -14
- package/lib/cjs/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +9 -10
- package/lib/cjs/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -2
- package/lib/cjs/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js +8 -14
- package/lib/cjs/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
- package/lib/cjs/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js +1 -1
- package/lib/cjs/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js +3 -3
- package/lib/cjs/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Content.js +8 -9
- package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +43 -45
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/StatusBar.js +1 -1
- package/lib/cjs/appui-react/widget-panels/StatusBar.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Tab.js +1 -1
- package/lib/cjs/appui-react/widget-panels/Tab.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js +21 -23
- package/lib/cjs/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Toolbars.js +2 -3
- package/lib/cjs/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js +2 -2
- package/lib/cjs/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetHost.js +2 -3
- package/lib/cjs/appui-react/widgets/WidgetHost.js.map +1 -1
- package/lib/esm/appui-react/UiFramework.js +4 -7
- package/lib/esm/appui-react/UiFramework.js.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js +1 -2
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js +1 -1
- package/lib/esm/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js +1 -1
- package/lib/esm/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/esm/appui-react/configurableui/TimeTracker.js +1 -2
- package/lib/esm/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.js +9 -12
- package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/esm/appui-react/content/DefaultViewOverlay.js +3 -4
- package/lib/esm/appui-react/content/DefaultViewOverlay.js.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.js +1 -2
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +3 -6
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/content/InternalContentLayoutManager.js +1 -2
- package/lib/esm/appui-react/content/InternalContentLayoutManager.js.map +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.js +1 -1
- package/lib/esm/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/esm/appui-react/content/split-pane/SplitPane.js +10 -12
- package/lib/esm/appui-react/content/split-pane/SplitPane.js.map +1 -1
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js +2 -3
- package/lib/esm/appui-react/cursor/cursormenu/CursorMenu.js.map +1 -1
- package/lib/esm/appui-react/dialog/ContentDialog.js +3 -6
- package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.js +2 -3
- package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +17 -7
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts +2 -0
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js +2 -0
- package/lib/esm/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js +2 -3
- package/lib/esm/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js +1 -2
- package/lib/esm/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js +7 -11
- package/lib/esm/appui-react/hooks/useAnalysisAnimationDataProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js +7 -11
- package/lib/esm/appui-react/hooks/useScheduleAnimationDataProvider.js.map +1 -1
- package/lib/esm/appui-react/hooks/useSolarDataProvider.js +8 -13
- package/lib/esm/appui-react/hooks/useSolarDataProvider.js.map +1 -1
- package/lib/esm/appui-react/messages/ActivityMessage.js +5 -7
- package/lib/esm/appui-react/messages/ActivityMessage.js.map +1 -1
- package/lib/esm/appui-react/pickers/ViewSelector.js +5 -6
- package/lib/esm/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js +1 -2
- package/lib/esm/appui-react/popup/KeyinPalettePanel.js.map +1 -1
- package/lib/esm/appui-react/popup/PopupManager.js +1 -2
- package/lib/esm/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/esm/appui-react/selection/SelectionContextItemDef.js +2 -2
- package/lib/esm/appui-react/selection/SelectionContextItemDef.js.map +1 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js +2 -1
- package/lib/esm/appui-react/settings/quantityformatting/QuantityFormat.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +5 -7
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/statusbar/Indicator.js +1 -2
- package/lib/esm/appui-react/statusbar/Indicator.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBar.js +3 -5
- package/lib/esm/appui-react/statusbar/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js +1 -1
- package/lib/esm/appui-react/statusfields/toolassistance/ToolAssistanceField.js.map +1 -1
- package/lib/esm/appui-react/toolbar/Toolbar.d.ts +1 -1
- package/lib/esm/appui-react/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/Toolbar.js.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarHelper.d.ts +6 -3
- package/lib/esm/appui-react/toolbar/ToolbarHelper.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarHelper.js +53 -80
- package/lib/esm/appui-react/toolbar/ToolbarHelper.js.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.d.ts +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.d.ts.map +1 -1
- package/lib/esm/appui-react/toolbar/ToolbarWithOverflow.js.map +1 -1
- package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js +3 -4
- package/lib/esm/appui-react/toolbar/useUiItemsProviderToolbarItems.js.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js +10 -17
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js +3 -2
- package/lib/esm/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js +12 -14
- package/lib/esm/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +9 -10
- package/lib/esm/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -2
- package/lib/esm/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js +8 -14
- package/lib/esm/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js +1 -1
- package/lib/esm/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/esm/appui-react/uiprovider/ComponentGenerator.js +1 -1
- package/lib/esm/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.js +3 -3
- package/lib/esm/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Content.js +8 -9
- package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +43 -45
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/StatusBar.js +1 -1
- package/lib/esm/appui-react/widget-panels/StatusBar.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Tab.js +1 -1
- package/lib/esm/appui-react/widget-panels/Tab.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/ToolSettings.js +21 -23
- package/lib/esm/appui-react/widget-panels/ToolSettings.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Toolbars.js +2 -3
- package/lib/esm/appui-react/widget-panels/Toolbars.js.map +1 -1
- package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js +2 -2
- package/lib/esm/appui-react/widgets/NavigationWidgetComposer.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetHost.js +2 -3
- package/lib/esm/appui-react/widgets/WidgetHost.js.map +1 -1
- package/package.json +10 -10
|
@@ -8,45 +8,36 @@ const CustomItemDef_1 = require("../shared/CustomItemDef");
|
|
|
8
8
|
const ToolItemDef_1 = require("../shared/ToolItemDef");
|
|
9
9
|
const GroupItem_1 = require("./GroupItem");
|
|
10
10
|
const ToolbarItem_1 = require("./ToolbarItem");
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Common implementation for `constructChildToolbarItems` and `createToolbarItemsFromItemDefs`.
|
|
13
|
+
* @param itemDefs List of itemDefs to convert.
|
|
14
|
+
* @param allowCustom false if we are building children and don't support custom items.
|
|
15
|
+
* @param startingItemPriority defaults to 10.
|
|
16
|
+
* @param overrides Single override to apply to each itemDefs.
|
|
17
|
+
* @returns ToolbarItem[] or (ToolbarActionItem | ToolbarGroupItem) if allowCustom is false.
|
|
18
|
+
*/
|
|
19
|
+
function constructToolbarItemArray(itemDefs, allowCustom, startingItemPriority = 10, overrides) {
|
|
20
|
+
let priority = startingItemPriority;
|
|
21
|
+
const items = [];
|
|
22
|
+
for (const itemDef of itemDefs) {
|
|
23
|
+
const item = ToolbarHelper.createToolbarItemFromItemDef(priority, itemDef, overrides);
|
|
24
|
+
priority = priority + 10;
|
|
25
|
+
if (allowCustom || (0, ToolbarItem_1.isToolbarActionItem)(item) || (0, ToolbarItem_1.isToolbarGroupItem)(item))
|
|
26
|
+
items.push(item);
|
|
27
|
+
}
|
|
28
|
+
return items;
|
|
29
|
+
}
|
|
30
|
+
/** Helper functions for defining a Toolbar items used in `Toolbar`, `ToolbarComposer` and `UiItemsProvider`.
|
|
12
31
|
* @public
|
|
13
32
|
*/
|
|
14
33
|
class ToolbarHelper {
|
|
15
|
-
/** Construct
|
|
34
|
+
/** Construct ToolbarCustomItem definitions given a CustomItemDef. */
|
|
16
35
|
static createCustomDefinitionToolbarItem(itemPriority, itemDef, overrides) {
|
|
17
|
-
|
|
18
|
-
const isDisabled = itemDef.isDisabled;
|
|
19
|
-
const internalData = new Map(); // used to store ReactNode if iconSpec hold a ReactNode
|
|
20
|
-
const icon = core_react_1.IconHelper.getIconData(itemDef.iconSpec, internalData);
|
|
21
|
-
const label = this.getStringOrConditionalString(itemDef.rawLabel);
|
|
22
|
-
const badgeType = itemDef.badgeType;
|
|
23
|
-
// istanbul ignore else
|
|
24
|
-
return {
|
|
25
|
-
id: itemDef.id,
|
|
26
|
-
itemPriority,
|
|
27
|
-
icon,
|
|
28
|
-
label,
|
|
29
|
-
isCustom: true,
|
|
30
|
-
isHidden,
|
|
31
|
-
isDisabled,
|
|
32
|
-
internalData,
|
|
33
|
-
badgeType,
|
|
34
|
-
panelContent: itemDef.popupPanelNode,
|
|
35
|
-
...overrides,
|
|
36
|
-
};
|
|
36
|
+
return this.createToolbarItemFromItemDef(itemPriority, itemDef, overrides);
|
|
37
37
|
}
|
|
38
|
-
/** Construct
|
|
38
|
+
/** Construct ToolbarActionItem and ToolbarGroupItem definitions given an array of ItemDefs. */
|
|
39
39
|
static constructChildToolbarItems(itemDefs) {
|
|
40
|
-
|
|
41
|
-
const items = [];
|
|
42
|
-
for (const itemDef of itemDefs) {
|
|
43
|
-
const item = this.createToolbarItemFromItemDef(count, itemDef);
|
|
44
|
-
count = count + 10;
|
|
45
|
-
// istanbul ignore else
|
|
46
|
-
if ((0, ToolbarItem_1.isToolbarActionItem)(item) || (0, ToolbarItem_1.isToolbarGroupItem)(item))
|
|
47
|
-
items.push(item);
|
|
48
|
-
}
|
|
49
|
-
return items;
|
|
40
|
+
return constructToolbarItemArray(itemDefs, false);
|
|
50
41
|
}
|
|
51
42
|
static getStringOrConditionalString(inString) {
|
|
52
43
|
if (inString instanceof appui_abstract_1.ConditionalStringValue ||
|
|
@@ -59,71 +50,53 @@ class ToolbarHelper {
|
|
|
59
50
|
}
|
|
60
51
|
/** Helper method to creates a generic toolbar item entry */
|
|
61
52
|
static createToolbarItemFromItemDef(itemPriority, itemDef, overrides) {
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
const { badgeType, icon, internalData, ...itemOverrides } = overrides ?? {};
|
|
54
|
+
const itemBase = {
|
|
55
|
+
id: itemDef.id,
|
|
56
|
+
itemPriority,
|
|
57
|
+
isActive: itemDef.isActive,
|
|
58
|
+
isHidden: itemDef.isHidden,
|
|
59
|
+
isDisabled: itemDef.isDisabled,
|
|
60
|
+
icon: internalData?.get(core_react_1.IconHelper.reactIconKey) ??
|
|
61
|
+
internalData?.get(core_react_1.IconHelper.conditionalIconItemKey) ??
|
|
62
|
+
icon ??
|
|
63
|
+
itemDef.iconSpec,
|
|
64
|
+
label: this.getStringOrConditionalString(itemDef.rawLabel),
|
|
65
|
+
badge: badgeType ?? itemDef.badgeType,
|
|
66
|
+
};
|
|
67
67
|
// istanbul ignore else
|
|
68
|
-
if (itemDef instanceof CommandItemDef_1.CommandItemDef) {
|
|
68
|
+
if (itemDef instanceof CommandItemDef_1.CommandItemDef || itemDef instanceof ToolItemDef_1.ToolItemDef) {
|
|
69
69
|
return {
|
|
70
|
-
|
|
71
|
-
itemPriority,
|
|
72
|
-
icon,
|
|
73
|
-
label,
|
|
74
|
-
isHidden,
|
|
75
|
-
isDisabled,
|
|
76
|
-
isActive: itemDef.isActive,
|
|
70
|
+
...itemBase,
|
|
77
71
|
execute: itemDef.execute,
|
|
78
|
-
|
|
79
|
-
...overrides,
|
|
72
|
+
...itemOverrides,
|
|
80
73
|
};
|
|
81
74
|
}
|
|
82
75
|
else if (itemDef instanceof CustomItemDef_1.CustomItemDef) {
|
|
83
|
-
return
|
|
76
|
+
return {
|
|
77
|
+
...itemBase,
|
|
78
|
+
panelContent: itemDef.popupPanelNode,
|
|
79
|
+
...itemOverrides,
|
|
80
|
+
};
|
|
84
81
|
}
|
|
85
82
|
else if (itemDef instanceof GroupItem_1.GroupItemDef) {
|
|
86
|
-
const children = this.constructChildToolbarItems(itemDef.items);
|
|
87
83
|
return {
|
|
88
|
-
|
|
89
|
-
itemPriority,
|
|
90
|
-
icon,
|
|
91
|
-
label,
|
|
84
|
+
...itemBase,
|
|
92
85
|
panelLabel: itemDef.panelLabel,
|
|
93
|
-
|
|
94
|
-
isDisabled,
|
|
95
|
-
items: children,
|
|
86
|
+
items: this.constructChildToolbarItems(itemDef.items),
|
|
96
87
|
isActive: false,
|
|
97
|
-
|
|
98
|
-
...overrides,
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
else if (itemDef instanceof ToolItemDef_1.ToolItemDef) {
|
|
102
|
-
return {
|
|
103
|
-
id: itemDef.id,
|
|
104
|
-
itemPriority,
|
|
105
|
-
icon,
|
|
106
|
-
label,
|
|
107
|
-
isHidden,
|
|
108
|
-
isDisabled,
|
|
109
|
-
isActive: itemDef.isActive,
|
|
110
|
-
execute: itemDef.execute,
|
|
111
|
-
badge,
|
|
112
|
-
...overrides,
|
|
88
|
+
...itemOverrides,
|
|
113
89
|
};
|
|
114
90
|
}
|
|
115
91
|
else {
|
|
116
92
|
throw new Error(`Invalid Item type encountered, item id=${itemDef.id}`);
|
|
117
93
|
}
|
|
118
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Helper method to creates a generic toolbar item entry list.
|
|
97
|
+
*/
|
|
119
98
|
static createToolbarItemsFromItemDefs(itemDefs, startingItemPriority = 10, overrides) {
|
|
120
|
-
|
|
121
|
-
const items = itemDefs.map((itemDef) => {
|
|
122
|
-
const item = ToolbarHelper.createToolbarItemFromItemDef(itemPriority, itemDef, overrides);
|
|
123
|
-
itemPriority = itemPriority + 10;
|
|
124
|
-
return item;
|
|
125
|
-
});
|
|
126
|
-
return items;
|
|
99
|
+
return constructToolbarItemArray(itemDefs, true, startingItemPriority, overrides);
|
|
127
100
|
}
|
|
128
101
|
}
|
|
129
102
|
exports.ToolbarHelper = ToolbarHelper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarHelper.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarHelper.tsx"],"names":[],"mappings":";;;AAeA,0DAA+D;AAC/D,kDAA+C;AAE/C,6DAA0D;AAC1D,2DAAwD;AACxD,uDAAoD;AACpD,2CAA2C;AAO3C,+CAAwE;AAExE
|
|
1
|
+
{"version":3,"file":"ToolbarHelper.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarHelper.tsx"],"names":[],"mappings":";;;AAeA,0DAA+D;AAC/D,kDAA+C;AAE/C,6DAA0D;AAC1D,2DAAwD;AACxD,uDAAoD;AACpD,2CAA2C;AAO3C,+CAAwE;AAExE;;;;;;;GAOG;AACH,SAAS,yBAAyB,CAChC,QAAsB,EACtB,WAAc,EACd,oBAAoB,GAAG,EAAE,EACzB,SAAsC;IAEtC,IAAI,QAAQ,GAAG,oBAAoB,CAAC;IACpC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;QAC9B,MAAM,IAAI,GAAG,aAAa,CAAC,4BAA4B,CACrD,QAAQ,EACR,OAAO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------------------------------------------------------\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 Toolbar\n */\nimport type * as React from \"react\";\nimport type {\n ActionButton,\n CommonToolbarItem,\n CustomButtonDefinition,\n GroupButton,\n StringGetter,\n} from \"@itwin/appui-abstract\";\nimport { ConditionalStringValue } from \"@itwin/appui-abstract\";\nimport { IconHelper } from \"@itwin/core-react\";\nimport type { AnyItemDef } from \"../shared/AnyItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { CustomItemDef } from \"../shared/CustomItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { GroupItemDef } from \"./GroupItem\";\nimport type {\n ToolbarActionItem,\n ToolbarCustomItem,\n ToolbarGroupItem,\n ToolbarItem,\n} from \"./ToolbarItem\";\nimport { isToolbarActionItem, isToolbarGroupItem } from \"./ToolbarItem\";\n\n/**\n * Common implementation for `constructChildToolbarItems` and `createToolbarItemsFromItemDefs`.\n * @param itemDefs List of itemDefs to convert.\n * @param allowCustom false if we are building children and don't support custom items.\n * @param startingItemPriority defaults to 10.\n * @param overrides Single override to apply to each itemDefs.\n * @returns ToolbarItem[] or (ToolbarActionItem | ToolbarGroupItem) if allowCustom is false.\n */\nfunction constructToolbarItemArray<T extends boolean>(\n itemDefs: AnyItemDef[],\n allowCustom: T,\n startingItemPriority = 10,\n overrides?: Partial<CommonToolbarItem>\n) {\n let priority = startingItemPriority;\n const items = [];\n for (const itemDef of itemDefs) {\n const item = ToolbarHelper.createToolbarItemFromItemDef(\n priority,\n itemDef,\n overrides\n );\n priority = priority + 10;\n if (allowCustom || isToolbarActionItem(item) || isToolbarGroupItem(item))\n items.push(item);\n }\n return items as T extends true\n ? Array<ToolbarItem>\n : Array<ToolbarActionItem | ToolbarGroupItem>;\n}\n\n/** Helper functions for defining a Toolbar items used in `Toolbar`, `ToolbarComposer` and `UiItemsProvider`.\n * @public\n */\nexport class ToolbarHelper {\n /** Construct ToolbarCustomItem definitions given a CustomItemDef. */\n public static createCustomDefinitionToolbarItem(\n itemPriority: number,\n itemDef: CustomItemDef,\n overrides?: Partial<CustomButtonDefinition>\n ): ToolbarCustomItem {\n return this.createToolbarItemFromItemDef(itemPriority, itemDef, overrides);\n }\n\n /** Construct ToolbarActionItem and ToolbarGroupItem definitions given an array of ItemDefs. */\n public static constructChildToolbarItems(\n itemDefs: AnyItemDef[]\n ): Array<ToolbarActionItem | ToolbarGroupItem> {\n return constructToolbarItemArray(itemDefs, false);\n }\n\n private static getStringOrConditionalString(\n inString: string | StringGetter | ConditionalStringValue\n ): string | ConditionalStringValue {\n if (\n inString instanceof ConditionalStringValue ||\n typeof inString === \"string\"\n )\n return inString;\n\n return inString();\n }\n\n public static getIconReactNode(\n item: ActionButton | GroupButton\n ): React.ReactNode {\n return IconHelper.getIconReactNode(item.icon, item.internalData);\n }\n\n /** Helper method to creates a generic toolbar item entry */\n public static createToolbarItemFromItemDef(\n itemPriority: number,\n itemDef: AnyItemDef,\n overrides?: Partial<CommonToolbarItem>\n ): ToolbarItem {\n const { badgeType, icon, internalData, ...itemOverrides } = overrides ?? {};\n const itemBase: ToolbarItem = {\n id: itemDef.id,\n itemPriority,\n isActive: itemDef.isActive,\n isHidden: itemDef.isHidden,\n isDisabled: itemDef.isDisabled,\n icon:\n internalData?.get(IconHelper.reactIconKey) ??\n internalData?.get(IconHelper.conditionalIconItemKey) ??\n icon ??\n itemDef.iconSpec,\n label: this.getStringOrConditionalString(itemDef.rawLabel),\n badge: badgeType ?? itemDef.badgeType,\n };\n\n // istanbul ignore else\n if (itemDef instanceof CommandItemDef || itemDef instanceof ToolItemDef) {\n return {\n ...itemBase,\n execute: itemDef.execute,\n ...itemOverrides,\n };\n } else if (itemDef instanceof CustomItemDef) {\n return {\n ...itemBase,\n panelContent: itemDef.popupPanelNode,\n ...itemOverrides,\n };\n } else if (itemDef instanceof GroupItemDef) {\n return {\n ...itemBase,\n panelLabel: itemDef.panelLabel,\n items: this.constructChildToolbarItems(itemDef.items),\n isActive: false,\n ...itemOverrides,\n };\n } else {\n throw new Error(`Invalid Item type encountered, item id=${itemDef.id}`);\n }\n }\n\n /**\n * Helper method to creates a generic toolbar item entry list.\n */\n public static createToolbarItemsFromItemDefs(\n itemDefs: AnyItemDef[],\n startingItemPriority = 10,\n overrides?: Partial<CommonToolbarItem>\n ): ToolbarItem[] {\n return constructToolbarItemArray(\n itemDefs,\n true,\n startingItemPriority,\n overrides\n );\n }\n}\n"]}
|
|
@@ -10,7 +10,7 @@ import type { ToolbarItem } from "./ToolbarItem";
|
|
|
10
10
|
* @beta
|
|
11
11
|
*/
|
|
12
12
|
export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {
|
|
13
|
-
/** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */
|
|
13
|
+
/** Describes to which direction the popup panels are expanded, also defines the orientation of the toolbar (Top/Bottom will create an horizontal toolbar, Left/Right will create a vertical toolbar). Defaults to: [[Direction.Bottom]] */
|
|
14
14
|
expandsTo?: Direction;
|
|
15
15
|
/** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */
|
|
16
16
|
overflowExpandsTo?: Direction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarWithOverflow.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,WAAW,EAAE,eAAe;IAC5E,
|
|
1
|
+
{"version":3,"file":"ToolbarWithOverflow.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,WAAW,EAAE,eAAe;IAC5E,2OAA2O;IAC3O,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,4GAA4G;IAC5G,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,uGAAuG;IACvG,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,mEAAmE;IACnE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oFAAoF;IACpF,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,sDAAsD;IACtD,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;CAC9C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,eAGlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarWithOverflow.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAS/B,uCAAoC;AAwBpC;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,oBAAC,iBAAO,IAAC,cAAc,EAAE,EAAE,iBAAiB,EAAE,KAAM,YAAY,GAAI,CAAC;AAC9E,CAAC;AAHD,kDAGC","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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem\";\nimport { Toolbar } from \"./Toolbar\";\n\n/** Component that displays toolbar items.\n * @beta\n */\nexport interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items, displaying only the elements that can fit in the available space,\n * and put the other items into a single panel.\n * @beta\n */\nexport function ToolbarWithOverflow(props: ToolbarWithOverflowProps) {\n const { overflowExpandsTo, ...toolbarProps } = props;\n return <Toolbar enableOverflow={{ overflowExpandsTo }} {...toolbarProps} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ToolbarWithOverflow.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/ToolbarWithOverflow.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAS/B,uCAAoC;AAwBpC;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IACrD,OAAO,oBAAC,iBAAO,IAAC,cAAc,EAAE,EAAE,iBAAiB,EAAE,KAAM,YAAY,GAAI,CAAC;AAC9E,CAAC;AAHD,kDAGC","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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type { OnItemExecutedFunc } from \"@itwin/appui-abstract\";\nimport type { CommonProps, NoChildrenProps } from \"@itwin/core-react\";\nimport type {\n Direction,\n ToolbarOpacitySetting,\n ToolbarPanelAlignment,\n} from \"@itwin/components-react\";\nimport type { ToolbarItem } from \"./ToolbarItem\";\nimport { Toolbar } from \"./Toolbar\";\n\n/** Component that displays toolbar items.\n * @beta\n */\nexport interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps {\n /** Describes to which direction the popup panels are expanded, also defines the orientation of the toolbar (Top/Bottom will create an horizontal toolbar, Left/Right will create a vertical toolbar). Defaults to: [[Direction.Bottom]] */\n expandsTo?: Direction;\n /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */\n overflowExpandsTo?: Direction;\n /** Definitions for items of the toolbar. Items are expected to be already sorted by group and item. */\n items: ToolbarItem[];\n /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */\n panelAlignment?: ToolbarPanelAlignment;\n /** Use Drag Interaction to open popups with nest action buttons */\n useDragInteraction?: boolean;\n /** Determines whether to use mouse proximity to alter the opacity of the toolbar */\n toolbarOpacitySetting?: ToolbarOpacitySetting;\n /** Optional function to call on any item execution */\n onItemExecuted?: OnItemExecutedFunc;\n /** Optional function to call on any KeyDown events processed by toolbar */\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\n/** Component that displays toolbar items, displaying only the elements that can fit in the available space,\n * and put the other items into a single panel.\n * @beta\n */\nexport function ToolbarWithOverflow(props: ToolbarWithOverflowProps) {\n const { overflowExpandsTo, ...toolbarProps } = props;\n return <Toolbar enableOverflow={{ overflowExpandsTo }} {...toolbarProps} />;\n}\n"]}
|
|
@@ -20,10 +20,9 @@ manager, toolbarUsage, toolbarOrientation) => {
|
|
|
20
20
|
const providedItems = (0, useActiveStageProvidedToolbarItems_1.useActiveStageProvidedToolbarItems)(toolbarUsage, toolbarOrientation);
|
|
21
21
|
const [items, setItems] = React.useState(providedItems);
|
|
22
22
|
React.useEffect(() => {
|
|
23
|
-
|
|
24
|
-
manager
|
|
25
|
-
|
|
26
|
-
return manager === null || manager === void 0 ? void 0 : manager.onItemsChanged.addListener((args) => {
|
|
23
|
+
manager?.loadItems(providedItems);
|
|
24
|
+
setItems(manager?.items ?? providedItems);
|
|
25
|
+
return manager?.onItemsChanged.addListener((args) => {
|
|
27
26
|
setItems(args.items);
|
|
28
27
|
});
|
|
29
28
|
}, [manager, providedItems]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUiItemsProviderToolbarItems.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/useUiItemsProviderToolbarItems.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAO/B,6FAA0F;AAE1F;;;GAGG;AACI,MAAM,8BAA8B,GAAG;AAC5C,mDAAmD;AACnD,OAA4B,EAC5B,YAA0B,EAC1B,kBAAsC,EACd,EAAE;IAC1B,MAAM,aAAa,GAAG,IAAA,uEAAkC,EACtD,YAAY,EACZ,kBAAkB,CACnB,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACxD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE
|
|
1
|
+
{"version":3,"file":"useUiItemsProviderToolbarItems.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/useUiItemsProviderToolbarItems.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAO/B,6FAA0F;AAE1F;;;GAGG;AACI,MAAM,8BAA8B,GAAG;AAC5C,mDAAmD;AACnD,OAA4B,EAC5B,YAA0B,EAC1B,kBAAsC,EACd,EAAE;IAC1B,MAAM,aAAa,GAAG,IAAA,uEAAkC,EACtD,YAAY,EACZ,kBAAkB,CACnB,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACxD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,OAAO,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;QAClC,QAAQ,CAAC,OAAO,EAAE,KAAK,IAAI,aAAa,CAAC,CAAC;QAE1C,OAAO,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE;YAClD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;IAC7B,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AApBW,QAAA,8BAA8B,kCAoBzC","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 Toolbar\n */\n\nimport * as React from \"react\";\nimport type {\n ToolbarItem,\n ToolbarOrientation,\n ToolbarUsage,\n} from \"./ToolbarItem\";\nimport type { ToolbarItemsManager } from \"./ToolbarItemsManager\";\nimport { useActiveStageProvidedToolbarItems } from \"./useActiveStageProvidedToolbarItems\";\n\n/** Hook that retrieves active frontstage toolbar items from UiItemsProviders and manage them through [[ToolbarItemsManager]].\n * @public\n * @deprecated in 4.4.0. This uses ToolbarItemsManager which is internal, directly use [[ToolbarComposer]] instead.\n */\nexport const useUiItemsProviderToolbarItems = (\n // eslint-disable-next-line deprecation/deprecation\n manager: ToolbarItemsManager,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation\n): readonly ToolbarItem[] => {\n const providedItems = useActiveStageProvidedToolbarItems(\n toolbarUsage,\n toolbarOrientation\n );\n const [items, setItems] = React.useState(providedItems);\n React.useEffect(() => {\n manager?.loadItems(providedItems);\n setItems(manager?.items ?? providedItems);\n\n return manager?.onItemsChanged.addListener((args) => {\n setItems(args.items);\n });\n }, [manager, providedItems]);\n return items;\n};\n"]}
|
|
@@ -80,9 +80,8 @@ class CoreTools {
|
|
|
80
80
|
return new ToolItemDef_1.ToolItemDef({
|
|
81
81
|
toolId: core_frontend_1.RotateViewTool.toolId,
|
|
82
82
|
iconSpec: new appui_abstract_1.ConditionalStringValue(() => {
|
|
83
|
-
var _a;
|
|
84
83
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
85
|
-
if (
|
|
84
|
+
if (activeContentControl?.viewport?.view.is2d())
|
|
86
85
|
return appui_abstract_1.IconSpecUtilities.createWebComponentIconSpec(rotate_left_svg_1.default);
|
|
87
86
|
return appui_abstract_1.IconSpecUtilities.createWebComponentIconSpec(gyroscope_svg_1.default);
|
|
88
87
|
}, [
|
|
@@ -102,9 +101,8 @@ class CoreTools {
|
|
|
102
101
|
label: core_frontend_1.WalkViewTool.flyover,
|
|
103
102
|
description: core_frontend_1.WalkViewTool.description,
|
|
104
103
|
isHidden: new appui_abstract_1.ConditionalBooleanValue(() => {
|
|
105
|
-
var _a;
|
|
106
104
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
107
|
-
return !!
|
|
105
|
+
return !!activeContentControl?.viewport?.view.is2d();
|
|
108
106
|
}, [
|
|
109
107
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveContentChanged,
|
|
110
108
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveViewportChanged,
|
|
@@ -135,10 +133,9 @@ class CoreTools {
|
|
|
135
133
|
return new ToolItemDef_1.ToolItemDef({
|
|
136
134
|
toolId: core_frontend_1.ViewToggleCameraTool.toolId,
|
|
137
135
|
iconSpec: new appui_abstract_1.ConditionalStringValue(() => {
|
|
138
|
-
var _a, _b;
|
|
139
136
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
140
|
-
if (
|
|
141
|
-
|
|
137
|
+
if (activeContentControl?.viewport?.view.is3d() &&
|
|
138
|
+
activeContentControl?.viewport?.isCameraOn) {
|
|
142
139
|
return appui_abstract_1.IconSpecUtilities.createWebComponentIconSpec(camera_animation_svg_1.default);
|
|
143
140
|
}
|
|
144
141
|
return appui_abstract_1.IconSpecUtilities.createWebComponentIconSpec(camera_animation_disabled_svg_1.default);
|
|
@@ -148,10 +145,9 @@ class CoreTools {
|
|
|
148
145
|
SyncUiEventDispatcher_1.SyncUiEventId.ViewStateChanged,
|
|
149
146
|
]),
|
|
150
147
|
label: new appui_abstract_1.ConditionalStringValue(() => {
|
|
151
|
-
var _a, _b;
|
|
152
148
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
153
|
-
if (
|
|
154
|
-
|
|
149
|
+
if (activeContentControl?.viewport?.view.is3d() &&
|
|
150
|
+
activeContentControl?.viewport?.isCameraOn) {
|
|
155
151
|
return UiFramework_1.UiFramework.translate("tools.View.ToggleCamera.turnOffFlyover");
|
|
156
152
|
}
|
|
157
153
|
return UiFramework_1.UiFramework.translate("tools.View.ToggleCamera.turnOnFlyover");
|
|
@@ -162,10 +158,9 @@ class CoreTools {
|
|
|
162
158
|
]),
|
|
163
159
|
description: core_frontend_1.ViewToggleCameraTool.description,
|
|
164
160
|
isHidden: new appui_abstract_1.ConditionalBooleanValue(() => {
|
|
165
|
-
var _a, _b;
|
|
166
161
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
167
|
-
return !(
|
|
168
|
-
|
|
162
|
+
return !(activeContentControl?.viewport?.view.is3d() &&
|
|
163
|
+
activeContentControl?.viewport?.view.supportsCamera());
|
|
169
164
|
}, [
|
|
170
165
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveContentChanged,
|
|
171
166
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveViewportChanged,
|
|
@@ -292,9 +287,8 @@ class CoreTools {
|
|
|
292
287
|
labelKey: "UiFramework:tools.sectionTools",
|
|
293
288
|
iconSpec: appui_abstract_1.IconSpecUtilities.createWebComponentIconSpec(section_tool_svg_1.default),
|
|
294
289
|
isHidden: new appui_abstract_1.ConditionalBooleanValue(() => {
|
|
295
|
-
var _a;
|
|
296
290
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
297
|
-
return !!
|
|
291
|
+
return !!activeContentControl?.viewport?.view.is2d();
|
|
298
292
|
}, [
|
|
299
293
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveContentChanged,
|
|
300
294
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveViewportChanged,
|
|
@@ -320,9 +314,8 @@ class CoreTools {
|
|
|
320
314
|
panelLabelKey: "UiFramework:tools.sectionPanelLabel",
|
|
321
315
|
iconSpec: appui_abstract_1.IconSpecUtilities.createWebComponentIconSpec(section_tool_svg_1.default),
|
|
322
316
|
isHidden: new appui_abstract_1.ConditionalBooleanValue(() => {
|
|
323
|
-
var _a;
|
|
324
317
|
const activeContentControl = UiFramework_1.UiFramework.content.getActiveContentControl();
|
|
325
|
-
return !!
|
|
318
|
+
return !!activeContentControl?.viewport?.view.is2d();
|
|
326
319
|
}, [
|
|
327
320
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveContentChanged,
|
|
328
321
|
SyncUiEventDispatcher_1.SyncUiEventId.ActiveViewportChanged,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../../src/appui-react/tools/CoreToolDefinitions.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B,CAAC,6BAA6B;AAC7D,wDAqB8B;AAC9B,0DAI+B;AAC/B,kFAAuF;AACvF,6DAA0D;AAC1D,uDAAoD;AACpD,2EAAgE;AAChE,oDAAoD;AACpD,2DAAkE;AAClE,gDAA6C;AAC7C,0FAAkF;AAClF,4GAAmG;AACnG,8EAAsE;AACtE,kFAAyE;AACzE,oFAA2E;AAC3E,0FAAiF;AACjF,oEAAoE;AAEpE;;GAEG;AACH,uBAAuB;AACvB,MAAa,SAAS;IACb,MAAM,KAAK,yBAAyB;QACzC,OAAO,IAAI,yBAAW,CAAC;YACrB,MAAM,EAAE,kBAAkB;YAC1B,QAAQ,EAAE,oBAAC,gCAAU,OAAG;YACxB,QAAQ,EAAE,gCAAgC;YAC1C,OAAO,EAAE,GAAG,EAAE;gBACZ,yBAAS,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACvC,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,cAAc;QAC9B,OAAO,IAAI,yBAAW,CAAC;YACrB,MAAM,EAAE,2BAAW,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AC;YACpD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qCAAqC;QACrD,OAAO,IAAI,yBAAW,CAAC;YACrB,MAAM,EAAE,+CAA2B,CAAC,MAAM;YAC1C,QAAQ,EAAE,+CAA2B,CAAC,QAAQ;YAC9C,KAAK,EAAE,+CAA2B,CAAC,OAAO;YAC1C,WAAW,EAAE,+CAA2B,CAAC,WAAW;YACpD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,yBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,+CAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA7dD,8BA6dC","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 Tools\n */\n\nimport * as React from \"react\"; // cSpell:ignore keyinbrowser\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n IconSpecUtilities,\n} from \"@itwin/appui-abstract\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher\";\nimport { GroupItemDef } from \"../toolbar/GroupItem\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool\";\nimport { UiFramework } from \"../UiFramework\";\nimport cameraAnimationIcon from \"@itwin/itwinui-icons/icons/camera-animation.svg\";\nimport cameraAnimationDisabledIcon from \"@itwin/itwinui-icons/icons/camera-animation-disabled.svg\";\nimport svgGyroscope from \"@bentley/icons-generic/icons/gyroscope.svg\";\nimport svgRotateLeft from \"@bentley/icons-generic/icons/rotate-left.svg\";\nimport svgSectionTool from \"@bentley/icons-generic/icons/section-tool.svg\";\nimport svgSelectionClear from \"@bentley/icons-generic/icons/selection-clear.svg\";\nimport { SvgMeasure, SvgProcess } from \"@itwin/itwinui-icons-react\";\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n */\n// istanbul ignore next\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n iconSpec: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n IModelApp.uiAdmin.showKeyinPalette();\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl?.viewport?.view.is2d())\n return IconSpecUtilities.createWebComponentIconSpec(svgRotateLeft);\n return IconSpecUtilities.createWebComponentIconSpec(svgGyroscope);\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return IconSpecUtilities.createWebComponentIconSpec(\n cameraAnimationIcon\n );\n }\n return IconSpecUtilities.createWebComponentIconSpec(\n cameraAnimationDisabledIcon\n );\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !(\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.view.supportsCamera()\n );\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isUndoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isRedoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgSectionTool),\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgSectionTool),\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n iconSpec: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgSelectionClear),\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CoreToolDefinitions.js","sourceRoot":"","sources":["../../../../src/appui-react/t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,EAAE,CAAC;gBAC3D,IAAI,gBAAgB,EAAE;oBACpB,gBAAgB,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;iBAC1C;gBACD,MAAM,IAAI,GAAG,yBAAS,CAAC,SAAS,CAAC,aAAa,CAAC;gBAC/C,IAAI,IAAI;oBAAE,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;;oBAChC,MAAM,yBAAS,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC;YACpD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,KAAK,qCAAqC;QACrD,OAAO,IAAI,yBAAW,CAAC;YACrB,MAAM,EAAE,+CAA2B,CAAC,MAAM;YAC1C,QAAQ,EAAE,+CAA2B,CAAC,QAAQ;YAC9C,KAAK,EAAE,+CAA2B,CAAC,OAAO;YAC1C,WAAW,EAAE,+CAA2B,CAAC,WAAW;YACpD,OAAO,EAAE,KAAK,IAAI,EAAE;gBAClB,OAAO,yBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,+CAA2B,CAAC,MAAM,CAAC,CAAC;YACjE,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AA7dD,8BA6dC","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 Tools\n */\n\nimport * as React from \"react\"; // cSpell:ignore keyinbrowser\nimport {\n FitViewTool,\n FlyViewTool,\n IModelApp,\n MeasureDistanceTool,\n MeasureLocationTool,\n PanViewTool,\n RotateViewTool,\n SelectionTool,\n SetupWalkCameraTool,\n ViewClipByElementTool,\n ViewClipByPlaneTool,\n ViewClipByRangeTool,\n ViewClipByShapeTool,\n ViewClipDecorationProvider,\n ViewRedoTool,\n ViewToggleCameraTool,\n ViewUndoTool,\n WalkViewTool,\n WindowAreaTool,\n ZoomViewTool,\n} from \"@itwin/core-frontend\";\nimport {\n ConditionalBooleanValue,\n ConditionalStringValue,\n IconSpecUtilities,\n} from \"@itwin/appui-abstract\";\nimport { getIsHiddenIfSelectionNotActive } from \"../selection/SelectionContextItemDef\";\nimport { CommandItemDef } from \"../shared/CommandItemDef\";\nimport { ToolItemDef } from \"../shared/ToolItemDef\";\nimport { SyncUiEventId } from \"../syncui/SyncUiEventDispatcher\";\nimport { GroupItemDef } from \"../toolbar/GroupItem\";\nimport { RestoreFrontstageLayoutTool } from \"./RestoreLayoutTool\";\nimport { UiFramework } from \"../UiFramework\";\nimport cameraAnimationIcon from \"@itwin/itwinui-icons/icons/camera-animation.svg\";\nimport cameraAnimationDisabledIcon from \"@itwin/itwinui-icons/icons/camera-animation-disabled.svg\";\nimport svgGyroscope from \"@bentley/icons-generic/icons/gyroscope.svg\";\nimport svgRotateLeft from \"@bentley/icons-generic/icons/rotate-left.svg\";\nimport svgSectionTool from \"@bentley/icons-generic/icons/section-tool.svg\";\nimport svgSelectionClear from \"@bentley/icons-generic/icons/selection-clear.svg\";\nimport { SvgMeasure, SvgProcess } from \"@itwin/itwinui-icons-react\";\n\n/** Utility Class that provides definitions of tools provided by the ($core-frontend) core. These definitions can be used to populate the UI.\n * @public\n */\n// istanbul ignore next\nexport class CoreTools {\n public static get keyinPaletteButtonItemDef() {\n return new ToolItemDef({\n toolId: \"uif:keyinpalette\",\n iconSpec: <SvgProcess />,\n labelKey: \"UiFramework:keyinbrowser.label\",\n execute: () => {\n IModelApp.uiAdmin.showKeyinPalette();\n },\n });\n }\n\n public static get fitViewCommand() {\n return new ToolItemDef({\n toolId: FitViewTool.toolId,\n iconSpec: FitViewTool.iconSpec,\n label: FitViewTool.flyover,\n description: FitViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FitViewTool.toolId,\n IModelApp.viewManager.selectedView,\n true\n ),\n });\n }\n\n public static get windowAreaCommand() {\n return new ToolItemDef({\n toolId: WindowAreaTool.toolId,\n iconSpec: WindowAreaTool.iconSpec,\n label: WindowAreaTool.flyover,\n description: WindowAreaTool.description,\n execute: async () =>\n IModelApp.tools.run(\n WindowAreaTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get zoomViewCommand() {\n return new ToolItemDef({\n toolId: ZoomViewTool.toolId,\n iconSpec: ZoomViewTool.iconSpec,\n label: ZoomViewTool.flyover,\n description: ZoomViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ZoomViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get panViewCommand() {\n return new ToolItemDef({\n toolId: PanViewTool.toolId,\n iconSpec: PanViewTool.iconSpec,\n label: PanViewTool.flyover,\n description: PanViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n PanViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get rotateViewCommand() {\n return new ToolItemDef({\n toolId: RotateViewTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl?.viewport?.view.is2d())\n return IconSpecUtilities.createWebComponentIconSpec(svgRotateLeft);\n return IconSpecUtilities.createWebComponentIconSpec(svgGyroscope);\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: RotateViewTool.flyover,\n description: RotateViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n RotateViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get walkViewCommand() {\n return new ToolItemDef({\n toolId: WalkViewTool.toolId,\n iconSpec: WalkViewTool.iconSpec,\n label: WalkViewTool.flyover,\n description: WalkViewTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n WalkViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get selectElementCommand() {\n return new ToolItemDef({\n toolId: SelectionTool.toolId,\n iconSpec: SelectionTool.iconSpec,\n label: SelectionTool.flyover,\n description: SelectionTool.description,\n execute: async () => IModelApp.tools.run(SelectionTool.toolId),\n });\n }\n\n public static get setupCameraWalkTool() {\n return new ToolItemDef({\n toolId: SetupWalkCameraTool.toolId,\n iconSpec: SetupWalkCameraTool.iconSpec,\n label: SetupWalkCameraTool.flyover,\n description: SetupWalkCameraTool.description,\n execute: async () => IModelApp.tools.run(SetupWalkCameraTool.toolId),\n });\n }\n\n public static get toggleCameraViewCommand() {\n return new ToolItemDef({\n toolId: ViewToggleCameraTool.toolId,\n iconSpec: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return IconSpecUtilities.createWebComponentIconSpec(\n cameraAnimationIcon\n );\n }\n return IconSpecUtilities.createWebComponentIconSpec(\n cameraAnimationDisabledIcon\n );\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n label: new ConditionalStringValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.isCameraOn\n ) {\n return UiFramework.translate(\n \"tools.View.ToggleCamera.turnOffFlyover\"\n );\n }\n return UiFramework.translate(\"tools.View.ToggleCamera.turnOnFlyover\");\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n description: ViewToggleCameraTool.description,\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !(\n activeContentControl?.viewport?.view.is3d() &&\n activeContentControl?.viewport?.view.supportsCamera()\n );\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n execute: async () =>\n IModelApp.tools.run(\n ViewToggleCameraTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get flyViewCommand() {\n return new ToolItemDef({\n toolId: FlyViewTool.toolId,\n iconSpec: FlyViewTool.iconSpec,\n label: FlyViewTool.flyover,\n description: FlyViewTool.description,\n execute: async () =>\n IModelApp.tools.run(\n FlyViewTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n // TODO - Need to provide a sync message that is fired when the Undo/Redo button needs to be refreshed in the\n // active view.\n public static get viewUndoCommand() {\n return new ToolItemDef({\n toolId: ViewUndoTool.toolId,\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isUndoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n iconSpec: ViewUndoTool.iconSpec,\n label: ViewUndoTool.flyover,\n description: ViewUndoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewUndoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n });\n }\n\n public static get viewRedoCommand() {\n return new ToolItemDef({\n toolId: ViewRedoTool.toolId,\n iconSpec: ViewRedoTool.iconSpec,\n label: ViewRedoTool.flyover,\n description: ViewRedoTool.description,\n execute: async () =>\n IModelApp.tools.run(\n ViewRedoTool.toolId,\n IModelApp.viewManager.selectedView\n ),\n isDisabled: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n if (activeContentControl && activeContentControl.viewport)\n return !activeContentControl.viewport.isRedoPossible;\n return false;\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n });\n }\n\n private static turnOnClipVolume() {\n const vp = IModelApp.viewManager.selectedView;\n if (!vp || !vp.view.is3d()) return;\n\n // Turn on clip volume flag for section tools\n vp.viewFlags = vp.viewFlags.with(\"clipVolume\", true);\n }\n\n // note current ViewClipByPlaneTool is not automatically registered so the app must call ViewClipByPlaneTool.register();\n public static get sectionByPlaneCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByPlaneTool.toolId,\n iconSpec: ViewClipByPlaneTool.iconSpec,\n label: ViewClipByPlaneTool.flyover,\n description: ViewClipByPlaneTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByPlaneTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByElementTool is not automatically registered so the app must call ViewClipByElementTool.register();\n public static get sectionByElementCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByElementTool.toolId,\n iconSpec: ViewClipByElementTool.iconSpec,\n label: ViewClipByElementTool.flyover,\n description: ViewClipByElementTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByElementTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByRangeTool is not automatically registered so the app must call ViewClipByRangeTool.register();\n public static get sectionByRangeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByRangeTool.toolId,\n iconSpec: ViewClipByRangeTool.iconSpec,\n label: ViewClipByRangeTool.flyover,\n description: ViewClipByRangeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByRangeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n // note current ViewClipByShapeTool is not automatically registered so the app must call ViewClipByShapeTool.register();\n public static get sectionByShapeCommandItemDef() {\n return new ToolItemDef({\n toolId: ViewClipByShapeTool.toolId,\n iconSpec: ViewClipByShapeTool.iconSpec,\n label: ViewClipByShapeTool.flyover,\n description: ViewClipByShapeTool.description,\n execute: async () => {\n this.turnOnClipVolume();\n return IModelApp.tools.run(\n ViewClipByShapeTool.toolId,\n ViewClipDecorationProvider.create()\n );\n },\n });\n }\n\n public static get sectionToolGroup() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group\",\n labelKey: \"UiFramework:tools.sectionTools\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgSectionTool),\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n this.sectionByPlaneCommandItemDef,\n this.sectionByElementCommandItemDef,\n this.sectionByRangeCommandItemDef,\n this.sectionByShapeCommandItemDef,\n ],\n itemsInColumn: 4,\n });\n }\n\n public static get sectionToolGroupWithPanel() {\n ViewClipByElementTool.register();\n ViewClipByPlaneTool.register();\n ViewClipByRangeTool.register();\n ViewClipByShapeTool.register();\n\n return new GroupItemDef({\n groupId: \"sectionTools-group-with-panel\",\n labelKey: \"UiFramework:tools.sectionTools\",\n panelLabelKey: \"UiFramework:tools.sectionPanelLabel\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgSectionTool),\n isHidden: new ConditionalBooleanValue(() => {\n const activeContentControl =\n UiFramework.content.getActiveContentControl();\n return !!activeContentControl?.viewport?.view.is2d();\n }, [\n SyncUiEventId.ActiveContentChanged,\n SyncUiEventId.ActiveViewportChanged,\n SyncUiEventId.ViewStateChanged,\n ]),\n items: [\n new ToolItemDef({\n ...this.sectionByPlaneCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByPlane\",\n }),\n new ToolItemDef({\n ...this.sectionByElementCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByElement\",\n }),\n new ToolItemDef({\n ...this.sectionByRangeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByRange\",\n }),\n new ToolItemDef({\n ...this.sectionByShapeCommandItemDef,\n labelKey: \"UiFramework:tools.sectionByShape\",\n }),\n ],\n itemsInColumn: 4,\n });\n }\n\n // note current MeasureDistanceTool is not automatically registered so the app must call MeasureDistanceTool.register();\n public static get measureDistanceToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureDistanceTool.toolId,\n iconSpec: MeasureDistanceTool.iconSpec,\n label: MeasureDistanceTool.flyover,\n description: MeasureDistanceTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureDistanceTool.toolId);\n },\n });\n }\n\n // note current MeasureLocationTool is not automatically registered so the app must call MeasureLocationTool.register();\n public static get measureLocationToolItemDef() {\n return new ToolItemDef({\n toolId: MeasureLocationTool.toolId,\n iconSpec: MeasureLocationTool.iconSpec,\n label: MeasureLocationTool.flyover,\n description: MeasureLocationTool.description,\n execute: async () => {\n return IModelApp.tools.run(MeasureLocationTool.toolId);\n },\n });\n }\n\n public static get measureToolGroup() {\n MeasureDistanceTool.register();\n MeasureLocationTool.register();\n\n return new GroupItemDef({\n groupId: \"measureTools-group\",\n labelKey: \"UiFramework:tools.measureTools\",\n iconSpec: <SvgMeasure />,\n items: [this.measureDistanceToolItemDef, this.measureLocationToolItemDef],\n itemsInColumn: 2,\n });\n }\n\n public static get clearSelectionItemDef() {\n return new CommandItemDef({\n commandId: \"UiFramework.ClearSelection\",\n iconSpec: IconSpecUtilities.createWebComponentIconSpec(svgSelectionClear),\n labelKey: \"UiFramework:buttons.clearSelection\",\n isHidden: getIsHiddenIfSelectionNotActive(),\n execute: async () => {\n const iModelConnection = UiFramework.getIModelConnection();\n if (iModelConnection) {\n iModelConnection.selectionSet.emptyAll();\n }\n const tool = IModelApp.toolAdmin.primitiveTool;\n if (tool) await tool.onRestartTool();\n else await IModelApp.toolAdmin.startDefaultTool();\n },\n });\n }\n\n public static get restoreFrontstageLayoutCommandItemDef() {\n return new ToolItemDef({\n toolId: RestoreFrontstageLayoutTool.toolId,\n iconSpec: RestoreFrontstageLayoutTool.iconSpec,\n label: RestoreFrontstageLayoutTool.flyover,\n description: RestoreFrontstageLayoutTool.description,\n execute: async () => {\n return IModelApp.tools.run(RestoreFrontstageLayoutTool.toolId);\n },\n });\n }\n}\n"]}
|
|
@@ -23,9 +23,10 @@ class ToolSettingsUiDataProvider extends appui_abstract_1.UiLayoutDataProvider {
|
|
|
23
23
|
super(...arguments);
|
|
24
24
|
// send property changes from UI back to tool
|
|
25
25
|
this.applyUiPropertyChange = (syncItem) => {
|
|
26
|
-
var _a;
|
|
27
26
|
// istanbul ignore next
|
|
28
|
-
|
|
27
|
+
core_frontend_1.IModelApp.toolAdmin.activeTool
|
|
28
|
+
?.applyToolSettingPropertyChange(syncItem)
|
|
29
|
+
.catch((err) => core_bentley_1.UnexpectedErrors.handle(err));
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
supplyDialogItems() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultToolSettingsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/toolsettings/DefaultToolSettingsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAiD;AAEjD,0DAA6D;AAE7D,yEAAsE;AACtE,yFAAsF;AAEtF,qDAAkD;AAClD,gDAA6C;AAC7C,sDAAuD;AAEvD,gBAAgB;AAEhB,yEAAyE;AACzE,MAAM,0BAA2B,SAAQ,qCAAoB;IAA7D;;QAKE,6CAA6C;QAC7B,0BAAqB,GAAG,CACtC,QAAgC,EAChC,EAAE
|
|
1
|
+
{"version":3,"file":"DefaultToolSettingsProvider.js","sourceRoot":"","sources":["../../../../src/appui-react/toolsettings/DefaultToolSettingsProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAEH,+BAA+B;AAC/B,wDAAiD;AAEjD,0D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,GAAG,EAAE,CAAC;SACtC;QACD,sHAAsH;QACtH,0DAA0D;QAC1D,yBAAW,CAAC,WAAW,CAAC,yBAAyB,CAAC,IAAI,EAAE,CAAC;IAC3D,CAAC;IAEe,wBAAwB;QACtC,wDAAwD;QACxD,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,CAAC,uBAAuB,EAAE,CAAC;IACjC,CAAC;IAED,6DAA6D;IAC7C,YAAY;QAC1B,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClC,CAAC;IAED,gFAAgF;IAChE,0BAA0B,CACxC,IAAyC;QAEzC,IAAI,CAAC,cAAc,CAAC,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;CACF;AAjDD,kEAiDC;AAED,yBAAW,CAAC,QAAQ,CAAC,QAAQ,CAC3B,qBAAqB,EACrB,2BAA2B,CAC5B,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 ToolSettings\n */\n\nimport * as React from \"react\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport type { DialogItem, DialogPropertySyncItem } from \"@itwin/appui-abstract\";\nimport { UiLayoutDataProvider } from \"@itwin/appui-abstract\";\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl\";\nimport { ComponentGenerator } from \"../uiprovider/ComponentGenerator\";\nimport { DefaultDialogGridContainer } from \"../uiprovider/DefaultDialogGridContainer\";\nimport type { SyncToolSettingsPropertiesEventArgs } from \"../framework/FrameworkToolSettings\";\nimport { ToolUiProvider } from \"./ToolUiProvider\";\nimport { UiFramework } from \"../UiFramework\";\nimport { UnexpectedErrors } from \"@itwin/core-bentley\";\n\n/** @internal */\n\n/** ToolSettingsUiDataProvider keeps tool data in sync with UI display */\nclass ToolSettingsUiDataProvider extends UiLayoutDataProvider {\n public override supplyDialogItems(): DialogItem[] | undefined {\n return UiFramework.toolSettings.toolSettingsProperties;\n }\n\n // send property changes from UI back to tool\n public override applyUiPropertyChange = (\n syncItem: DialogPropertySyncItem\n ) => {\n // istanbul ignore next\n IModelApp.toolAdmin.activeTool\n ?.applyToolSettingPropertyChange(syncItem)\n .catch((err) => UnexpectedErrors.handle(err));\n };\n}\n\n/** ToolUiProvider class that informs ConfigurableUi that Tool Settings are provided for the specified tool.\n * @internal\n */\nexport class DefaultToolSettingsProvider extends ToolUiProvider {\n constructor(info: ConfigurableCreateInfo, options: any) {\n super(info, options);\n this._dataProvider = new ToolSettingsUiDataProvider();\n }\n\n public get uiDataProvider() {\n return this._dataProvider as ToolSettingsUiDataProvider;\n }\n\n public updateToolSettingsNodes(): void {\n // istanbul ignore else\n if (this.uiDataProvider.layoutDialogRows()) {\n const componentGenerator = new ComponentGenerator(this.uiDataProvider);\n\n this.toolSettingsNode = (\n <DefaultDialogGridContainer\n componentGenerator={componentGenerator}\n isToolSettings={true}\n />\n );\n this.horizontalToolSettingNodes =\n componentGenerator.getToolSettingsEntries();\n } else {\n this.toolSettingsNode = null;\n this.horizontalToolSettingNodes = [];\n }\n // We emit the UiFramework.frontstages.onToolSettingsReloadEvent event here because the Frontstage Manager is a static\n // class that UI components can easily register listeners.\n UiFramework.frontstages.onToolSettingsReloadEvent.emit();\n }\n\n public override reloadPropertiesFromTool(): void {\n // trigger the items to be reloaded from the active tool\n this.uiDataProvider.reloadDialogItems(false);\n this.updateToolSettingsNodes();\n }\n\n // called when tool is activated to repopulate tool settings.\n public override onInitialize(): void {\n this.reloadPropertiesFromTool();\n }\n\n // called to process UiFramework.toolSettings.onSyncToolSettingsProperties event\n public override syncToolSettingsProperties(\n args: SyncToolSettingsPropertiesEventArgs\n ): void {\n this.uiDataProvider.fireSyncPropertiesEvent(args.syncProperties);\n }\n}\n\nUiFramework.controls.register(\n \"DefaultToolSettings\",\n DefaultToolSettingsProvider\n);\n"]}
|