@itwin/appui-react 3.4.0-dev.9 → 3.5.0-dev.12
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 +43 -1
- package/lib/cjs/appui-react/childwindow/ChildWindowManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/childwindow/ChildWindowManager.js +4 -5
- package/lib/cjs/appui-react/childwindow/ChildWindowManager.js.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.d.ts +7 -0
- package/lib/cjs/appui-react/dialog/DialogManagerBase.d.ts.map +1 -1
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js +23 -0
- package/lib/cjs/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/cjs/appui-react/dialog/ModelessDialogManager.d.ts +0 -2
- package/lib/cjs/appui-react/dialog/ModelessDialogManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/dialog/ModelessDialogManager.js +6 -18
- package/lib/cjs/appui-react/dialog/ModelessDialogManager.js.map +1 -1
- package/lib/cjs/appui-react/dialog/StandardMessageBox.d.ts.map +1 -1
- package/lib/cjs/appui-react/dialog/StandardMessageBox.js +2 -1
- package/lib/cjs/appui-react/dialog/StandardMessageBox.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +13 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +140 -96
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageManager.d.ts +2 -0
- package/lib/cjs/appui-react/frontstage/FrontstageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageManager.js +4 -0
- package/lib/cjs/appui-react/frontstage/FrontstageManager.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/Categories.json +2 -2
- package/lib/cjs/appui-react/imodel-components/models-tree/Hierarchy.GroupedByClass.json +1 -0
- package/lib/cjs/appui-react/imodel-components/models-tree/Hierarchy.json +1 -0
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsTree.d.ts +1 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsTree.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsTree.js +11 -8
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsTree.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.d.ts +15 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.js +5 -2
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts +0 -6
- package/lib/cjs/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.d.ts +1 -0
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js +23 -4
- package/lib/cjs/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.d.ts +9 -0
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.js +17 -1
- package/lib/cjs/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsProvider.js +2 -0
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsProvider.js.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.d.ts +1 -0
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js +2 -0
- package/lib/cjs/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/FloatingWidget.d.ts +7 -0
- package/lib/cjs/appui-react/widget-panels/FloatingWidget.d.ts.map +1 -0
- package/lib/cjs/appui-react/widget-panels/FloatingWidget.js +19 -0
- package/lib/cjs/appui-react/widget-panels/FloatingWidget.js.map +1 -0
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +20 -697
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +300 -271
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/useWidgetDirection.js +1 -1
- package/lib/cjs/appui-react/widget-panels/useWidgetDirection.js.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts +16 -6
- package/lib/cjs/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js +13 -1
- package/lib/cjs/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/esm/appui-react/childwindow/ChildWindowManager.d.ts.map +1 -1
- package/lib/esm/appui-react/childwindow/ChildWindowManager.js +4 -5
- package/lib/esm/appui-react/childwindow/ChildWindowManager.js.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.d.ts +7 -0
- package/lib/esm/appui-react/dialog/DialogManagerBase.d.ts.map +1 -1
- package/lib/esm/appui-react/dialog/DialogManagerBase.js +23 -0
- package/lib/esm/appui-react/dialog/DialogManagerBase.js.map +1 -1
- package/lib/esm/appui-react/dialog/ModelessDialogManager.d.ts +0 -2
- package/lib/esm/appui-react/dialog/ModelessDialogManager.d.ts.map +1 -1
- package/lib/esm/appui-react/dialog/ModelessDialogManager.js +6 -18
- package/lib/esm/appui-react/dialog/ModelessDialogManager.js.map +1 -1
- package/lib/esm/appui-react/dialog/StandardMessageBox.d.ts.map +1 -1
- package/lib/esm/appui-react/dialog/StandardMessageBox.js +2 -1
- package/lib/esm/appui-react/dialog/StandardMessageBox.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +13 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +142 -98
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageManager.d.ts +2 -0
- package/lib/esm/appui-react/frontstage/FrontstageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageManager.js +4 -0
- package/lib/esm/appui-react/frontstage/FrontstageManager.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/Categories.json +2 -2
- package/lib/esm/appui-react/imodel-components/models-tree/Hierarchy.GroupedByClass.json +1 -0
- package/lib/esm/appui-react/imodel-components/models-tree/Hierarchy.json +1 -0
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsTree.d.ts +1 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsTree.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsTree.js +12 -9
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsTree.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.d.ts +15 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.js +4 -2
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts +0 -6
- package/lib/esm/appui-react/stagepanels/StagePanelDef.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.d.ts +1 -0
- package/lib/esm/appui-react/tools/CoreToolDefinitions.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js +25 -6
- package/lib/esm/appui-react/tools/CoreToolDefinitions.js.map +1 -1
- package/lib/esm/appui-react/tools/RestoreLayoutTool.d.ts +9 -0
- package/lib/esm/appui-react/tools/RestoreLayoutTool.d.ts.map +1 -1
- package/lib/esm/appui-react/tools/RestoreLayoutTool.js +15 -0
- package/lib/esm/appui-react/tools/RestoreLayoutTool.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsProvider.d.ts.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsProvider.js +2 -0
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsProvider.js.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.d.ts +1 -0
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js +2 -0
- package/lib/esm/appui-react/ui-items-provider/StandardNavigationToolsUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/FloatingWidget.d.ts +7 -0
- package/lib/esm/appui-react/widget-panels/FloatingWidget.d.ts.map +1 -0
- package/lib/esm/appui-react/widget-panels/FloatingWidget.js +15 -0
- package/lib/esm/appui-react/widget-panels/FloatingWidget.js.map +1 -0
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +20 -697
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +291 -265
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/useWidgetDirection.js +2 -2
- package/lib/esm/appui-react/widget-panels/useWidgetDirection.js.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts +16 -6
- package/lib/esm/appui-react/widgets/WidgetDef.d.ts.map +1 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js +13 -1
- package/lib/esm/appui-react/widgets/WidgetDef.js.map +1 -1
- package/lib/public/locales/en/UiFramework.json +10 -3
- package/package.json +37 -35
|
@@ -13,6 +13,7 @@ exports.FrontstageDef = void 0;
|
|
|
13
13
|
const React = require("react");
|
|
14
14
|
const core_frontend_1 = require("@itwin/core-frontend");
|
|
15
15
|
const appui_abstract_1 = require("@itwin/appui-abstract");
|
|
16
|
+
const core_react_1 = require("@itwin/core-react");
|
|
16
17
|
const appui_layout_react_1 = require("@itwin/appui-layout-react");
|
|
17
18
|
const ContentGroup_1 = require("../content/ContentGroup");
|
|
18
19
|
const ContentLayoutManager_1 = require("../content/ContentLayoutManager");
|
|
@@ -24,7 +25,6 @@ const Frontstage_1 = require("./Frontstage");
|
|
|
24
25
|
const FrontstageManager_1 = require("./FrontstageManager");
|
|
25
26
|
const TimeTracker_1 = require("../configurableui/TimeTracker");
|
|
26
27
|
const PopoutWidget_1 = require("../childwindow/PopoutWidget");
|
|
27
|
-
const Frontstage_2 = require("../widget-panels/Frontstage");
|
|
28
28
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
29
29
|
const ContentDialogManager_1 = require("../dialog/ContentDialogManager");
|
|
30
30
|
/** FrontstageDef class provides an API for a Frontstage.
|
|
@@ -186,6 +186,11 @@ class FrontstageDef {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
/** @internal */
|
|
189
|
+
get savedWidgetDefs() { return this._savedWidgetDefs; }
|
|
190
|
+
set savedWidgetDefs(widgets) {
|
|
191
|
+
this._savedWidgetDefs = widgets;
|
|
192
|
+
}
|
|
193
|
+
/** @internal */
|
|
189
194
|
get timeTracker() { return this._timeTracker; }
|
|
190
195
|
/** Created a [[FrontstageDef]] and initialize it */
|
|
191
196
|
static async create(provider) {
|
|
@@ -555,17 +560,12 @@ class FrontstageDef {
|
|
|
555
560
|
}
|
|
556
561
|
/** @beta */
|
|
557
562
|
restoreLayout() {
|
|
558
|
-
for (const zoneDef of this.zoneDefs) {
|
|
559
|
-
for (const widgetDef of zoneDef.widgetDefs) {
|
|
560
|
-
widgetDef.setWidgetState(widgetDef.defaultState);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
563
|
for (const panelDef of this.panelDefs) {
|
|
564
564
|
panelDef.size = panelDef.defaultSize;
|
|
565
565
|
panelDef.panelState = panelDef.defaultState;
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
566
|
+
}
|
|
567
|
+
for (const widgetDef of this.widgetDefs) {
|
|
568
|
+
widgetDef.setWidgetState(widgetDef.defaultState);
|
|
569
569
|
}
|
|
570
570
|
FrontstageManager_1.FrontstageManager.onFrontstageRestoreLayoutEvent.emit({ frontstageDef: this });
|
|
571
571
|
}
|
|
@@ -575,11 +575,11 @@ class FrontstageDef {
|
|
|
575
575
|
getWidgetCurrentState(widgetDef) {
|
|
576
576
|
// istanbul ignore else
|
|
577
577
|
if (this.nineZoneState) {
|
|
578
|
-
const location = (0, appui_layout_react_1.
|
|
578
|
+
const location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetDef.id);
|
|
579
579
|
// istanbul ignore next
|
|
580
580
|
if (!location)
|
|
581
581
|
return appui_abstract_1.WidgetState.Hidden;
|
|
582
|
-
if ((0, appui_layout_react_1.
|
|
582
|
+
if ((0, appui_layout_react_1.isFloatingTabLocation)(location)) {
|
|
583
583
|
const floatingWidget = this.nineZoneState.floatingWidgets.byId[location.floatingWidgetId];
|
|
584
584
|
if (floatingWidget && floatingWidget.hidden)
|
|
585
585
|
return appui_abstract_1.WidgetState.Hidden;
|
|
@@ -618,20 +618,20 @@ class FrontstageDef {
|
|
|
618
618
|
isPopoutWidget(widgetId) {
|
|
619
619
|
// istanbul ignore else
|
|
620
620
|
if (this.nineZoneState) {
|
|
621
|
-
const location = (0, appui_layout_react_1.
|
|
621
|
+
const location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
622
622
|
// istanbul ignore else
|
|
623
623
|
if (location)
|
|
624
|
-
return (0, appui_layout_react_1.
|
|
624
|
+
return (0, appui_layout_react_1.isPopoutTabLocation)(location);
|
|
625
625
|
}
|
|
626
626
|
return false;
|
|
627
627
|
}
|
|
628
628
|
isFloatingWidget(widgetId) {
|
|
629
629
|
// istanbul ignore else
|
|
630
630
|
if (this.nineZoneState) {
|
|
631
|
-
const location = (0, appui_layout_react_1.
|
|
631
|
+
const location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
632
632
|
// istanbul ignore else
|
|
633
633
|
if (location)
|
|
634
|
-
return (0, appui_layout_react_1.
|
|
634
|
+
return (0, appui_layout_react_1.isFloatingTabLocation)(location);
|
|
635
635
|
}
|
|
636
636
|
return false;
|
|
637
637
|
}
|
|
@@ -646,10 +646,10 @@ class FrontstageDef {
|
|
|
646
646
|
floatWidget(widgetId, point, size) {
|
|
647
647
|
// istanbul ignore else
|
|
648
648
|
if (this.nineZoneState) {
|
|
649
|
-
const location = (0, appui_layout_react_1.
|
|
649
|
+
const location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
650
650
|
if (location) {
|
|
651
651
|
let popoutWidgetContainerId;
|
|
652
|
-
if ((0, appui_layout_react_1.
|
|
652
|
+
if ((0, appui_layout_react_1.isPopoutTabLocation)(location)) {
|
|
653
653
|
popoutWidgetContainerId = location.popoutWidgetId;
|
|
654
654
|
}
|
|
655
655
|
const state = (0, appui_layout_react_1.floatWidget)(this.nineZoneState, widgetId, point, size);
|
|
@@ -671,21 +671,21 @@ class FrontstageDef {
|
|
|
671
671
|
let widgetIsVisible = false;
|
|
672
672
|
// istanbul ignore else
|
|
673
673
|
if (this.nineZoneState) {
|
|
674
|
-
const tabLocation = (0, appui_layout_react_1.
|
|
674
|
+
const tabLocation = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
675
675
|
// istanbul ignore else
|
|
676
676
|
if (tabLocation) {
|
|
677
|
-
if ((0, appui_layout_react_1.
|
|
677
|
+
if ((0, appui_layout_react_1.isFloatingTabLocation)(tabLocation)) {
|
|
678
678
|
const floatingWidget = this.nineZoneState.floatingWidgets.byId[tabLocation.floatingWidgetId];
|
|
679
679
|
// istanbul ignore else
|
|
680
680
|
if (!!!floatingWidget.hidden)
|
|
681
681
|
widgetIsVisible = true;
|
|
682
682
|
}
|
|
683
|
-
else if ((0, appui_layout_react_1.
|
|
683
|
+
else if ((0, appui_layout_react_1.isPopoutTabLocation)(tabLocation)) {
|
|
684
684
|
widgetIsVisible = true;
|
|
685
685
|
}
|
|
686
686
|
else {
|
|
687
687
|
// istanbul ignore else
|
|
688
|
-
if ((0, appui_layout_react_1.
|
|
688
|
+
if ((0, appui_layout_react_1.isPanelTabLocation)(tabLocation)) {
|
|
689
689
|
const panel = this.nineZoneState.panels[tabLocation.side];
|
|
690
690
|
const widgetDef = this.findWidgetDef(widgetId);
|
|
691
691
|
if (widgetDef && widgetDef.state === appui_abstract_1.WidgetState.Open && !panel.collapsed)
|
|
@@ -699,25 +699,33 @@ class FrontstageDef {
|
|
|
699
699
|
/** Opens window for specified PopoutWidget container. Used to reopen popout when running in Electron.
|
|
700
700
|
* @internal */
|
|
701
701
|
openPopoutWidgetContainer(state, widgetContainerId) {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}
|
|
702
|
+
const location = (0, appui_layout_react_1.getWidgetLocation)(state, widgetContainerId);
|
|
703
|
+
// istanbul ignore next
|
|
704
|
+
if (!location)
|
|
705
|
+
return;
|
|
706
|
+
// istanbul ignore next
|
|
707
|
+
if (!(0, appui_layout_react_1.isPopoutWidgetLocation)(location))
|
|
708
|
+
return;
|
|
709
|
+
const widget = state.widgets[widgetContainerId];
|
|
710
|
+
const popoutWidget = state.popoutWidgets.byId[location.popoutWidgetId];
|
|
711
|
+
// Popout widget should only contain a single tab.
|
|
712
|
+
// istanbul ignore next
|
|
713
|
+
if (widget.tabs.length !== 1)
|
|
714
|
+
return;
|
|
715
|
+
const tabId = widget.tabs[0];
|
|
716
|
+
const widgetDef = this.findWidgetDef(tabId);
|
|
717
|
+
// istanbul ignore next
|
|
718
|
+
if (!widgetDef)
|
|
719
|
+
return;
|
|
720
|
+
const popoutContent = (React.createElement(PopoutWidget_1.PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
|
|
721
|
+
const bounds = core_react_1.Rectangle.create(popoutWidget.bounds);
|
|
722
|
+
const position = {
|
|
723
|
+
width: bounds.getWidth(),
|
|
724
|
+
height: bounds.getHeight(),
|
|
725
|
+
left: bounds.left,
|
|
726
|
+
top: bounds.top,
|
|
727
|
+
};
|
|
728
|
+
UiFramework_1.UiFramework.childWindowManager.openChildWindow(widgetContainerId, widgetDef.label, popoutContent, position, UiFramework_1.UiFramework.useDefaultPopoutUrl);
|
|
721
729
|
}
|
|
722
730
|
/** Create a new popout/child window that contains the widget specified by its Id. Supported only when in
|
|
723
731
|
* UI 2.0 or higher.
|
|
@@ -728,42 +736,43 @@ class FrontstageDef {
|
|
|
728
736
|
* @beta
|
|
729
737
|
*/
|
|
730
738
|
popoutWidget(widgetId, point, size) {
|
|
731
|
-
// istanbul ignore
|
|
732
|
-
if (this.nineZoneState)
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
|
|
739
|
+
// istanbul ignore next
|
|
740
|
+
if (!this.nineZoneState)
|
|
741
|
+
return;
|
|
742
|
+
let location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
743
|
+
if (!location || (0, appui_layout_react_1.isPopoutTabLocation)(location))
|
|
744
|
+
return;
|
|
745
|
+
const widgetDef = this.findWidgetDef(widgetId);
|
|
746
|
+
// istanbul ignore next
|
|
747
|
+
if (!widgetDef)
|
|
748
|
+
return;
|
|
749
|
+
// get the state to apply that will pop-out the specified WidgetTab to child window.
|
|
750
|
+
let preferredBounds = core_react_1.Rectangle.createFromSize({ height: 800, width: 600 });
|
|
751
|
+
// istanbul ignore next
|
|
752
|
+
if (widgetDef.popoutBounds)
|
|
753
|
+
preferredBounds = widgetDef.popoutBounds;
|
|
754
|
+
if (size)
|
|
755
|
+
preferredBounds = preferredBounds.setSize(size);
|
|
756
|
+
if (point)
|
|
757
|
+
preferredBounds = preferredBounds.setPosition(point);
|
|
758
|
+
const state = (0, appui_layout_react_1.popoutWidgetToChildWindow)(this.nineZoneState, widgetId, preferredBounds);
|
|
759
|
+
this.nineZoneState = state;
|
|
760
|
+
// now that the state is updated get the id of the container that houses the widgetTab/widgetId
|
|
761
|
+
location = (0, appui_layout_react_1.getTabLocation)(state, widgetId);
|
|
762
|
+
(0, core_bentley_1.assert)(!!location && (0, appui_layout_react_1.isPopoutTabLocation)(location));
|
|
763
|
+
const widgetContainerId = location.widgetId;
|
|
764
|
+
const popoutWidget = state.popoutWidgets.byId[widgetContainerId];
|
|
765
|
+
const bounds = core_react_1.Rectangle.create(popoutWidget.bounds);
|
|
766
|
+
setTimeout(() => {
|
|
767
|
+
const popoutContent = (React.createElement(PopoutWidget_1.PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
|
|
768
|
+
const position = {
|
|
769
|
+
width: bounds.getWidth(),
|
|
770
|
+
height: bounds.getHeight(),
|
|
771
|
+
left: bounds.left,
|
|
772
|
+
top: bounds.top,
|
|
773
|
+
};
|
|
774
|
+
UiFramework_1.UiFramework.childWindowManager.openChildWindow(widgetContainerId, widgetDef.label, popoutContent, position, UiFramework_1.UiFramework.useDefaultPopoutUrl);
|
|
775
|
+
});
|
|
767
776
|
}
|
|
768
777
|
get isStageClosing() {
|
|
769
778
|
return this._isStageClosing;
|
|
@@ -775,12 +784,23 @@ class FrontstageDef {
|
|
|
775
784
|
return this._isReady;
|
|
776
785
|
}
|
|
777
786
|
/** @internal */
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
787
|
+
saveChildWindowSizeAndPosition(childWindowId, childWindow) {
|
|
788
|
+
if (!this.nineZoneState)
|
|
789
|
+
return;
|
|
790
|
+
const location = (0, appui_layout_react_1.getWidgetLocation)(this.nineZoneState, childWindowId);
|
|
791
|
+
if (!location || !(0, appui_layout_react_1.isPopoutWidgetLocation)(location))
|
|
792
|
+
return;
|
|
793
|
+
const widget = this.nineZoneState.widgets[location.popoutWidgetId];
|
|
794
|
+
const tabId = widget.tabs[0];
|
|
795
|
+
const widgetDef = this.findWidgetDef(tabId);
|
|
796
|
+
if (!widgetDef)
|
|
797
|
+
return;
|
|
798
|
+
const adjustmentWidth = core_bentley_1.ProcessDetector.isElectronAppFrontend ? 16 : 0;
|
|
799
|
+
const adjustmentHeight = core_bentley_1.ProcessDetector.isElectronAppFrontend ? 39 : 0;
|
|
800
|
+
const width = childWindow.innerWidth + adjustmentWidth;
|
|
801
|
+
const height = childWindow.innerHeight + adjustmentHeight;
|
|
802
|
+
const bounds = core_react_1.Rectangle.createFromSize({ width, height }).offset({ x: childWindow.screenX, y: childWindow.screenY });
|
|
803
|
+
widgetDef.popoutBounds = bounds;
|
|
784
804
|
}
|
|
785
805
|
/** @internal */
|
|
786
806
|
setFloatingWidgetBoundsInternal(floatingWidgetId, bounds, inhibitNineZoneStateChangedEvent = false) {
|
|
@@ -798,16 +818,16 @@ class FrontstageDef {
|
|
|
798
818
|
* @internal
|
|
799
819
|
*/
|
|
800
820
|
dockPopoutWidgetContainer(widgetContainerId) {
|
|
801
|
-
if (this.nineZoneState)
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
821
|
+
if (!this.nineZoneState)
|
|
822
|
+
return;
|
|
823
|
+
// Make sure the widgetContainerId is still in popout state. We don't want to set it to docked if the window is being closed because
|
|
824
|
+
// an API call has moved the widget from a popout state to a floating state.
|
|
825
|
+
// istanbul ignore else
|
|
826
|
+
const location = (0, appui_layout_react_1.getWidgetLocation)(this.nineZoneState, widgetContainerId);
|
|
827
|
+
if (!location || !(0, appui_layout_react_1.isPopoutWidgetLocation)(location))
|
|
828
|
+
return;
|
|
829
|
+
const state = (0, appui_layout_react_1.dockWidgetContainer)(this.nineZoneState, widgetContainerId, true);
|
|
830
|
+
this.nineZoneState = state;
|
|
811
831
|
}
|
|
812
832
|
/** Finds the container with the specified widget and re-docks all widgets
|
|
813
833
|
* back to the panel zone location that was used when the floating container
|
|
@@ -818,12 +838,12 @@ class FrontstageDef {
|
|
|
818
838
|
dockWidgetContainer(widgetId) {
|
|
819
839
|
// istanbul ignore else
|
|
820
840
|
if (this.nineZoneState) {
|
|
821
|
-
const location = (0, appui_layout_react_1.
|
|
841
|
+
const location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
822
842
|
if (location) {
|
|
823
843
|
const widgetContainerId = location.widgetId;
|
|
824
844
|
const state = (0, appui_layout_react_1.dockWidgetContainer)(this.nineZoneState, widgetContainerId, true);
|
|
825
845
|
state && (this.nineZoneState = state);
|
|
826
|
-
if ((0, appui_layout_react_1.
|
|
846
|
+
if ((0, appui_layout_react_1.isPopoutTabLocation)(location)) {
|
|
827
847
|
UiFramework_1.UiFramework.childWindowManager.closeChildWindow(location.widgetId, true);
|
|
828
848
|
}
|
|
829
849
|
}
|
|
@@ -843,9 +863,9 @@ class FrontstageDef {
|
|
|
843
863
|
getFloatingWidgetContainerIdByWidgetId(widgetId) {
|
|
844
864
|
if (!this.nineZoneState)
|
|
845
865
|
return undefined;
|
|
846
|
-
const location = (0, appui_layout_react_1.
|
|
866
|
+
const location = (0, appui_layout_react_1.getTabLocation)(this.nineZoneState, widgetId);
|
|
847
867
|
// istanbul ignore else
|
|
848
|
-
if (location && (0, appui_layout_react_1.
|
|
868
|
+
if (location && (0, appui_layout_react_1.isFloatingTabLocation)(location)) {
|
|
849
869
|
return location.floatingWidgetId;
|
|
850
870
|
}
|
|
851
871
|
// istanbul ignore next
|
|
@@ -866,6 +886,30 @@ class FrontstageDef {
|
|
|
866
886
|
}
|
|
867
887
|
return undefined;
|
|
868
888
|
}
|
|
889
|
+
*_widgetDefs() {
|
|
890
|
+
for (const zoneDef of this.zoneDefs) {
|
|
891
|
+
for (const widgetDef of zoneDef.widgetDefs) {
|
|
892
|
+
yield widgetDef;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
for (const panelDef of this.panelDefs) {
|
|
896
|
+
for (const widgetDef of panelDef.widgetDefs) {
|
|
897
|
+
yield widgetDef;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
return undefined;
|
|
901
|
+
}
|
|
902
|
+
/** Iterable of all widget definitions in a frontstage.
|
|
903
|
+
* @internal
|
|
904
|
+
*/
|
|
905
|
+
get widgetDefs() {
|
|
906
|
+
const defs = this._widgetDefs();
|
|
907
|
+
return {
|
|
908
|
+
[Symbol.iterator]() {
|
|
909
|
+
return defs;
|
|
910
|
+
},
|
|
911
|
+
};
|
|
912
|
+
}
|
|
869
913
|
}
|
|
870
914
|
exports.FrontstageDef = FrontstageDef;
|
|
871
915
|
//# sourceMappingURL=FrontstageDef.js.map
|