@itwin/appui-react 3.1.0-dev.7 → 3.2.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +122 -16
- package/lib/cjs/appui-react/backstage/Backstage.d.ts +0 -2
- package/lib/cjs/appui-react/backstage/Backstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/backstage/Backstage.js +0 -1
- package/lib/cjs/appui-react/backstage/Backstage.js.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.d.ts +1 -0
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.d.ts.map +1 -1
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js +2 -2
- package/lib/cjs/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js +2 -0
- package/lib/cjs/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiManager.js +6 -1
- package/lib/cjs/appui-react/configurableui/ConfigurableUiManager.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentControl.d.ts +6 -0
- package/lib/cjs/appui-react/content/ContentControl.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentControl.js +11 -1
- package/lib/cjs/appui-react/content/ContentControl.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.d.ts +8 -0
- package/lib/cjs/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.js +43 -36
- package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.scss +27 -27
- package/lib/cjs/appui-react/content/ContentViewManager.d.ts +7 -0
- package/lib/cjs/appui-react/content/ContentViewManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentViewManager.js +46 -22
- package/lib/cjs/appui-react/content/ContentViewManager.js.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.css +9 -0
- package/lib/cjs/appui-react/content/FloatingViewportContent.d.ts +25 -0
- package/lib/cjs/appui-react/content/FloatingViewportContent.d.ts.map +1 -0
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +73 -0
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -0
- package/lib/cjs/appui-react/content/IModelViewport.d.ts +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js +1 -1
- package/lib/cjs/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/cjs/appui-react/content/ViewportContentControl.d.ts +9 -0
- package/lib/cjs/appui-react/content/ViewportContentControl.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ViewportContentControl.js +24 -1
- package/lib/cjs/appui-react/content/ViewportContentControl.js.map +1 -1
- package/lib/cjs/appui-react/dialog/ContentDialog.d.ts +24 -0
- package/lib/cjs/appui-react/dialog/ContentDialog.d.ts.map +1 -0
- package/lib/cjs/appui-react/dialog/ContentDialog.js +72 -0
- package/lib/cjs/appui-react/dialog/ContentDialog.js.map +1 -0
- package/lib/cjs/appui-react/dialog/ContentDialog.scss +25 -0
- package/lib/cjs/appui-react/dialog/ContentDialogManager.d.ts +65 -0
- package/lib/cjs/appui-react/dialog/ContentDialogManager.d.ts.map +1 -0
- package/lib/cjs/appui-react/dialog/ContentDialogManager.js +148 -0
- package/lib/cjs/appui-react/dialog/ContentDialogManager.js.map +1 -0
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +9 -0
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +65 -7
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageManager.d.ts +3 -0
- package/lib/cjs/appui-react/frontstage/FrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageManager.js +8 -0
- package/lib/cjs/appui-react/frontstage/FrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/hooks/useUiVisibility.d.ts +6 -0
- package/lib/cjs/appui-react/hooks/useUiVisibility.d.ts.map +1 -0
- package/lib/cjs/appui-react/hooks/useUiVisibility.js +27 -0
- package/lib/cjs/appui-react/hooks/useUiVisibility.js.map +1 -0
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js +2 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsTreeSearch.json +3 -3
- package/lib/cjs/appui-react/popup/CardPopup.scss +3 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +2 -3
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js +2 -3
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.d.ts +3 -0
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.d.ts.map +1 -1
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js +20 -5
- package/lib/cjs/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/cjs/appui-react/timeline/AnalysisAnimationProvider.js +1 -1
- package/lib/cjs/appui-react/timeline/AnalysisAnimationProvider.js.map +1 -1
- package/lib/cjs/appui-react/uiprovider/DefaultDialogGridContainer.scss +3 -0
- package/lib/cjs/appui-react/widget-panels/Content.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Content.js +2 -2
- package/lib/cjs/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +25 -7
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widgets/BasicNavigationWidget.js +2 -2
- package/lib/cjs/appui-react/widgets/BasicNavigationWidget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/BasicToolWidget.d.ts +0 -2
- package/lib/cjs/appui-react/widgets/BasicToolWidget.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/BasicToolWidget.js +3 -17
- package/lib/cjs/appui-react/widgets/BasicToolWidget.js.map +1 -1
- package/lib/cjs/appui-react/widgets/ContentToolWidgetComposer.js +2 -2
- package/lib/cjs/appui-react/widgets/ContentToolWidgetComposer.js.map +1 -1
- package/lib/cjs/appui-react/widgets/ViewToolWidgetComposer.js +2 -2
- package/lib/cjs/appui-react/widgets/ViewToolWidgetComposer.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +2 -0
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +2 -0
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/cjs/appui-react.d.ts +4 -0
- package/lib/cjs/appui-react.d.ts.map +1 -1
- package/lib/cjs/appui-react.js +4 -0
- package/lib/cjs/appui-react.js.map +1 -1
- package/lib/esm/appui-react/backstage/Backstage.d.ts +0 -2
- package/lib/esm/appui-react/backstage/Backstage.d.ts.map +1 -1
- package/lib/esm/appui-react/backstage/Backstage.js +0 -1
- package/lib/esm/appui-react/backstage/Backstage.js.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposerItem.d.ts +1 -0
- package/lib/esm/appui-react/backstage/BackstageComposerItem.d.ts.map +1 -1
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js +2 -2
- package/lib/esm/appui-react/backstage/BackstageComposerItem.js.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js +2 -0
- package/lib/esm/appui-react/configurableui/ConfigurableUiContent.js.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiManager.d.ts.map +1 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiManager.js +6 -1
- package/lib/esm/appui-react/configurableui/ConfigurableUiManager.js.map +1 -1
- package/lib/esm/appui-react/content/ContentControl.d.ts +6 -0
- package/lib/esm/appui-react/content/ContentControl.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentControl.js +10 -1
- package/lib/esm/appui-react/content/ContentControl.js.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.d.ts +8 -0
- package/lib/esm/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.js +41 -35
- package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.scss +27 -27
- package/lib/esm/appui-react/content/ContentViewManager.d.ts +7 -0
- package/lib/esm/appui-react/content/ContentViewManager.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentViewManager.js +46 -22
- package/lib/esm/appui-react/content/ContentViewManager.js.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.css +9 -0
- package/lib/esm/appui-react/content/FloatingViewportContent.d.ts +25 -0
- package/lib/esm/appui-react/content/FloatingViewportContent.d.ts.map +1 -0
- package/lib/esm/appui-react/content/FloatingViewportContent.js +69 -0
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -0
- package/lib/esm/appui-react/content/IModelViewport.d.ts +1 -1
- package/lib/esm/appui-react/content/IModelViewport.d.ts.map +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js +1 -1
- package/lib/esm/appui-react/content/IModelViewport.js.map +1 -1
- package/lib/esm/appui-react/content/ViewportContentControl.d.ts +9 -0
- package/lib/esm/appui-react/content/ViewportContentControl.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ViewportContentControl.js +23 -1
- package/lib/esm/appui-react/content/ViewportContentControl.js.map +1 -1
- package/lib/esm/appui-react/dialog/ContentDialog.d.ts +24 -0
- package/lib/esm/appui-react/dialog/ContentDialog.d.ts.map +1 -0
- package/lib/esm/appui-react/dialog/ContentDialog.js +67 -0
- package/lib/esm/appui-react/dialog/ContentDialog.js.map +1 -0
- package/lib/esm/appui-react/dialog/ContentDialog.scss +25 -0
- package/lib/esm/appui-react/dialog/ContentDialogManager.d.ts +65 -0
- package/lib/esm/appui-react/dialog/ContentDialogManager.d.ts.map +1 -0
- package/lib/esm/appui-react/dialog/ContentDialogManager.js +142 -0
- package/lib/esm/appui-react/dialog/ContentDialogManager.js.map +1 -0
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +9 -0
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +66 -8
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageManager.d.ts +3 -0
- package/lib/esm/appui-react/frontstage/FrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageManager.js +8 -0
- package/lib/esm/appui-react/frontstage/FrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/hooks/useUiVisibility.d.ts +6 -0
- package/lib/esm/appui-react/hooks/useUiVisibility.d.ts.map +1 -0
- package/lib/esm/appui-react/hooks/useUiVisibility.js +23 -0
- package/lib/esm/appui-react/hooks/useUiVisibility.js.map +1 -0
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js +2 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsTreeSearch.json +3 -3
- package/lib/esm/appui-react/popup/CardPopup.scss +3 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +2 -3
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js +1 -2
- package/lib/esm/appui-react/stagepanels/StagePanelDef.js.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.d.ts +3 -0
- package/lib/esm/appui-react/statusbar/StatusBarComposer.d.ts.map +1 -1
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js +20 -5
- package/lib/esm/appui-react/statusbar/StatusBarComposer.js.map +1 -1
- package/lib/esm/appui-react/timeline/AnalysisAnimationProvider.js +1 -1
- package/lib/esm/appui-react/timeline/AnalysisAnimationProvider.js.map +1 -1
- package/lib/esm/appui-react/uiprovider/DefaultDialogGridContainer.scss +3 -0
- package/lib/esm/appui-react/widget-panels/Content.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Content.js +2 -2
- package/lib/esm/appui-react/widget-panels/Content.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +25 -7
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widgets/BasicNavigationWidget.js +1 -1
- package/lib/esm/appui-react/widgets/BasicNavigationWidget.js.map +1 -1
- package/lib/esm/appui-react/widgets/BasicToolWidget.d.ts +0 -2
- package/lib/esm/appui-react/widgets/BasicToolWidget.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/BasicToolWidget.js +1 -14
- package/lib/esm/appui-react/widgets/BasicToolWidget.js.map +1 -1
- package/lib/esm/appui-react/widgets/ContentToolWidgetComposer.js +1 -1
- package/lib/esm/appui-react/widgets/ContentToolWidgetComposer.js.map +1 -1
- package/lib/esm/appui-react/widgets/ViewToolWidgetComposer.js +1 -1
- package/lib/esm/appui-react/widgets/ViewToolWidgetComposer.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts +2 -0
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +2 -0
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react.d.ts +4 -0
- package/lib/esm/appui-react.d.ts.map +1 -1
- package/lib/esm/appui-react.js +4 -0
- package/lib/esm/appui-react.js.map +1 -1
- package/package.json +34 -35
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackstageComposerItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposerItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,EACL,mBAAmB,EAAE,aAAa,EAAE,sBAAsB,EAC3D,MAAM,uBAAuB,CAAC;AAO/B,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;CACpC;AAED,gBAAgB;AAChB,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,
|
|
1
|
+
{"version":3,"file":"BackstageComposerItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposerItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;;AAIH,OAAO,EACL,mBAAmB,EAAE,aAAa,EAAE,sBAAsB,EAC3D,MAAM,uBAAuB,CAAC;AAO/B,gBAAgB;AAChB,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;CACpC;AAED,gBAAgB;AAChB,wBAAgB,2BAA2B,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,eAsBrF;AAED,gBAAgB;AAChB,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;CACvC;AAED,gBAAgB;AAChB,wBAAgB,8BAA8B,CAAC,EAAE,IAAI,EAAE,EAAE,mCAAmC,eA0B3F;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,EAAE,0BAA0B,eAazE"}
|
|
@@ -20,7 +20,7 @@ export function BackstageComposerActionItem({ item }) {
|
|
|
20
20
|
manager.close();
|
|
21
21
|
item.execute();
|
|
22
22
|
}, [manager, item]);
|
|
23
|
-
return (React.createElement(NZ_BackstageItem, { itemId: item.id, icon: React.createElement(Icon, { iconSpec: ConditionalStringValue.getValue(item.icon) }), isActive: ConditionalBooleanValue.getValue(item.isActive), isDisabled: ConditionalBooleanValue.getValue(item.isDisabled), onClick: handleClick, subtitle: ConditionalStringValue.getValue(item.subtitle), badge: BadgeUtilities.getComponentForBadgeType(item.badgeType) }, ConditionalStringValue.getValue(item.label)));
|
|
23
|
+
return (React.createElement(NZ_BackstageItem, { itemId: item.id, providerId: item.providerId, itemPriority: item.itemPriority, groupPriority: item.groupPriority, icon: React.createElement(Icon, { iconSpec: ConditionalStringValue.getValue(item.icon) }), isActive: ConditionalBooleanValue.getValue(item.isActive), isDisabled: ConditionalBooleanValue.getValue(item.isDisabled), onClick: handleClick, subtitle: ConditionalStringValue.getValue(item.subtitle), badge: BadgeUtilities.getComponentForBadgeType(item.badgeType) }, ConditionalStringValue.getValue(item.label)));
|
|
24
24
|
}
|
|
25
25
|
/** @internal */
|
|
26
26
|
export function BackstageComposerStageLauncher({ item }) {
|
|
@@ -34,7 +34,7 @@ export function BackstageComposerStageLauncher({ item }) {
|
|
|
34
34
|
}, [manager, item.stageId]);
|
|
35
35
|
const activeFrontstageId = useActiveFrontstageId();
|
|
36
36
|
const isActive = ConditionalBooleanValue.getValue((_a = item.isActive) !== null && _a !== void 0 ? _a : item.stageId === activeFrontstageId);
|
|
37
|
-
return (React.createElement(NZ_BackstageItem, { itemId: item.id, icon: React.createElement(Icon, { iconSpec: ConditionalStringValue.getValue(item.icon) }), isActive: isActive, isDisabled: ConditionalBooleanValue.getValue(item.isDisabled), onClick: handleClick, subtitle: ConditionalStringValue.getValue(item.subtitle), badge: BadgeUtilities.getComponentForBadgeType(item.badgeType) }, ConditionalStringValue.getValue(item.label)));
|
|
37
|
+
return (React.createElement(NZ_BackstageItem, { itemId: item.id, providerId: item.providerId, itemPriority: item.itemPriority, groupPriority: item.groupPriority, icon: React.createElement(Icon, { iconSpec: ConditionalStringValue.getValue(item.icon) }), isActive: isActive, isDisabled: ConditionalBooleanValue.getValue(item.isDisabled), onClick: handleClick, subtitle: ConditionalStringValue.getValue(item.subtitle), badge: BadgeUtilities.getComponentForBadgeType(item.badgeType) }, ConditionalStringValue.getValue(item.label)));
|
|
38
38
|
}
|
|
39
39
|
/** Item of [[BackstageComposer]].
|
|
40
40
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackstageComposerItem.js","sourceRoot":"","sources":["../../../../src/appui-react/backstage/BackstageComposerItem.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACuD,uBAAuB,EAAE,sBAAsB,EAAE,eAAe,GAC7H,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAOzD,gBAAgB;AAChB,MAAM,UAAU,2BAA2B,CAAC,EAAE,I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AAK,CAAC,CAC3B,CACpB,CAAC;AACJ,CAAC;AAWD;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAE,IAAI,EAA8B;IACxE,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE;QACzB,OAAO,CACL,oBAAC,8BAA8B,IAC7B,IAAI,EAAE,IAAI,GACV,CACH,CAAC;KACH;IACD,OAAO,CACL,oBAAC,2BAA2B,IAC1B,IAAI,EAAE,IAAI,GACV,CACH,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Backstage\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport {\r\n BackstageActionItem, BackstageItem, BackstageStageLauncher, ConditionalBooleanValue, ConditionalStringValue, isStageLauncher,\r\n} from \"@itwin/appui-abstract\";\r\nimport { BadgeUtilities, Icon } from \"@itwin/core-react\";\r\nimport { BackstageItem as NZ_BackstageItem } from \"@itwin/appui-layout-react\";\r\nimport { useActiveFrontstageId } from \"../frontstage/Frontstage\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { useBackstageManager } from \"./BackstageManager\";\r\n\r\n/** @internal */\r\nexport interface BackstageComposerActionItemProps {\r\n readonly item: BackstageActionItem;\r\n}\r\n\r\n/** @internal */\r\nexport function BackstageComposerActionItem({ item }: BackstageComposerActionItemProps) {\r\n const manager = useBackstageManager();\r\n const handleClick = React.useCallback(() => {\r\n manager.close();\r\n item.execute();\r\n }, [manager, item]);\r\n return (\r\n <NZ_BackstageItem\r\n itemId={item.id}\r\n providerId={item.providerId}\r\n itemPriority={item.itemPriority}\r\n groupPriority={item.groupPriority}\r\n icon={<Icon iconSpec={ConditionalStringValue.getValue(item.icon)} />}\r\n isActive={ConditionalBooleanValue.getValue(item.isActive)}\r\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\r\n onClick={handleClick}\r\n subtitle={ConditionalStringValue.getValue(item.subtitle)}\r\n badge={BadgeUtilities.getComponentForBadgeType(item.badgeType)}\r\n >\r\n {ConditionalStringValue.getValue(item.label)}\r\n </NZ_BackstageItem>\r\n );\r\n}\r\n\r\n/** @internal */\r\nexport interface BackstageComposerStageLauncherProps {\r\n readonly item: BackstageStageLauncher;\r\n}\r\n\r\n/** @internal */\r\nexport function BackstageComposerStageLauncher({ item }: BackstageComposerStageLauncherProps) {\r\n const manager = useBackstageManager();\r\n const handleClick = React.useCallback(() => {\r\n manager.close();\r\n if (!FrontstageManager.hasFrontstage(item.stageId))\r\n return Logger.logError(\"BackstageComposerStageLauncher\", `Frontstage with id '${item.stageId}' not found`);\r\n void FrontstageManager.setActiveFrontstage(item.stageId);\r\n }, [manager, item.stageId]);\r\n const activeFrontstageId = useActiveFrontstageId();\r\n const isActive = ConditionalBooleanValue.getValue(item.isActive ?? item.stageId === activeFrontstageId);\r\n return (\r\n <NZ_BackstageItem\r\n itemId={item.id}\r\n providerId={item.providerId}\r\n itemPriority={item.itemPriority}\r\n groupPriority={item.groupPriority}\r\n icon={<Icon iconSpec={ConditionalStringValue.getValue(item.icon)} />}\r\n isActive={isActive}\r\n isDisabled={ConditionalBooleanValue.getValue(item.isDisabled)}\r\n onClick={handleClick}\r\n subtitle={ConditionalStringValue.getValue(item.subtitle)}\r\n badge={BadgeUtilities.getComponentForBadgeType(item.badgeType)}\r\n >\r\n {ConditionalStringValue.getValue(item.label)}\r\n </NZ_BackstageItem>\r\n );\r\n}\r\n\r\n/** Props of [[BackstageComposerItem]] component.\r\n * @internal\r\n */\r\nexport interface BackstageComposerItemProps {\r\n /** Backstage item to render */\r\n readonly item: BackstageItem;\r\n readonly providerId?: string;\r\n}\r\n\r\n/** Item of [[BackstageComposer]].\r\n * @internal\r\n */\r\nexport function BackstageComposerItem({ item }: BackstageComposerItemProps) {\r\n if (isStageLauncher(item)) {\r\n return (\r\n <BackstageComposerStageLauncher\r\n item={item}\r\n />\r\n );\r\n }\r\n return (\r\n <BackstageComposerActionItem\r\n item={item}\r\n />\r\n );\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAS,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigurableUiContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAS,MAAM,mBAAmB,CAAC;AAoBvD;;GAEG;AACH,MAAM,WAAW,0BAA2B,SAAQ,WAAW;IAC7D,kCAAkC;IAClC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE/B,gBAAgB;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,eAuCtE"}
|
|
@@ -23,6 +23,7 @@ import { PointerMessage } from "../messages/Pointer";
|
|
|
23
23
|
import { PopupRenderer } from "../popup/PopupManager";
|
|
24
24
|
import { WidgetPanelsFrontstage } from "../widget-panels/Frontstage";
|
|
25
25
|
import { ConfigurableUiManager } from "./ConfigurableUiManager";
|
|
26
|
+
import { ContentDialogRenderer } from "../dialog/ContentDialogManager";
|
|
26
27
|
/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
@@ -44,6 +45,7 @@ export function ConfigurableUiContent(props) {
|
|
|
44
45
|
return (React.createElement("main", { role: "main", id: "uifw-configurableui-wrapper", className: props.className, style: props.style, onMouseMove: handleMouseMove },
|
|
45
46
|
props.appBackstage,
|
|
46
47
|
version === "1" ? React.createElement(FrontstageComposer, { style: { position: "relative", height: "100%" } }) : /* istanbul ignore next */ React.createElement(WidgetPanelsFrontstage, null),
|
|
48
|
+
React.createElement(ContentDialogRenderer, null),
|
|
47
49
|
React.createElement(ModelessDialogRenderer, null),
|
|
48
50
|
React.createElement(ModalDialogRenderer, null),
|
|
49
51
|
React.createElement(ElementTooltip, null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigurableUiContent.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiContent.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,uBAAuB,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAe,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,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AC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,0BAA0B,CAAC,oBAAC,sBAAsB,OAAG;QAClJ,oBAAC,qBAAqB,OAAG;QACzB,oBAAC,sBAAsB,OAAG;QAC1B,oBAAC,mBAAmB,OAAG;QACvB,oBAAC,cAAc,OAAG;QAClB,oBAAC,cAAc,OAAG;QAClB,oBAAC,oBAAoB,OAAG;QACxB,oBAAC,iBAAiB,OAAG;QACrB,oBAAC,eAAe,OAAG;QACnB,oBAAC,mBAAmB,OAAG;QACvB,oBAAC,aAAa,OAAG,CACZ,CACR,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ConfigurableUi\r\n */\r\n\r\nimport \"./configurableui.scss\";\r\nimport * as React from \"react\";\r\nimport { CommonProps, Point } from \"@itwin/core-react\";\r\nimport { CursorInformation } from \"../cursor/CursorInformation\";\r\nimport { CursorPopupMenu } from \"../cursor/cursormenu/CursorMenu\";\r\nimport { CursorPopupRenderer } from \"../cursor/cursorpopup/CursorPopupManager\";\r\nimport { ModalDialogRenderer } from \"../dialog/ModalDialogManager\";\r\nimport { ModelessDialogRenderer } from \"../dialog/ModelessDialogManager\";\r\nimport { ElementTooltip } from \"../feedback/ElementTooltip\";\r\nimport { FrontstageComposer } from \"../frontstage/FrontstageComposer\";\r\nimport { useFrameworkVersion } from \"../hooks/useFrameworkVersion\";\r\nimport { KeyboardShortcutManager } from \"../keyboardshortcut/KeyboardShortcut\";\r\nimport { KeyboardShortcutMenu } from \"../keyboardshortcut/KeyboardShortcutMenu\";\r\nimport { InputFieldMessage } from \"../messages/InputField\";\r\nimport { PointerMessage } from \"../messages/Pointer\";\r\nimport { PopupRenderer } from \"../popup/PopupManager\";\r\nimport { WidgetPanelsFrontstage } from \"../widget-panels/Frontstage\";\r\nimport { ConfigurableUiManager } from \"./ConfigurableUiManager\";\r\nimport { ContentDialogRenderer } from \"../dialog/ContentDialogManager\";\r\n\r\n// cSpell:ignore cursormenu cursorpopup\r\n\r\n/** Properties for [[ConfigurableUiContent]]\r\n * @public\r\n */\r\nexport interface ConfigurableUiContentProps extends CommonProps {\r\n /** React node of the Backstage */\r\n appBackstage?: React.ReactNode;\r\n\r\n /** @internal */\r\n idleTimeout?: number;\r\n /** @internal */\r\n intervalTimeout?: number;\r\n}\r\n\r\n/** The ConfigurableUiContent component is the component the pages specified using ConfigurableUi\r\n * @public\r\n */\r\nexport function ConfigurableUiContent(props: ConfigurableUiContentProps) {\r\n const version = useFrameworkVersion();\r\n React.useEffect(() => {\r\n KeyboardShortcutManager.setFocusToHome();\r\n }, []);\r\n React.useEffect(() => {\r\n ConfigurableUiManager.activityTracker.initialize({ idleTimeout: props.idleTimeout, intervalTimeout: props.intervalTimeout });\r\n return () => {\r\n ConfigurableUiManager.activityTracker.terminate();\r\n };\r\n }, [props.idleTimeout, props.intervalTimeout]);\r\n\r\n const handleMouseMove = React.useCallback((e: React.MouseEvent) => {\r\n const point = new Point(e.pageX, e.pageY);\r\n CursorInformation.handleMouseMove(point);\r\n }, []);\r\n\r\n return (\r\n <main role=\"main\"\r\n id=\"uifw-configurableui-wrapper\"\r\n className={props.className}\r\n style={props.style}\r\n onMouseMove={handleMouseMove}\r\n >\r\n {props.appBackstage}\r\n {/* eslint-disable-next-line deprecation/deprecation */}\r\n {version === \"1\" ? <FrontstageComposer style={{ position: \"relative\", height: \"100%\" }} /> : /* istanbul ignore next */ <WidgetPanelsFrontstage />}\r\n <ContentDialogRenderer />\r\n <ModelessDialogRenderer />\r\n <ModalDialogRenderer />\r\n <ElementTooltip />\r\n <PointerMessage />\r\n <KeyboardShortcutMenu />\r\n <InputFieldMessage />\r\n <CursorPopupMenu />\r\n <CursorPopupRenderer />\r\n <PopupRenderer />\r\n </main>\r\n );\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableUiManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAA2B,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAOtG,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAmB,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAA0B,gCAAgC,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAK1H,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConfigurableUiManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAA2B,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAOtG,OAAO,EAAe,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAmB,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAA0B,gCAAgC,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAK1H,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,KAAK,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS,C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,YAAY,EAAE,qBAAqB,EAAE,GAAG,IAAI;IAIhF,wDAAwD;WAC1C,iBAAiB,IAAI,WAAW;IAM9C,0CAA0C;WAC5B,OAAO,IAAI,IAAI;CAU9B"}
|
|
@@ -24,6 +24,7 @@ import { ModalDialogManager } from "../dialog/ModalDialogManager";
|
|
|
24
24
|
import { MessageManager } from "../messages/MessageManager";
|
|
25
25
|
import { PopupManager } from "../popup/PopupManager";
|
|
26
26
|
import { ActivityTracker } from "./ActivityTracker";
|
|
27
|
+
import { ContentDialogManager } from "../dialog/ContentDialogManager";
|
|
27
28
|
/** Ui Activity Event class.
|
|
28
29
|
* @internal
|
|
29
30
|
*/
|
|
@@ -53,8 +54,11 @@ export class ConfigurableUiManager {
|
|
|
53
54
|
FrontstageManager.initialize();
|
|
54
55
|
// Initialize the ToolSettingsManager that manages Tool Settings properties.
|
|
55
56
|
ToolSettingsManager.initialize();
|
|
56
|
-
// Initialize
|
|
57
|
+
// Initialize dialog managers that allow one or more dialogs to be open at a time. These managers adjust the z-indexing
|
|
58
|
+
// to ensure the most recently focused dialog of a specific type displays above its siblings.
|
|
57
59
|
ModelessDialogManager.initialize();
|
|
60
|
+
// ContentDialog have a z-index just above the fixed content views and below all other UI elements.
|
|
61
|
+
ContentDialogManager.initialize();
|
|
58
62
|
// Initialize the Keyboard Shortcut manager
|
|
59
63
|
KeyboardShortcutManager.initialize();
|
|
60
64
|
this._initialized = true;
|
|
@@ -164,6 +168,7 @@ export class ConfigurableUiManager {
|
|
|
164
168
|
MessageManager.closeAllMessages();
|
|
165
169
|
ModelessDialogManager.closeAll();
|
|
166
170
|
ModalDialogManager.closeAll();
|
|
171
|
+
ContentDialogManager.closeAll();
|
|
167
172
|
KeyboardShortcutManager.closeShortcutsMenu();
|
|
168
173
|
UiFramework.closeCursorMenu();
|
|
169
174
|
PopupManager.clearPopups();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableUiManager.js","sourceRoot":"","sources":["../../../../src/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AC,aAA4B;QAClD,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAG,8CAA8C;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,aAA4B;QACrD,eAAe,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAI,8CAA8C;IAChG,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,iBAAoC;QAC9D,eAAe,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,CAAG,8CAA8C;IACpG,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,qBAAqB,CAAC,YAAqC;QACvE,uBAAuB,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,wDAAwD;IACjD,MAAM,CAAC,iBAAiB;QAC7B,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,6BAA6B,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,OAAQ,CAAC;QAC7B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,0CAA0C;IACnC,MAAM,CAAC,OAAO;QACnB,cAAc,CAAC,gBAAgB,EAAE,CAAC;QAClC,qBAAqB,CAAC,QAAQ,EAAE,CAAC;QACjC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;QAC9B,uBAAuB,CAAC,kBAAkB,EAAE,CAAC;QAC7C,WAAW,CAAC,eAAe,EAAE,CAAC;QAC9B,YAAY,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;;AAjKc,yCAAmB,GAAG,IAAI,GAAG,EAA4C,CAAC;AAC1E,kCAAY,GAAG,KAAK,CAAC;AAEpC,gBAAgB;AACO,qCAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAC/D,gBAAgB;AACO,uCAAiB,GAAG,IAAI,eAAe,EAAE,CAAC;AACjE,gBAAgB;AACO,uCAAiB,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ConfigurableUi\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\nimport { UiError } from \"@itwin/appui-abstract\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { FrontstageProvider } from \"../frontstage/FrontstageProvider\";\r\nimport { KeyboardShortcutManager, KeyboardShortcutProps } from \"../keyboardshortcut/KeyboardShortcut\";\r\nimport { CubeNavigationAidControl } from \"../navigationaids/CubeNavigationAidControl\";\r\nimport { DrawingNavigationAidControl } from \"../navigationaids/DrawingNavigationAidControl\";\r\nimport { SheetNavigationAidControl } from \"../navigationaids/SheetNavigationAid\";\r\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\r\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { TaskManager, TaskPropsList } from \"../workflow/Task\";\r\nimport { WorkflowManager, WorkflowProps, WorkflowPropsList } from \"../workflow/Workflow\";\r\nimport { ToolSettingsManager } from \"../zones/toolsettings/ToolSettingsManager\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiElement } from \"./ConfigurableUiControl\";\r\nimport { ModelessDialogManager } from \"../dialog/ModelessDialogManager\";\r\nimport { ModalDialogManager } from \"../dialog/ModalDialogManager\";\r\nimport { MessageManager } from \"../messages/MessageManager\";\r\nimport { PopupManager } from \"../popup/PopupManager\";\r\nimport { ActivityTracker } from \"./ActivityTracker\";\r\n\r\n/** Ui Activity Event Args interface.\r\n * @internal\r\n */\r\nexport interface UiActivityEventArgs {\r\n event: Event;\r\n}\r\n\r\n/** Ui Activity Event class.\r\n * @internal\r\n */\r\nexport class UiActivityEvent extends BeUiEvent<UiActivityEventArgs> { }\r\n\r\n/** Ui Interval Event Args interface\r\n * @internal\r\n */\r\nexport interface UiIntervalEventArgs {\r\n idleTimeout?: number;\r\n}\r\n\r\n/** Ui Interval Event class.\r\n * @internal\r\n */\r\nexport class UiIntervalEvent extends BeUiEvent<UiIntervalEventArgs> { }\r\n\r\n/** Configurable Ui Manager maintains controls, Frontstages, Content Groups, Content Layouts, Tasks and Workflows.\r\n * @public\r\n */\r\nexport class ConfigurableUiManager {\r\n private static _registeredControls = new Map<string, ConfigurableUiControlConstructor>();\r\n private static _initialized = false;\r\n\r\n /** @internal */\r\n public static readonly activityTracker = new ActivityTracker();\r\n /** @internal */\r\n public static readonly onUiActivityEvent = new UiActivityEvent();\r\n /** @internal */\r\n public static readonly onUiIntervalEvent = new UiIntervalEvent();\r\n\r\n /** Initializes the ConfigurableUiManager and registers core controls. */\r\n public static initialize() {\r\n if (this._initialized)\r\n return;\r\n\r\n // Register core controls\r\n ConfigurableUiManager.registerControl(StandardRotationNavigationAidControl.navigationAidId, StandardRotationNavigationAidControl);\r\n ConfigurableUiManager.registerControl(SheetNavigationAidControl.navigationAidId, SheetNavigationAidControl);\r\n ConfigurableUiManager.registerControl(DrawingNavigationAidControl.navigationAidId, DrawingNavigationAidControl);\r\n ConfigurableUiManager.registerControl(CubeNavigationAidControl.navigationAidId, CubeNavigationAidControl);\r\n\r\n // Initialize SyncUiEventDispatcher so it can register event callbacks.\r\n SyncUiEventDispatcher.initialize();\r\n\r\n // Initialize the FrontstageManager\r\n FrontstageManager.initialize();\r\n\r\n // Initialize the ToolSettingsManager that manages Tool Settings properties.\r\n ToolSettingsManager.initialize();\r\n\r\n // Initialize the modeless dialog manager.\r\n ModelessDialogManager.initialize();\r\n\r\n // Initialize the Keyboard Shortcut manager\r\n KeyboardShortcutManager.initialize();\r\n\r\n this._initialized = true;\r\n }\r\n\r\n /** Registers a control implementing the [[ConfigurableUiElement]] interface.\r\n * These controls can be a\r\n * [[ContentControl]],\r\n * [[NavigationAidControl]],\r\n * [[StatusBarWidgetControl]],\r\n * [[WidgetControl]] or\r\n * [ToolUiProvider]($appui-react).\r\n * @param classId the class id of the control to register\r\n * @param constructor the constructor of the control to register\r\n */\r\n public static registerControl(classId: string, constructor: ConfigurableUiControlConstructor): void {\r\n if (this._registeredControls.get(classId) !== undefined) {\r\n throw new UiError(UiFramework.loggerCategory(this), `registerControl: classId '${classId}' already registered`);\r\n }\r\n\r\n this._registeredControls.set(classId, constructor);\r\n }\r\n\r\n /** Determines if a control has been registered based on its classId.\r\n * @param classId the class id of the control to test\r\n * @returns true if the control is registered or false if not\r\n */\r\n public static isControlRegistered(classId: string): boolean {\r\n const constructor = this._registeredControls.get(classId);\r\n return constructor !== undefined;\r\n }\r\n\r\n /** Determines if a control has been registered.\r\n * @internal\r\n */\r\n public static getConstructorClassId(constructor: ConfigurableUiControlConstructor): string | undefined {\r\n for (const [key, value] of this._registeredControls.entries()) {\r\n if (value === constructor)\r\n return key;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Unregisters a control that has been registered.\r\n * @param classId the class id of the control to unregister\r\n */\r\n public static unregisterControl(classId: string): void {\r\n const constructor = this._registeredControls.get(classId);\r\n if (constructor)\r\n this._registeredControls.delete(classId);\r\n }\r\n\r\n /** Creates a control registered by calling registerControl.\r\n * @param classId the class id of the control to create\r\n * @param uniqueId a unique id for the control\r\n * @param options options passed to the constructor of the control\r\n * @param controlId controlId which may not be unique across all control instances.\r\n * @returns the created control\r\n */\r\n public static createControl(classId: string, uniqueId: string, options?: any, controlId?: string): ConfigurableUiElement | undefined {\r\n const info = new ConfigurableCreateInfo(classId, uniqueId, controlId ?? uniqueId);\r\n const constructor = this._registeredControls.get(info.classId);\r\n if (!constructor) {\r\n throw new UiError(UiFramework.loggerCategory(this), `createControl: classId '${classId}' not registered`);\r\n }\r\n\r\n const control = new constructor(info, options);\r\n return control;\r\n }\r\n\r\n /** Add a Frontstage via a provider into the [[FrontstageManager]].\r\n * @param frontstageProvider Provider of the Frontstage to add\r\n */\r\n public static addFrontstageProvider(frontstageProvider: FrontstageProvider): void {\r\n FrontstageManager.addFrontstageProvider(frontstageProvider);\r\n }\r\n\r\n /** Loads one or more Tasks into the [[TaskManager]].\r\n * @param taskPropsList the list of Tasks to load\r\n * @internal\r\n * @deprecated\r\n */\r\n public static loadTasks(taskPropsList: TaskPropsList): void { // eslint-disable-line deprecation/deprecation\r\n TaskManager.loadTasks(taskPropsList); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Loads a Workflow into the [[WorkflowManager]].\r\n * @param workflowProps the Workflow to load\r\n * @internal\r\n * @deprecated\r\n */\r\n public static loadWorkflow(workflowProps: WorkflowProps): void { // eslint-disable-line deprecation/deprecation\r\n WorkflowManager.loadWorkflow(workflowProps); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Loads one or more Workflows into the [[WorkflowManager]].\r\n * @param workflowPropsList the list of Workflows to load\r\n * @internal\r\n * @deprecated\r\n */\r\n public static loadWorkflows(workflowPropsList: WorkflowPropsList): void { // eslint-disable-line deprecation/deprecation\r\n WorkflowManager.loadWorkflows(workflowPropsList); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Loads one or more Keyboard Shortcuts into the [[KeyboardShortcutManager]].\r\n * @param shortcutList the properties of the Keyboard Shortcuts to load\r\n */\r\n public static loadKeyboardShortcuts(shortcutList: KeyboardShortcutProps[]): void {\r\n KeyboardShortcutManager.loadKeyboardShortcuts(shortcutList);\r\n }\r\n\r\n /** Gets the HTML wrapper element for Configurable UI */\r\n public static getWrapperElement(): HTMLElement {\r\n const wrapper = document.getElementById(\"uifw-configurableui-wrapper\");\r\n const htmlElement = wrapper!;\r\n return htmlElement;\r\n }\r\n\r\n /** Closes all UI popups currently open */\r\n public static closeUi(): void {\r\n MessageManager.closeAllMessages();\r\n ModelessDialogManager.closeAll();\r\n ModalDialogManager.closeAll();\r\n KeyboardShortcutManager.closeShortcutsMenu();\r\n UiFramework.closeCursorMenu();\r\n PopupManager.clearPopups();\r\n }\r\n\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ConfigurableUiManager.js","sourceRoot":"","sources":["../../../../src/appui-react/configurableui/ConfigurableUiManager.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,EAAE,uBAAuB,EAAyB,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAoC,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAA2D,MAAM,yBAAyB,CAAC;AAC1H,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAStE;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ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pC,gBAAgB;AACO,qCAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAC/D,gBAAgB;AACO,uCAAiB,GAAG,IAAI,eAAe,EAAE,CAAC;AACjE,gBAAgB;AACO,uCAAiB,GAAG,IAAI,eAAe,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ConfigurableUi\r\n */\r\n\r\nimport { BeUiEvent } from \"@itwin/core-bentley\";\r\nimport { UiError } from \"@itwin/appui-abstract\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { FrontstageProvider } from \"../frontstage/FrontstageProvider\";\r\nimport { KeyboardShortcutManager, KeyboardShortcutProps } from \"../keyboardshortcut/KeyboardShortcut\";\r\nimport { CubeNavigationAidControl } from \"../navigationaids/CubeNavigationAidControl\";\r\nimport { DrawingNavigationAidControl } from \"../navigationaids/DrawingNavigationAidControl\";\r\nimport { SheetNavigationAidControl } from \"../navigationaids/SheetNavigationAid\";\r\nimport { StandardRotationNavigationAidControl } from \"../navigationaids/StandardRotationNavigationAid\";\r\nimport { SyncUiEventDispatcher } from \"../syncui/SyncUiEventDispatcher\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { TaskManager, TaskPropsList } from \"../workflow/Task\";\r\nimport { WorkflowManager, WorkflowProps, WorkflowPropsList } from \"../workflow/Workflow\";\r\nimport { ToolSettingsManager } from \"../zones/toolsettings/ToolSettingsManager\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControlConstructor, ConfigurableUiElement } from \"./ConfigurableUiControl\";\r\nimport { ModelessDialogManager } from \"../dialog/ModelessDialogManager\";\r\nimport { ModalDialogManager } from \"../dialog/ModalDialogManager\";\r\nimport { MessageManager } from \"../messages/MessageManager\";\r\nimport { PopupManager } from \"../popup/PopupManager\";\r\nimport { ActivityTracker } from \"./ActivityTracker\";\r\nimport { ContentDialogManager } from \"../dialog/ContentDialogManager\";\r\n\r\n/** Ui Activity Event Args interface.\r\n * @internal\r\n */\r\nexport interface UiActivityEventArgs {\r\n event: Event;\r\n}\r\n\r\n/** Ui Activity Event class.\r\n * @internal\r\n */\r\nexport class UiActivityEvent extends BeUiEvent<UiActivityEventArgs> { }\r\n\r\n/** Ui Interval Event Args interface\r\n * @internal\r\n */\r\nexport interface UiIntervalEventArgs {\r\n idleTimeout?: number;\r\n}\r\n\r\n/** Ui Interval Event class.\r\n * @internal\r\n */\r\nexport class UiIntervalEvent extends BeUiEvent<UiIntervalEventArgs> { }\r\n\r\n/** Configurable Ui Manager maintains controls, Frontstages, Content Groups, Content Layouts, Tasks and Workflows.\r\n * @public\r\n */\r\nexport class ConfigurableUiManager {\r\n private static _registeredControls = new Map<string, ConfigurableUiControlConstructor>();\r\n private static _initialized = false;\r\n\r\n /** @internal */\r\n public static readonly activityTracker = new ActivityTracker();\r\n /** @internal */\r\n public static readonly onUiActivityEvent = new UiActivityEvent();\r\n /** @internal */\r\n public static readonly onUiIntervalEvent = new UiIntervalEvent();\r\n\r\n /** Initializes the ConfigurableUiManager and registers core controls. */\r\n public static initialize() {\r\n if (this._initialized)\r\n return;\r\n\r\n // Register core controls\r\n ConfigurableUiManager.registerControl(StandardRotationNavigationAidControl.navigationAidId, StandardRotationNavigationAidControl);\r\n ConfigurableUiManager.registerControl(SheetNavigationAidControl.navigationAidId, SheetNavigationAidControl);\r\n ConfigurableUiManager.registerControl(DrawingNavigationAidControl.navigationAidId, DrawingNavigationAidControl);\r\n ConfigurableUiManager.registerControl(CubeNavigationAidControl.navigationAidId, CubeNavigationAidControl);\r\n\r\n // Initialize SyncUiEventDispatcher so it can register event callbacks.\r\n SyncUiEventDispatcher.initialize();\r\n\r\n // Initialize the FrontstageManager\r\n FrontstageManager.initialize();\r\n\r\n // Initialize the ToolSettingsManager that manages Tool Settings properties.\r\n ToolSettingsManager.initialize();\r\n\r\n // Initialize dialog managers that allow one or more dialogs to be open at a time. These managers adjust the z-indexing\r\n // to ensure the most recently focused dialog of a specific type displays above its siblings.\r\n ModelessDialogManager.initialize();\r\n // ContentDialog have a z-index just above the fixed content views and below all other UI elements.\r\n ContentDialogManager.initialize();\r\n\r\n // Initialize the Keyboard Shortcut manager\r\n KeyboardShortcutManager.initialize();\r\n\r\n this._initialized = true;\r\n }\r\n\r\n /** Registers a control implementing the [[ConfigurableUiElement]] interface.\r\n * These controls can be a\r\n * [[ContentControl]],\r\n * [[NavigationAidControl]],\r\n * [[StatusBarWidgetControl]],\r\n * [[WidgetControl]] or\r\n * [ToolUiProvider]($appui-react).\r\n * @param classId the class id of the control to register\r\n * @param constructor the constructor of the control to register\r\n */\r\n public static registerControl(classId: string, constructor: ConfigurableUiControlConstructor): void {\r\n if (this._registeredControls.get(classId) !== undefined) {\r\n throw new UiError(UiFramework.loggerCategory(this), `registerControl: classId '${classId}' already registered`);\r\n }\r\n\r\n this._registeredControls.set(classId, constructor);\r\n }\r\n\r\n /** Determines if a control has been registered based on its classId.\r\n * @param classId the class id of the control to test\r\n * @returns true if the control is registered or false if not\r\n */\r\n public static isControlRegistered(classId: string): boolean {\r\n const constructor = this._registeredControls.get(classId);\r\n return constructor !== undefined;\r\n }\r\n\r\n /** Determines if a control has been registered.\r\n * @internal\r\n */\r\n public static getConstructorClassId(constructor: ConfigurableUiControlConstructor): string | undefined {\r\n for (const [key, value] of this._registeredControls.entries()) {\r\n if (value === constructor)\r\n return key;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Unregisters a control that has been registered.\r\n * @param classId the class id of the control to unregister\r\n */\r\n public static unregisterControl(classId: string): void {\r\n const constructor = this._registeredControls.get(classId);\r\n if (constructor)\r\n this._registeredControls.delete(classId);\r\n }\r\n\r\n /** Creates a control registered by calling registerControl.\r\n * @param classId the class id of the control to create\r\n * @param uniqueId a unique id for the control\r\n * @param options options passed to the constructor of the control\r\n * @param controlId controlId which may not be unique across all control instances.\r\n * @returns the created control\r\n */\r\n public static createControl(classId: string, uniqueId: string, options?: any, controlId?: string): ConfigurableUiElement | undefined {\r\n const info = new ConfigurableCreateInfo(classId, uniqueId, controlId ?? uniqueId);\r\n const constructor = this._registeredControls.get(info.classId);\r\n if (!constructor) {\r\n throw new UiError(UiFramework.loggerCategory(this), `createControl: classId '${classId}' not registered`);\r\n }\r\n\r\n const control = new constructor(info, options);\r\n return control;\r\n }\r\n\r\n /** Add a Frontstage via a provider into the [[FrontstageManager]].\r\n * @param frontstageProvider Provider of the Frontstage to add\r\n */\r\n public static addFrontstageProvider(frontstageProvider: FrontstageProvider): void {\r\n FrontstageManager.addFrontstageProvider(frontstageProvider);\r\n }\r\n\r\n /** Loads one or more Tasks into the [[TaskManager]].\r\n * @param taskPropsList the list of Tasks to load\r\n * @internal\r\n * @deprecated\r\n */\r\n public static loadTasks(taskPropsList: TaskPropsList): void { // eslint-disable-line deprecation/deprecation\r\n TaskManager.loadTasks(taskPropsList); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Loads a Workflow into the [[WorkflowManager]].\r\n * @param workflowProps the Workflow to load\r\n * @internal\r\n * @deprecated\r\n */\r\n public static loadWorkflow(workflowProps: WorkflowProps): void { // eslint-disable-line deprecation/deprecation\r\n WorkflowManager.loadWorkflow(workflowProps); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Loads one or more Workflows into the [[WorkflowManager]].\r\n * @param workflowPropsList the list of Workflows to load\r\n * @internal\r\n * @deprecated\r\n */\r\n public static loadWorkflows(workflowPropsList: WorkflowPropsList): void { // eslint-disable-line deprecation/deprecation\r\n WorkflowManager.loadWorkflows(workflowPropsList); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** Loads one or more Keyboard Shortcuts into the [[KeyboardShortcutManager]].\r\n * @param shortcutList the properties of the Keyboard Shortcuts to load\r\n */\r\n public static loadKeyboardShortcuts(shortcutList: KeyboardShortcutProps[]): void {\r\n KeyboardShortcutManager.loadKeyboardShortcuts(shortcutList);\r\n }\r\n\r\n /** Gets the HTML wrapper element for Configurable UI */\r\n public static getWrapperElement(): HTMLElement {\r\n const wrapper = document.getElementById(\"uifw-configurableui-wrapper\");\r\n const htmlElement = wrapper!;\r\n return htmlElement;\r\n }\r\n\r\n /** Closes all UI popups currently open */\r\n public static closeUi(): void {\r\n MessageManager.closeAllMessages();\r\n ModelessDialogManager.closeAll();\r\n ModalDialogManager.closeAll();\r\n ContentDialogManager.closeAll();\r\n KeyboardShortcutManager.closeShortcutsMenu();\r\n UiFramework.closeCursorMenu();\r\n PopupManager.clearPopups();\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -56,4 +56,10 @@ export declare class ContentControl extends ConfigurableUiControl {
|
|
|
56
56
|
/** Get the NavigationAidControl associated with this ContentControl */
|
|
57
57
|
get navigationAidControl(): string;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* @beta
|
|
61
|
+
*/
|
|
62
|
+
export declare class FloatingContentControl extends ContentControl {
|
|
63
|
+
constructor(uniqueId: string, name: string, node: React.ReactNode);
|
|
64
|
+
}
|
|
59
65
|
//# sourceMappingURL=ContentControl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentControl.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentControl.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEnI;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,oBAAoB,EAAE,cAAc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a9C,SAAS,CAAC,YAAY,IAAI,KAAK,CAAC,SAAS;IAIzC,mDAAmD;IACnD,IAAW,SAAS,IAAI,KAAK,CAAC,SAAS,CAEtC;IAED,IAAW,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,EAA0B;IAEjE,uEAAuE;IACvE,IAAW,oBAAoB,IAAI,MAAM,CAExC;CAEF;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,cAAc;gBAC5C,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS;CAIlE"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { UiEvent } from "@itwin/appui-abstract";
|
|
10
|
-
import { ConfigurableUiControl, ConfigurableUiControlType } from "../configurableui/ConfigurableUiControl";
|
|
10
|
+
import { ConfigurableCreateInfo, ConfigurableUiControl, ConfigurableUiControlType } from "../configurableui/ConfigurableUiControl";
|
|
11
11
|
/** ContentControl Activated Event class.
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
@@ -61,4 +61,13 @@ export class ContentControl extends ConfigurableUiControl {
|
|
|
61
61
|
return "";
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* @beta
|
|
66
|
+
*/
|
|
67
|
+
export class FloatingContentControl extends ContentControl {
|
|
68
|
+
constructor(uniqueId, name, node) {
|
|
69
|
+
super(new ConfigurableCreateInfo(name, uniqueId, name), undefined);
|
|
70
|
+
this._reactNode = node;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
64
73
|
//# sourceMappingURL=ContentControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentControl.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentControl.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA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C,UAAU,EAAE,eAAe,CAAC,CAAC;aACxE;YACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACvB;QAED,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAES,YAAY;QACpB,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;IAED,mDAAmD;IACnD,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,YAAY,EAAE,CAAC;IAC7B,CAAC;IAED,IAAW,SAAS,CAAC,CAAkB,IAAI,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IAEjE,uEAAuE;IACvE,IAAW,oBAAoB;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;CAEF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IACxD,YAAY,QAAgB,EAAE,IAAY,EAAE,IAAqB;QAC/D,KAAK,CAAC,IAAI,sBAAsB,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelConnection, ScreenViewport, ViewState } from \"@itwin/core-frontend\";\r\nimport { UiEvent } from \"@itwin/appui-abstract\";\r\nimport { ConfigurableCreateInfo, ConfigurableUiControl, ConfigurableUiControlType } from \"../configurableui/ConfigurableUiControl\";\r\n\r\n/** ControlControl Activated Event Args interface.\r\n * @public\r\n */\r\nexport interface ContentControlActivatedEventArgs {\r\n activeContentControl: ContentControl;\r\n oldContentControl?: ContentControl;\r\n}\r\n\r\n/** ContentControl Activated Event class.\r\n * @public\r\n */\r\nexport class ContentControlActivatedEvent extends UiEvent<ContentControlActivatedEventArgs> { }\r\n\r\n/** Interface to be implemented when the ContentControl supports ViewSelector changes\r\n * @public\r\n */\r\nexport interface SupportsViewSelectorChange {\r\n /** Returns true if this control supports reacting to ViewSelector changes. */\r\n supportsViewSelectorChange: boolean;\r\n /** Process a ViewSelector change. */\r\n processViewSelectorChange(iModel: IModelConnection, viewDefinitionId: Id64String, viewState: ViewState, name: string): Promise<void>;\r\n}\r\n\r\n/** The base class for Frontstage content controls.\r\n * @public\r\n */\r\nexport class ContentControl extends ConfigurableUiControl {\r\n protected _reactNode: React.ReactNode;\r\n private _keyAdded = false;\r\n\r\n /** Creates an instance of ContentControl.\r\n * @param info An object that the subclass must pass to this base class.\r\n * @param options Options provided via the applicationData in a [[ContentProps]].\r\n */\r\n constructor(info: ConfigurableCreateInfo, options: any) {\r\n super(info, options);\r\n }\r\n\r\n /** Called when this ContentControl is activated */\r\n public onActivated(): void {\r\n }\r\n\r\n /** Called when this ContentControl is deactivated */\r\n public onDeactivated(): void {\r\n }\r\n\r\n /** Gets the type of ConfigurableUiControl, which is 'Content' in this case */\r\n public getType(): ConfigurableUiControlType { return ConfigurableUiControlType.Content; }\r\n\r\n /** Returns true if this control is a Viewport control. */\r\n public get isViewport(): boolean { return false; }\r\n /** Returns the ScreenViewport if isViewport is true */\r\n public get viewport(): ScreenViewport | undefined { return undefined; }\r\n\r\n protected getKeyedReactNode(): React.ReactNode {\r\n if (!this._keyAdded && React.isValidElement(this._reactNode)) {\r\n // istanbul ignore else\r\n if (!(this._reactNode as React.ReactElement<any>).key) {\r\n const additionalProps: any = { key: this.uniqueId };\r\n this._reactNode = React.cloneElement(this._reactNode, additionalProps);\r\n }\r\n this._keyAdded = true;\r\n }\r\n\r\n return this._reactNode;\r\n }\r\n\r\n protected getReactNode(): React.ReactNode {\r\n return this.getKeyedReactNode();\r\n }\r\n\r\n /** The React node associated with this control. */\r\n public get reactNode(): React.ReactNode {\r\n return this.getReactNode();\r\n }\r\n\r\n public set reactNode(r: React.ReactNode) { this._reactNode = r; }\r\n\r\n /** Get the NavigationAidControl associated with this ContentControl */\r\n public get navigationAidControl(): string {\r\n return \"\";\r\n }\r\n\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport class FloatingContentControl extends ContentControl {\r\n constructor(uniqueId: string, name: string, node: React.ReactNode) {\r\n super(new ConfigurableCreateInfo(name, uniqueId, name), undefined);\r\n this._reactNode = node;\r\n }\r\n}\r\n"]}
|
|
@@ -6,6 +6,14 @@ import * as React from "react";
|
|
|
6
6
|
import { CommonProps } from "@itwin/core-react";
|
|
7
7
|
import { ContentGroup } from "./ContentGroup";
|
|
8
8
|
import { ContentLayoutProps, LayoutFragmentProps, UiEvent } from "@itwin/appui-abstract";
|
|
9
|
+
/** Properties for [[ContentWrapper]] */
|
|
10
|
+
interface ContentWrapperProps extends CommonProps {
|
|
11
|
+
content: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** ContentWrapper React component.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function ContentWrapper(props: ContentWrapperProps): JSX.Element;
|
|
9
17
|
/** Common interface for HorizontalSplit and VerticalSplit
|
|
10
18
|
*/
|
|
11
19
|
interface LayoutSplit {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAA8E,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentLayout.d.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WACF,WAAW,CAAC,WAAW,EAAE,mBAAmB,GAAG,WAAW,GAAG,SAAS;CAUrF;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,OAAO,CAAC,+BAA+B,CAAC;CAAI;AAE7F;GACG;AACH,UAAU,kBAAkB;IAC1B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,WAAW;IAC9D,aAAa,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAAC,2BAA2B,EAAE,kBAAkB,CAAC;IAEjG,gBAAgB;IAChB,SAAyB,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;gBAEjD,KAAK,EAAE,2BAA2B;IAgB9B,iBAAiB;IAIjB,oBAAoB;IAIpC,OAAO,CAAC,6BAA6B,CAYnC;IAEc,MAAM,IAAI,KAAK,CAAC,SAAS;IAezC,OAAO,CAAC,YAAY,CAElB;IAEF,OAAO,CAAC,UAAU,CAEhB;CACH"}
|
|
@@ -15,44 +15,49 @@ import { FrontstageManager } from "../frontstage/FrontstageManager";
|
|
|
15
15
|
import { UiShowHideManager } from "../utils/UiShowHideManager";
|
|
16
16
|
import { UiEvent } from "@itwin/appui-abstract";
|
|
17
17
|
import { ContentViewManager } from "./ContentViewManager";
|
|
18
|
+
import { useActiveFrontstageDef } from "../frontstage/Frontstage";
|
|
18
19
|
/** ContentWrapper React component.
|
|
20
|
+
* @internal
|
|
19
21
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
export function ContentWrapper(props) {
|
|
23
|
+
const { content } = props;
|
|
24
|
+
const [isActive, setIsActive] = React.useState(content === ContentViewManager.getActiveContent());
|
|
25
|
+
const activeFrontstageDef = useActiveFrontstageDef();
|
|
26
|
+
// istanbul ignore next
|
|
27
|
+
const [hasMultipleContents, setHasMultipleContents] = React.useState(() => {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
return (activeFrontstageDef && (!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
30
|
+
((_c = (_b = activeFrontstageDef === null || activeFrontstageDef === void 0 ? void 0 : activeFrontstageDef.contentGroup) === null || _b === void 0 ? void 0 : _b.getContentControls().length) !== null && _c !== void 0 ? _c : 0) > 1);
|
|
31
|
+
});
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
setIsActive(content === ContentViewManager.getActiveContent());
|
|
34
|
+
}, [content]);
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
const handleActiveContentChanged = (args) => {
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
setIsActive(content === args.activeContent);
|
|
39
|
+
// istanbul ignore next
|
|
40
|
+
setHasMultipleContents((activeFrontstageDef && (!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
41
|
+
((_c = (_b = activeFrontstageDef === null || activeFrontstageDef === void 0 ? void 0 : activeFrontstageDef.contentGroup) === null || _b === void 0 ? void 0 : _b.getContentControls().length) !== null && _c !== void 0 ? _c : 0) > 1));
|
|
32
42
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
return ContentViewManager.onActiveContentChangedEvent.addListener(handleActiveContentChanged);
|
|
44
|
+
}, [activeFrontstageDef, content]);
|
|
45
|
+
const handleMouseDown = React.useCallback(() => {
|
|
46
|
+
ContentViewManager.setActiveContent(content);
|
|
47
|
+
}, [content]);
|
|
48
|
+
React.useEffect(() => {
|
|
49
|
+
const onAvailableContentChanged = () => {
|
|
50
|
+
var _a, _b, _c;
|
|
51
|
+
// istanbul ignore next
|
|
52
|
+
setHasMultipleContents((activeFrontstageDef && (!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
53
|
+
((_c = (_b = activeFrontstageDef === null || activeFrontstageDef === void 0 ? void 0 : activeFrontstageDef.contentGroup) === null || _b === void 0 ? void 0 : _b.getContentControls().length) !== null && _c !== void 0 ? _c : 0) > 1));
|
|
36
54
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
componentDidMount() {
|
|
45
|
-
ContentViewManager.onActiveContentChangedEvent.addListener(this._handleActiveContentChanged);
|
|
46
|
-
}
|
|
47
|
-
componentWillUnmount() {
|
|
48
|
-
ContentViewManager.onActiveContentChangedEvent.removeListener(this._handleActiveContentChanged);
|
|
49
|
-
}
|
|
50
|
-
// istanbul ignore next
|
|
51
|
-
componentDidUpdate(prevProps, _prevState) {
|
|
52
|
-
if (this.props.content !== prevProps.content) {
|
|
53
|
-
this.setState((_, props) => ({ content: props.content, isActive: props.content === ContentViewManager.getActiveContent() }));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
55
|
+
return ContentViewManager.onAvailableContentChangedEvent.addListener(onAvailableContentChanged);
|
|
56
|
+
}, [activeFrontstageDef]);
|
|
57
|
+
const overlayClassName = classnames("uifw-contentlayout-overlay-div", isActive && hasMultipleContents ? "uifw-contentlayout-overlay-active" : "uifw-contentlayout-overlay-inactive");
|
|
58
|
+
return (React.createElement("div", { className: classnames("uifw-contentlayout-wrapper", props.className), style: props.style, onMouseDown: handleMouseDown, onMouseMove: UiShowHideManager.handleContentMouseMove, role: "presentation" },
|
|
59
|
+
content,
|
|
60
|
+
React.createElement("div", { className: overlayClassName })));
|
|
56
61
|
}
|
|
57
62
|
/** Split Container class.
|
|
58
63
|
*/
|
|
@@ -97,7 +102,8 @@ class SplitContainer extends React.Component {
|
|
|
97
102
|
*/
|
|
98
103
|
class SingleContentContainer extends React.Component {
|
|
99
104
|
render() {
|
|
100
|
-
return (React.createElement("div", { className: classnames("uifw-contentlayout-full-size", this.props.className), style: this.props.style, "data-testid": "single-content-container", onMouseMove: UiShowHideManager.handleContentMouseMove },
|
|
105
|
+
return (React.createElement("div", { className: classnames("uifw-contentlayout-full-size", this.props.className), style: this.props.style, "data-testid": "single-content-container", onMouseMove: UiShowHideManager.handleContentMouseMove },
|
|
106
|
+
React.createElement(ContentWrapper, { content: this.props.content, style: { height: "100%", position: "relative" } })));
|
|
101
107
|
}
|
|
102
108
|
}
|
|
103
109
|
/** Minimum split size */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,8BAA8B;AAE9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAuH,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrK,OAAO,EAAiC,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAazF;GACG;AACH,MAAM,cAAe,SAAQ,KAAK,CAAC,SAAmD;IAKpF,YAAY,KAA0B;QACp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,CAAC;IACrG,CAAC;IAgBe,MAAM;QACpB,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC/B,OAAO,CACL,6BAAK,EAAE,EAAC,wBAAwB,EAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvF,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,EAAE,EACrE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAC,cAAc,IAE9E,IAAI,CAAC,KAAK,CAAC,gBAAgB,CACxB,CACP,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CASF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\n// cSpell:ignore contentlayout\r\n\r\nimport \"./ContentLayout.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { SplitPane } from \"./split-pane/SplitPane\";\r\nimport { CommonProps, Orientation } from \"@itwin/core-react\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { UiShowHideManager } from \"../utils/UiShowHideManager\";\r\nimport { ContentGroup } from \"./ContentGroup\";\r\nimport { ContentLayoutProps, LayoutFragmentProps, LayoutHorizontalSplitProps, LayoutSplitPropsBase, LayoutVerticalSplitProps, UiEvent } from \"@itwin/appui-abstract\";\r\nimport { ActiveContentChangedEventArgs, ContentViewManager } from \"./ContentViewManager\";\r\n\r\n/** Properties for [[ContentWrapper]] */\r\ninterface ContentWrapperProps extends CommonProps {\r\n content: React.ReactNode;\r\n}\r\n\r\n/** State for [[ContentWrapper]] */\r\ninterface ContentWrapperState {\r\n content: React.ReactNode;\r\n isActive: boolean;\r\n}\r\n\r\n/** ContentWrapper React component.\r\n */\r\nclass ContentWrapper extends React.Component<ContentWrapperProps, ContentWrapperState> {\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<ContentWrapperState>;\r\n\r\n constructor(props: ContentWrapperProps) {\r\n super(props);\r\n\r\n this.state = {\r\n content: this.props.content,\r\n isActive: this.props.content === ContentViewManager.getActiveContent(),\r\n };\r\n }\r\n\r\n public override render(): React.ReactNode {\r\n const overlayClassName = classnames(\r\n \"uifw-contentlayout-overlay-div\",\r\n this.state.isActive ? \"uifw-contentlayout-overlay-active\" : \"uifw-contentlayout-overlay-inactive\",\r\n );\r\n\r\n return (\r\n <div className={classnames(\"uifw-contentlayout-wrapper\", this.props.className)} style={this.props.style}\r\n onMouseDown={this._handleMouseDown} onMouseMove={UiShowHideManager.handleContentMouseMove} role=\"presentation\"\r\n >\r\n {this.state.content}\r\n <div className={overlayClassName} />\r\n </div>\r\n );\r\n }\r\n\r\n private _handleMouseDown = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n // event.preventDefault();\r\n\r\n ContentViewManager.setActiveContent(this.state.content);\r\n };\r\n\r\n public override componentDidMount() {\r\n ContentViewManager.onActiveContentChangedEvent.addListener(this._handleActiveContentChanged);\r\n }\r\n\r\n public override componentWillUnmount() {\r\n ContentViewManager.onActiveContentChangedEvent.removeListener(this._handleActiveContentChanged);\r\n }\r\n\r\n private _handleActiveContentChanged = (args: ActiveContentChangedEventArgs) => {\r\n const isActive = this.state.content === args.activeContent;\r\n if (this.state.isActive !== isActive) {\r\n this.setState({ isActive });\r\n }\r\n };\r\n\r\n // istanbul ignore next\r\n public override componentDidUpdate(prevProps: ContentWrapperProps, _prevState: ContentWrapperState) {\r\n if (this.props.content !== prevProps.content) {\r\n this.setState((_, props) => ({ content: props.content, isActive: props.content === ContentViewManager.getActiveContent() }));\r\n }\r\n }\r\n}\r\n\r\n/** Properties for the [[SplitContainer]] component */\r\ninterface SplitContainerProps extends CommonProps {\r\n contentA: React.ReactNode;\r\n contentB: React.ReactNode;\r\n orientation: Orientation;\r\n percentage: number;\r\n resizable: boolean;\r\n minSizeTopLeft: number;\r\n minSizeBottomRight: number;\r\n splitterStateId?: string;\r\n onSplitterChange?: (size: number, percentage: number) => void;\r\n}\r\n\r\n/** Split Container class.\r\n */\r\nclass SplitContainer extends React.Component<SplitContainerProps> {\r\n private _containerDiv: HTMLDivElement | null = null;\r\n\r\n constructor(props: SplitContainerProps) {\r\n super(props);\r\n }\r\n\r\n private _onSplitterChange = (size: number): void => {\r\n let percentage = 0;\r\n\r\n // istanbul ignore else\r\n if (this._containerDiv && size > 0) {\r\n if (this.props.orientation === Orientation.Horizontal) {\r\n const height = this._containerDiv.getBoundingClientRect().height;\r\n // istanbul ignore if\r\n if (height > 0)\r\n percentage = size / height;\r\n } else {\r\n const width = this._containerDiv.getBoundingClientRect().width;\r\n // istanbul ignore if\r\n if (width > 0)\r\n percentage = size / width;\r\n }\r\n\r\n // istanbul ignore else\r\n if (this.props.onSplitterChange)\r\n this.props.onSplitterChange(size, percentage);\r\n }\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n const orientation = (this.props.orientation === Orientation.Horizontal) ? \"horizontal\" : \"vertical\";\r\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\r\n const minSizeTopLeft = this.props.minSizeTopLeft;\r\n const minSizeBottomRight = -(this.props.minSizeBottomRight);\r\n\r\n return (\r\n <div ref={(e) => { this._containerDiv = e; }}\r\n className={classnames(\"uifw-contentlayout-full-size\", this.props.className)}\r\n style={this.props.style}\r\n >\r\n <SplitPane split={orientation}\r\n minSize={minSizeTopLeft} maxSize={minSizeBottomRight} defaultSize={defaultSize}\r\n onChange={this._onSplitterChange} allowResize={this.props.resizable}\r\n >\r\n {this.props.contentA}\r\n {this.props.contentB}\r\n </SplitPane>\r\n </div >\r\n );\r\n }\r\n}\r\n\r\n/** Properties for [[SingleContentContainer]] component\r\n */\r\ninterface SingleContentProps extends CommonProps {\r\n content: React.ReactNode;\r\n}\r\n\r\n/** Single Content Container class.\r\n */\r\nclass SingleContentContainer extends React.Component<SingleContentProps> {\r\n\r\n public override render(): React.ReactNode {\r\n\r\n return (\r\n <div className={classnames(\"uifw-contentlayout-full-size\", this.props.className)} style={this.props.style} data-testid=\"single-content-container\"\r\n onMouseMove={UiShowHideManager.handleContentMouseMove}\r\n >\r\n {this.props.content}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** Common interface for HorizontalSplit and VerticalSplit\r\n */\r\ninterface LayoutSplit {\r\n createContentContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode;\r\n isLocked: boolean;\r\n}\r\n\r\n/** Minimum split size */\r\nconst MIN_SPLIT_SIZE = 6;\r\n\r\n/** Base Split class.\r\n */\r\nclass BaseSplit {\r\n public defaultPercentage: number;\r\n public stateId: string = \"\";\r\n public isLocked: boolean = false;\r\n\r\n constructor(props: LayoutSplitPropsBase) {\r\n this.defaultPercentage = props.percentage;\r\n\r\n // istanbul ignore else\r\n if (props.id)\r\n this.stateId = props.id;\r\n\r\n // istanbul ignore else\r\n if (props.lock)\r\n this.isLocked = props.lock;\r\n }\r\n}\r\n\r\n/** Horizontal Split class.\r\n */\r\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\r\n private _topIndex: number = -1;\r\n private _bottomIndex: number = -1;\r\n private _topSplit?: LayoutSplit;\r\n private _bottomSplit?: LayoutSplit;\r\n private _props: LayoutHorizontalSplitProps;\r\n private _minSizeTop: number = MIN_SPLIT_SIZE;\r\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\r\n\r\n constructor(props: LayoutHorizontalSplitProps) {\r\n super(props);\r\n\r\n this._props = props;\r\n\r\n if (typeof props.top === \"number\") {\r\n this._topIndex = props.top;\r\n } else {\r\n this._topSplit = ContentLayoutDef.createSplit(props.top);\r\n }\r\n\r\n if (typeof props.bottom === \"number\") {\r\n this._bottomIndex = props.bottom;\r\n } else {\r\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\r\n }\r\n\r\n if (props.minSizeTop)\r\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\r\n\r\n if (props.minSizeBottom)\r\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\r\n }\r\n\r\n private _handleSplitterChange = (_size: number, percentage: number): void => {\r\n this._props.percentage = percentage;\r\n };\r\n\r\n public createContentContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode {\r\n if (this.isLocked)\r\n resizable = false;\r\n\r\n const topContent = (!this._topSplit) ?\r\n <ContentWrapper content={contentNodes[this._topIndex]} /> :\r\n this._topSplit.createContentContainer(contentNodes, resizable);\r\n const bottomContent = (!this._bottomSplit) ?\r\n <ContentWrapper content={contentNodes[this._bottomIndex]} /> :\r\n this._bottomSplit.createContentContainer(contentNodes, resizable);\r\n\r\n return (\r\n <SplitContainer\r\n contentA={topContent}\r\n contentB={bottomContent}\r\n orientation={Orientation.Horizontal}\r\n percentage={this.defaultPercentage}\r\n resizable={resizable}\r\n minSizeTopLeft={this._minSizeTop}\r\n minSizeBottomRight={this._minSizeBottom}\r\n splitterStateId={this.stateId}\r\n onSplitterChange={this._handleSplitterChange}\r\n />\r\n );\r\n }\r\n}\r\n\r\n/** Vertical Split class.\r\n */\r\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\r\n private _leftIndex: number = -1;\r\n private _rightIndex: number = -1;\r\n private _leftSplit?: LayoutSplit;\r\n private _rightSplit?: LayoutSplit;\r\n private _props: LayoutVerticalSplitProps;\r\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\r\n private _minSizeRight: number = MIN_SPLIT_SIZE;\r\n\r\n constructor(props: LayoutVerticalSplitProps) {\r\n super(props);\r\n\r\n this._props = props;\r\n\r\n if (typeof props.left === \"number\") {\r\n this._leftIndex = props.left;\r\n } else {\r\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\r\n }\r\n\r\n if (typeof props.right === \"number\") {\r\n this._rightIndex = props.right;\r\n } else {\r\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\r\n }\r\n\r\n if (props.minSizeLeft)\r\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\r\n\r\n if (props.minSizeRight)\r\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\r\n }\r\n\r\n private _handleSplitterChange = (_size: number, percentage: number): void => {\r\n this._props.percentage = percentage;\r\n };\r\n\r\n public createContentContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode {\r\n if (this.isLocked)\r\n resizable = false;\r\n\r\n const leftContent = (!this._leftSplit) ?\r\n <ContentWrapper content={contentNodes[this._leftIndex]} /> :\r\n this._leftSplit.createContentContainer(contentNodes, resizable);\r\n const rightContent = (!this._rightSplit) ?\r\n <ContentWrapper content={contentNodes[this._rightIndex]} /> :\r\n this._rightSplit.createContentContainer(contentNodes, resizable);\r\n\r\n return (\r\n <SplitContainer\r\n contentA={leftContent}\r\n contentB={rightContent}\r\n orientation={Orientation.Vertical}\r\n percentage={this.defaultPercentage}\r\n resizable={resizable}\r\n minSizeTopLeft={this._minSizeLeft}\r\n minSizeBottomRight={this._minSizeRight}\r\n splitterStateId={this.stateId}\r\n onSplitterChange={this._handleSplitterChange}\r\n />\r\n );\r\n }\r\n}\r\n\r\n/** Content Layout Definition class.\r\n * @public\r\n */\r\nexport class ContentLayoutDef {\r\n private _layoutProps: ContentLayoutProps;\r\n private _rootSplit?: LayoutSplit;\r\n\r\n /** ID for this Content Layout */\r\n public id: string = \"\";\r\n /** Description of the layout. */\r\n public description: string = \"\";\r\n constructor(layoutProps: ContentLayoutProps) {\r\n this._layoutProps = layoutProps;\r\n this.id = layoutProps.id;\r\n if (layoutProps.description !== undefined)\r\n this.description = layoutProps.description;\r\n }\r\n\r\n public get rootSplit(): LayoutSplit | undefined { return this._rootSplit; }\r\n\r\n /** Creates [[ContentLayoutProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(): ContentLayoutProps { return this._layoutProps; }\r\n\r\n /** Fill a layout container with React nodes for each content view\r\n */\r\n public fillLayoutContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode | undefined {\r\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\r\n\r\n if (this.rootSplit) {\r\n return this.rootSplit.createContentContainer(contentNodes, resizable);\r\n }\r\n\r\n if (contentNodes.length > 0)\r\n return <SingleContentContainer content={contentNodes[0]} />;\r\n\r\n return undefined;\r\n }\r\n\r\n /** Gets the indexes of content views used in this Content Layout\r\n */\r\n public getUsedContentIndexes(): number[] {\r\n let allContentIndexes: number[] = [];\r\n\r\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\r\n allContentIndexes.push(0);\r\n else {\r\n allContentIndexes = allContentIndexes.concat(this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit));\r\n allContentIndexes = allContentIndexes.concat(this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit));\r\n }\r\n\r\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\r\n\r\n return uniqueContentIndexes;\r\n }\r\n\r\n private getHorizontalSplitContentIndexes(splitProps?: LayoutHorizontalSplitProps): number[] {\r\n let contentIndexes: number[] = [];\r\n\r\n if (!splitProps)\r\n return contentIndexes;\r\n\r\n if (typeof splitProps.top === \"number\")\r\n contentIndexes.push(splitProps.top);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit));\r\n }\r\n\r\n if (typeof splitProps.bottom === \"number\")\r\n contentIndexes.push(splitProps.bottom);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit));\r\n }\r\n\r\n return contentIndexes;\r\n }\r\n\r\n private getVerticalSplitContentIndexes(splitProps?: LayoutVerticalSplitProps): number[] {\r\n let contentIndexes: number[] = [];\r\n\r\n if (!splitProps)\r\n return contentIndexes;\r\n\r\n if (typeof splitProps.left === \"number\")\r\n contentIndexes.push(splitProps.left);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit));\r\n }\r\n\r\n if (typeof splitProps.right === \"number\")\r\n contentIndexes.push(splitProps.right);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit));\r\n }\r\n\r\n return contentIndexes;\r\n }\r\n\r\n /** @internal */\r\n public static createSplit(fragmentDef: LayoutFragmentProps): LayoutSplit | undefined {\r\n if (fragmentDef.horizontalSplit) {\r\n return new HorizontalSplit(fragmentDef.horizontalSplit);\r\n } else if (fragmentDef.verticalSplit) {\r\n return new VerticalSplit(fragmentDef.verticalSplit);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n/** Content Layout Activated Event Args class.\r\n * @public\r\n */\r\nexport interface ContentLayoutActivatedEventArgs {\r\n contentLayout: ContentLayoutDef;\r\n contentGroup: ContentGroup;\r\n}\r\n\r\n/** Content Layout Activated Event class.\r\n * @public\r\n */\r\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> { }\r\n\r\n/** State for the [[ContentLayout]].\r\n */\r\ninterface ContentLayoutState {\r\n contentLayoutDef: ContentLayoutDef;\r\n contentContainer?: React.ReactNode;\r\n contentGroupId?: string;\r\n}\r\n\r\n/** Properties for the [[ContentLayout]] React component.\r\n * @public\r\n */\r\nexport interface ContentLayoutComponentProps extends CommonProps {\r\n contentLayout: ContentLayoutDef;\r\n contentGroup: ContentGroup;\r\n isInFooterMode: boolean;\r\n}\r\n\r\n/** Content Layout React component.\r\n * @public\r\n */\r\nexport class ContentLayout extends React.Component<ContentLayoutComponentProps, ContentLayoutState> {\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<ContentLayoutState>;\r\n\r\n constructor(props: ContentLayoutComponentProps) {\r\n super(props);\r\n\r\n const contentLayoutDef = this.props.contentLayout;\r\n const contentGroup = this.props.contentGroup;\r\n\r\n const contentNodes = contentGroup.getContentNodes();\r\n const contentContainer = contentLayoutDef.fillLayoutContainer(contentNodes, true);\r\n\r\n this.state = {\r\n contentLayoutDef: this.props.contentLayout,\r\n contentContainer,\r\n contentGroupId: this.props.contentGroup.groupId,\r\n };\r\n }\r\n\r\n public override componentDidMount() {\r\n FrontstageManager.onContentLayoutActivatedEvent.addListener(this._handleContentLayoutActivated);\r\n }\r\n\r\n public override componentWillUnmount() {\r\n FrontstageManager.onContentLayoutActivatedEvent.removeListener(this._handleContentLayoutActivated);\r\n }\r\n\r\n private _handleContentLayoutActivated = (args: ContentLayoutActivatedEventArgs) => {\r\n const contentLayoutDef = args.contentLayout;\r\n const contentGroup = args.contentGroup;\r\n\r\n const contentNodes = contentGroup.getContentNodes();\r\n const contentContainer = contentLayoutDef.fillLayoutContainer(contentNodes, true);\r\n\r\n this.setState({\r\n contentLayoutDef: args.contentLayout,\r\n contentContainer,\r\n contentGroupId: contentGroup.groupId,\r\n });\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n if (this.state.contentContainer) {\r\n return (\r\n <div id=\"uifw-contentlayout-div\" className={this.props.className} style={this.props.style}\r\n key={`${this.state.contentGroupId}-${this.state.contentLayoutDef.id}`}\r\n onMouseDown={this._onMouseDown} onMouseUp={this._onMouseUp} role=\"presentation\"\r\n >\r\n {this.state.contentContainer}\r\n </div>\r\n );\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _onMouseDown = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n ContentViewManager.setMouseDown(true);\r\n };\r\n\r\n private _onMouseUp = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n ContentViewManager.setMouseDown(false);\r\n };\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,8BAA8B;AAE9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAe,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAuH,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrK,OAAO,EAAiC,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAOlE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,KAAK,kBAAkB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClG,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;IAErD,uBAAuB;IACvB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;;QACxE,OAAA,CAAC,mBAAmB,IAAI,CAAC,CAAC,CAAC,CAAA,MAAA,mBAAmB,CAAC,uBAAuB,0CAAE,MAAM,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AAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAElF,IAAI,CAAC,KAAK,GAAG;YACX,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;YAC1C,gBAAgB;YAChB,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO;SAChD,CAAC;IACJ,CAAC;IAEe,iBAAiB;QAC/B,iBAAiB,CAAC,6BAA6B,CAAC,WAAW,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAClG,CAAC;IAEe,oBAAoB;QAClC,iBAAiB,CAAC,6BAA6B,CAAC,cAAc,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IACrG,CAAC;IAgBe,MAAM;QACpB,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;YAC/B,OAAO,CACL,6BAAK,EAAE,EAAC,wBAAwB,EAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvF,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,EAAE,EACrE,WAAW,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAC,cAAc,IAE9E,IAAI,CAAC,KAAK,CAAC,gBAAgB,CACxB,CACP,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CASF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module ContentView\r\n */\r\n\r\n// cSpell:ignore contentlayout\r\n\r\nimport \"./ContentLayout.scss\";\r\nimport classnames from \"classnames\";\r\nimport * as React from \"react\";\r\nimport { SplitPane } from \"./split-pane/SplitPane\";\r\nimport { CommonProps, Orientation } from \"@itwin/core-react\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { UiShowHideManager } from \"../utils/UiShowHideManager\";\r\nimport { ContentGroup } from \"./ContentGroup\";\r\nimport { ContentLayoutProps, LayoutFragmentProps, LayoutHorizontalSplitProps, LayoutSplitPropsBase, LayoutVerticalSplitProps, UiEvent } from \"@itwin/appui-abstract\";\r\nimport { ActiveContentChangedEventArgs, ContentViewManager } from \"./ContentViewManager\";\r\nimport { useActiveFrontstageDef } from \"../frontstage/Frontstage\";\r\n\r\n/** Properties for [[ContentWrapper]] */\r\ninterface ContentWrapperProps extends CommonProps {\r\n content: React.ReactNode;\r\n}\r\n\r\n/** ContentWrapper React component.\r\n * @internal\r\n */\r\nexport function ContentWrapper(props: ContentWrapperProps) {\r\n const { content } = props;\r\n const [isActive, setIsActive] = React.useState(content === ContentViewManager.getActiveContent());\r\n const activeFrontstageDef = useActiveFrontstageDef();\r\n\r\n // istanbul ignore next\r\n const [hasMultipleContents, setHasMultipleContents] = React.useState(() =>\r\n (activeFrontstageDef && (!!activeFrontstageDef.floatingContentControls?.length) ||\r\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1)\r\n );\r\n\r\n React.useEffect(() => {\r\n setIsActive(content === ContentViewManager.getActiveContent());\r\n }, [content]);\r\n\r\n React.useEffect(() => {\r\n const handleActiveContentChanged = (args: ActiveContentChangedEventArgs) => {\r\n setIsActive(content === args.activeContent);\r\n // istanbul ignore next\r\n setHasMultipleContents((activeFrontstageDef && (!!activeFrontstageDef.floatingContentControls?.length) ||\r\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1));\r\n };\r\n return ContentViewManager.onActiveContentChangedEvent.addListener(handleActiveContentChanged);\r\n }, [activeFrontstageDef, content]);\r\n\r\n const handleMouseDown = React.useCallback(() => {\r\n ContentViewManager.setActiveContent(content);\r\n }, [content]);\r\n\r\n React.useEffect(() => {\r\n const onAvailableContentChanged = () => {\r\n // istanbul ignore next\r\n setHasMultipleContents((activeFrontstageDef && (!!activeFrontstageDef.floatingContentControls?.length) ||\r\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1));\r\n };\r\n return ContentViewManager.onAvailableContentChangedEvent.addListener(onAvailableContentChanged);\r\n }, [activeFrontstageDef]);\r\n\r\n const overlayClassName = classnames(\r\n \"uifw-contentlayout-overlay-div\",\r\n isActive && hasMultipleContents ? \"uifw-contentlayout-overlay-active\" : \"uifw-contentlayout-overlay-inactive\",\r\n );\r\n\r\n return (\r\n <div className={classnames(\"uifw-contentlayout-wrapper\", props.className)} style={props.style}\r\n onMouseDown={handleMouseDown} onMouseMove={UiShowHideManager.handleContentMouseMove} role=\"presentation\"\r\n >\r\n {content}\r\n <div className={overlayClassName} />\r\n </div>\r\n );\r\n}\r\n\r\n/** Properties for the [[SplitContainer]] component */\r\ninterface SplitContainerProps extends CommonProps {\r\n contentA: React.ReactNode;\r\n contentB: React.ReactNode;\r\n orientation: Orientation;\r\n percentage: number;\r\n resizable: boolean;\r\n minSizeTopLeft: number;\r\n minSizeBottomRight: number;\r\n splitterStateId?: string;\r\n onSplitterChange?: (size: number, percentage: number) => void;\r\n}\r\n\r\n/** Split Container class.\r\n */\r\nclass SplitContainer extends React.Component<SplitContainerProps> {\r\n private _containerDiv: HTMLDivElement | null = null;\r\n\r\n constructor(props: SplitContainerProps) {\r\n super(props);\r\n }\r\n\r\n private _onSplitterChange = (size: number): void => {\r\n let percentage = 0;\r\n\r\n // istanbul ignore else\r\n if (this._containerDiv && size > 0) {\r\n if (this.props.orientation === Orientation.Horizontal) {\r\n const height = this._containerDiv.getBoundingClientRect().height;\r\n // istanbul ignore if\r\n if (height > 0)\r\n percentage = size / height;\r\n } else {\r\n const width = this._containerDiv.getBoundingClientRect().width;\r\n // istanbul ignore if\r\n if (width > 0)\r\n percentage = size / width;\r\n }\r\n\r\n // istanbul ignore else\r\n if (this.props.onSplitterChange)\r\n this.props.onSplitterChange(size, percentage);\r\n }\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n const orientation = (this.props.orientation === Orientation.Horizontal) ? \"horizontal\" : \"vertical\";\r\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\r\n const minSizeTopLeft = this.props.minSizeTopLeft;\r\n const minSizeBottomRight = -(this.props.minSizeBottomRight);\r\n\r\n return (\r\n <div ref={(e) => { this._containerDiv = e; }}\r\n className={classnames(\"uifw-contentlayout-full-size\", this.props.className)}\r\n style={this.props.style}\r\n >\r\n <SplitPane split={orientation}\r\n minSize={minSizeTopLeft} maxSize={minSizeBottomRight} defaultSize={defaultSize}\r\n onChange={this._onSplitterChange} allowResize={this.props.resizable}\r\n >\r\n {this.props.contentA}\r\n {this.props.contentB}\r\n </SplitPane>\r\n </div >\r\n );\r\n }\r\n}\r\n\r\n/** Properties for [[SingleContentContainer]] component\r\n */\r\ninterface SingleContentProps extends CommonProps {\r\n content: React.ReactNode;\r\n}\r\n\r\n/** Single Content Container class.\r\n */\r\nclass SingleContentContainer extends React.Component<SingleContentProps> {\r\n\r\n public override render(): React.ReactNode {\r\n\r\n return (\r\n <div className={classnames(\"uifw-contentlayout-full-size\", this.props.className)} style={this.props.style} data-testid=\"single-content-container\"\r\n onMouseMove={UiShowHideManager.handleContentMouseMove}\r\n >\r\n <ContentWrapper content={this.props.content} style={{ height: \"100%\", position: \"relative\" }} />\r\n </div>\r\n );\r\n }\r\n}\r\n\r\n/** Common interface for HorizontalSplit and VerticalSplit\r\n */\r\ninterface LayoutSplit {\r\n createContentContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode;\r\n isLocked: boolean;\r\n}\r\n\r\n/** Minimum split size */\r\nconst MIN_SPLIT_SIZE = 6;\r\n\r\n/** Base Split class.\r\n */\r\nclass BaseSplit {\r\n public defaultPercentage: number;\r\n public stateId: string = \"\";\r\n public isLocked: boolean = false;\r\n\r\n constructor(props: LayoutSplitPropsBase) {\r\n this.defaultPercentage = props.percentage;\r\n\r\n // istanbul ignore else\r\n if (props.id)\r\n this.stateId = props.id;\r\n\r\n // istanbul ignore else\r\n if (props.lock)\r\n this.isLocked = props.lock;\r\n }\r\n}\r\n\r\n/** Horizontal Split class.\r\n */\r\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\r\n private _topIndex: number = -1;\r\n private _bottomIndex: number = -1;\r\n private _topSplit?: LayoutSplit;\r\n private _bottomSplit?: LayoutSplit;\r\n private _props: LayoutHorizontalSplitProps;\r\n private _minSizeTop: number = MIN_SPLIT_SIZE;\r\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\r\n\r\n constructor(props: LayoutHorizontalSplitProps) {\r\n super(props);\r\n\r\n this._props = props;\r\n\r\n if (typeof props.top === \"number\") {\r\n this._topIndex = props.top;\r\n } else {\r\n this._topSplit = ContentLayoutDef.createSplit(props.top);\r\n }\r\n\r\n if (typeof props.bottom === \"number\") {\r\n this._bottomIndex = props.bottom;\r\n } else {\r\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\r\n }\r\n\r\n if (props.minSizeTop)\r\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\r\n\r\n if (props.minSizeBottom)\r\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\r\n }\r\n\r\n private _handleSplitterChange = (_size: number, percentage: number): void => {\r\n this._props.percentage = percentage;\r\n };\r\n\r\n public createContentContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode {\r\n if (this.isLocked)\r\n resizable = false;\r\n\r\n const topContent = (!this._topSplit) ?\r\n <ContentWrapper content={contentNodes[this._topIndex]} /> :\r\n this._topSplit.createContentContainer(contentNodes, resizable);\r\n const bottomContent = (!this._bottomSplit) ?\r\n <ContentWrapper content={contentNodes[this._bottomIndex]} /> :\r\n this._bottomSplit.createContentContainer(contentNodes, resizable);\r\n\r\n return (\r\n <SplitContainer\r\n contentA={topContent}\r\n contentB={bottomContent}\r\n orientation={Orientation.Horizontal}\r\n percentage={this.defaultPercentage}\r\n resizable={resizable}\r\n minSizeTopLeft={this._minSizeTop}\r\n minSizeBottomRight={this._minSizeBottom}\r\n splitterStateId={this.stateId}\r\n onSplitterChange={this._handleSplitterChange}\r\n />\r\n );\r\n }\r\n}\r\n\r\n/** Vertical Split class.\r\n */\r\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\r\n private _leftIndex: number = -1;\r\n private _rightIndex: number = -1;\r\n private _leftSplit?: LayoutSplit;\r\n private _rightSplit?: LayoutSplit;\r\n private _props: LayoutVerticalSplitProps;\r\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\r\n private _minSizeRight: number = MIN_SPLIT_SIZE;\r\n\r\n constructor(props: LayoutVerticalSplitProps) {\r\n super(props);\r\n\r\n this._props = props;\r\n\r\n if (typeof props.left === \"number\") {\r\n this._leftIndex = props.left;\r\n } else {\r\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\r\n }\r\n\r\n if (typeof props.right === \"number\") {\r\n this._rightIndex = props.right;\r\n } else {\r\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\r\n }\r\n\r\n if (props.minSizeLeft)\r\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\r\n\r\n if (props.minSizeRight)\r\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\r\n }\r\n\r\n private _handleSplitterChange = (_size: number, percentage: number): void => {\r\n this._props.percentage = percentage;\r\n };\r\n\r\n public createContentContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode {\r\n if (this.isLocked)\r\n resizable = false;\r\n\r\n const leftContent = (!this._leftSplit) ?\r\n <ContentWrapper content={contentNodes[this._leftIndex]} /> :\r\n this._leftSplit.createContentContainer(contentNodes, resizable);\r\n const rightContent = (!this._rightSplit) ?\r\n <ContentWrapper content={contentNodes[this._rightIndex]} /> :\r\n this._rightSplit.createContentContainer(contentNodes, resizable);\r\n\r\n return (\r\n <SplitContainer\r\n contentA={leftContent}\r\n contentB={rightContent}\r\n orientation={Orientation.Vertical}\r\n percentage={this.defaultPercentage}\r\n resizable={resizable}\r\n minSizeTopLeft={this._minSizeLeft}\r\n minSizeBottomRight={this._minSizeRight}\r\n splitterStateId={this.stateId}\r\n onSplitterChange={this._handleSplitterChange}\r\n />\r\n );\r\n }\r\n}\r\n\r\n/** Content Layout Definition class.\r\n * @public\r\n */\r\nexport class ContentLayoutDef {\r\n private _layoutProps: ContentLayoutProps;\r\n private _rootSplit?: LayoutSplit;\r\n\r\n /** ID for this Content Layout */\r\n public id: string = \"\";\r\n /** Description of the layout. */\r\n public description: string = \"\";\r\n constructor(layoutProps: ContentLayoutProps) {\r\n this._layoutProps = layoutProps;\r\n this.id = layoutProps.id;\r\n if (layoutProps.description !== undefined)\r\n this.description = layoutProps.description;\r\n }\r\n\r\n public get rootSplit(): LayoutSplit | undefined { return this._rootSplit; }\r\n\r\n /** Creates [[ContentLayoutProps]] for JSON purposes\r\n * @public\r\n */\r\n public toJSON(): ContentLayoutProps { return this._layoutProps; }\r\n\r\n /** Fill a layout container with React nodes for each content view\r\n */\r\n public fillLayoutContainer(contentNodes: React.ReactNode[], resizable: boolean): React.ReactNode | undefined {\r\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\r\n\r\n if (this.rootSplit) {\r\n return this.rootSplit.createContentContainer(contentNodes, resizable);\r\n }\r\n\r\n if (contentNodes.length > 0)\r\n return <SingleContentContainer content={contentNodes[0]} />;\r\n\r\n return undefined;\r\n }\r\n\r\n /** Gets the indexes of content views used in this Content Layout\r\n */\r\n public getUsedContentIndexes(): number[] {\r\n let allContentIndexes: number[] = [];\r\n\r\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\r\n allContentIndexes.push(0);\r\n else {\r\n allContentIndexes = allContentIndexes.concat(this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit));\r\n allContentIndexes = allContentIndexes.concat(this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit));\r\n }\r\n\r\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\r\n\r\n return uniqueContentIndexes;\r\n }\r\n\r\n private getHorizontalSplitContentIndexes(splitProps?: LayoutHorizontalSplitProps): number[] {\r\n let contentIndexes: number[] = [];\r\n\r\n if (!splitProps)\r\n return contentIndexes;\r\n\r\n if (typeof splitProps.top === \"number\")\r\n contentIndexes.push(splitProps.top);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit));\r\n }\r\n\r\n if (typeof splitProps.bottom === \"number\")\r\n contentIndexes.push(splitProps.bottom);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit));\r\n }\r\n\r\n return contentIndexes;\r\n }\r\n\r\n private getVerticalSplitContentIndexes(splitProps?: LayoutVerticalSplitProps): number[] {\r\n let contentIndexes: number[] = [];\r\n\r\n if (!splitProps)\r\n return contentIndexes;\r\n\r\n if (typeof splitProps.left === \"number\")\r\n contentIndexes.push(splitProps.left);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit));\r\n }\r\n\r\n if (typeof splitProps.right === \"number\")\r\n contentIndexes.push(splitProps.right);\r\n else {\r\n contentIndexes = contentIndexes.concat(this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit));\r\n contentIndexes = contentIndexes.concat(this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit));\r\n }\r\n\r\n return contentIndexes;\r\n }\r\n\r\n /** @internal */\r\n public static createSplit(fragmentDef: LayoutFragmentProps): LayoutSplit | undefined {\r\n if (fragmentDef.horizontalSplit) {\r\n return new HorizontalSplit(fragmentDef.horizontalSplit);\r\n } else if (fragmentDef.verticalSplit) {\r\n return new VerticalSplit(fragmentDef.verticalSplit);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n/** Content Layout Activated Event Args class.\r\n * @public\r\n */\r\nexport interface ContentLayoutActivatedEventArgs {\r\n contentLayout: ContentLayoutDef;\r\n contentGroup: ContentGroup;\r\n}\r\n\r\n/** Content Layout Activated Event class.\r\n * @public\r\n */\r\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> { }\r\n\r\n/** State for the [[ContentLayout]].\r\n */\r\ninterface ContentLayoutState {\r\n contentLayoutDef: ContentLayoutDef;\r\n contentContainer?: React.ReactNode;\r\n contentGroupId?: string;\r\n}\r\n\r\n/** Properties for the [[ContentLayout]] React component.\r\n * @public\r\n */\r\nexport interface ContentLayoutComponentProps extends CommonProps {\r\n contentLayout: ContentLayoutDef;\r\n contentGroup: ContentGroup;\r\n isInFooterMode: boolean;\r\n}\r\n\r\n/** Content Layout React component.\r\n * @public\r\n */\r\nexport class ContentLayout extends React.Component<ContentLayoutComponentProps, ContentLayoutState> {\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<ContentLayoutState>;\r\n\r\n constructor(props: ContentLayoutComponentProps) {\r\n super(props);\r\n\r\n const contentLayoutDef = this.props.contentLayout;\r\n const contentGroup = this.props.contentGroup;\r\n\r\n const contentNodes = contentGroup.getContentNodes();\r\n const contentContainer = contentLayoutDef.fillLayoutContainer(contentNodes, true);\r\n\r\n this.state = {\r\n contentLayoutDef: this.props.contentLayout,\r\n contentContainer,\r\n contentGroupId: this.props.contentGroup.groupId,\r\n };\r\n }\r\n\r\n public override componentDidMount() {\r\n FrontstageManager.onContentLayoutActivatedEvent.addListener(this._handleContentLayoutActivated);\r\n }\r\n\r\n public override componentWillUnmount() {\r\n FrontstageManager.onContentLayoutActivatedEvent.removeListener(this._handleContentLayoutActivated);\r\n }\r\n\r\n private _handleContentLayoutActivated = (args: ContentLayoutActivatedEventArgs) => {\r\n const contentLayoutDef = args.contentLayout;\r\n const contentGroup = args.contentGroup;\r\n\r\n const contentNodes = contentGroup.getContentNodes();\r\n const contentContainer = contentLayoutDef.fillLayoutContainer(contentNodes, true);\r\n\r\n this.setState({\r\n contentLayoutDef: args.contentLayout,\r\n contentContainer,\r\n contentGroupId: contentGroup.groupId,\r\n });\r\n };\r\n\r\n public override render(): React.ReactNode {\r\n if (this.state.contentContainer) {\r\n return (\r\n <div id=\"uifw-contentlayout-div\" className={this.props.className} style={this.props.style}\r\n key={`${this.state.contentGroupId}-${this.state.contentLayoutDef.id}`}\r\n onMouseDown={this._onMouseDown} onMouseUp={this._onMouseUp} role=\"presentation\"\r\n >\r\n {this.state.contentContainer}\r\n </div>\r\n );\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _onMouseDown = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n ContentViewManager.setMouseDown(true);\r\n };\r\n\r\n private _onMouseUp = (_event: React.MouseEvent<HTMLDivElement>) => {\r\n ContentViewManager.setMouseDown(false);\r\n };\r\n}\r\n"]}
|