@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.
- package/CHANGELOG.md +27 -0
- package/lib/appui-react/UiFramework.js +20 -13
- package/lib/appui-react/UiFramework.js.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawPopupManager.js +1 -1
- package/lib/appui-react/accudraw/AccuDrawPopupManager.js.map +1 -1
- package/lib/appui-react/accudraw/AccuDrawWidget.js +1 -1
- package/lib/appui-react/accudraw/AccuDrawWidget.js.map +1 -1
- package/lib/appui-react/accudraw/Calculator.js +92 -98
- package/lib/appui-react/accudraw/Calculator.js.map +1 -1
- package/lib/appui-react/accudraw/CalculatorEngine.js +130 -129
- package/lib/appui-react/accudraw/CalculatorEngine.js.map +1 -1
- package/lib/appui-react/accudraw/CalculatorPopup.js +9 -12
- package/lib/appui-react/accudraw/CalculatorPopup.js.map +1 -1
- package/lib/appui-react/accudraw/FrameworkAccuDraw.js +39 -38
- package/lib/appui-react/accudraw/FrameworkAccuDraw.js.map +1 -1
- package/lib/appui-react/accudraw/MenuButton.js +20 -20
- package/lib/appui-react/accudraw/MenuButton.js.map +1 -1
- package/lib/appui-react/accudraw/MenuButtonPopup.js +9 -12
- package/lib/appui-react/accudraw/MenuButtonPopup.js.map +1 -1
- package/lib/appui-react/backstage/BackstageItemsManager.js +5 -5
- package/lib/appui-react/backstage/BackstageItemsManager.js.map +1 -1
- package/lib/appui-react/backstage/BackstageManager.js +1 -3
- package/lib/appui-react/backstage/BackstageManager.js.map +1 -1
- package/lib/appui-react/backstage/InternalBackstageManager.js +3 -5
- package/lib/appui-react/backstage/InternalBackstageManager.js.map +1 -1
- package/lib/appui-react/childwindow/InternalChildWindowManager.js +30 -32
- package/lib/appui-react/childwindow/InternalChildWindowManager.js.map +1 -1
- package/lib/appui-react/configurableui/ActivityTracker.js +33 -33
- package/lib/appui-react/configurableui/ActivityTracker.js.map +1 -1
- package/lib/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
- package/lib/appui-react/configurableui/ConfigurableUiControl.js +8 -0
- package/lib/appui-react/configurableui/ConfigurableUiControl.js.map +1 -1
- package/lib/appui-react/configurableui/InternalConfigurableUiManager.js +8 -8
- package/lib/appui-react/configurableui/InternalConfigurableUiManager.js.map +1 -1
- package/lib/appui-react/configurableui/TimeTracker.js +25 -27
- package/lib/appui-react/configurableui/TimeTracker.js.map +1 -1
- package/lib/appui-react/content/ContentControl.js +2 -1
- package/lib/appui-react/content/ContentControl.js.map +1 -1
- package/lib/appui-react/content/ContentGroup.js +8 -4
- package/lib/appui-react/content/ContentGroup.js.map +1 -1
- package/lib/appui-react/content/ContentLayout.js +47 -38
- package/lib/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/appui-react/content/IModelViewport.js +28 -23
- package/lib/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/appui-react/content/InternalContentLayoutManager.js +1 -1
- package/lib/appui-react/content/InternalContentLayoutManager.js.map +1 -1
- package/lib/appui-react/content/InternalContentViewManager.js +9 -8
- package/lib/appui-react/content/InternalContentViewManager.js.map +1 -1
- package/lib/appui-react/content/StandardContentLayouts.js +141 -141
- package/lib/appui-react/content/StandardContentLayouts.js.map +1 -1
- package/lib/appui-react/content/ViewportContentControl.js +25 -22
- package/lib/appui-react/content/ViewportContentControl.js.map +1 -1
- package/lib/appui-react/cursor/CursorInformation.js +7 -6
- package/lib/appui-react/cursor/CursorInformation.js.map +1 -1
- package/lib/appui-react/cursor/cursorpopup/CursorPopup.js +9 -9
- package/lib/appui-react/cursor/cursorpopup/CursorPopup.js.map +1 -1
- package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js +7 -7
- package/lib/appui-react/cursor/cursorpopup/CursorPopupManager.js.map +1 -1
- package/lib/appui-react/dialog/DialogManagerBase.js +18 -19
- package/lib/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/appui-react/dialog/InternalContentDialogManager.js +7 -7
- package/lib/appui-react/dialog/InternalContentDialogManager.js.map +1 -1
- package/lib/appui-react/dialog/InternalModalDialogManager.js +4 -4
- package/lib/appui-react/dialog/InternalModalDialogManager.js.map +1 -1
- package/lib/appui-react/dialog/InternalModelessDialogManager.js +6 -6
- package/lib/appui-react/dialog/InternalModelessDialogManager.js.map +1 -1
- package/lib/appui-react/dialog/ModelessDialog.js +3 -3
- package/lib/appui-react/dialog/ModelessDialog.js.map +1 -1
- package/lib/appui-react/feedback/ElementTooltip.js +3 -1
- package/lib/appui-react/feedback/ElementTooltip.js.map +1 -1
- package/lib/appui-react/feedback/ValidationTextbox.js +25 -25
- package/lib/appui-react/feedback/ValidationTextbox.js.map +1 -1
- package/lib/appui-react/frontstage/FrontstageDef.js +28 -10
- package/lib/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/appui-react/frontstage/InternalFrontstageManager.js +96 -96
- package/lib/appui-react/frontstage/InternalFrontstageManager.js.map +1 -1
- package/lib/appui-react/frontstage/ModalFrontstage.js +5 -5
- package/lib/appui-react/frontstage/ModalFrontstage.js.map +1 -1
- package/lib/appui-react/frontstage/ModalSettingsStage.js +5 -4
- package/lib/appui-react/frontstage/ModalSettingsStage.js.map +1 -1
- package/lib/appui-react/frontstage/StandardFrontstageProvider.js +1 -0
- package/lib/appui-react/frontstage/StandardFrontstageProvider.js.map +1 -1
- package/lib/appui-react/keyboardshortcut/InternalKeyboardShortcut.js +22 -22
- package/lib/appui-react/keyboardshortcut/InternalKeyboardShortcut.js.map +1 -1
- package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js +11 -9
- package/lib/appui-react/keyboardshortcut/KeyboardShortcut.js.map +1 -1
- package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js +17 -20
- package/lib/appui-react/keyboardshortcut/KeyboardShortcutMenu.js.map +1 -1
- package/lib/appui-react/layout/backstage/Backstage.js +11 -14
- package/lib/appui-react/layout/backstage/Backstage.js.map +1 -1
- package/lib/appui-react/layout/base/DragManager.js +6 -7
- package/lib/appui-react/layout/base/DragManager.js.map +1 -1
- package/lib/appui-react/layout/base/SafeAreaInsets.js +8 -8
- package/lib/appui-react/layout/base/SafeAreaInsets.js.map +1 -1
- package/lib/appui-react/layout/popup/Tooltip.js +8 -11
- package/lib/appui-react/layout/popup/Tooltip.js.map +1 -1
- package/lib/appui-react/layout/state/NineZoneStateReducer.d.ts.map +1 -1
- package/lib/appui-react/layout/state/NineZoneStateReducer.js +8 -4
- package/lib/appui-react/layout/state/NineZoneStateReducer.js.map +1 -1
- package/lib/appui-react/layout/widget/Overflow.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/Overflow.js +11 -17
- package/lib/appui-react/layout/widget/Overflow.js.map +1 -1
- package/lib/appui-react/layout/widget/Overflow.scss +3 -48
- package/lib/appui-react/layout/widget/Tab.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/Tab.js +7 -5
- package/lib/appui-react/layout/widget/Tab.js.map +1 -1
- package/lib/appui-react/messages/InputField.js +21 -24
- package/lib/appui-react/messages/InputField.js.map +1 -1
- package/lib/appui-react/messages/MessageManager.js +39 -38
- package/lib/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/appui-react/messages/Pointer.js +38 -38
- package/lib/appui-react/messages/Pointer.js.map +1 -1
- package/lib/appui-react/messages/ReactNotifyMessageDetails.js +6 -0
- package/lib/appui-react/messages/ReactNotifyMessageDetails.js.map +1 -1
- package/lib/appui-react/messages/StatusMessageManager.js +2 -4
- package/lib/appui-react/messages/StatusMessageManager.js.map +1 -1
- package/lib/appui-react/navigationaids/CubeNavigationAidControl.js +1 -1
- package/lib/appui-react/navigationaids/CubeNavigationAidControl.js.map +1 -1
- package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js +1 -1
- package/lib/appui-react/navigationaids/DrawingNavigationAidControl.js.map +1 -1
- package/lib/appui-react/navigationaids/NavigationAidControl.js +1 -0
- package/lib/appui-react/navigationaids/NavigationAidControl.js.map +1 -1
- package/lib/appui-react/navigationaids/SheetNavigationAid.js +55 -54
- package/lib/appui-react/navigationaids/SheetNavigationAid.js.map +1 -1
- package/lib/appui-react/navigationaids/SheetsModalFrontstage.js +22 -20
- package/lib/appui-react/navigationaids/SheetsModalFrontstage.js.map +1 -1
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js +15 -14
- package/lib/appui-react/navigationaids/StandardRotationNavigationAid.js.map +1 -1
- package/lib/appui-react/pickers/ListPicker.js +28 -28
- package/lib/appui-react/pickers/ListPicker.js.map +1 -1
- package/lib/appui-react/pickers/ViewSelector.js +87 -86
- package/lib/appui-react/pickers/ViewSelector.js.map +1 -1
- package/lib/appui-react/popup/CardPopup.js +18 -21
- package/lib/appui-react/popup/CardPopup.js.map +1 -1
- package/lib/appui-react/popup/HTMLElementPopup.js +9 -12
- package/lib/appui-react/popup/HTMLElementPopup.js.map +1 -1
- package/lib/appui-react/popup/InputEditorPopup.js +18 -20
- package/lib/appui-react/popup/InputEditorPopup.js.map +1 -1
- package/lib/appui-react/popup/PopupManager.js +22 -25
- package/lib/appui-react/popup/PopupManager.js.map +1 -1
- package/lib/appui-react/popup/ToolSettingsPopup.js +17 -17
- package/lib/appui-react/popup/ToolSettingsPopup.js.map +1 -1
- package/lib/appui-react/popup/ToolbarPopup.js +18 -21
- package/lib/appui-react/popup/ToolbarPopup.js.map +1 -1
- package/lib/appui-react/redux/ReducerRegistry.js +2 -0
- package/lib/appui-react/redux/ReducerRegistry.js.map +1 -1
- package/lib/appui-react/redux/StateManager.js +4 -1
- package/lib/appui-react/redux/StateManager.js.map +1 -1
- package/lib/appui-react/selection/HideIsolateEmphasizeManager.js +7 -3
- package/lib/appui-react/selection/HideIsolateEmphasizeManager.js.map +1 -1
- package/lib/appui-react/shared/ActionButtonItemDef.js +13 -6
- package/lib/appui-react/shared/ActionButtonItemDef.js.map +1 -1
- package/lib/appui-react/shared/CommandItemDef.js +3 -3
- package/lib/appui-react/shared/CommandItemDef.js.map +1 -1
- package/lib/appui-react/shared/CustomItemDef.js +4 -2
- package/lib/appui-react/shared/CustomItemDef.js.map +1 -1
- package/lib/appui-react/shared/ItemDefBase.js +13 -5
- package/lib/appui-react/shared/ItemDefBase.js.map +1 -1
- package/lib/appui-react/shared/MenuItem.js +6 -1
- package/lib/appui-react/shared/MenuItem.js.map +1 -1
- package/lib/appui-react/shared/ToolItemDef.js +1 -1
- package/lib/appui-react/shared/ToolItemDef.js.map +1 -1
- package/lib/appui-react/stagepanels/StagePanelDef.js +4 -3
- package/lib/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/appui-react/statusbar/StatusBarItemsManager.js +5 -5
- package/lib/appui-react/statusbar/StatusBarItemsManager.js.map +1 -1
- package/lib/appui-react/statusfields/ViewAttributes.js +16 -16
- package/lib/appui-react/statusfields/ViewAttributes.js.map +1 -1
- package/lib/appui-react/statusfields/tileloading/TileLoadingIndicator.js +35 -33
- package/lib/appui-react/statusfields/tileloading/TileLoadingIndicator.js.map +1 -1
- package/lib/appui-react/syncui/InternalSyncUiEventDispatcher.js +7 -0
- package/lib/appui-react/syncui/InternalSyncUiEventDispatcher.js.map +1 -1
- package/lib/appui-react/syncui/SyncUiEventDispatcher.js +4 -3
- package/lib/appui-react/syncui/SyncUiEventDispatcher.js.map +1 -1
- package/lib/appui-react/timeline/AnalysisAnimationProvider.js +9 -8
- package/lib/appui-react/timeline/AnalysisAnimationProvider.js.map +1 -1
- package/lib/appui-react/timeline/ScheduleAnimationProvider.js +13 -12
- package/lib/appui-react/timeline/ScheduleAnimationProvider.js.map +1 -1
- package/lib/appui-react/timeline/SolarTimelineDataProvider.js +6 -5
- package/lib/appui-react/timeline/SolarTimelineDataProvider.js.map +1 -1
- package/lib/appui-react/toolbar/GroupItem.js +11 -5
- package/lib/appui-react/toolbar/GroupItem.js.map +1 -1
- package/lib/appui-react/toolbar/ToolbarItemsManager.js +7 -7
- package/lib/appui-react/toolbar/ToolbarItemsManager.js.map +1 -1
- package/lib/appui-react/tools/FrameworkToolAdmin.js +5 -1
- package/lib/appui-react/tools/FrameworkToolAdmin.js.map +1 -1
- package/lib/appui-react/tools/KeyinPaletteTools.js +2 -2
- package/lib/appui-react/tools/KeyinPaletteTools.js.map +1 -1
- package/lib/appui-react/tools/OpenSettingsTool.js +2 -2
- package/lib/appui-react/tools/OpenSettingsTool.js.map +1 -1
- package/lib/appui-react/tools/RestoreLayoutTool.js +4 -4
- package/lib/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/appui-react/tools/ToolSettingsTools.js +2 -2
- package/lib/appui-react/tools/ToolSettingsTools.js.map +1 -1
- package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js +15 -18
- package/lib/appui-react/toolsettings/DefaultToolSettingsProvider.js.map +1 -1
- package/lib/appui-react/toolsettings/InternalToolSettingsManager.js +8 -8
- package/lib/appui-react/toolsettings/InternalToolSettingsManager.js.map +1 -1
- package/lib/appui-react/toolsettings/ToolInformation.js +2 -0
- package/lib/appui-react/toolsettings/ToolInformation.js.map +1 -1
- package/lib/appui-react/toolsettings/ToolUiProvider.js +3 -0
- package/lib/appui-react/toolsettings/ToolUiProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js +1 -0
- package/lib/appui-react/ui-items-provider/AbstractUiItemsManager.js.map +1 -1
- package/lib/appui-react/ui-items-provider/BaseUiItemsProvider.js +2 -0
- package/lib/appui-react/ui-items-provider/BaseUiItemsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardContentToolsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardContentToolsUiItemsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardStatusbarItemsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js +1 -0
- package/lib/appui-react/ui-items-provider/StandardStatusbarUiItemsProvider.js.map +1 -1
- package/lib/appui-react/ui-items-provider/UiItemsManager.js +3 -3
- package/lib/appui-react/ui-items-provider/UiItemsManager.js.map +1 -1
- package/lib/appui-react/uiadmin/FrameworkUiAdmin.js +1 -4
- package/lib/appui-react/uiadmin/FrameworkUiAdmin.js.map +1 -1
- package/lib/appui-react/uiprovider/ComponentGenerator.js +2 -0
- package/lib/appui-react/uiprovider/ComponentGenerator.js.map +1 -1
- package/lib/appui-react/uistate/AppUiSettings.js +41 -33
- package/lib/appui-react/uistate/AppUiSettings.js.map +1 -1
- package/lib/appui-react/utils/InternalUiShowHideManager.js +13 -14
- package/lib/appui-react/utils/InternalUiShowHideManager.js.map +1 -1
- package/lib/appui-react/widgets/StatusBarWidgetComposerControl.js +2 -5
- package/lib/appui-react/widgets/StatusBarWidgetComposerControl.js.map +1 -1
- package/lib/appui-react/widgets/WidgetControl.js +2 -0
- package/lib/appui-react/widgets/WidgetControl.js.map +1 -1
- package/lib/appui-react/widgets/WidgetDef.js +28 -7
- package/lib/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/appui-react/widgets/WidgetHost.js +4 -4
- package/lib/appui-react/widgets/WidgetHost.js.map +1 -1
- package/lib/appui-react/widgets/WidgetManager.js +5 -7
- package/lib/appui-react/widgets/WidgetManager.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
- package/lib/cjs/appui-react/layout/widget/Overflow.scss +3 -48
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.scss +0 -1
- package/lib/esm/appui-react/layout/widget/Overflow.scss +3 -48
- package/package.json +10 -11
- package/lib/appui-react/layout/widget/Menu.d.ts +0 -16
- package/lib/appui-react/layout/widget/Menu.d.ts.map +0 -1
- package/lib/appui-react/layout/widget/Menu.js +0 -21
- package/lib/appui-react/layout/widget/Menu.js.map +0 -1
- package/lib/appui-react/layout/widget/Menu.scss +0 -12
- package/lib/cjs/appui-react/layout/widget/Menu.scss +0 -12
- package/lib/esm/appui-react/layout/widget/Menu.scss +0 -12
|
@@ -33,13 +33,15 @@ export class ContentGroupProvider {
|
|
|
33
33
|
* @public
|
|
34
34
|
*/
|
|
35
35
|
export class ContentGroup {
|
|
36
|
+
static _sId = 0;
|
|
37
|
+
groupId;
|
|
38
|
+
propsId;
|
|
39
|
+
layout;
|
|
40
|
+
contentPropsList;
|
|
36
41
|
get id() {
|
|
37
42
|
return this.groupId;
|
|
38
43
|
}
|
|
39
44
|
constructor(contentGroupProps) {
|
|
40
|
-
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
41
|
-
this._contentControls = new Map();
|
|
42
|
-
this._contentSetMap = new Map();
|
|
43
45
|
this.layout = { ...contentGroupProps.layout };
|
|
44
46
|
this.propsId = contentGroupProps.id;
|
|
45
47
|
// ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls
|
|
@@ -124,6 +126,9 @@ export class ContentGroup {
|
|
|
124
126
|
});
|
|
125
127
|
return viewports;
|
|
126
128
|
}
|
|
129
|
+
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
130
|
+
_contentControls = new Map();
|
|
131
|
+
_contentSetMap = new Map();
|
|
127
132
|
/** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]].
|
|
128
133
|
* @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.
|
|
129
134
|
*/
|
|
@@ -190,5 +195,4 @@ export class ContentGroup {
|
|
|
190
195
|
return contentControls;
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
|
-
ContentGroup._sId = 0;
|
|
194
198
|
//# sourceMappingURL=ContentGroup.js.map
|
|
@@ -1 +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I,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,qBAAqB,CAAC,EAAU;QACrC,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,qBAAqB,CAC1B,IAAqB;QAErB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,KAAK,CAAC;YAAE,KAAK,IAAI,CAAC,eAAe,EAAE,CAAC;QAEhE,IAAI,IAAI,IAAK,IAAgC,CAAC,GAAG,EAAE,CAAC;YAClD,MAAM,GAAG,GAAI,IAAgC,CAAC,GAAa,CAAC;YAC5D,oFAAoF;YACpF,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,kBAAkB;QACvB,MAAM,eAAe,GAAqB,IAAI,KAAK,EAAkB,CAAC;QAEtE,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;YACpD,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,OAAO;gBAAE,OAAO;YAErB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,CAAC;;AAtNc,iBAAI,GAAG,CAAC,AAAJ,CAAK","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 ContentView\n */\n\nimport type * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport type { ConfigurableUiControlConstructor } from \"../configurableui/ConfigurableUiControl.js\";\nimport {\n ConfigurableCreateInfo,\n ConfigurableUiControlType,\n} from \"../configurableui/ConfigurableUiControl.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { ContentControl } from \"./ContentControl.js\";\nimport { InternalConfigurableUiManager } from \"../configurableui/InternalConfigurableUiManager.js\";\nimport type { Frontstage } from \"../frontstage/Frontstage.js\";\nimport type { ContentLayoutProps } from \"./ContentLayoutProps.js\";\nimport type { ConditionalValue } from \"../shared/ConditionalValue.js\";\n\n/** Properties for content displayed in a content view\n * @public\n */\nexport interface ContentProps {\n /** A unique id for the Content View within the group. */\n id: string;\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead and specify an empty string for this property. This will be made optional in 5.0.0.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n classId: string | ConfigurableUiControlConstructor;\n /** Optional application data passed down to the content view.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead.\n */\n applicationData?: any;\n /** Content to be displayed in the content view. */\n content?: React.ReactNode;\n /** Describes if the content should display the active strip.\n * If `undefined` the strip will be displayed only if this content is active and multiple contents are available.\n * Floating content controls (deprecated API) and `ContentOverlay` components are considered as content nodes.\n */\n renderActiveStrip?: boolean | ConditionalValue<boolean | undefined>;\n}\n\n/** Properties for a [[ContentGroup]]\n * @public\n */\nexport interface ContentGroupProps {\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\n id: string;\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\n layout: ContentLayoutProps;\n /** A collection of [[ContentProps]], one for each content view */\n contents: ContentProps[];\n}\n\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\n * content group just prior to activating the frontstage.\n * @public\n */\nexport abstract class ContentGroupProvider {\n /** Return the contentGroup based on the `Frontstage`. */\n public abstract contentGroup(frontstage: Frontstage): Promise<ContentGroup>;\n\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\n * be to remove applicationData entries.\n */\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\n * Typically this may be to add applicationData to content entries.\n */\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to save any content group data before the stage deactivated. */\n public async onFrontstageDeactivated() {}\n}\n\n/** Callback to process content properties during toJSON method\n * @public\n */\nexport type ContentCallback = (content: ContentProps) => void;\n\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\n * @public\n */\nexport class ContentGroup {\n private static _sId = 0;\n public groupId: string;\n public propsId: string;\n public layout: ContentLayoutProps;\n public contentPropsList: ContentProps[];\n\n public get id() {\n return this.groupId;\n }\n\n constructor(contentGroupProps: ContentGroupProps) {\n this.layout = { ...contentGroupProps.layout };\n this.propsId = contentGroupProps.id;\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\n this.contentPropsList = contentGroupProps.contents;\n }\n\n /** Gets the React nodes representing the content views in this content group.\n * @deprecated in 4.16.0. Use {@link ContentGroup.contentPropsList} instead.\n */\n public getContentNodes(): React.ReactNode[] {\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\n\n this._contentSetMap.clear();\n\n this.contentPropsList.forEach((contentProps, index) => {\n if (contentProps.content) {\n contentNodes.push(contentProps.content);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentNodes.push(control.reactNode);\n this._contentSetMap.set(control.controlId, control);\n });\n\n return contentNodes;\n }\n\n /** Refreshes the React nodes representing the Content Views in this Content Group. */\n public refreshContentNodes() {\n this._contentSetMap.clear();\n }\n\n /** Called when Frontstage is deactivated. */\n public onFrontstageDeactivated(): void {\n this.clearContentControls();\n }\n\n /** Called when Frontstage is ready. */\n public onFrontstageReady(): void {}\n\n /** Clears the map of content controls. */\n public clearContentControls(): void {\n this._contentControls.clear();\n }\n\n /** Creates [[ContentGroupProps]] for JSON purposes.\n * @public\n */\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\n const contentGroupProps: ContentGroupProps = {\n id: this.propsId,\n layout: this.layout,\n contents: this.contentPropsList,\n };\n\n contentGroupProps.contents.forEach((content, index) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (typeof content.classId !== \"string\") {\n const classId = InternalConfigurableUiManager.getConstructorClassId(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n content.classId\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (classId !== undefined) content.classId = classId;\n else\n throw new UiError( // eslint-disable-line @typescript-eslint/no-deprecated\n UiFramework.loggerCategory(\"ContentGroup\"),\n `toJSON: ContentControl at index ${index} is NOT registered with a string id`\n );\n\n if (typeof contentCallback === \"function\") contentCallback(content);\n }\n });\n\n return contentGroupProps;\n }\n\n /** Gets Viewports from Viewport Content Controls.\n * @internal\n */\n public getViewports(): Array<ScreenViewport | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentControls = this.getContentControls();\n const viewports = new Array<ScreenViewport | undefined>();\n\n contentControls.forEach((control) => {\n if (control.isViewport && control.viewport) {\n viewports.push(control.viewport);\n } else {\n viewports.push(undefined);\n }\n });\n\n return viewports;\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n\n private _contentControls = new Map<string, ContentControl>();\n private _contentSetMap = new Map<string, ContentControl>();\n\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]].\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControl(\n contentProps: ContentProps,\n _index: number\n ): ContentControl | undefined {\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\n const id = `${contentProps.id}::${this.groupId}`;\n let contentControl: ContentControl | undefined;\n\n if (!this._contentControls.get(contentProps.id)) {\n let usedClassId: string = \"\";\n\n if (typeof contentProps.classId === \"string\") {\n if (\n !this._contentControls.get(contentProps.id) &&\n UiFramework.controls.isRegistered(contentProps.classId)\n ) {\n contentControl = UiFramework.controls.create(\n contentProps.classId,\n id,\n contentProps.applicationData,\n contentProps.id\n ) as ContentControl;\n usedClassId = contentProps.classId;\n }\n } else {\n const info = new ConfigurableCreateInfo(\n contentProps.classId.name,\n id,\n contentProps.id\n );\n contentControl = new contentProps.classId(\n info,\n contentProps.applicationData\n ) as ContentControl;\n usedClassId = contentProps.classId.name;\n }\n\n if (contentControl) {\n if (\n contentControl.getType() !== ConfigurableUiControlType.Content &&\n contentControl.getType() !== ConfigurableUiControlType.Viewport\n ) {\n throw new UiError(\n UiFramework.loggerCategory(\"ContentGroup\"),\n `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`\n );\n }\n contentControl.initialize();\n this._contentControls.set(contentProps.id, contentControl);\n }\n }\n\n return this._contentControls.get(contentProps.id);\n }\n\n /** Gets a [[ContentControl]] from the Content Group with a given ID.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControlById(id: string): ContentControl | undefined {\n return this._contentControls.get(id);\n }\n\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getControlFromElement(\n node: React.ReactNode\n ): ContentControl | undefined {\n if (this._contentSetMap.size === 0) void this.getContentNodes();\n\n if (node && (node as React.ReactElement<any>).key) {\n const key = (node as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n const controlId = key.split(\"::\", 1)[0];\n return this._contentSetMap.get(controlId);\n }\n\n return undefined;\n }\n\n /** Gets an array of the content controls representing the Content Views.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControls(): ContentControl[] {\n const contentControls: ContentControl[] = new Array<ContentControl>();\n\n this.contentPropsList.forEach((contentProps, index) => {\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentControls.push(control);\n });\n\n return contentControls;\n }\n\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ContentGroup.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentGroup.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAyCnG;;;GAGG;AACH,MAAM,OAAgB,oBAAoB;IAIxC;;OAEG;IACI,kBAAkB,CAAC,iBAAoC;QAC5D,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,wBAAwB,CAAC,iBAAoC;QAClE,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,kFAAkF;IAC3E,KAAK,CAAC,uBAAuB,KAAI,CAAC;CAC1C;AAOD;;GAEG;AACH,MAAM,OAAO,YAAY;IACf,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC;IACjB,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,MAAM,CAAqB;IAC3B,gBAAgB,CAAiB;IAExC,IAAW,EAAE;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAY,iBAAoC;QAC9C,IAAI,CAAC,MAAM,GAAG,EAAE,GAAG,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,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O,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;YAC5D,IAAI,CAAC,OAAO;gBAAE,OAAO;YAErB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;QAEH,OAAO,eAAe,CAAC;IACzB,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 ContentView\n */\n\nimport type * as React from \"react\";\nimport type { ScreenViewport } from \"@itwin/core-frontend\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport type { ConfigurableUiControlConstructor } from \"../configurableui/ConfigurableUiControl.js\";\nimport {\n ConfigurableCreateInfo,\n ConfigurableUiControlType,\n} from \"../configurableui/ConfigurableUiControl.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport type { ContentControl } from \"./ContentControl.js\";\nimport { InternalConfigurableUiManager } from \"../configurableui/InternalConfigurableUiManager.js\";\nimport type { Frontstage } from \"../frontstage/Frontstage.js\";\nimport type { ContentLayoutProps } from \"./ContentLayoutProps.js\";\nimport type { ConditionalValue } from \"../shared/ConditionalValue.js\";\n\n/** Properties for content displayed in a content view\n * @public\n */\nexport interface ContentProps {\n /** A unique id for the Content View within the group. */\n id: string;\n /** The class name or [[ConfigurableUiControlConstructor]] of the content control.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead and specify an empty string for this property. This will be made optional in 5.0.0.\n */\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n classId: string | ConfigurableUiControlConstructor;\n /** Optional application data passed down to the content view.\n * @deprecated in 4.16.0. Use {@link ContentProps.content} instead.\n */\n applicationData?: any;\n /** Content to be displayed in the content view. */\n content?: React.ReactNode;\n /** Describes if the content should display the active strip.\n * If `undefined` the strip will be displayed only if this content is active and multiple contents are available.\n * Floating content controls (deprecated API) and `ContentOverlay` components are considered as content nodes.\n */\n renderActiveStrip?: boolean | ConditionalValue<boolean | undefined>;\n}\n\n/** Properties for a [[ContentGroup]]\n * @public\n */\nexport interface ContentGroupProps {\n /** An id for the [[ContentGroup]]. This id is used to locate a ContentGroup and it also can be used by an ContentGroupProvider to save/restore content settings */\n id: string;\n /** Content Layout Id or complete set of [[ContentLayoutProps]] */\n layout: ContentLayoutProps;\n /** A collection of [[ContentProps]], one for each content view */\n contents: ContentProps[];\n}\n\n/** Abstract class that can be implemented and specified by frontstage to dynamically construct\n * content group just prior to activating the frontstage.\n * @public\n */\nexport abstract class ContentGroupProvider {\n /** Return the contentGroup based on the `Frontstage`. */\n public abstract contentGroup(frontstage: Frontstage): Promise<ContentGroup>;\n\n /** Allow provider to update any data stored in ContentGroupProps. Typically this may\n * be to remove applicationData entries.\n */\n public prepareToSaveProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to update any stored ContentGroupProps be it is to be used to create ContentGroup and layouts.\n * Typically this may be to add applicationData to content entries.\n */\n public applyUpdatesToSavedProps(contentGroupProps: ContentGroupProps) {\n return contentGroupProps;\n }\n\n /** Allow provider to save any content group data before the stage deactivated. */\n public async onFrontstageDeactivated() {}\n}\n\n/** Callback to process content properties during toJSON method\n * @public\n */\nexport type ContentCallback = (content: ContentProps) => void;\n\n/** ContentGroup class. Content Groups define content displayed in content views that are laid out using a [[ContentLayout]].\n * @public\n */\nexport class ContentGroup {\n private static _sId = 0;\n public groupId: string;\n public propsId: string;\n public layout: ContentLayoutProps;\n public contentPropsList: ContentProps[];\n\n public get id() {\n return this.groupId;\n }\n\n constructor(contentGroupProps: ContentGroupProps) {\n this.layout = { ...contentGroupProps.layout };\n this.propsId = contentGroupProps.id;\n // ensure we have a unique groupId for each instance of a content group - this will be used to generate a key in the React controls\n this.groupId = `[${contentGroupProps.id}-${ContentGroup._sId++}]`;\n this.contentPropsList = contentGroupProps.contents;\n }\n\n /** Gets the React nodes representing the content views in this content group.\n * @deprecated in 4.16.0. Use {@link ContentGroup.contentPropsList} instead.\n */\n public getContentNodes(): React.ReactNode[] {\n const contentNodes: React.ReactNode[] = new Array<React.ReactNode>();\n\n this._contentSetMap.clear();\n\n this.contentPropsList.forEach((contentProps, index) => {\n if (contentProps.content) {\n contentNodes.push(contentProps.content);\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentNodes.push(control.reactNode);\n this._contentSetMap.set(control.controlId, control);\n });\n\n return contentNodes;\n }\n\n /** Refreshes the React nodes representing the Content Views in this Content Group. */\n public refreshContentNodes() {\n this._contentSetMap.clear();\n }\n\n /** Called when Frontstage is deactivated. */\n public onFrontstageDeactivated(): void {\n this.clearContentControls();\n }\n\n /** Called when Frontstage is ready. */\n public onFrontstageReady(): void {}\n\n /** Clears the map of content controls. */\n public clearContentControls(): void {\n this._contentControls.clear();\n }\n\n /** Creates [[ContentGroupProps]] for JSON purposes.\n * @public\n */\n public toJSON(contentCallback?: ContentCallback): ContentGroupProps {\n const contentGroupProps: ContentGroupProps = {\n id: this.propsId,\n layout: this.layout,\n contents: this.contentPropsList,\n };\n\n contentGroupProps.contents.forEach((content, index) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (typeof content.classId !== \"string\") {\n const classId = InternalConfigurableUiManager.getConstructorClassId(\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n content.classId\n );\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (classId !== undefined) content.classId = classId;\n else\n throw new UiError( // eslint-disable-line @typescript-eslint/no-deprecated\n UiFramework.loggerCategory(\"ContentGroup\"),\n `toJSON: ContentControl at index ${index} is NOT registered with a string id`\n );\n\n if (typeof contentCallback === \"function\") contentCallback(content);\n }\n });\n\n return contentGroupProps;\n }\n\n /** Gets Viewports from Viewport Content Controls.\n * @internal\n */\n public getViewports(): Array<ScreenViewport | undefined> {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentControls = this.getContentControls();\n const viewports = new Array<ScreenViewport | undefined>();\n\n contentControls.forEach((control) => {\n if (control.isViewport && control.viewport) {\n viewports.push(control.viewport);\n } else {\n viewports.push(undefined);\n }\n });\n\n return viewports;\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n\n private _contentControls = new Map<string, ContentControl>();\n private _contentSetMap = new Map<string, ContentControl>();\n\n /** Gets a [[ContentControl]] from the Content Group based on its [[ContentProps]].\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControl(\n contentProps: ContentProps,\n _index: number\n ): ContentControl | undefined {\n // ensure we have a unique control Id for each instance of a content control - this will be used as a key for the React control - see `ContentControl.getKeyedReactNode`\n const id = `${contentProps.id}::${this.groupId}`;\n let contentControl: ContentControl | undefined;\n\n if (!this._contentControls.get(contentProps.id)) {\n let usedClassId: string = \"\";\n\n if (typeof contentProps.classId === \"string\") {\n if (\n !this._contentControls.get(contentProps.id) &&\n UiFramework.controls.isRegistered(contentProps.classId)\n ) {\n contentControl = UiFramework.controls.create(\n contentProps.classId,\n id,\n contentProps.applicationData,\n contentProps.id\n ) as ContentControl;\n usedClassId = contentProps.classId;\n }\n } else {\n const info = new ConfigurableCreateInfo(\n contentProps.classId.name,\n id,\n contentProps.id\n );\n contentControl = new contentProps.classId(\n info,\n contentProps.applicationData\n ) as ContentControl;\n usedClassId = contentProps.classId.name;\n }\n\n if (contentControl) {\n if (\n contentControl.getType() !== ConfigurableUiControlType.Content &&\n contentControl.getType() !== ConfigurableUiControlType.Viewport\n ) {\n throw new UiError(\n UiFramework.loggerCategory(\"ContentGroup\"),\n `getContentControl error: '${usedClassId}' is NOT a ContentControl or ViewportContentControl`\n );\n }\n contentControl.initialize();\n this._contentControls.set(contentProps.id, contentControl);\n }\n }\n\n return this._contentControls.get(contentProps.id);\n }\n\n /** Gets a [[ContentControl]] from the Content Group with a given ID.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControlById(id: string): ContentControl | undefined {\n return this._contentControls.get(id);\n }\n\n /** Gets the [[ContentControl]] associated with a given React node representing a Content View.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getControlFromElement(\n node: React.ReactNode\n ): ContentControl | undefined {\n if (this._contentSetMap.size === 0) void this.getContentNodes();\n\n if (node && (node as React.ReactElement<any>).key) {\n const key = (node as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n const controlId = key.split(\"::\", 1)[0];\n return this._contentSetMap.get(controlId);\n }\n\n return undefined;\n }\n\n /** Gets an array of the content controls representing the Content Views.\n * @deprecated in 4.16.0. Uses a deprecated class {@link ContentControl}.\n */\n public getContentControls(): ContentControl[] {\n const contentControls: ContentControl[] = new Array<ContentControl>();\n\n this.contentPropsList.forEach((contentProps, index) => {\n const control = this.getContentControl(contentProps, index);\n if (!control) return;\n\n contentControls.push(control);\n });\n\n return contentControls;\n }\n\n /* eslint-enable @typescript-eslint/no-deprecated */\n}\n"]}
|
|
@@ -112,27 +112,27 @@ function useRenderActiveStrip(contentIndex) {
|
|
|
112
112
|
/** Split Container class.
|
|
113
113
|
*/
|
|
114
114
|
class SplitContainer extends React.Component {
|
|
115
|
+
_containerDiv = null;
|
|
115
116
|
constructor(props) {
|
|
116
117
|
super(props);
|
|
117
|
-
this._containerDiv = null;
|
|
118
|
-
this._onSplitterChange = (size) => {
|
|
119
|
-
let percentage = 0;
|
|
120
|
-
if (this._containerDiv && size > 0) {
|
|
121
|
-
if (this.props.orientation === Orientation.Horizontal) {
|
|
122
|
-
const height = this._containerDiv.getBoundingClientRect().height;
|
|
123
|
-
if (height > 0)
|
|
124
|
-
percentage = size / height;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
const width = this._containerDiv.getBoundingClientRect().width;
|
|
128
|
-
if (width > 0)
|
|
129
|
-
percentage = size / width;
|
|
130
|
-
}
|
|
131
|
-
if (this.props.onSplitterChange)
|
|
132
|
-
this.props.onSplitterChange(size, percentage);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
118
|
}
|
|
119
|
+
_onSplitterChange = (size) => {
|
|
120
|
+
let percentage = 0;
|
|
121
|
+
if (this._containerDiv && size > 0) {
|
|
122
|
+
if (this.props.orientation === Orientation.Horizontal) {
|
|
123
|
+
const height = this._containerDiv.getBoundingClientRect().height;
|
|
124
|
+
if (height > 0)
|
|
125
|
+
percentage = size / height;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
const width = this._containerDiv.getBoundingClientRect().width;
|
|
129
|
+
if (width > 0)
|
|
130
|
+
percentage = size / width;
|
|
131
|
+
}
|
|
132
|
+
if (this.props.onSplitterChange)
|
|
133
|
+
this.props.onSplitterChange(size, percentage);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
136
|
render() {
|
|
137
137
|
const orientation = this.props.orientation === Orientation.Horizontal
|
|
138
138
|
? "horizontal"
|
|
@@ -160,9 +160,10 @@ const MIN_SPLIT_SIZE = 6;
|
|
|
160
160
|
/** Base Split class.
|
|
161
161
|
*/
|
|
162
162
|
class BaseSplit {
|
|
163
|
+
defaultPercentage;
|
|
164
|
+
stateId = "";
|
|
165
|
+
isLocked = false;
|
|
163
166
|
constructor(props) {
|
|
164
|
-
this.stateId = "";
|
|
165
|
-
this.isLocked = false;
|
|
166
167
|
this.defaultPercentage = props.percentage;
|
|
167
168
|
if (props.id)
|
|
168
169
|
this.stateId = props.id;
|
|
@@ -173,15 +174,15 @@ class BaseSplit {
|
|
|
173
174
|
/** Horizontal Split class.
|
|
174
175
|
*/
|
|
175
176
|
class HorizontalSplit extends BaseSplit {
|
|
177
|
+
_topIndex = -1;
|
|
178
|
+
_bottomIndex = -1;
|
|
179
|
+
_topSplit;
|
|
180
|
+
_bottomSplit;
|
|
181
|
+
_props;
|
|
182
|
+
_minSizeTop = MIN_SPLIT_SIZE;
|
|
183
|
+
_minSizeBottom = MIN_SPLIT_SIZE;
|
|
176
184
|
constructor(props) {
|
|
177
185
|
super(props);
|
|
178
|
-
this._topIndex = -1;
|
|
179
|
-
this._bottomIndex = -1;
|
|
180
|
-
this._minSizeTop = MIN_SPLIT_SIZE;
|
|
181
|
-
this._minSizeBottom = MIN_SPLIT_SIZE;
|
|
182
|
-
this._handleSplitterChange = (_size, percentage) => {
|
|
183
|
-
this._props.percentage = percentage;
|
|
184
|
-
};
|
|
185
186
|
this._props = props;
|
|
186
187
|
if (typeof props.top === "number") {
|
|
187
188
|
this._topIndex = props.top;
|
|
@@ -200,6 +201,9 @@ class HorizontalSplit extends BaseSplit {
|
|
|
200
201
|
if (props.minSizeBottom)
|
|
201
202
|
this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);
|
|
202
203
|
}
|
|
204
|
+
_handleSplitterChange = (_size, percentage) => {
|
|
205
|
+
this._props.percentage = percentage;
|
|
206
|
+
};
|
|
203
207
|
createContentContainer(contentNodes, resizable) {
|
|
204
208
|
if (this.isLocked)
|
|
205
209
|
resizable = false;
|
|
@@ -211,15 +215,15 @@ class HorizontalSplit extends BaseSplit {
|
|
|
211
215
|
/** Vertical Split class.
|
|
212
216
|
*/
|
|
213
217
|
class VerticalSplit extends BaseSplit {
|
|
218
|
+
_leftIndex = -1;
|
|
219
|
+
_rightIndex = -1;
|
|
220
|
+
_leftSplit;
|
|
221
|
+
_rightSplit;
|
|
222
|
+
_props;
|
|
223
|
+
_minSizeLeft = MIN_SPLIT_SIZE;
|
|
224
|
+
_minSizeRight = MIN_SPLIT_SIZE;
|
|
214
225
|
constructor(props) {
|
|
215
226
|
super(props);
|
|
216
|
-
this._leftIndex = -1;
|
|
217
|
-
this._rightIndex = -1;
|
|
218
|
-
this._minSizeLeft = MIN_SPLIT_SIZE;
|
|
219
|
-
this._minSizeRight = MIN_SPLIT_SIZE;
|
|
220
|
-
this._handleSplitterChange = (_size, percentage) => {
|
|
221
|
-
this._props.percentage = percentage;
|
|
222
|
-
};
|
|
223
227
|
this._props = props;
|
|
224
228
|
if (typeof props.left === "number") {
|
|
225
229
|
this._leftIndex = props.left;
|
|
@@ -238,6 +242,9 @@ class VerticalSplit extends BaseSplit {
|
|
|
238
242
|
if (props.minSizeRight)
|
|
239
243
|
this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);
|
|
240
244
|
}
|
|
245
|
+
_handleSplitterChange = (_size, percentage) => {
|
|
246
|
+
this._props.percentage = percentage;
|
|
247
|
+
};
|
|
241
248
|
createContentContainer(contentNodes, resizable) {
|
|
242
249
|
if (this.isLocked)
|
|
243
250
|
resizable = false;
|
|
@@ -250,11 +257,13 @@ class VerticalSplit extends BaseSplit {
|
|
|
250
257
|
* @public
|
|
251
258
|
*/
|
|
252
259
|
export class ContentLayoutDef {
|
|
260
|
+
_layoutProps;
|
|
261
|
+
_rootSplit;
|
|
262
|
+
/** ID for this Content Layout */
|
|
263
|
+
id = "";
|
|
264
|
+
/** Description of the layout. */
|
|
265
|
+
description = "";
|
|
253
266
|
constructor(layoutProps) {
|
|
254
|
-
/** ID for this Content Layout */
|
|
255
|
-
this.id = "";
|
|
256
|
-
/** Description of the layout. */
|
|
257
|
-
this.description = "";
|
|
258
267
|
this._layoutProps = layoutProps;
|
|
259
268
|
this.id = layoutProps.id;
|
|
260
269
|
if (layoutProps.description !== undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAUtD,OAAO,EAAE,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CAAC,CAAC;YACxC,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC7C,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACnC,4DAA4D;YAC5D,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC,CAAC;QACvD,CAAC,CACF,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,4DAA4D;IAC5D,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,mBAAmB,CAC3D,YAAY,EACZ,IAAI,CACL,CAAC;IACF,IAAI,CAAC,gBAAgB;QAAE,OAAO,IAAI,CAAC;IAEnC,OAAO,CACL,6BACE,EAAE,EAAC,wBAAwB,EAC3B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,GAAG,EACD,mBAAmB;YACjB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,GAAG,cAAc,IAAI,gBAAgB,CAAC,EAAE,EAAE,EAEhD,WAAW,EAAE,GAAG,EAAE;YAChB,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;YACd,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC,EACD,IAAI,EAAC,cAAc;QAEnB,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC/C,gBAAgB,CACa,CAC5B,CACP,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAC9C,SAAS,CACV,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,2BAA2B,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 ContentView\n */\n\nimport \"./ContentLayout.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/components-react\";\nimport { SplitPane } from \"./split-pane/SplitPane.js\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ContentGroup } from \"./ContentGroup.js\";\nimport type {\n ContentLayoutProps,\n LayoutFragmentProps,\n LayoutHorizontalSplitProps,\n LayoutSplitPropsBase,\n LayoutVerticalSplitProps,\n} from \"./ContentLayoutProps.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { ContentOverlay, useContentOverlayStore } from \"./ContentOverlay.js\";\nimport { useConditionalValue } from \"../hooks/useConditionalValue.js\";\nimport { usePreviewFeatures } from \"../preview/PreviewFeatures.js\";\n\n/** Properties for [[ContentWrapper]] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface ContentWrapperProps extends CommonProps {\n content: React.ReactNode;\n contentIndex: number | undefined;\n}\n\n/** ContentWrapper React component.\n * @internal\n */\nexport function ContentWrapper(props: ContentWrapperProps) {\n const { content, contentIndex } = props;\n const activeFrontstageDef = useActiveFrontstageDef();\n const [isActive, setIsActive] = React.useState(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return content === UiFramework.content.getActive();\n });\n\n const contentControlKey = (\n contentControl: React.ReactNode\n ): string | undefined => {\n let controlId: string | undefined;\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\n const key = (contentControl as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n controlId = key.split(\"::\", 1)[0];\n }\n return controlId;\n };\n\n const [hasMultipleContents, setHasMultipleContents] = React.useState(\n () =>\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1\n );\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setIsActive(content === UiFramework.content.getActive());\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onActiveContentChangedEvent.addListener(\n (args) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentIsIdentical = content === args.activeContent;\n if (contentIsIdentical) {\n setIsActive(contentIsIdentical);\n } else {\n const contentId = contentControlKey(content);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const activeContentId = contentControlKey(args.activeContent);\n setIsActive(!!contentId && contentId === activeContentId);\n }\n\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef, content]);\n\n const handleMouseDown = React.useCallback(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.setActive(content);\n setIsActive(true);\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onAvailableContentChangedEvent.addListener(\n () => {\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef]);\n\n const renderActiveStrip = useRenderActiveStrip(contentIndex);\n const contentOverlays = useContentOverlayStore();\n\n const active =\n renderActiveStrip !== undefined\n ? renderActiveStrip\n : isActive && (hasMultipleContents || contentOverlays > 1);\n return (\n <ContentOverlay\n className={classnames(\"uifw-contentlayout-wrapper\", props.className)}\n style={props.style}\n active={active}\n onMouseDown={handleMouseDown}\n role=\"presentation\"\n >\n {content}\n </ContentOverlay>\n );\n}\n\nfunction useRenderActiveStrip(contentIndex: number | undefined) {\n const contentGroup = React.useContext(ContentLayoutContext);\n const contentProps =\n contentIndex === undefined\n ? undefined\n : contentGroup?.contentPropsList[contentIndex];\n const renderActiveStrip = contentProps?.renderActiveStrip;\n const getValue = React.useCallback(() => {\n if (renderActiveStrip === undefined) return undefined;\n if (typeof renderActiveStrip === \"boolean\") return renderActiveStrip;\n return renderActiveStrip.getValue();\n }, [renderActiveStrip]);\n const eventIds = React.useMemo(() => {\n if (renderActiveStrip === undefined) return [];\n if (typeof renderActiveStrip === \"boolean\") return [];\n return renderActiveStrip.eventIds;\n }, [renderActiveStrip]);\n return useConditionalValue(getValue, eventIds);\n}\n\n/** Properties for the [[SplitContainer]] component */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface SplitContainerProps extends CommonProps {\n contentA: React.ReactNode;\n contentB: React.ReactNode;\n orientation: Orientation;\n percentage: number;\n resizable: boolean;\n minSizeTopLeft: number;\n minSizeBottomRight: number;\n splitterStateId?: string;\n onSplitterChange?: (size: number, percentage: number) => void;\n}\n\n/** Split Container class.\n */\nclass SplitContainer extends React.Component<SplitContainerProps> {\n private _containerDiv: HTMLDivElement | null = null;\n\n constructor(props: SplitContainerProps) {\n super(props);\n }\n\n private _onSplitterChange = (size: number): void => {\n let percentage = 0;\n\n if (this._containerDiv && size > 0) {\n if (this.props.orientation === Orientation.Horizontal) {\n const height = this._containerDiv.getBoundingClientRect().height;\n if (height > 0) percentage = size / height;\n } else {\n const width = this._containerDiv.getBoundingClientRect().width;\n if (width > 0) percentage = size / width;\n }\n\n if (this.props.onSplitterChange)\n this.props.onSplitterChange(size, percentage);\n }\n };\n\n public override render(): React.ReactNode {\n const orientation =\n this.props.orientation === Orientation.Horizontal\n ? \"horizontal\"\n : \"vertical\";\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\n const minSizeTopLeft = this.props.minSizeTopLeft;\n const minSizeBottomRight = -this.props.minSizeBottomRight;\n\n return (\n <div\n ref={(e) => {\n this._containerDiv = e;\n }}\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n >\n <SplitPane\n split={orientation}\n minSize={minSizeTopLeft}\n maxSize={minSizeBottomRight}\n defaultSize={defaultSize}\n onChange={this._onSplitterChange}\n allowResize={this.props.resizable}\n >\n {this.props.contentA}\n {this.props.contentB}\n </SplitPane>\n </div>\n );\n }\n}\n\n/** Properties for [[SingleContentContainer]] component\n */\ninterface SingleContentProps\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n extends CommonProps,\n Pick<ContentWrapperProps, \"contentIndex\"> {\n content: React.ReactNode;\n}\n\n/** Single Content Container class. */\nclass SingleContentContainer extends React.Component<SingleContentProps> {\n public override render(): React.ReactNode {\n return (\n <div\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n data-testid=\"single-content-container\"\n >\n <ContentWrapper\n content={this.props.content}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={this.props.contentIndex}\n />\n </div>\n );\n }\n}\n\n/** Common interface for HorizontalSplit and VerticalSplit. */\ninterface LayoutSplit {\n createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode;\n isLocked: boolean;\n}\n\n/** Minimum split size */\nconst MIN_SPLIT_SIZE = 6;\n\n/** Base Split class.\n */\nclass BaseSplit {\n public defaultPercentage: number;\n public stateId: string = \"\";\n public isLocked: boolean = false;\n\n constructor(props: LayoutSplitPropsBase) {\n this.defaultPercentage = props.percentage;\n\n if (props.id) this.stateId = props.id;\n\n if (props.lock) this.isLocked = props.lock;\n }\n}\n\n/** Horizontal Split class.\n */\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\n private _topIndex: number = -1;\n private _bottomIndex: number = -1;\n private _topSplit?: LayoutSplit;\n private _bottomSplit?: LayoutSplit;\n private _props: LayoutHorizontalSplitProps;\n private _minSizeTop: number = MIN_SPLIT_SIZE;\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutHorizontalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.top === \"number\") {\n this._topIndex = props.top;\n } else {\n this._topSplit = ContentLayoutDef.createSplit(props.top);\n }\n\n if (typeof props.bottom === \"number\") {\n this._bottomIndex = props.bottom;\n } else {\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\n }\n\n if (props.minSizeTop)\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\n\n if (props.minSizeBottom)\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const topContent = !this._topSplit ? (\n <ContentWrapper\n content={contentNodes[this._topIndex]}\n contentIndex={this._topIndex}\n />\n ) : (\n this._topSplit.createContentContainer(contentNodes, resizable)\n );\n const bottomContent = !this._bottomSplit ? (\n <ContentWrapper\n content={contentNodes[this._bottomIndex]}\n contentIndex={this._bottomIndex}\n />\n ) : (\n this._bottomSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={topContent}\n contentB={bottomContent}\n orientation={Orientation.Horizontal}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeTop}\n minSizeBottomRight={this._minSizeBottom}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Vertical Split class.\n */\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\n private _leftIndex: number = -1;\n private _rightIndex: number = -1;\n private _leftSplit?: LayoutSplit;\n private _rightSplit?: LayoutSplit;\n private _props: LayoutVerticalSplitProps;\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\n private _minSizeRight: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutVerticalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.left === \"number\") {\n this._leftIndex = props.left;\n } else {\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\n }\n\n if (typeof props.right === \"number\") {\n this._rightIndex = props.right;\n } else {\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\n }\n\n if (props.minSizeLeft)\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\n\n if (props.minSizeRight)\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const leftContent = !this._leftSplit ? (\n <ContentWrapper\n content={contentNodes[this._leftIndex]}\n contentIndex={this._leftIndex}\n />\n ) : (\n this._leftSplit.createContentContainer(contentNodes, resizable)\n );\n const rightContent = !this._rightSplit ? (\n <ContentWrapper\n content={contentNodes[this._rightIndex]}\n contentIndex={this._rightIndex}\n />\n ) : (\n this._rightSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={leftContent}\n contentB={rightContent}\n orientation={Orientation.Vertical}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeLeft}\n minSizeBottomRight={this._minSizeRight}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Content Layout Definition class.\n * @public\n */\nexport class ContentLayoutDef {\n private _layoutProps: ContentLayoutProps;\n private _rootSplit?: LayoutSplit;\n\n /** ID for this Content Layout */\n public id: string = \"\";\n /** Description of the layout. */\n public description: string = \"\";\n constructor(layoutProps: ContentLayoutProps) {\n this._layoutProps = layoutProps;\n this.id = layoutProps.id;\n if (layoutProps.description !== undefined)\n this.description = layoutProps.description;\n }\n\n /** @deprecated in 4.16.0. Used internally. */\n public get rootSplit(): LayoutSplit | undefined {\n return this._rootSplit;\n }\n\n /** Creates [[ContentLayoutProps]] for JSON purposes\n * @public\n */\n public toJSON(): ContentLayoutProps {\n return this._layoutProps;\n }\n\n /** Fill a layout container with React nodes for each content view.\n * @deprecated in 4.16.0. Used internally.\n */\n public fillLayoutContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode | undefined {\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (this.rootSplit) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.rootSplit.createContentContainer(contentNodes, resizable);\n }\n\n if (contentNodes.length > 0)\n return (\n <SingleContentContainer content={contentNodes[0]} contentIndex={0} />\n );\n\n return undefined;\n }\n\n /** Gets the indexes of content views used in this Content Layout. */\n public getUsedContentIndexes(): number[] {\n let allContentIndexes: number[] = [];\n\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\n allContentIndexes.push(0);\n else {\n allContentIndexes = allContentIndexes.concat(\n this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit)\n );\n allContentIndexes = allContentIndexes.concat(\n this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit)\n );\n }\n\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\n\n return uniqueContentIndexes;\n }\n\n private getHorizontalSplitContentIndexes(\n splitProps?: LayoutHorizontalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.top === \"number\") contentIndexes.push(splitProps.top);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit)\n );\n }\n\n if (typeof splitProps.bottom === \"number\")\n contentIndexes.push(splitProps.bottom);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n private getVerticalSplitContentIndexes(\n splitProps?: LayoutVerticalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.left === \"number\")\n contentIndexes.push(splitProps.left);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit)\n );\n }\n\n if (typeof splitProps.right === \"number\")\n contentIndexes.push(splitProps.right);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n /** @internal */\n public static createSplit(\n fragmentDef: LayoutFragmentProps\n ): LayoutSplit | undefined {\n if (fragmentDef.horizontalSplit) {\n return new HorizontalSplit(fragmentDef.horizontalSplit);\n } else if (fragmentDef.verticalSplit) {\n return new VerticalSplit(fragmentDef.verticalSplit);\n }\n\n return undefined;\n }\n}\n\n/** Content Layout Activated Event Args class.\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 ContentLayoutActivatedEventArgs {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout Activated Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> {}\n\n/** Properties for the [[ContentLayout]] React component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ContentLayoutComponentProps extends CommonProps {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout React component.\n * @public\n */\nexport function ContentLayout(props: ContentLayoutComponentProps) {\n const { stableContentLayout } = usePreviewFeatures();\n const [contentLayoutDef, setContentLayoutDef] =\n React.useState<ContentLayoutDef>(props.contentLayout);\n const [contentGroupId, setContentGroupId] = React.useState<\n ContentGroup[\"id\"]\n >(props.contentGroup.groupId);\n const [contentGroup, setContentGroup] = React.useState<ContentGroup>(\n props.contentGroup\n );\n const [contentNodes, setContentNodes] = React.useState<React.ReactNode[]>(\n () => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return props.contentGroup.getContentNodes();\n }\n );\n\n React.useEffect(() => {\n return UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(\n (args) => {\n setContentLayoutDef(args.contentLayout);\n setContentGroupId(args.contentGroup.groupId);\n setContentGroup(args.contentGroup);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setContentNodes(args.contentGroup.getContentNodes());\n }\n );\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n if (!contentContainer) return null;\n\n return (\n <div\n id=\"uifw-contentlayout-div\"\n className={props.className}\n style={props.style}\n key={\n stableContentLayout\n ? undefined\n : `${contentGroupId}-${contentLayoutDef.id}`\n }\n onMouseDown={() => {\n UiFramework.content.setMouseDown(true);\n }}\n onMouseUp={() => {\n UiFramework.content.setMouseDown(false);\n }}\n role=\"presentation\"\n >\n <ContentLayoutContext.Provider value={contentGroup}>\n {contentContainer}\n </ContentLayoutContext.Provider>\n </div>\n );\n}\n\nconst ContentLayoutContext = React.createContext<ContentGroup | undefined>(\n undefined\n);\nContentLayoutContext.displayName = \"uifw:ContentLayoutContext\";\n"]}
|
|
1
|
+
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;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,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC1C,CAAC,EACD,IAAI,EAAC,cAAc;QAEnB,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC/C,gBAAgB,CACa,CAC5B,CACP,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAC9C,SAAS,CACV,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,2BAA2B,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 ContentView\n */\n\nimport \"./ContentLayout.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/components-react\";\nimport { SplitPane } from \"./split-pane/SplitPane.js\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ContentGroup } from \"./ContentGroup.js\";\nimport type {\n ContentLayoutProps,\n LayoutFragmentProps,\n LayoutHorizontalSplitProps,\n LayoutSplitPropsBase,\n LayoutVerticalSplitProps,\n} from \"./ContentLayoutProps.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { ContentOverlay, useContentOverlayStore } from \"./ContentOverlay.js\";\nimport { useConditionalValue } from \"../hooks/useConditionalValue.js\";\nimport { usePreviewFeatures } from \"../preview/PreviewFeatures.js\";\n\n/** Properties for [[ContentWrapper]] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface ContentWrapperProps extends CommonProps {\n content: React.ReactNode;\n contentIndex: number | undefined;\n}\n\n/** ContentWrapper React component.\n * @internal\n */\nexport function ContentWrapper(props: ContentWrapperProps) {\n const { content, contentIndex } = props;\n const activeFrontstageDef = useActiveFrontstageDef();\n const [isActive, setIsActive] = React.useState(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return content === UiFramework.content.getActive();\n });\n\n const contentControlKey = (\n contentControl: React.ReactNode\n ): string | undefined => {\n let controlId: string | undefined;\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\n const key = (contentControl as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n controlId = key.split(\"::\", 1)[0];\n }\n return controlId;\n };\n\n const [hasMultipleContents, setHasMultipleContents] = React.useState(\n () =>\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1\n );\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setIsActive(content === UiFramework.content.getActive());\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onActiveContentChangedEvent.addListener(\n (args) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentIsIdentical = content === args.activeContent;\n if (contentIsIdentical) {\n setIsActive(contentIsIdentical);\n } else {\n const contentId = contentControlKey(content);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const activeContentId = contentControlKey(args.activeContent);\n setIsActive(!!contentId && contentId === activeContentId);\n }\n\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef, content]);\n\n const handleMouseDown = React.useCallback(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.setActive(content);\n setIsActive(true);\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onAvailableContentChangedEvent.addListener(\n () => {\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef]);\n\n const renderActiveStrip = useRenderActiveStrip(contentIndex);\n const contentOverlays = useContentOverlayStore();\n\n const active =\n renderActiveStrip !== undefined\n ? renderActiveStrip\n : isActive && (hasMultipleContents || contentOverlays > 1);\n return (\n <ContentOverlay\n className={classnames(\"uifw-contentlayout-wrapper\", props.className)}\n style={props.style}\n active={active}\n onMouseDown={handleMouseDown}\n role=\"presentation\"\n >\n {content}\n </ContentOverlay>\n );\n}\n\nfunction useRenderActiveStrip(contentIndex: number | undefined) {\n const contentGroup = React.useContext(ContentLayoutContext);\n const contentProps =\n contentIndex === undefined\n ? undefined\n : contentGroup?.contentPropsList[contentIndex];\n const renderActiveStrip = contentProps?.renderActiveStrip;\n const getValue = React.useCallback(() => {\n if (renderActiveStrip === undefined) return undefined;\n if (typeof renderActiveStrip === \"boolean\") return renderActiveStrip;\n return renderActiveStrip.getValue();\n }, [renderActiveStrip]);\n const eventIds = React.useMemo(() => {\n if (renderActiveStrip === undefined) return [];\n if (typeof renderActiveStrip === \"boolean\") return [];\n return renderActiveStrip.eventIds;\n }, [renderActiveStrip]);\n return useConditionalValue(getValue, eventIds);\n}\n\n/** Properties for the [[SplitContainer]] component */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface SplitContainerProps extends CommonProps {\n contentA: React.ReactNode;\n contentB: React.ReactNode;\n orientation: Orientation;\n percentage: number;\n resizable: boolean;\n minSizeTopLeft: number;\n minSizeBottomRight: number;\n splitterStateId?: string;\n onSplitterChange?: (size: number, percentage: number) => void;\n}\n\n/** Split Container class.\n */\nclass SplitContainer extends React.Component<SplitContainerProps> {\n private _containerDiv: HTMLDivElement | null = null;\n\n constructor(props: SplitContainerProps) {\n super(props);\n }\n\n private _onSplitterChange = (size: number): void => {\n let percentage = 0;\n\n if (this._containerDiv && size > 0) {\n if (this.props.orientation === Orientation.Horizontal) {\n const height = this._containerDiv.getBoundingClientRect().height;\n if (height > 0) percentage = size / height;\n } else {\n const width = this._containerDiv.getBoundingClientRect().width;\n if (width > 0) percentage = size / width;\n }\n\n if (this.props.onSplitterChange)\n this.props.onSplitterChange(size, percentage);\n }\n };\n\n public override render(): React.ReactNode {\n const orientation =\n this.props.orientation === Orientation.Horizontal\n ? \"horizontal\"\n : \"vertical\";\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\n const minSizeTopLeft = this.props.minSizeTopLeft;\n const minSizeBottomRight = -this.props.minSizeBottomRight;\n\n return (\n <div\n ref={(e) => {\n this._containerDiv = e;\n }}\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n >\n <SplitPane\n split={orientation}\n minSize={minSizeTopLeft}\n maxSize={minSizeBottomRight}\n defaultSize={defaultSize}\n onChange={this._onSplitterChange}\n allowResize={this.props.resizable}\n >\n {this.props.contentA}\n {this.props.contentB}\n </SplitPane>\n </div>\n );\n }\n}\n\n/** Properties for [[SingleContentContainer]] component\n */\ninterface SingleContentProps\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n extends CommonProps,\n Pick<ContentWrapperProps, \"contentIndex\"> {\n content: React.ReactNode;\n}\n\n/** Single Content Container class. */\nclass SingleContentContainer extends React.Component<SingleContentProps> {\n public override render(): React.ReactNode {\n return (\n <div\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n data-testid=\"single-content-container\"\n >\n <ContentWrapper\n content={this.props.content}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={this.props.contentIndex}\n />\n </div>\n );\n }\n}\n\n/** Common interface for HorizontalSplit and VerticalSplit. */\ninterface LayoutSplit {\n createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode;\n isLocked: boolean;\n}\n\n/** Minimum split size */\nconst MIN_SPLIT_SIZE = 6;\n\n/** Base Split class.\n */\nclass BaseSplit {\n public defaultPercentage: number;\n public stateId: string = \"\";\n public isLocked: boolean = false;\n\n constructor(props: LayoutSplitPropsBase) {\n this.defaultPercentage = props.percentage;\n\n if (props.id) this.stateId = props.id;\n\n if (props.lock) this.isLocked = props.lock;\n }\n}\n\n/** Horizontal Split class.\n */\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\n private _topIndex: number = -1;\n private _bottomIndex: number = -1;\n private _topSplit?: LayoutSplit;\n private _bottomSplit?: LayoutSplit;\n private _props: LayoutHorizontalSplitProps;\n private _minSizeTop: number = MIN_SPLIT_SIZE;\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutHorizontalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.top === \"number\") {\n this._topIndex = props.top;\n } else {\n this._topSplit = ContentLayoutDef.createSplit(props.top);\n }\n\n if (typeof props.bottom === \"number\") {\n this._bottomIndex = props.bottom;\n } else {\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\n }\n\n if (props.minSizeTop)\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\n\n if (props.minSizeBottom)\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const topContent = !this._topSplit ? (\n <ContentWrapper\n content={contentNodes[this._topIndex]}\n contentIndex={this._topIndex}\n />\n ) : (\n this._topSplit.createContentContainer(contentNodes, resizable)\n );\n const bottomContent = !this._bottomSplit ? (\n <ContentWrapper\n content={contentNodes[this._bottomIndex]}\n contentIndex={this._bottomIndex}\n />\n ) : (\n this._bottomSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={topContent}\n contentB={bottomContent}\n orientation={Orientation.Horizontal}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeTop}\n minSizeBottomRight={this._minSizeBottom}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Vertical Split class.\n */\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\n private _leftIndex: number = -1;\n private _rightIndex: number = -1;\n private _leftSplit?: LayoutSplit;\n private _rightSplit?: LayoutSplit;\n private _props: LayoutVerticalSplitProps;\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\n private _minSizeRight: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutVerticalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.left === \"number\") {\n this._leftIndex = props.left;\n } else {\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\n }\n\n if (typeof props.right === \"number\") {\n this._rightIndex = props.right;\n } else {\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\n }\n\n if (props.minSizeLeft)\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\n\n if (props.minSizeRight)\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const leftContent = !this._leftSplit ? (\n <ContentWrapper\n content={contentNodes[this._leftIndex]}\n contentIndex={this._leftIndex}\n />\n ) : (\n this._leftSplit.createContentContainer(contentNodes, resizable)\n );\n const rightContent = !this._rightSplit ? (\n <ContentWrapper\n content={contentNodes[this._rightIndex]}\n contentIndex={this._rightIndex}\n />\n ) : (\n this._rightSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={leftContent}\n contentB={rightContent}\n orientation={Orientation.Vertical}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeLeft}\n minSizeBottomRight={this._minSizeRight}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Content Layout Definition class.\n * @public\n */\nexport class ContentLayoutDef {\n private _layoutProps: ContentLayoutProps;\n private _rootSplit?: LayoutSplit;\n\n /** ID for this Content Layout */\n public id: string = \"\";\n /** Description of the layout. */\n public description: string = \"\";\n constructor(layoutProps: ContentLayoutProps) {\n this._layoutProps = layoutProps;\n this.id = layoutProps.id;\n if (layoutProps.description !== undefined)\n this.description = layoutProps.description;\n }\n\n /** @deprecated in 4.16.0. Used internally. */\n public get rootSplit(): LayoutSplit | undefined {\n return this._rootSplit;\n }\n\n /** Creates [[ContentLayoutProps]] for JSON purposes\n * @public\n */\n public toJSON(): ContentLayoutProps {\n return this._layoutProps;\n }\n\n /** Fill a layout container with React nodes for each content view.\n * @deprecated in 4.16.0. Used internally.\n */\n public fillLayoutContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode | undefined {\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (this.rootSplit) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.rootSplit.createContentContainer(contentNodes, resizable);\n }\n\n if (contentNodes.length > 0)\n return (\n <SingleContentContainer content={contentNodes[0]} contentIndex={0} />\n );\n\n return undefined;\n }\n\n /** Gets the indexes of content views used in this Content Layout. */\n public getUsedContentIndexes(): number[] {\n let allContentIndexes: number[] = [];\n\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\n allContentIndexes.push(0);\n else {\n allContentIndexes = allContentIndexes.concat(\n this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit)\n );\n allContentIndexes = allContentIndexes.concat(\n this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit)\n );\n }\n\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\n\n return uniqueContentIndexes;\n }\n\n private getHorizontalSplitContentIndexes(\n splitProps?: LayoutHorizontalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.top === \"number\") contentIndexes.push(splitProps.top);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit)\n );\n }\n\n if (typeof splitProps.bottom === \"number\")\n contentIndexes.push(splitProps.bottom);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n private getVerticalSplitContentIndexes(\n splitProps?: LayoutVerticalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.left === \"number\")\n contentIndexes.push(splitProps.left);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit)\n );\n }\n\n if (typeof splitProps.right === \"number\")\n contentIndexes.push(splitProps.right);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n /** @internal */\n public static createSplit(\n fragmentDef: LayoutFragmentProps\n ): LayoutSplit | undefined {\n if (fragmentDef.horizontalSplit) {\n return new HorizontalSplit(fragmentDef.horizontalSplit);\n } else if (fragmentDef.verticalSplit) {\n return new VerticalSplit(fragmentDef.verticalSplit);\n }\n\n return undefined;\n }\n}\n\n/** Content Layout Activated Event Args class.\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 ContentLayoutActivatedEventArgs {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout Activated Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> {}\n\n/** Properties for the [[ContentLayout]] React component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ContentLayoutComponentProps extends CommonProps {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout React component.\n * @public\n */\nexport function ContentLayout(props: ContentLayoutComponentProps) {\n const { stableContentLayout } = usePreviewFeatures();\n const [contentLayoutDef, setContentLayoutDef] =\n React.useState<ContentLayoutDef>(props.contentLayout);\n const [contentGroupId, setContentGroupId] = React.useState<\n ContentGroup[\"id\"]\n >(props.contentGroup.groupId);\n const [contentGroup, setContentGroup] = React.useState<ContentGroup>(\n props.contentGroup\n );\n const [contentNodes, setContentNodes] = React.useState<React.ReactNode[]>(\n () => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return props.contentGroup.getContentNodes();\n }\n );\n\n React.useEffect(() => {\n return UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(\n (args) => {\n setContentLayoutDef(args.contentLayout);\n setContentGroupId(args.contentGroup.groupId);\n setContentGroup(args.contentGroup);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setContentNodes(args.contentGroup.getContentNodes());\n }\n );\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n if (!contentContainer) return null;\n\n return (\n <div\n id=\"uifw-contentlayout-div\"\n className={props.className}\n style={props.style}\n key={\n stableContentLayout\n ? undefined\n : `${contentGroupId}-${contentLayoutDef.id}`\n }\n onMouseDown={() => {\n UiFramework.content.setMouseDown(true);\n }}\n onMouseUp={() => {\n UiFramework.content.setMouseDown(false);\n }}\n role=\"presentation\"\n >\n <ContentLayoutContext.Provider value={contentGroup}>\n {contentContainer}\n </ContentLayoutContext.Provider>\n </div>\n );\n}\n\nconst ContentLayoutContext = React.createContext<ContentGroup | undefined>(\n undefined\n);\nContentLayoutContext.displayName = \"uifw:ContentLayoutContext\";\n"]}
|
|
@@ -42,36 +42,19 @@ export function ViewOverlayHost({ viewport, featureOptions, userSuppliedOverlay,
|
|
|
42
42
|
* @deprecated in 4.16.0. Use {@link @itwin/imodel-components-react#ViewportComponent} component instead.
|
|
43
43
|
*/
|
|
44
44
|
export class IModelViewportControl extends ViewportContentControl {
|
|
45
|
+
_options;
|
|
45
46
|
static get id() {
|
|
46
47
|
return "UiFramework.IModelViewportControl";
|
|
47
48
|
}
|
|
49
|
+
_featureOptions = {};
|
|
50
|
+
_viewState;
|
|
51
|
+
_iModelConnection;
|
|
52
|
+
_alwaysUseSuppliedViewState;
|
|
53
|
+
_userSuppliedViewOverlay;
|
|
48
54
|
constructor(info, _options) {
|
|
49
55
|
_options = _options ?? {};
|
|
50
56
|
super(info, _options);
|
|
51
57
|
this._options = _options;
|
|
52
|
-
this._featureOptions = {};
|
|
53
|
-
/**
|
|
54
|
-
* This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().
|
|
55
|
-
* It is called by ViewportComponent on a mount to resolve the viewState.
|
|
56
|
-
*/
|
|
57
|
-
this._determineViewState = () => {
|
|
58
|
-
let viewState;
|
|
59
|
-
if (this.viewport && !this._alwaysUseSuppliedViewState)
|
|
60
|
-
viewState = this.viewport.view;
|
|
61
|
-
else if (this._viewState) {
|
|
62
|
-
if (typeof this._viewState === "function")
|
|
63
|
-
viewState = this._viewState();
|
|
64
|
-
else
|
|
65
|
-
viewState = this._viewState;
|
|
66
|
-
}
|
|
67
|
-
else
|
|
68
|
-
throw new UiError(UiFramework.loggerCategory("IModelViewport"), "No ViewState could be determined");
|
|
69
|
-
return viewState;
|
|
70
|
-
};
|
|
71
|
-
/** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */
|
|
72
|
-
this._getViewOverlay = (vp) => {
|
|
73
|
-
return (React.createElement(ViewOverlayHost, { viewport: vp, featureOptions: this._featureOptions, userSuppliedOverlay: this._userSuppliedViewOverlay, "data-testid": "ViewOverlay" }));
|
|
74
|
-
};
|
|
75
58
|
this._options = _options;
|
|
76
59
|
if (_options.featureOptions)
|
|
77
60
|
this._featureOptions = _options.featureOptions;
|
|
@@ -109,6 +92,24 @@ export class IModelViewportControl extends ViewportContentControl {
|
|
|
109
92
|
this.initializeReactNode();
|
|
110
93
|
return this.getKeyedReactNode();
|
|
111
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().
|
|
97
|
+
* It is called by ViewportComponent on a mount to resolve the viewState.
|
|
98
|
+
*/
|
|
99
|
+
_determineViewState = () => {
|
|
100
|
+
let viewState;
|
|
101
|
+
if (this.viewport && !this._alwaysUseSuppliedViewState)
|
|
102
|
+
viewState = this.viewport.view;
|
|
103
|
+
else if (this._viewState) {
|
|
104
|
+
if (typeof this._viewState === "function")
|
|
105
|
+
viewState = this._viewState();
|
|
106
|
+
else
|
|
107
|
+
viewState = this._viewState;
|
|
108
|
+
}
|
|
109
|
+
else
|
|
110
|
+
throw new UiError(UiFramework.loggerCategory("IModelViewport"), "No ViewState could be determined");
|
|
111
|
+
return viewState;
|
|
112
|
+
};
|
|
112
113
|
/** Get the React component that will contain the Viewport */
|
|
113
114
|
getImodelConnectedViewportReactElement() {
|
|
114
115
|
return (React.createElement(IModelConnectedViewport, { viewportRef: (v) => {
|
|
@@ -139,6 +140,10 @@ export class IModelViewportControl extends ViewportContentControl {
|
|
|
139
140
|
getReactElementForViewSelectorChange(iModelConnection, _unusedViewDefinitionId, viewState, _name) {
|
|
140
141
|
return this.getImodelViewportReactElement(iModelConnection, viewState);
|
|
141
142
|
}
|
|
143
|
+
/** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */
|
|
144
|
+
_getViewOverlay = (vp) => {
|
|
145
|
+
return (React.createElement(ViewOverlayHost, { viewport: vp, featureOptions: this._featureOptions, userSuppliedOverlay: this._userSuppliedViewOverlay, "data-testid": "ViewOverlay" }));
|
|
146
|
+
};
|
|
142
147
|
/** Get the NavigationAidControl associated with this ContentControl */
|
|
143
148
|
get navigationAidControl() {
|
|
144
149
|
if (this.viewport)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelViewport.js","sourceRoot":"","sources":["../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,oCAAoC,EAAE,MAAM,oDAAoD,CAAC;AAC1G,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,qDAAqD;AAErD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,KAAkD;IAElD,MAAM,MAAM,GAAG,sBAAsB,CACnC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,YAA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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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport type {\n ViewportProps,\n ViewStateProp,\n} from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FillCentered } from \"@itwin/core-react\";\n\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { DefaultViewOverlay } from \"./DefaultViewOverlay.js\";\nimport { ViewportContentControl } from \"./ViewportContentControl.js\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid.js\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport { ConfigurableUiContext } from \"../configurableui/ConfigurableUiContent.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Viewport that is connected to the IModelConnection property in the Redux store. The application must set up the Redux store and include the FrameworkReducer.\n * @note Requires redux provider.\n * @public\n * @deprecated in 4.15.0. Use {@link @itwin/imodel-components-react#ViewportComponent} instead.\n */\nexport function IModelConnectedViewport(\n props: Omit<ViewportProps, \"imodel\" | \"viewState\">\n) {\n const iModel = useReduxFrameworkState(\n (state) => state?.sessionState.iModelConnection\n );\n const viewState = useReduxFrameworkState(\n (state) => state?.sessionState.defaultViewState\n );\n if (!iModel) return null;\n return <ViewportComponent imodel={iModel} viewState={viewState} {...props} />;\n}\n\n/** [[IModelViewportControl]] options. These options are set in the applicationData property of the [[ContentProps]].\n * @public\n * @deprecated in 4.16.0. Used in a deprecated class {@link IModelViewportControl}.\n */\nexport interface IModelViewportControlOptions {\n /** ViewState or a function to return a ViewState */\n viewState?: ViewStateProp;\n /** IModelConnection of data in Viewport */\n iModelConnection?: IModelConnection | (() => IModelConnection);\n /** Map of options that can be used to enable/disable features within the view */\n featureOptions?: { [key: string]: any };\n /** Optional background color which may be used if viewState and iModelConnection are undefined */\n bgColor?: string;\n /** Optional property to always use the supplied `viewState` property instead of using viewport.view when set */\n alwaysUseSuppliedViewState?: boolean;\n /** Optional property to supply custom view overlay. Uses when caller want to supply custom overlay component. */\n supplyViewOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n /** Optional property to defer reactNode initialization until first reactNode property is needed. Useful when subClassing the `IModelViewportControl`. */\n deferNodeInitialization?: boolean;\n}\n\ninterface ViewOverlayHostProps {\n viewport: ScreenViewport;\n featureOptions?: { [key: string]: any };\n userSuppliedOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n}\n\n/** @internal */\nexport function ViewOverlayHost({\n viewport,\n featureOptions,\n userSuppliedOverlay,\n}: ViewOverlayHostProps) {\n const reduxDisplayViewOverlay = useReduxFrameworkState(\n (state) => state?.configurableUiState.viewOverlayDisplay\n );\n const configurableUi = React.useContext(ConfigurableUiContext);\n const displayViewOverlay =\n configurableUi?.viewOverlay ?? reduxDisplayViewOverlay ?? true;\n if (!displayViewOverlay) return null;\n return userSuppliedOverlay ? (\n <React.Fragment>{userSuppliedOverlay(viewport)}</React.Fragment>\n ) : (\n <DefaultViewOverlay viewport={viewport} featureOptions={featureOptions} />\n );\n}\n\n/** iModel Viewport Control\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/imodel-components-react#ViewportComponent} component instead.\n */\nexport class IModelViewportControl extends ViewportContentControl {\n public static get id() {\n return \"UiFramework.IModelViewportControl\";\n }\n protected _featureOptions: { [key: string]: boolean | string } = {};\n protected _viewState: ViewStateProp | undefined;\n protected _iModelConnection: IModelConnection | undefined;\n protected _alwaysUseSuppliedViewState: boolean;\n private _userSuppliedViewOverlay?: (\n _viewport: ScreenViewport\n ) => React.ReactNode;\n\n constructor(\n info: ConfigurableCreateInfo,\n protected _options: IModelViewportControlOptions\n ) {\n _options = _options ?? {};\n super(info, _options);\n this._options = _options;\n\n if (_options.featureOptions) this._featureOptions = _options.featureOptions;\n this._alwaysUseSuppliedViewState =\n _options.alwaysUseSuppliedViewState ?? false;\n this._userSuppliedViewOverlay = _options.supplyViewOverlay;\n\n if (!_options.deferNodeInitialization) this.initializeReactNode();\n }\n\n protected initializeReactNode() {\n const options = this._options;\n\n if (options.viewState) this._viewState = options.viewState;\n\n const iModelConnection =\n typeof options.iModelConnection === \"function\"\n ? options.iModelConnection()\n : options.iModelConnection;\n\n if (this._viewState && iModelConnection) {\n /** Passing _determineViewState as a function reference; it is not called here. */\n this._reactNode = this.getImodelViewportReactElement(\n iModelConnection,\n this._determineViewState\n );\n } else {\n if (\n UiFramework.getIModelConnection() &&\n UiFramework.getDefaultViewState()\n ) {\n this._reactNode = this.getImodelConnectedViewportReactElement();\n } else {\n this._reactNode = this.getNoContentReactElement(options);\n this.setIsReady();\n }\n }\n }\n\n protected override getReactNode(): React.ReactNode {\n if (\n !React.isValidElement(this._reactNode) &&\n this._options.deferNodeInitialization\n )\n this.initializeReactNode();\n\n return this.getKeyedReactNode();\n }\n\n /**\n * This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().\n * It is called by ViewportComponent on a mount to resolve the viewState.\n */\n private _determineViewState = (): ViewState => {\n let viewState: ViewState;\n\n if (this.viewport && !this._alwaysUseSuppliedViewState)\n viewState = this.viewport.view;\n else if (this._viewState) {\n if (typeof this._viewState === \"function\") viewState = this._viewState();\n else viewState = this._viewState;\n } else\n throw new UiError(\n UiFramework.loggerCategory(\"IModelViewport\"),\n \"No ViewState could be determined\"\n );\n\n return viewState!;\n };\n\n /** Get the React component that will contain the Viewport */\n protected getImodelConnectedViewportReactElement(): React.ReactNode {\n return (\n <IModelConnectedViewport\n viewportRef={(v) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will contain the Viewport */\n protected getImodelViewportReactElement(\n iModelConnection: IModelConnection,\n viewState: ViewStateProp\n ): React.ReactNode {\n return (\n <ViewportComponent\n viewState={viewState}\n imodel={iModelConnection}\n controlId={this.controlId}\n viewportRef={(v) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will be shown when no iModel data is available */\n protected getNoContentReactElement(\n _options: IModelViewportControlOptions\n ): React.ReactNode {\n return (\n <FillCentered>{UiFramework.translate(\"general.no-content\")}</FillCentered>\n );\n }\n\n /** Get the React.Element for a ViewSelector change. */\n public override getReactElementForViewSelectorChange(\n iModelConnection: IModelConnection,\n _unusedViewDefinitionId: Id64String,\n viewState: ViewState,\n _name: string\n ): React.ReactNode {\n return this.getImodelViewportReactElement(iModelConnection, viewState);\n }\n\n /** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */\n protected _getViewOverlay = (vp: ScreenViewport): React.ReactNode => {\n return (\n <ViewOverlayHost\n viewport={vp}\n featureOptions={this._featureOptions}\n userSuppliedOverlay={this._userSuppliedViewOverlay}\n data-testid=\"ViewOverlay\"\n />\n );\n };\n\n /** Get the NavigationAidControl associated with this ContentControl */\n public override get navigationAidControl(): string {\n if (this.viewport) return super.navigationAidControl;\n else return StandardRotationNavigationAidControl.navigationAidId;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IModelViewport.js","sourceRoot":"","sources":["../../../src/appui-react/content/IModelViewport.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAA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AAkF;IACxE,wBAAwB,CAChC,QAAsC;QAEtC,OAAO,CACL,oBAAC,YAAY,QAAE,WAAW,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAgB,CAC3E,CAAC;IACJ,CAAC;IAED,uDAAuD;IACvC,oCAAoC,CAClD,gBAAkC,EAClC,uBAAmC,EACnC,SAAoB,EACpB,KAAa;QAEb,OAAO,IAAI,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAED,+HAA+H;IACrH,eAAe,GAAG,CAAC,EAAkB,EAAmB,EAAE;QAClE,OAAO,CACL,oBAAC,eAAe,IACd,QAAQ,EAAE,EAAE,EACZ,cAAc,EAAE,IAAI,CAAC,eAAe,EACpC,mBAAmB,EAAE,IAAI,CAAC,wBAAwB,iBACtC,aAAa,GACzB,CACH,CAAC;IACJ,CAAC,CAAC;IAEF,uEAAuE;IACvE,IAAoB,oBAAoB;QACtC,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,KAAK,CAAC,oBAAoB,CAAC;;YAChD,OAAO,oCAAoC,CAAC,eAAe,CAAC;IACnE,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 ContentView\n */\n\nimport * as React from \"react\";\nimport type { Id64String } from \"@itwin/core-bentley\";\nimport type {\n IModelConnection,\n ScreenViewport,\n ViewState,\n} from \"@itwin/core-frontend\";\nimport type {\n ViewportProps,\n ViewStateProp,\n} from \"@itwin/imodel-components-react\";\nimport { ViewportComponent } from \"@itwin/imodel-components-react\";\nimport { FillCentered } from \"@itwin/core-react\";\n\nimport type { ConfigurableCreateInfo } from \"../configurableui/ConfigurableUiControl.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { DefaultViewOverlay } from \"./DefaultViewOverlay.js\";\nimport { ViewportContentControl } from \"./ViewportContentControl.js\";\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid.js\";\nimport { UiError } from \"@itwin/appui-abstract\";\nimport { useReduxFrameworkState } from \"../uistate/useReduxFrameworkState.js\";\nimport { ConfigurableUiContext } from \"../configurableui/ConfigurableUiContent.js\";\n\n/* eslint-disable @typescript-eslint/no-deprecated */\n\n/** Viewport that is connected to the IModelConnection property in the Redux store. The application must set up the Redux store and include the FrameworkReducer.\n * @note Requires redux provider.\n * @public\n * @deprecated in 4.15.0. Use {@link @itwin/imodel-components-react#ViewportComponent} instead.\n */\nexport function IModelConnectedViewport(\n props: Omit<ViewportProps, \"imodel\" | \"viewState\">\n) {\n const iModel = useReduxFrameworkState(\n (state) => state?.sessionState.iModelConnection\n );\n const viewState = useReduxFrameworkState(\n (state) => state?.sessionState.defaultViewState\n );\n if (!iModel) return null;\n return <ViewportComponent imodel={iModel} viewState={viewState} {...props} />;\n}\n\n/** [[IModelViewportControl]] options. These options are set in the applicationData property of the [[ContentProps]].\n * @public\n * @deprecated in 4.16.0. Used in a deprecated class {@link IModelViewportControl}.\n */\nexport interface IModelViewportControlOptions {\n /** ViewState or a function to return a ViewState */\n viewState?: ViewStateProp;\n /** IModelConnection of data in Viewport */\n iModelConnection?: IModelConnection | (() => IModelConnection);\n /** Map of options that can be used to enable/disable features within the view */\n featureOptions?: { [key: string]: any };\n /** Optional background color which may be used if viewState and iModelConnection are undefined */\n bgColor?: string;\n /** Optional property to always use the supplied `viewState` property instead of using viewport.view when set */\n alwaysUseSuppliedViewState?: boolean;\n /** Optional property to supply custom view overlay. Uses when caller want to supply custom overlay component. */\n supplyViewOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n /** Optional property to defer reactNode initialization until first reactNode property is needed. Useful when subClassing the `IModelViewportControl`. */\n deferNodeInitialization?: boolean;\n}\n\ninterface ViewOverlayHostProps {\n viewport: ScreenViewport;\n featureOptions?: { [key: string]: any };\n userSuppliedOverlay?: (_viewport: ScreenViewport) => React.ReactNode;\n}\n\n/** @internal */\nexport function ViewOverlayHost({\n viewport,\n featureOptions,\n userSuppliedOverlay,\n}: ViewOverlayHostProps) {\n const reduxDisplayViewOverlay = useReduxFrameworkState(\n (state) => state?.configurableUiState.viewOverlayDisplay\n );\n const configurableUi = React.useContext(ConfigurableUiContext);\n const displayViewOverlay =\n configurableUi?.viewOverlay ?? reduxDisplayViewOverlay ?? true;\n if (!displayViewOverlay) return null;\n return userSuppliedOverlay ? (\n <React.Fragment>{userSuppliedOverlay(viewport)}</React.Fragment>\n ) : (\n <DefaultViewOverlay viewport={viewport} featureOptions={featureOptions} />\n );\n}\n\n/** iModel Viewport Control\n * @public\n * @deprecated in 4.16.0. Use {@link @itwin/imodel-components-react#ViewportComponent} component instead.\n */\nexport class IModelViewportControl extends ViewportContentControl {\n public static get id() {\n return \"UiFramework.IModelViewportControl\";\n }\n protected _featureOptions: { [key: string]: boolean | string } = {};\n protected _viewState: ViewStateProp | undefined;\n protected _iModelConnection: IModelConnection | undefined;\n protected _alwaysUseSuppliedViewState: boolean;\n private _userSuppliedViewOverlay?: (\n _viewport: ScreenViewport\n ) => React.ReactNode;\n\n constructor(\n info: ConfigurableCreateInfo,\n protected _options: IModelViewportControlOptions\n ) {\n _options = _options ?? {};\n super(info, _options);\n this._options = _options;\n\n if (_options.featureOptions) this._featureOptions = _options.featureOptions;\n this._alwaysUseSuppliedViewState =\n _options.alwaysUseSuppliedViewState ?? false;\n this._userSuppliedViewOverlay = _options.supplyViewOverlay;\n\n if (!_options.deferNodeInitialization) this.initializeReactNode();\n }\n\n protected initializeReactNode() {\n const options = this._options;\n\n if (options.viewState) this._viewState = options.viewState;\n\n const iModelConnection =\n typeof options.iModelConnection === \"function\"\n ? options.iModelConnection()\n : options.iModelConnection;\n\n if (this._viewState && iModelConnection) {\n /** Passing _determineViewState as a function reference; it is not called here. */\n this._reactNode = this.getImodelViewportReactElement(\n iModelConnection,\n this._determineViewState\n );\n } else {\n if (\n UiFramework.getIModelConnection() &&\n UiFramework.getDefaultViewState()\n ) {\n this._reactNode = this.getImodelConnectedViewportReactElement();\n } else {\n this._reactNode = this.getNoContentReactElement(options);\n this.setIsReady();\n }\n }\n }\n\n protected override getReactNode(): React.ReactNode {\n if (\n !React.isValidElement(this._reactNode) &&\n this._options.deferNodeInitialization\n )\n this.initializeReactNode();\n\n return this.getKeyedReactNode();\n }\n\n /**\n * This is passed as a function to the ViewportComponent as the `viewState` prop in getImodelViewportReactElement().\n * It is called by ViewportComponent on a mount to resolve the viewState.\n */\n private _determineViewState = (): ViewState => {\n let viewState: ViewState;\n\n if (this.viewport && !this._alwaysUseSuppliedViewState)\n viewState = this.viewport.view;\n else if (this._viewState) {\n if (typeof this._viewState === \"function\") viewState = this._viewState();\n else viewState = this._viewState;\n } else\n throw new UiError(\n UiFramework.loggerCategory(\"IModelViewport\"),\n \"No ViewState could be determined\"\n );\n\n return viewState!;\n };\n\n /** Get the React component that will contain the Viewport */\n protected getImodelConnectedViewportReactElement(): React.ReactNode {\n return (\n <IModelConnectedViewport\n viewportRef={(v) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will contain the Viewport */\n protected getImodelViewportReactElement(\n iModelConnection: IModelConnection,\n viewState: ViewStateProp\n ): React.ReactNode {\n return (\n <ViewportComponent\n viewState={viewState}\n imodel={iModelConnection}\n controlId={this.controlId}\n viewportRef={(v) => {\n this.viewport = v;\n // for convenience, if window defined bind viewport to window\n if (undefined !== window) (window as any).viewport = v;\n if (!UiFramework.frontstages.isLoading)\n UiFramework.frontstages.activeFrontstageDef?.setActiveViewFromViewport(\n v\n );\n }}\n getViewOverlay={this._getViewOverlay}\n />\n );\n }\n\n /** Get the React component that will be shown when no iModel data is available */\n protected getNoContentReactElement(\n _options: IModelViewportControlOptions\n ): React.ReactNode {\n return (\n <FillCentered>{UiFramework.translate(\"general.no-content\")}</FillCentered>\n );\n }\n\n /** Get the React.Element for a ViewSelector change. */\n public override getReactElementForViewSelectorChange(\n iModelConnection: IModelConnection,\n _unusedViewDefinitionId: Id64String,\n viewState: ViewState,\n _name: string\n ): React.ReactNode {\n return this.getImodelViewportReactElement(iModelConnection, viewState);\n }\n\n /** Get the default ViewOverlay unless parameter is set to not use it. May be override in an application specific sub-class */\n protected _getViewOverlay = (vp: ScreenViewport): React.ReactNode => {\n return (\n <ViewOverlayHost\n viewport={vp}\n featureOptions={this._featureOptions}\n userSuppliedOverlay={this._userSuppliedViewOverlay}\n data-testid=\"ViewOverlay\"\n />\n );\n };\n\n /** Get the NavigationAidControl associated with this ContentControl */\n public override get navigationAidControl(): string {\n if (this.viewport) return super.navigationAidControl;\n else return StandardRotationNavigationAidControl.navigationAidId;\n }\n}\n"]}
|
|
@@ -12,6 +12,7 @@ import { ContentLayoutDef } from "./ContentLayout.js";
|
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
14
|
export class InternalContentLayoutManager {
|
|
15
|
+
static _layoutDefs = new Map();
|
|
15
16
|
/** build a layout key that is unique for group layout combination */
|
|
16
17
|
static getKey(props) {
|
|
17
18
|
return `${props.contentGroupId}-${props.layoutId}`;
|
|
@@ -95,5 +96,4 @@ export class InternalContentLayoutManager {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
|
-
InternalContentLayoutManager._layoutDefs = new Map();
|
|
99
99
|
//# sourceMappingURL=InternalContentLayoutManager.js.map
|