@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelessDialogManager.js","sourceRoot":"","sources":["../../../../src/appui-react/dialog/ModelessDialogManager.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,EAAe,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEjH,gCAAgC;AAEhC;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;CAAI;AAStE,+DAA+D;AAC/D,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAOhC,wCAAwC;IACjC,MAAM,KAAK,OAAO,KAAK,OAAO,qBAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAOnF,6CAA6C;IACtC,MAAM,CAAC,UAAU;QACtB,qBAAqB,CAAC,UAAU,GAAG,qBAAqB,CAAC,sBAAsB,EAAE,CAAC;IACpF,CAAC;IAEO,MAAM,CAAC,sBAAsB;QACnC,MAAM,QAAQ,GAAG,yBAAyB,CAAC;QAC3C,MAAM,KAAK,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAE/C,uBAAuB;QACvB,IAAI,CAAC,KAAK,CAAC,K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AAG,IAAI,KAAK,EAAU,CAAC;AAE/B,gCAAU,GAAG,cAAc,CAAC;AAmH7C;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK,CAAC,aAA0B;IAE1E,YAAY,KAAkB;QAC5B,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAEe,MAAM;QACpB,OAAO,CACL,oBAAC,kBAAkB,OAAK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,qBAAqB,CAAC,aAAa,GAAI,CAC3F,CAAC;IACJ,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 Dialog\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { CommonProps, getCssVariableAsNumber } from \"@itwin/core-react\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { DialogChangedEvent, DialogManagerBase, DialogRendererBase } from \"./DialogManagerBase\";\r\nimport { IModelApp, NotifyMessageDetails, OutputMessagePriority, OutputMessageType } from \"@itwin/core-frontend\";\r\n\r\n// cSpell:ignore ZINDEX modeless\r\n\r\n/** Modeless Dialog Changed Event class.\r\n * @public\r\n */\r\nexport class ModelessDialogChangedEvent extends DialogChangedEvent { }\r\n\r\n/** @internal */\r\ninterface ModelessDialogInfo {\r\n reactNode: React.ReactNode;\r\n zIndex: number;\r\n parentDocument: Document;\r\n}\r\n\r\n/** Used if the 'dialog' z-index CSS variable cannot be read */\r\nconst ZINDEX_DEFAULT = 12000;\r\n\r\n/** Modeless Dialog Manager class displays and manages multiple modeless dialogs\r\n * @public\r\n */\r\nexport class ModelessDialogManager {\r\n /** Modeless Dialog Changed Event */\r\n public static readonly onModelessDialogChangedEvent = new ModelessDialogChangedEvent();\r\n\r\n /** @internal */\r\n public static readonly dialogManager: DialogManagerBase = new DialogManagerBase(ModelessDialogManager.onModelessDialogChangedEvent);\r\n\r\n /** Get the array of modeless dialogs */\r\n public static get dialogs() { return ModelessDialogManager.dialogManager.dialogs; }\r\n\r\n private static _dialogMap = new Map<string, ModelessDialogInfo>();\r\n private static _idArray = new Array<string>();\r\n\r\n private static _topZIndex = ZINDEX_DEFAULT;\r\n\r\n /** Initialize the modeless dialog manager */\r\n public static initialize(): void {\r\n ModelessDialogManager._topZIndex = ModelessDialogManager.getDialogZIndexDefault();\r\n }\r\n\r\n private static getDialogZIndexDefault(): number {\r\n const variable = \"--uicore-z-index-dialog\";\r\n const value = getCssVariableAsNumber(variable);\r\n\r\n // istanbul ignore next\r\n if (!isNaN(value))\r\n return value;\r\n\r\n Logger.logError(UiFramework.loggerCategory(this), `'${variable}' CSS variable not found`);\r\n return ZINDEX_DEFAULT;\r\n }\r\n\r\n /** Open a modeless dialog\r\n * @param dialog The Dialog to open\r\n * @param id The id of the Dialog to open\r\n */\r\n public static openDialog(dialog: React.ReactNode, id: string, parentDocument = document): void {\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n if (dialogInfo) {\r\n const message = `Dialog with id of '${id}' already opened`;\r\n Logger.logInfo(UiFramework.loggerCategory(this), `openDialog: ${message}`);\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, message, undefined, OutputMessageType.Toast));\r\n return;\r\n }\r\n ModelessDialogManager._dialogMap.set(id, { reactNode: dialog, zIndex: ++ModelessDialogManager._topZIndex, parentDocument });\r\n ModelessDialogManager._idArray.push(id);\r\n ModelessDialogManager.dialogManager.openDialog(dialog, id, parentDocument);\r\n }\r\n\r\n /** Close a modeless dialog\r\n * @param id The id of the Dialog to close.\r\n */\r\n public static closeDialog(id: string): void {\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n if (dialogInfo) {\r\n ModelessDialogManager.dialogManager.removeDialog(dialogInfo.reactNode);\r\n ModelessDialogManager._dialogMap.delete(id);\r\n const index = ModelessDialogManager._idArray.indexOf(id);\r\n // istanbul ignore else\r\n if (index >= 0)\r\n ModelessDialogManager._idArray.splice(index, 1);\r\n\r\n if (ModelessDialogManager.activeDialog === undefined)\r\n ModelessDialogManager._topZIndex = ModelessDialogManager.getDialogZIndexDefault();\r\n\r\n this.update();\r\n } else {\r\n Logger.logError(UiFramework.loggerCategory(this), `closeDialog: Could not find dialog with id of '${id}'`);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static closeAll(): void {\r\n ModelessDialogManager.dialogManager.closeAll();\r\n }\r\n\r\n /** Update the dialogs */\r\n public static update(): void {\r\n ModelessDialogManager.dialogManager.update();\r\n }\r\n\r\n /** Get the active modeless dialog */\r\n public static get activeDialog(): React.ReactNode | undefined {\r\n if (ModelessDialogManager._idArray.length > 0) {\r\n const id = ModelessDialogManager._idArray[ModelessDialogManager._idArray.length - 1];\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n // istanbul ignore else\r\n if (dialogInfo)\r\n return dialogInfo.reactNode;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Get the count of modeless dialogs */\r\n public static get dialogCount(): number {\r\n return ModelessDialogManager.dialogManager.dialogCount;\r\n }\r\n\r\n /** Handle a pointer down event on a modeless dialog */\r\n public static handlePointerDownEvent(_event: React.PointerEvent, id: string, updateFunc: () => void): void {\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n if (dialogInfo && dialogInfo.reactNode !== ModelessDialogManager.activeDialog) {\r\n dialogInfo.zIndex = ++ModelessDialogManager._topZIndex;\r\n\r\n ModelessDialogManager._idArray.splice(ModelessDialogManager._idArray.indexOf(id), 1);\r\n ModelessDialogManager._idArray.push(id);\r\n\r\n updateFunc();\r\n this.update();\r\n }\r\n }\r\n\r\n /** Get the z-index for a modeless dialog */\r\n public static getDialogZIndex(id: string): number {\r\n let zIndex = ModelessDialogManager.getDialogZIndexDefault();\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n // istanbul ignore else\r\n if (dialogInfo)\r\n zIndex = dialogInfo.zIndex;\r\n return zIndex;\r\n }\r\n\r\n public static getDialogInfo(id: string): ModelessDialogInfo | undefined {\r\n return ModelessDialogManager._dialogMap.get(id);\r\n }\r\n}\r\n\r\n/** ModelessDialogRenderer React component renders modeless dialogs.\r\n * @public\r\n */\r\nexport class ModelessDialogRenderer extends React.PureComponent<CommonProps> {\r\n\r\n constructor(props: CommonProps) {\r\n super(props);\r\n }\r\n\r\n public override render(): React.ReactNode {\r\n return (\r\n <DialogRendererBase {...this.props} dialogManager={ModelessDialogManager.dialogManager} />\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ModelessDialogManager.js","sourceRoot":"","sources":["../../../../src/appui-react/dialog/ModelessDialogManager.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;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEjH,gCAAgC;AAEhC;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;CAAI;AAStE;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAOhC,wCAAwC;IACjC,MAAM,KAAK,OAAO,KAAK,OAAO,qBAAqB,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAKnF,6CAA6C;IACtC,MAAM,CAAC,UAAU;QACtB,iBAAiB,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,MAAuB,EAAE,EAAU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,OAAK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,qBAAqB,CAAC,aAAa,GAAI,CAC3F,CAAC;IACJ,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 Dialog\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { CommonProps } from \"@itwin/core-react\";\r\nimport { UiFramework } from \"../UiFramework\";\r\nimport { DialogChangedEvent, DialogManagerBase, DialogRendererBase } from \"./DialogManagerBase\";\r\nimport { IModelApp, NotifyMessageDetails, OutputMessagePriority, OutputMessageType } from \"@itwin/core-frontend\";\r\n\r\n// cSpell:ignore ZINDEX modeless\r\n\r\n/** Modeless Dialog Changed Event class.\r\n * @public\r\n */\r\nexport class ModelessDialogChangedEvent extends DialogChangedEvent { }\r\n\r\n/** @internal */\r\ninterface ModelessDialogInfo {\r\n reactNode: React.ReactNode;\r\n zIndex: number;\r\n parentDocument: Document;\r\n}\r\n\r\n/** Modeless Dialog Manager class displays and manages multiple modeless dialogs\r\n * @public\r\n */\r\nexport class ModelessDialogManager {\r\n /** Modeless Dialog Changed Event */\r\n public static readonly onModelessDialogChangedEvent = new ModelessDialogChangedEvent();\r\n\r\n /** @internal */\r\n public static readonly dialogManager: DialogManagerBase = new DialogManagerBase(ModelessDialogManager.onModelessDialogChangedEvent);\r\n\r\n /** Get the array of modeless dialogs */\r\n public static get dialogs() { return ModelessDialogManager.dialogManager.dialogs; }\r\n\r\n private static _dialogMap = new Map<string, ModelessDialogInfo>();\r\n private static _idArray = new Array<string>();\r\n\r\n /** Initialize the modeless dialog manager */\r\n public static initialize(): void {\r\n DialogManagerBase.initialize();\r\n }\r\n\r\n /** Open a modeless dialog\r\n * @param dialog The Dialog to open\r\n * @param id The id of the Dialog to open\r\n */\r\n public static openDialog(dialog: React.ReactNode, id: string, parentDocument = document): void {\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n if (dialogInfo) {\r\n const message = `Dialog with id of '${id}' already opened`;\r\n Logger.logInfo(UiFramework.loggerCategory(this), `openDialog: ${message}`);\r\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, message, undefined, OutputMessageType.Toast));\r\n return;\r\n }\r\n ModelessDialogManager._dialogMap.set(id, { reactNode: dialog, zIndex: DialogManagerBase.topZIndex, parentDocument });\r\n ModelessDialogManager._idArray.push(id);\r\n ModelessDialogManager.dialogManager.openDialog(dialog, id, parentDocument);\r\n }\r\n\r\n /** Close a modeless dialog\r\n * @param id The id of the Dialog to close.\r\n */\r\n public static closeDialog(id: string): void {\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n if (dialogInfo) {\r\n ModelessDialogManager.dialogManager.removeDialog(dialogInfo.reactNode);\r\n ModelessDialogManager._dialogMap.delete(id);\r\n const index = ModelessDialogManager._idArray.indexOf(id);\r\n // istanbul ignore else\r\n if (index >= 0)\r\n ModelessDialogManager._idArray.splice(index, 1);\r\n\r\n if (ModelessDialogManager.activeDialog === undefined)\r\n DialogManagerBase.topZIndex = DialogManagerBase.getDialogZIndexDefault();\r\n\r\n this.update();\r\n } else {\r\n Logger.logError(UiFramework.loggerCategory(this), `closeDialog: Could not find dialog with id of '${id}'`);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static closeAll(): void {\r\n ModelessDialogManager.dialogManager.closeAll();\r\n }\r\n\r\n /** Update the dialogs */\r\n public static update(): void {\r\n ModelessDialogManager.dialogManager.update();\r\n }\r\n\r\n /** Get the active modeless dialog */\r\n public static get activeDialog(): React.ReactNode | undefined {\r\n if (ModelessDialogManager._idArray.length > 0) {\r\n const id = ModelessDialogManager._idArray[ModelessDialogManager._idArray.length - 1];\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n // istanbul ignore else\r\n if (dialogInfo)\r\n return dialogInfo.reactNode;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Get the count of modeless dialogs */\r\n public static get dialogCount(): number {\r\n return ModelessDialogManager.dialogManager.dialogCount;\r\n }\r\n\r\n /** Handle a pointer down event on a modeless dialog */\r\n public static handlePointerDownEvent(_event: React.PointerEvent, id: string, updateFunc: () => void): void {\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n if (dialogInfo && dialogInfo.reactNode !== ModelessDialogManager.activeDialog) {\r\n DialogManagerBase.topZIndex += 1;\r\n dialogInfo.zIndex = DialogManagerBase.topZIndex;\r\n\r\n ModelessDialogManager._idArray.splice(ModelessDialogManager._idArray.indexOf(id), 1);\r\n ModelessDialogManager._idArray.push(id);\r\n\r\n updateFunc();\r\n this.update();\r\n }\r\n }\r\n\r\n /** Get the z-index for a modeless dialog */\r\n public static getDialogZIndex(id: string): number {\r\n let zIndex = DialogManagerBase.getDialogZIndexDefault();\r\n const dialogInfo = ModelessDialogManager._dialogMap.get(id);\r\n // istanbul ignore else\r\n if (dialogInfo)\r\n zIndex = dialogInfo.zIndex;\r\n return zIndex;\r\n }\r\n\r\n public static getDialogInfo(id: string): ModelessDialogInfo | undefined {\r\n return ModelessDialogManager._dialogMap.get(id);\r\n }\r\n}\r\n\r\n/** ModelessDialogRenderer React component renders modeless dialogs.\r\n * @public\r\n */\r\nexport class ModelessDialogRenderer extends React.PureComponent<CommonProps> {\r\n\r\n constructor(props: CommonProps) {\r\n super(props);\r\n }\r\n\r\n public override render(): React.ReactNode {\r\n return (\r\n <DialogRendererBase {...this.props} dialogManager={ModelessDialogManager.dialogManager} />\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardMessageBox.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/dialog/StandardMessageBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"StandardMessageBox.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/dialog/StandardMessageBox.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,WAAW,EAAc,MAAM,mBAAmB,CAAC;AAI5D;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,gDAAgD;IAChD,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,cAAc,EAAE,cAAc,CAAC;IAC/B,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CAC9C;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK,CAAC,aAAa,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAE3G,gBAAgB;IAChB,SAAyB,KAAK,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;gBAEtD,KAAK,EAAE,uBAAuB;IAO1B,MAAM,IAAI,GAAG,CAAC,OAAO;IA4DrC,OAAO,CAAC,aAAa,CAMnB;IAEF,OAAO,CAAC,aAAa,CAMnB;IAEF,OAAO,CAAC,YAAY,CAOlB;CACH"}
|
|
@@ -10,6 +10,7 @@ import { MessageBoxIconType, MessageBoxType, MessageBoxValue } from "@itwin/core
|
|
|
10
10
|
import { DialogButtonType, MessageSeverity } from "@itwin/appui-abstract";
|
|
11
11
|
import { MessageBox } from "@itwin/core-react";
|
|
12
12
|
import { ModalDialogManager } from "./ModalDialogManager";
|
|
13
|
+
import { DialogManagerBase } from "./DialogManagerBase";
|
|
13
14
|
/** StandardMessageBox React component displays a standard icon, message text and a standard button set in the lower right.
|
|
14
15
|
* @public
|
|
15
16
|
*/
|
|
@@ -83,7 +84,7 @@ export class StandardMessageBox extends React.PureComponent {
|
|
|
83
84
|
severity = MessageSeverity.Success;
|
|
84
85
|
break;
|
|
85
86
|
}
|
|
86
|
-
return (React.createElement(MessageBox, { className: this.props.className, style: this.props.style, opened: this.state.opened, title: this.props.title, severity: severity, buttonCluster: buttonCluster, onClose: this._handleCancel, onEscape: this._handleCancel }, this.props.children));
|
|
87
|
+
return (React.createElement(MessageBox, { className: this.props.className, style: { zIndex: DialogManagerBase.topZIndex, ...this.props.style }, opened: this.state.opened, title: this.props.title, severity: severity, buttonCluster: buttonCluster, onClose: this._handleCancel, onEscape: this._handleCancel }, this.props.children));
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
//# sourceMappingURL=StandardMessageBox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardMessageBox.js","sourceRoot":"","sources":["../../../../src/appui-react/dialog/StandardMessageBox.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAAmB,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"StandardMessageBox.js","sourceRoot":"","sources":["../../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IAAI,CAAC,KAAK,CAAC,SAAS,EAC/B,KAAK,EAAE,EAAE,MAAM,EAAE,iBAAiB,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EACnE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,IAAI,CAAC,aAAa,EAC3B,QAAQ,EAAE,IAAI,CAAC,aAAa,IAE3B,IAAI,CAAC,KAAK,CAAC,QAAQ,CACT,CACd,CAAC;IACJ,CAAC;CA0BF","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 Dialog\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { MessageBoxIconType, MessageBoxType, MessageBoxValue } from \"@itwin/core-frontend\";\r\nimport { DialogButtonDef, DialogButtonType, MessageSeverity } from \"@itwin/appui-abstract\";\r\nimport { CommonProps, MessageBox } from \"@itwin/core-react\";\r\nimport { ModalDialogManager } from \"./ModalDialogManager\";\r\nimport { DialogManagerBase } from \"./DialogManagerBase\";\r\n\r\n/** Properties for [[StandardMessageBox]] React component\r\n * @public\r\n */\r\nexport interface StandardMessageBoxProps extends CommonProps {\r\n /** Indicates whether the message box is open */\r\n opened: boolean;\r\n /** The standard icon to display in the message box */\r\n iconType: MessageBoxIconType;\r\n /** Title to display in the message box */\r\n title: string;\r\n /** Controls the button set displayed */\r\n messageBoxType: MessageBoxType;\r\n /** Callback function for processing the message box result */\r\n onResult?: (result: MessageBoxValue) => void;\r\n}\r\n\r\n/** State for [[StandardMessageBox]] React component\r\n * @internal\r\n */\r\ninterface StandardMessageBoxState {\r\n opened: boolean;\r\n}\r\n\r\n/** StandardMessageBox React component displays a standard icon, message text and a standard button set in the lower right.\r\n * @public\r\n */\r\nexport class StandardMessageBox extends React.PureComponent<StandardMessageBoxProps, StandardMessageBoxState> {\r\n\r\n /** @internal */\r\n public override readonly state: Readonly<StandardMessageBoxState>;\r\n\r\n constructor(props: StandardMessageBoxProps) {\r\n super(props);\r\n this.state = {\r\n opened: this.props.opened,\r\n };\r\n }\r\n\r\n public override render(): JSX.Element {\r\n const buttonCluster: DialogButtonDef[] = new Array<DialogButtonDef>();\r\n\r\n switch (this.props.messageBoxType) {\r\n case MessageBoxType.Ok:\r\n case MessageBoxType.LargeOk:\r\n buttonCluster.push({ type: DialogButtonType.OK, onClick: () => { this._handleButton(MessageBoxValue.Ok); } });\r\n break;\r\n case MessageBoxType.OkCancel:\r\n case MessageBoxType.MediumAlert:\r\n buttonCluster.push({ type: DialogButtonType.OK, onClick: () => { this._handleButton(MessageBoxValue.Ok); } });\r\n buttonCluster.push({ type: DialogButtonType.Cancel, onClick: () => { this._handleButton(MessageBoxValue.Cancel); } });\r\n break;\r\n case MessageBoxType.YesNo:\r\n case MessageBoxType.YesNoCancel:\r\n buttonCluster.push({ type: DialogButtonType.Yes, onClick: () => { this._handleButton(MessageBoxValue.Yes); } });\r\n buttonCluster.push({ type: DialogButtonType.No, onClick: () => { this._handleButton(MessageBoxValue.No); } });\r\n if (MessageBoxType.YesNoCancel === this.props.messageBoxType)\r\n buttonCluster.push({ type: DialogButtonType.Cancel, onClick: () => { this._handleButton(MessageBoxValue.Cancel); } });\r\n break;\r\n }\r\n\r\n let severity = MessageSeverity.None;\r\n switch (this.props.iconType) {\r\n case MessageBoxIconType.NoSymbol:\r\n severity = MessageSeverity.None;\r\n break;\r\n case MessageBoxIconType.Information:\r\n severity = MessageSeverity.Information;\r\n break;\r\n case MessageBoxIconType.Question:\r\n severity = MessageSeverity.Question;\r\n break;\r\n case MessageBoxIconType.Warning:\r\n severity = MessageSeverity.Warning;\r\n break;\r\n case MessageBoxIconType.Critical:\r\n severity = MessageSeverity.Error;\r\n break;\r\n case MessageBoxIconType.Success:\r\n severity = MessageSeverity.Success;\r\n break;\r\n }\r\n\r\n return (\r\n <MessageBox\r\n className={this.props.className}\r\n style={{ zIndex: DialogManagerBase.topZIndex, ...this.props.style }}\r\n opened={this.state.opened}\r\n title={this.props.title}\r\n severity={severity}\r\n buttonCluster={buttonCluster}\r\n onClose={this._handleCancel}\r\n onEscape={this._handleCancel}\r\n >\r\n {this.props.children}\r\n </MessageBox>\r\n );\r\n }\r\n\r\n private _handleButton = (buttonType: MessageBoxValue) => {\r\n this._closeDialog(() => {\r\n // istanbul ignore else\r\n if (this.props.onResult)\r\n this.props.onResult(buttonType);\r\n });\r\n };\r\n\r\n private _handleCancel = () => {\r\n this._closeDialog(() => {\r\n // istanbul ignore else\r\n if (this.props.onResult)\r\n this.props.onResult(MessageBoxValue.Cancel);\r\n });\r\n };\r\n\r\n private _closeDialog = (followUp: () => void) => {\r\n this.setState((_prevState) => ({\r\n opened: false,\r\n }), () => {\r\n ModalDialogManager.closeDialog();\r\n followUp();\r\n });\r\n };\r\n}\r\n"]}
|
|
@@ -15,6 +15,7 @@ import { ZoneDef } from "../zones/ZoneDef";
|
|
|
15
15
|
import { FrontstageProps } from "./Frontstage";
|
|
16
16
|
import { FrontstageProvider } from "./FrontstageProvider";
|
|
17
17
|
import { TimeTracker } from "../configurableui/TimeTracker";
|
|
18
|
+
import { SavedWidgets } from "../widget-panels/Frontstage";
|
|
18
19
|
/** @internal */
|
|
19
20
|
export interface FrontstageEventArgs {
|
|
20
21
|
frontstageDef: FrontstageDef;
|
|
@@ -60,6 +61,7 @@ export declare class FrontstageDef {
|
|
|
60
61
|
private _nineZoneState?;
|
|
61
62
|
private _contentGroupProvider?;
|
|
62
63
|
private _floatingContentControls?;
|
|
64
|
+
private _savedWidgetDefs?;
|
|
63
65
|
get id(): string;
|
|
64
66
|
get defaultTool(): ToolItemDef | undefined;
|
|
65
67
|
get defaultContentId(): string;
|
|
@@ -104,6 +106,9 @@ export declare class FrontstageDef {
|
|
|
104
106
|
get nineZoneState(): NineZoneState | undefined;
|
|
105
107
|
set nineZoneState(state: NineZoneState | undefined);
|
|
106
108
|
/** @internal */
|
|
109
|
+
get savedWidgetDefs(): SavedWidgets | undefined;
|
|
110
|
+
set savedWidgetDefs(widgets: SavedWidgets | undefined);
|
|
111
|
+
/** @internal */
|
|
107
112
|
get timeTracker(): TimeTracker;
|
|
108
113
|
/** Created a [[FrontstageDef]] and initialize it */
|
|
109
114
|
static create(provider: FrontstageProvider): Promise<FrontstageDef>;
|
|
@@ -201,7 +206,7 @@ export declare class FrontstageDef {
|
|
|
201
206
|
get isApplicationClosing(): boolean;
|
|
202
207
|
get isReady(): boolean;
|
|
203
208
|
/** @internal */
|
|
204
|
-
saveChildWindowSizeAndPosition(childWindowId: string, childWindow: Window):
|
|
209
|
+
saveChildWindowSizeAndPosition(childWindowId: string, childWindow: Window): void;
|
|
205
210
|
/** @internal */
|
|
206
211
|
setFloatingWidgetBoundsInternal(floatingWidgetId: string, bounds: RectangleProps, inhibitNineZoneStateChangedEvent?: boolean): void;
|
|
207
212
|
/** Method used to possibly change a Popout Widget back to a docked widget if the user was the one closing the popout's child
|
|
@@ -220,5 +225,12 @@ export declare class FrontstageDef {
|
|
|
220
225
|
getFloatingWidgetContainerIds(): string[];
|
|
221
226
|
getFloatingWidgetContainerIdByWidgetId(widgetId: string): string | undefined;
|
|
222
227
|
getFloatingWidgetContainerBounds(floatingWidgetId: string | undefined): RectangleProps | undefined;
|
|
228
|
+
private _widgetDefs;
|
|
229
|
+
/** Iterable of all widget definitions in a frontstage.
|
|
230
|
+
* @internal
|
|
231
|
+
*/
|
|
232
|
+
get widgetDefs(): {
|
|
233
|
+
[Symbol.iterator](): Iterator<WidgetDef, any, undefined>;
|
|
234
|
+
};
|
|
223
235
|
}
|
|
224
236
|
//# sourceMappingURL=FrontstageDef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontstageDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/frontstage/FrontstageDef.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAKH,OAAO,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAuB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,
|
|
1
|
+
{"version":3,"file":"FrontstageDef.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/frontstage/FrontstageDef.tsx"],"names":[],"mappings":"AAKA;;GAEG;AAKH,OAAO,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAuB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzG,OAAO,EAAa,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAGL,oBAAoB,EAAE,aAAa,EACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAG3F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAI3D,gBAAgB;AAChB,MA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IAYxC;;;;;;;OAOG;IACI,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS;IAoBzE;;;OAGG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM;IA4BzC;mBACe;IACR,yBAAyB,CAAC,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM;IAmChF;;;;;;;OAOG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,EAAE,SAAS;IA+C1E,IAAW,cAAc,YAExB;IAED,IAAW,oBAAoB,YAE9B;IAED,IAAW,OAAO,YAEjB;IAED,gBAAgB;IACT,8BAA8B,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAuBhF,gBAAgB;IACT,+BAA+B,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,gCAAgC,UAAQ;IAWjI;;;OAGG;IACI,yBAAyB,CAAC,iBAAiB,EAAE,MAAM;IAe1D;;;;;OAKG;IACI,mBAAmB,CAAC,QAAQ,EAAE,MAAM;IAepC,gCAAgC,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc;IAQjF,6BAA6B,IAAI,MAAM,EAAE;IAOzC,sCAAsC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAa5E,gCAAgC,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS;IAiB5E,OAAO,CAAE,WAAW;IAepB;;OAEG;IACH,IAAW,UAAU;;MAOpB;CACF"}
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { IModelApp } from "@itwin/core-frontend";
|
|
12
12
|
import { StagePanelLocation, StageUsage, UiError, WidgetState } from "@itwin/appui-abstract";
|
|
13
|
-
import {
|
|
13
|
+
import { Rectangle } from "@itwin/core-react";
|
|
14
|
+
import { dockWidgetContainer, floatWidget, getTabLocation, getWidgetLocation, isFloatingTabLocation, isPanelTabLocation, isPopoutTabLocation, isPopoutWidgetLocation, panelSides, popoutWidgetToChildWindow, setFloatingWidgetContainerBounds, } from "@itwin/appui-layout-react";
|
|
14
15
|
import { ContentGroupProvider } from "../content/ContentGroup";
|
|
15
16
|
import { ContentLayoutManager } from "../content/ContentLayoutManager";
|
|
16
17
|
import { ContentViewManager } from "../content/ContentViewManager";
|
|
@@ -21,8 +22,7 @@ import { Frontstage } from "./Frontstage";
|
|
|
21
22
|
import { FrontstageManager } from "./FrontstageManager";
|
|
22
23
|
import { TimeTracker } from "../configurableui/TimeTracker";
|
|
23
24
|
import { PopoutWidget } from "../childwindow/PopoutWidget";
|
|
24
|
-
import {
|
|
25
|
-
import { BentleyStatus } from "@itwin/core-bentley";
|
|
25
|
+
import { assert, BentleyStatus, ProcessDetector } from "@itwin/core-bentley";
|
|
26
26
|
import { ContentDialogManager } from "../dialog/ContentDialogManager";
|
|
27
27
|
/** FrontstageDef class provides an API for a Frontstage.
|
|
28
28
|
* @public
|
|
@@ -183,6 +183,11 @@ export class FrontstageDef {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
/** @internal */
|
|
186
|
+
get savedWidgetDefs() { return this._savedWidgetDefs; }
|
|
187
|
+
set savedWidgetDefs(widgets) {
|
|
188
|
+
this._savedWidgetDefs = widgets;
|
|
189
|
+
}
|
|
190
|
+
/** @internal */
|
|
186
191
|
get timeTracker() { return this._timeTracker; }
|
|
187
192
|
/** Created a [[FrontstageDef]] and initialize it */
|
|
188
193
|
static async create(provider) {
|
|
@@ -552,17 +557,12 @@ export class FrontstageDef {
|
|
|
552
557
|
}
|
|
553
558
|
/** @beta */
|
|
554
559
|
restoreLayout() {
|
|
555
|
-
for (const zoneDef of this.zoneDefs) {
|
|
556
|
-
for (const widgetDef of zoneDef.widgetDefs) {
|
|
557
|
-
widgetDef.setWidgetState(widgetDef.defaultState);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
560
|
for (const panelDef of this.panelDefs) {
|
|
561
561
|
panelDef.size = panelDef.defaultSize;
|
|
562
562
|
panelDef.panelState = panelDef.defaultState;
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
563
|
+
}
|
|
564
|
+
for (const widgetDef of this.widgetDefs) {
|
|
565
|
+
widgetDef.setWidgetState(widgetDef.defaultState);
|
|
566
566
|
}
|
|
567
567
|
FrontstageManager.onFrontstageRestoreLayoutEvent.emit({ frontstageDef: this });
|
|
568
568
|
}
|
|
@@ -572,11 +572,11 @@ export class FrontstageDef {
|
|
|
572
572
|
getWidgetCurrentState(widgetDef) {
|
|
573
573
|
// istanbul ignore else
|
|
574
574
|
if (this.nineZoneState) {
|
|
575
|
-
const location =
|
|
575
|
+
const location = getTabLocation(this.nineZoneState, widgetDef.id);
|
|
576
576
|
// istanbul ignore next
|
|
577
577
|
if (!location)
|
|
578
578
|
return WidgetState.Hidden;
|
|
579
|
-
if (
|
|
579
|
+
if (isFloatingTabLocation(location)) {
|
|
580
580
|
const floatingWidget = this.nineZoneState.floatingWidgets.byId[location.floatingWidgetId];
|
|
581
581
|
if (floatingWidget && floatingWidget.hidden)
|
|
582
582
|
return WidgetState.Hidden;
|
|
@@ -615,20 +615,20 @@ export class FrontstageDef {
|
|
|
615
615
|
isPopoutWidget(widgetId) {
|
|
616
616
|
// istanbul ignore else
|
|
617
617
|
if (this.nineZoneState) {
|
|
618
|
-
const location =
|
|
618
|
+
const location = getTabLocation(this.nineZoneState, widgetId);
|
|
619
619
|
// istanbul ignore else
|
|
620
620
|
if (location)
|
|
621
|
-
return
|
|
621
|
+
return isPopoutTabLocation(location);
|
|
622
622
|
}
|
|
623
623
|
return false;
|
|
624
624
|
}
|
|
625
625
|
isFloatingWidget(widgetId) {
|
|
626
626
|
// istanbul ignore else
|
|
627
627
|
if (this.nineZoneState) {
|
|
628
|
-
const location =
|
|
628
|
+
const location = getTabLocation(this.nineZoneState, widgetId);
|
|
629
629
|
// istanbul ignore else
|
|
630
630
|
if (location)
|
|
631
|
-
return
|
|
631
|
+
return isFloatingTabLocation(location);
|
|
632
632
|
}
|
|
633
633
|
return false;
|
|
634
634
|
}
|
|
@@ -643,10 +643,10 @@ export class FrontstageDef {
|
|
|
643
643
|
floatWidget(widgetId, point, size) {
|
|
644
644
|
// istanbul ignore else
|
|
645
645
|
if (this.nineZoneState) {
|
|
646
|
-
const location =
|
|
646
|
+
const location = getTabLocation(this.nineZoneState, widgetId);
|
|
647
647
|
if (location) {
|
|
648
648
|
let popoutWidgetContainerId;
|
|
649
|
-
if (
|
|
649
|
+
if (isPopoutTabLocation(location)) {
|
|
650
650
|
popoutWidgetContainerId = location.popoutWidgetId;
|
|
651
651
|
}
|
|
652
652
|
const state = floatWidget(this.nineZoneState, widgetId, point, size);
|
|
@@ -668,21 +668,21 @@ export class FrontstageDef {
|
|
|
668
668
|
let widgetIsVisible = false;
|
|
669
669
|
// istanbul ignore else
|
|
670
670
|
if (this.nineZoneState) {
|
|
671
|
-
const tabLocation =
|
|
671
|
+
const tabLocation = getTabLocation(this.nineZoneState, widgetId);
|
|
672
672
|
// istanbul ignore else
|
|
673
673
|
if (tabLocation) {
|
|
674
|
-
if (
|
|
674
|
+
if (isFloatingTabLocation(tabLocation)) {
|
|
675
675
|
const floatingWidget = this.nineZoneState.floatingWidgets.byId[tabLocation.floatingWidgetId];
|
|
676
676
|
// istanbul ignore else
|
|
677
677
|
if (!!!floatingWidget.hidden)
|
|
678
678
|
widgetIsVisible = true;
|
|
679
679
|
}
|
|
680
|
-
else if (
|
|
680
|
+
else if (isPopoutTabLocation(tabLocation)) {
|
|
681
681
|
widgetIsVisible = true;
|
|
682
682
|
}
|
|
683
683
|
else {
|
|
684
684
|
// istanbul ignore else
|
|
685
|
-
if (
|
|
685
|
+
if (isPanelTabLocation(tabLocation)) {
|
|
686
686
|
const panel = this.nineZoneState.panels[tabLocation.side];
|
|
687
687
|
const widgetDef = this.findWidgetDef(widgetId);
|
|
688
688
|
if (widgetDef && widgetDef.state === WidgetState.Open && !panel.collapsed)
|
|
@@ -696,25 +696,33 @@ export class FrontstageDef {
|
|
|
696
696
|
/** Opens window for specified PopoutWidget container. Used to reopen popout when running in Electron.
|
|
697
697
|
* @internal */
|
|
698
698
|
openPopoutWidgetContainer(state, widgetContainerId) {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
699
|
+
const location = getWidgetLocation(state, widgetContainerId);
|
|
700
|
+
// istanbul ignore next
|
|
701
|
+
if (!location)
|
|
702
|
+
return;
|
|
703
|
+
// istanbul ignore next
|
|
704
|
+
if (!isPopoutWidgetLocation(location))
|
|
705
|
+
return;
|
|
706
|
+
const widget = state.widgets[widgetContainerId];
|
|
707
|
+
const popoutWidget = state.popoutWidgets.byId[location.popoutWidgetId];
|
|
708
|
+
// Popout widget should only contain a single tab.
|
|
709
|
+
// istanbul ignore next
|
|
710
|
+
if (widget.tabs.length !== 1)
|
|
711
|
+
return;
|
|
712
|
+
const tabId = widget.tabs[0];
|
|
713
|
+
const widgetDef = this.findWidgetDef(tabId);
|
|
714
|
+
// istanbul ignore next
|
|
715
|
+
if (!widgetDef)
|
|
716
|
+
return;
|
|
717
|
+
const popoutContent = (React.createElement(PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
|
|
718
|
+
const bounds = Rectangle.create(popoutWidget.bounds);
|
|
719
|
+
const position = {
|
|
720
|
+
width: bounds.getWidth(),
|
|
721
|
+
height: bounds.getHeight(),
|
|
722
|
+
left: bounds.left,
|
|
723
|
+
top: bounds.top,
|
|
724
|
+
};
|
|
725
|
+
UiFramework.childWindowManager.openChildWindow(widgetContainerId, widgetDef.label, popoutContent, position, UiFramework.useDefaultPopoutUrl);
|
|
718
726
|
}
|
|
719
727
|
/** Create a new popout/child window that contains the widget specified by its Id. Supported only when in
|
|
720
728
|
* UI 2.0 or higher.
|
|
@@ -725,42 +733,43 @@ export class FrontstageDef {
|
|
|
725
733
|
* @beta
|
|
726
734
|
*/
|
|
727
735
|
popoutWidget(widgetId, point, size) {
|
|
728
|
-
// istanbul ignore
|
|
729
|
-
if (this.nineZoneState)
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
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
|
-
|
|
736
|
+
// istanbul ignore next
|
|
737
|
+
if (!this.nineZoneState)
|
|
738
|
+
return;
|
|
739
|
+
let location = getTabLocation(this.nineZoneState, widgetId);
|
|
740
|
+
if (!location || isPopoutTabLocation(location))
|
|
741
|
+
return;
|
|
742
|
+
const widgetDef = this.findWidgetDef(widgetId);
|
|
743
|
+
// istanbul ignore next
|
|
744
|
+
if (!widgetDef)
|
|
745
|
+
return;
|
|
746
|
+
// get the state to apply that will pop-out the specified WidgetTab to child window.
|
|
747
|
+
let preferredBounds = Rectangle.createFromSize({ height: 800, width: 600 });
|
|
748
|
+
// istanbul ignore next
|
|
749
|
+
if (widgetDef.popoutBounds)
|
|
750
|
+
preferredBounds = widgetDef.popoutBounds;
|
|
751
|
+
if (size)
|
|
752
|
+
preferredBounds = preferredBounds.setSize(size);
|
|
753
|
+
if (point)
|
|
754
|
+
preferredBounds = preferredBounds.setPosition(point);
|
|
755
|
+
const state = popoutWidgetToChildWindow(this.nineZoneState, widgetId, preferredBounds);
|
|
756
|
+
this.nineZoneState = state;
|
|
757
|
+
// now that the state is updated get the id of the container that houses the widgetTab/widgetId
|
|
758
|
+
location = getTabLocation(state, widgetId);
|
|
759
|
+
assert(!!location && isPopoutTabLocation(location));
|
|
760
|
+
const widgetContainerId = location.widgetId;
|
|
761
|
+
const popoutWidget = state.popoutWidgets.byId[widgetContainerId];
|
|
762
|
+
const bounds = Rectangle.create(popoutWidget.bounds);
|
|
763
|
+
setTimeout(() => {
|
|
764
|
+
const popoutContent = (React.createElement(PopoutWidget, { widgetContainerId: widgetContainerId, widgetDef: widgetDef }));
|
|
765
|
+
const position = {
|
|
766
|
+
width: bounds.getWidth(),
|
|
767
|
+
height: bounds.getHeight(),
|
|
768
|
+
left: bounds.left,
|
|
769
|
+
top: bounds.top,
|
|
770
|
+
};
|
|
771
|
+
UiFramework.childWindowManager.openChildWindow(widgetContainerId, widgetDef.label, popoutContent, position, UiFramework.useDefaultPopoutUrl);
|
|
772
|
+
});
|
|
764
773
|
}
|
|
765
774
|
get isStageClosing() {
|
|
766
775
|
return this._isStageClosing;
|
|
@@ -772,12 +781,23 @@ export class FrontstageDef {
|
|
|
772
781
|
return this._isReady;
|
|
773
782
|
}
|
|
774
783
|
/** @internal */
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
784
|
+
saveChildWindowSizeAndPosition(childWindowId, childWindow) {
|
|
785
|
+
if (!this.nineZoneState)
|
|
786
|
+
return;
|
|
787
|
+
const location = getWidgetLocation(this.nineZoneState, childWindowId);
|
|
788
|
+
if (!location || !isPopoutWidgetLocation(location))
|
|
789
|
+
return;
|
|
790
|
+
const widget = this.nineZoneState.widgets[location.popoutWidgetId];
|
|
791
|
+
const tabId = widget.tabs[0];
|
|
792
|
+
const widgetDef = this.findWidgetDef(tabId);
|
|
793
|
+
if (!widgetDef)
|
|
794
|
+
return;
|
|
795
|
+
const adjustmentWidth = ProcessDetector.isElectronAppFrontend ? 16 : 0;
|
|
796
|
+
const adjustmentHeight = ProcessDetector.isElectronAppFrontend ? 39 : 0;
|
|
797
|
+
const width = childWindow.innerWidth + adjustmentWidth;
|
|
798
|
+
const height = childWindow.innerHeight + adjustmentHeight;
|
|
799
|
+
const bounds = Rectangle.createFromSize({ width, height }).offset({ x: childWindow.screenX, y: childWindow.screenY });
|
|
800
|
+
widgetDef.popoutBounds = bounds;
|
|
781
801
|
}
|
|
782
802
|
/** @internal */
|
|
783
803
|
setFloatingWidgetBoundsInternal(floatingWidgetId, bounds, inhibitNineZoneStateChangedEvent = false) {
|
|
@@ -795,16 +815,16 @@ export class FrontstageDef {
|
|
|
795
815
|
* @internal
|
|
796
816
|
*/
|
|
797
817
|
dockPopoutWidgetContainer(widgetContainerId) {
|
|
798
|
-
if (this.nineZoneState)
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
818
|
+
if (!this.nineZoneState)
|
|
819
|
+
return;
|
|
820
|
+
// 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
|
|
821
|
+
// an API call has moved the widget from a popout state to a floating state.
|
|
822
|
+
// istanbul ignore else
|
|
823
|
+
const location = getWidgetLocation(this.nineZoneState, widgetContainerId);
|
|
824
|
+
if (!location || !isPopoutWidgetLocation(location))
|
|
825
|
+
return;
|
|
826
|
+
const state = dockWidgetContainer(this.nineZoneState, widgetContainerId, true);
|
|
827
|
+
this.nineZoneState = state;
|
|
808
828
|
}
|
|
809
829
|
/** Finds the container with the specified widget and re-docks all widgets
|
|
810
830
|
* back to the panel zone location that was used when the floating container
|
|
@@ -815,12 +835,12 @@ export class FrontstageDef {
|
|
|
815
835
|
dockWidgetContainer(widgetId) {
|
|
816
836
|
// istanbul ignore else
|
|
817
837
|
if (this.nineZoneState) {
|
|
818
|
-
const location =
|
|
838
|
+
const location = getTabLocation(this.nineZoneState, widgetId);
|
|
819
839
|
if (location) {
|
|
820
840
|
const widgetContainerId = location.widgetId;
|
|
821
841
|
const state = dockWidgetContainer(this.nineZoneState, widgetContainerId, true);
|
|
822
842
|
state && (this.nineZoneState = state);
|
|
823
|
-
if (
|
|
843
|
+
if (isPopoutTabLocation(location)) {
|
|
824
844
|
UiFramework.childWindowManager.closeChildWindow(location.widgetId, true);
|
|
825
845
|
}
|
|
826
846
|
}
|
|
@@ -840,9 +860,9 @@ export class FrontstageDef {
|
|
|
840
860
|
getFloatingWidgetContainerIdByWidgetId(widgetId) {
|
|
841
861
|
if (!this.nineZoneState)
|
|
842
862
|
return undefined;
|
|
843
|
-
const location =
|
|
863
|
+
const location = getTabLocation(this.nineZoneState, widgetId);
|
|
844
864
|
// istanbul ignore else
|
|
845
|
-
if (location &&
|
|
865
|
+
if (location && isFloatingTabLocation(location)) {
|
|
846
866
|
return location.floatingWidgetId;
|
|
847
867
|
}
|
|
848
868
|
// istanbul ignore next
|
|
@@ -863,5 +883,29 @@ export class FrontstageDef {
|
|
|
863
883
|
}
|
|
864
884
|
return undefined;
|
|
865
885
|
}
|
|
886
|
+
*_widgetDefs() {
|
|
887
|
+
for (const zoneDef of this.zoneDefs) {
|
|
888
|
+
for (const widgetDef of zoneDef.widgetDefs) {
|
|
889
|
+
yield widgetDef;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
for (const panelDef of this.panelDefs) {
|
|
893
|
+
for (const widgetDef of panelDef.widgetDefs) {
|
|
894
|
+
yield widgetDef;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return undefined;
|
|
898
|
+
}
|
|
899
|
+
/** Iterable of all widget definitions in a frontstage.
|
|
900
|
+
* @internal
|
|
901
|
+
*/
|
|
902
|
+
get widgetDefs() {
|
|
903
|
+
const defs = this._widgetDefs();
|
|
904
|
+
return {
|
|
905
|
+
[Symbol.iterator]() {
|
|
906
|
+
return defs;
|
|
907
|
+
},
|
|
908
|
+
};
|
|
909
|
+
}
|
|
866
910
|
}
|
|
867
911
|
//# sourceMappingURL=FrontstageDef.js.map
|