@itwin/appui-react 3.6.0-dev.5 → 3.6.0-dev.50
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 +33 -1
- package/LICENSE.md +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentLayout.js +18 -1
- package/lib/cjs/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/cjs/appui-react/content/ContentViewManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/ContentViewManager.js +19 -1
- package/lib/cjs/appui-react/content/ContentViewManager.js.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.d.ts +6 -3
- package/lib/cjs/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/cjs/appui-react/content/FloatingViewportContent.js +19 -8
- package/lib/cjs/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts +0 -2
- package/lib/cjs/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js +12 -12
- package/lib/cjs/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/Common.d.ts +2 -0
- package/lib/cjs/appui-react/imodel-components/Common.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/Common.js +1 -0
- package/lib/cjs/appui-react/imodel-components/Common.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeEventHandler.d.ts +6 -0
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeEventHandler.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeEventHandler.js +2 -0
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeRenderer.d.ts +6 -0
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeRenderer.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeRenderer.js +6 -0
- package/lib/cjs/appui-react/imodel-components/VisibilityTreeRenderer.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoriesTree.d.ts +5 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoriesTree.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoriesTree.js +4 -0
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoriesTree.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts +9 -2
- 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 +5 -1
- package/lib/cjs/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsTree.d.ts +2 -0
- 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 +2 -0
- 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 +3 -0
- 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 +2 -0
- package/lib/cjs/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/cjs/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.d.ts +2 -0
- package/lib/cjs/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.d.ts.map +1 -1
- package/lib/cjs/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.js +2 -0
- package/lib/cjs/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.js.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/cjs/appui-react/messages/MessageManager.js +3 -1
- package/lib/cjs/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts +3 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/cjs/appui-react/widget-panels/Frontstage.js +3 -5
- package/lib/cjs/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentLayout.js +18 -1
- package/lib/esm/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/esm/appui-react/content/ContentViewManager.d.ts.map +1 -1
- package/lib/esm/appui-react/content/ContentViewManager.js +19 -1
- package/lib/esm/appui-react/content/ContentViewManager.js.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.d.ts +6 -3
- package/lib/esm/appui-react/content/FloatingViewportContent.d.ts.map +1 -1
- package/lib/esm/appui-react/content/FloatingViewportContent.js +19 -8
- package/lib/esm/appui-react/content/FloatingViewportContent.js.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts +0 -2
- package/lib/esm/appui-react/frontstage/FrontstageDef.d.ts.map +1 -1
- package/lib/esm/appui-react/frontstage/FrontstageDef.js +13 -13
- package/lib/esm/appui-react/frontstage/FrontstageDef.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/Common.d.ts +2 -0
- package/lib/esm/appui-react/imodel-components/Common.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/Common.js +1 -0
- package/lib/esm/appui-react/imodel-components/Common.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/VisibilityTreeEventHandler.d.ts +6 -0
- package/lib/esm/appui-react/imodel-components/VisibilityTreeEventHandler.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/VisibilityTreeEventHandler.js +2 -0
- package/lib/esm/appui-react/imodel-components/VisibilityTreeEventHandler.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/VisibilityTreeRenderer.d.ts +6 -0
- package/lib/esm/appui-react/imodel-components/VisibilityTreeRenderer.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/VisibilityTreeRenderer.js +6 -0
- package/lib/esm/appui-react/imodel-components/VisibilityTreeRenderer.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoriesTree.d.ts +5 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoriesTree.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoriesTree.js +4 -0
- package/lib/esm/appui-react/imodel-components/category-tree/CategoriesTree.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.d.ts +9 -2
- 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 +5 -1
- package/lib/esm/appui-react/imodel-components/category-tree/CategoryVisibilityHandler.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsTree.d.ts +2 -0
- 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 +2 -0
- 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 +3 -0
- 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 +2 -0
- package/lib/esm/appui-react/imodel-components/models-tree/ModelsVisibilityHandler.js.map +1 -1
- package/lib/esm/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.d.ts +2 -0
- package/lib/esm/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.d.ts.map +1 -1
- package/lib/esm/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.js +2 -0
- package/lib/esm/appui-react/imodel-components/spatial-tree/SpatialContainmentTree.js.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.d.ts.map +1 -1
- package/lib/esm/appui-react/messages/MessageManager.js +3 -1
- package/lib/esm/appui-react/messages/MessageManager.js.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts +3 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.d.ts.map +1 -1
- package/lib/esm/appui-react/widget-panels/Frontstage.js +2 -5
- package/lib/esm/appui-react/widget-panels/Frontstage.js.map +1 -1
- package/package.json +33 -33
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
# Change Log - @itwin/appui-react
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 11 Jan 2023 16:46:30 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.5.2
|
|
6
|
+
Wed, 11 Jan 2023 16:46:30 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Fix detailed output message on a new line in toasts.
|
|
11
|
+
|
|
12
|
+
## 3.5.1
|
|
13
|
+
Thu, 15 Dec 2022 16:38:28 GMT
|
|
14
|
+
|
|
15
|
+
_Version update only_
|
|
16
|
+
|
|
17
|
+
## 3.5.0
|
|
18
|
+
Wed, 07 Dec 2022 19:12:36 GMT
|
|
19
|
+
|
|
20
|
+
### Updates
|
|
21
|
+
|
|
22
|
+
- Add FeatureOverridesChanged SyncUIEvent in SyncUiEventDispatcher.ts
|
|
23
|
+
- Do not auto-hide the UI when floating widget is hovered.
|
|
24
|
+
- Fix a circular dependency issue.
|
|
25
|
+
- Updated pin icon for help widget.
|
|
26
|
+
- Deprecate pseudo components of frontstage provider in favor of configuration interfaces.
|
|
27
|
+
- Add automatic horizonal scrolling to the ListPicker's expandable blocks for small form factors or long strings.
|
|
28
|
+
- Refactored many tests to remove enzyme and snaphot testing
|
|
29
|
+
- Unpin classnames package
|
|
30
|
+
- Rename RestoreFrontstagesLayoutTool to RestoreAllFrontstagesTool.
|
|
31
|
+
- Add RestoreFrontstagesLayout tool.
|
|
32
|
+
- Deprecate components in preparation for next major version.
|
|
33
|
+
- Persist the toolbar-opacity to state.
|
|
34
|
+
- Add a toolbar opacity to the state and the UiFramework API to allow users or apps to configure it. Add a slider to the UiSettingsPage to control the toolbar opacity.
|
|
35
|
+
- Update WidgetDef to pass the optional prop allowedPanelTargets to createTab wh
|
|
4
36
|
|
|
5
37
|
## 3.4.7
|
|
6
38
|
Wed, 30 Nov 2022 14:28:19 GMT
|
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2017-
|
|
3
|
+
Copyright © 2017-2023 Bentley Systems, Incorporated. All rights reserved.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
|
@@ -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;AAIrK,wCAAwC;AACxC,UAAU,mBAAoB,SAAQ,WAAW;IAC/C,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;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I,MAAM,EAAE;IAexC,OAAO,CAAC,gCAAgC;IAuBxC,OAAO,CAAC,8BAA8B;IAuBtC,gBAAgB;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;;MAEE;IACF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;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"}
|
|
@@ -26,6 +26,15 @@ function ContentWrapper(props) {
|
|
|
26
26
|
const { content } = props;
|
|
27
27
|
const [isActive, setIsActive] = React.useState(content === ContentViewManager_1.ContentViewManager.getActiveContent());
|
|
28
28
|
const activeFrontstageDef = (0, Frontstage_1.useActiveFrontstageDef)();
|
|
29
|
+
const contentControlKey = (contentControl) => {
|
|
30
|
+
let controlId;
|
|
31
|
+
if (contentControl && contentControl.key) {
|
|
32
|
+
const key = contentControl.key;
|
|
33
|
+
// key has format `${contentProps.id}::${this.groupId}` which is stored as unique id
|
|
34
|
+
controlId = key.split("::", 1)[0];
|
|
35
|
+
}
|
|
36
|
+
return controlId;
|
|
37
|
+
};
|
|
29
38
|
// istanbul ignore next
|
|
30
39
|
const [hasMultipleContents, setHasMultipleContents] = React.useState(() => {
|
|
31
40
|
var _a, _b, _c;
|
|
@@ -38,7 +47,14 @@ function ContentWrapper(props) {
|
|
|
38
47
|
React.useEffect(() => {
|
|
39
48
|
const handleActiveContentChanged = (args) => {
|
|
40
49
|
var _a, _b, _c;
|
|
41
|
-
|
|
50
|
+
const contentIsIdentical = content === args.activeContent;
|
|
51
|
+
if (contentIsIdentical)
|
|
52
|
+
setIsActive(contentIsIdentical);
|
|
53
|
+
else {
|
|
54
|
+
const contentId = contentControlKey(content);
|
|
55
|
+
const activeContentId = contentControlKey(args.activeContent);
|
|
56
|
+
setIsActive(contentId === activeContentId);
|
|
57
|
+
}
|
|
42
58
|
// istanbul ignore next
|
|
43
59
|
setHasMultipleContents((activeFrontstageDef && (!!((_a = activeFrontstageDef.floatingContentControls) === null || _a === void 0 ? void 0 : _a.length)) ||
|
|
44
60
|
((_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));
|
|
@@ -47,6 +63,7 @@ function ContentWrapper(props) {
|
|
|
47
63
|
}, [activeFrontstageDef, content]);
|
|
48
64
|
const handleMouseDown = React.useCallback(() => {
|
|
49
65
|
ContentViewManager_1.ContentViewManager.setActiveContent(content);
|
|
66
|
+
setIsActive(true);
|
|
50
67
|
}, [content]);
|
|
51
68
|
React.useEffect(() => {
|
|
52
69
|
const onAvailableContentChanged = () => {
|
|
@@ -1 +1 @@
|
|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BAA6B,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;AAjED,sCAiEC","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 /**\r\n * @deprecated In upcoming version, widget mode will be removed and footer mode will always be true.\r\n */\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,gCAA8B;AAC9B,2CAAoC;AACpC,+BAA+B;AAC/B,sDAAmD;AACnD,kDAA6D;AAC7D,uEAAoE;AACpE,kEAA+D;AAE/D,0DAAqK;AACrK,6DAAyF;AACzF,yDAAkE;AAOlE;;GAEG;AACH,SAAgB,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,uCAAkB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClG,MAAM,mBAAmB,GAAG,IAAA,mCAAsB,GAAE,CAAC;IAErD,MAAM,iBAAiB,GAAG,CAAC,cAA+B,EAAsB,EAAE;QAChF,IAAI,SAA6B,CAAC;QAClC,IAAI,cAAc,IAAK,cAA0C,CAAC,GAAG,EAAE;YACrE,MAAM,GAAG,GAAK,cAA0C,CAAC,GAAc,CAAC;YACxE,oFAAoF;YACpF,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACnC;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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;AAjED,sCAiEC","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 const contentControlKey = (contentControl: React.ReactNode): string | undefined => {\r\n let controlId: string | undefined;\r\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\r\n const key = ((contentControl as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n controlId = key.split(\"::\", 1)[0];\r\n }\r\n return controlId;\r\n };\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 const contentIsIdentical = content === args.activeContent;\r\n if (contentIsIdentical)\r\n setIsActive(contentIsIdentical);\r\n else {\r\n const contentId = contentControlKey(content);\r\n const activeContentId = contentControlKey(args.activeContent);\r\n setIsActive(contentId === activeContentId);\r\n }\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 setIsActive(true);\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 /**\r\n * @deprecated In upcoming version, widget mode will be removed and footer mode will always be true.\r\n */\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentViewManager.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentViewManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,0CAA0C;IAC1C,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,yBAAyB,CAAC;CAAI;AAEjF;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,oCAAoC;IACpC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,6CAA6C;IAC7C,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,OAAO,CAAC,6BAA6B,CAAC;CAAI;AAEzF;;GAEG;AACH,qBAAa,k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class ContentViewManager {
|
|
|
46
46
|
}
|
|
47
47
|
static getControlFromElement(content, activeContentGroup, floatingControls, logIfNotFound = false) {
|
|
48
48
|
if (floatingControls === null || floatingControls === void 0 ? void 0 : floatingControls.length) {
|
|
49
|
-
|
|
49
|
+
// if we find a React node that matches exactly, return its containing control
|
|
50
|
+
let control = floatingControls.find((contentControl) => contentControl.reactNode === content);
|
|
51
|
+
if (control)
|
|
52
|
+
return control;
|
|
53
|
+
// if we don't find a React node that matches exactly, rely on the id specified by the creator
|
|
54
|
+
let controlId;
|
|
55
|
+
if (content && content.key) {
|
|
56
|
+
const key = content.key;
|
|
57
|
+
// key has format `${contentProps.id}::${this.groupId}` which is stored as unique id
|
|
58
|
+
controlId = key.split("::", 1)[0];
|
|
59
|
+
}
|
|
60
|
+
floatingControls.forEach((contentControl) => {
|
|
61
|
+
const node = contentControl.reactNode;
|
|
62
|
+
const key = node.key;
|
|
63
|
+
const nodeId = key && key.split("::", 1)[0];
|
|
64
|
+
if (nodeId === controlId)
|
|
65
|
+
control = contentControl;
|
|
66
|
+
});
|
|
50
67
|
if (control)
|
|
51
68
|
return control;
|
|
52
69
|
}
|
|
70
|
+
// if it's not a floating control, look through the content area views
|
|
53
71
|
// istanbul ignore else
|
|
54
72
|
if (activeContentGroup) {
|
|
55
73
|
const activeContentControl = activeContentGroup.getControlFromElement(content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentViewManager.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentViewManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,0DAAgD;AAChD,uEAAoE;AACpE,0DAAuD;AAEvD,iEAA8D;AAC9D,wDAAiD;AAEjD,sDAA6C;AAC7C,gDAA6C;AAU7C;;GAEG;AACH,MAAa,qBAAsB,SAAQ,wBAAkC;CAAI;AAAjF,sDAAiF;AAYjF;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAsC;CAAI;AAAzF,8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AAyB,EAAE,CAAC;AAErF,wDAAwD;AAEjC,iDAA8B,GAAG,IAAI,wBAAO,EAAyB,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 ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { UiEvent } from \"@itwin/appui-abstract\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { ViewUtilities } from \"../utils/ViewUtilities\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { ContentLayoutManager } from \"./ContentLayoutManager\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { ContentGroup } from \"./ContentGroup\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { UiFramework } from \"../UiFramework\";\r\n\r\n/** [[MouseDownChangedEvent]] Args interface.\r\n * @public\r\n */\r\nexport interface MouseDownChangedEventArgs {\r\n /** Indicates whether the mouse is down */\r\n mouseDown: boolean;\r\n}\r\n\r\n/** Mouse Down Changed Event class.\r\n * @public\r\n */\r\nexport class MouseDownChangedEvent extends UiEvent<MouseDownChangedEventArgs> { }\r\n\r\n/** [[ActiveContentChangedEvent]] Args interface.\r\n * @public\r\n */\r\nexport interface ActiveContentChangedEventArgs {\r\n /** React node of the old content */\r\n oldContent?: React.ReactNode;\r\n /** React node of the newly active content */\r\n activeContent?: React.ReactNode;\r\n}\r\n\r\n/** Active Content Changed Event class.\r\n * @public\r\n */\r\nexport class ActiveContentChangedEvent extends UiEvent<ActiveContentChangedEventArgs> { }\r\n\r\n/** Content View Manager class.\r\n * @public\r\n */\r\nexport class ContentViewManager {\r\n private static _mouseDown: boolean = false;\r\n private static _activeContent?: React.ReactNode;\r\n\r\n /** Gets the [[MouseDownChangedEvent]] */\r\n public static readonly onMouseDownChangedEvent = new MouseDownChangedEvent();\r\n\r\n /** Determines if the mouse is down in a content view */\r\n public static get isMouseDown(): boolean {\r\n return this._mouseDown;\r\n }\r\n\r\n /** Sets the mouse down status for a content view */\r\n public static setMouseDown(mouseDown: boolean): void {\r\n this._mouseDown = mouseDown;\r\n this.onMouseDownChangedEvent.emit({ mouseDown });\r\n }\r\n\r\n /** Gets the [[ActiveContentChangedEvent]] */\r\n public static readonly onActiveContentChangedEvent = new ActiveContentChangedEvent();\r\n\r\n /** Fires when floating contents are added or removed */\r\n\r\n public static readonly onAvailableContentChangedEvent = new UiEvent<{ contentId: string }>();\r\n\r\n /** Gets the active content as a React.ReactNode. */\r\n public static getActiveContent(): React.ReactNode | undefined {\r\n return this._activeContent;\r\n }\r\n\r\n private static getControlFromElement(content: React.ReactNode, activeContentGroup: ContentGroup | undefined, floatingControls: ContentControl[] | undefined, logIfNotFound = false) {\r\n if (floatingControls?.length) {\r\n const control = floatingControls.find((contentControl) => contentControl.reactNode === content);\r\n if (control)\r\n return control;\r\n }\r\n\r\n // istanbul ignore else\r\n if (activeContentGroup) {\r\n const activeContentControl = activeContentGroup.getControlFromElement(content);\r\n if (activeContentControl)\r\n return activeContentControl;\r\n }\r\n\r\n if (logIfNotFound)\r\n Logger.logError(UiFramework.loggerCategory(this), `getControlFromElement: no control found for element`);\r\n\r\n return undefined;\r\n }\r\n\r\n /** Return the active ContentControl. */\r\n public static getActiveContentControl(): ContentControl | undefined {\r\n let activeContentControl: ContentControl | undefined;\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n\r\n // istanbul ignore else\r\n if (this._activeContent && activeFrontstageDef) {\r\n const activeContentGroup = activeFrontstageDef.contentGroup;\r\n activeContentControl = this.getControlFromElement(this._activeContent, activeContentGroup, activeFrontstageDef.floatingContentControls);\r\n }\r\n\r\n return activeContentControl;\r\n }\r\n\r\n public static addFloatingContentControl(contentControl?: ContentControl) {\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n // istanbul ignore else\r\n if (activeFrontstageDef && contentControl) {\r\n activeFrontstageDef.addFloatingContentControl(contentControl);\r\n }\r\n }\r\n\r\n public static dropFloatingContentControl(contentControl?: ContentControl) {\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n // istanbul ignore else\r\n if (activeFrontstageDef && contentControl)\r\n activeFrontstageDef.dropFloatingContentControl(contentControl);\r\n }\r\n\r\n /** Sets the active [[ContentControl]] */\r\n public static setActiveContent(activeContent?: React.ReactNode, forceEventProcessing = false): void {\r\n // istanbul ignore else\r\n if (this._activeContent !== activeContent || forceEventProcessing) {\r\n const oldContent = this._activeContent;\r\n this._activeContent = activeContent;\r\n\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n\r\n // istanbul ignore else\r\n if (activeFrontstageDef) {\r\n const activeContentGroup = activeFrontstageDef.contentGroup;\r\n\r\n // istanbul ignore else\r\n const oldContentControl = this.getControlFromElement(oldContent, activeContentGroup, activeFrontstageDef.floatingContentControls);\r\n const activeContentControl = this.getControlFromElement(activeContent, activeContentGroup, activeFrontstageDef.floatingContentControls, true);\r\n\r\n // Only call setActiveView if going to or coming from a non-viewport ContentControl\r\n // istanbul ignore else\r\n if (activeContentControl) {\r\n // istanbul ignore next\r\n const doSetActiveView =\r\n forceEventProcessing || (!activeContentControl.viewport ||\r\n (/* istanbul ignore next */ oldContentControl && /* istanbul ignore next */ !oldContentControl.viewport));\r\n\r\n // istanbul ignore else\r\n if (doSetActiveView) {\r\n activeFrontstageDef.setActiveView(activeContentControl, oldContentControl);\r\n this.onActiveContentChangedEvent.emit({ activeContent, oldContent });\r\n } else {\r\n if (activeContentControl.viewport && activeContentControl.viewport !== IModelApp.viewManager.selectedView) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n IModelApp.viewManager.setSelectedView(activeContentControl.viewport);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Refreshes the active [[ContentControl]] */\r\n public static refreshActiveContent(activeContent: React.ReactNode) {\r\n ContentLayoutManager.refreshActiveLayout();\r\n this.setActiveContent(activeContent, true);\r\n }\r\n\r\n /**\r\n * Determines if content displays a Sheet view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentSheetView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isSheetView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a Drawing view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentDrawingView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isDrawingView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a Spatial view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentSpatialView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isSpatialView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a Orthographic view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentOrthographicView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isOrthographicView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a 3d view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContent3dView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.is3dView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if viewport supports use of a camera.\r\n * @param content ContentControl to check\r\n */\r\n public static contentSupportsCamera(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.viewSupportsCamera(content.viewport));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"ContentViewManager.js","sourceRoot":"","sources":["../../../../src/appui-react/content/ContentViewManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,0DAAgD;AAChD,uEAAoE;AACpE,0DAAuD;AAEvD,iEAA8D;AAC9D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CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,yBAAyB,CAAC,OAAmC;QACzE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,OAAO,KAAK,CAAC;QACf,OAAO,CAAC,6BAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,eAAe,CAAC,OAAmC;QAC/D,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,OAAO,KAAK,CAAC;QACf,OAAO,CAAC,6BAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,qBAAqB,CAAC,OAAmC;QACrE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,OAAO,KAAK,CAAC;QACf,OAAO,CAAC,6BAAa,CAAC,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC;;AA1MH,gDA2MC;AA1MgB,6BAAU,GAAY,KAAK,CAAC;AAG3C,yCAAyC;AAClB,0CAAuB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAa7E,6CAA6C;AACtB,8CAA2B,GAAG,IAAI,yBAAyB,EAAE,CAAC;AAErF,wDAAwD;AAEjC,iDAA8B,GAAG,IAAI,wBAAO,EAAyB,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 ContentView\r\n */\r\n\r\nimport * as React from \"react\";\r\nimport { UiEvent } from \"@itwin/appui-abstract\";\r\nimport { FrontstageManager } from \"../frontstage/FrontstageManager\";\r\nimport { ViewUtilities } from \"../utils/ViewUtilities\";\r\nimport { ContentControl } from \"./ContentControl\";\r\nimport { ContentLayoutManager } from \"./ContentLayoutManager\";\r\nimport { IModelApp } from \"@itwin/core-frontend\";\r\nimport { ContentGroup } from \"./ContentGroup\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport { UiFramework } from \"../UiFramework\";\r\n\r\n/** [[MouseDownChangedEvent]] Args interface.\r\n * @public\r\n */\r\nexport interface MouseDownChangedEventArgs {\r\n /** Indicates whether the mouse is down */\r\n mouseDown: boolean;\r\n}\r\n\r\n/** Mouse Down Changed Event class.\r\n * @public\r\n */\r\nexport class MouseDownChangedEvent extends UiEvent<MouseDownChangedEventArgs> { }\r\n\r\n/** [[ActiveContentChangedEvent]] Args interface.\r\n * @public\r\n */\r\nexport interface ActiveContentChangedEventArgs {\r\n /** React node of the old content */\r\n oldContent?: React.ReactNode;\r\n /** React node of the newly active content */\r\n activeContent?: React.ReactNode;\r\n}\r\n\r\n/** Active Content Changed Event class.\r\n * @public\r\n */\r\nexport class ActiveContentChangedEvent extends UiEvent<ActiveContentChangedEventArgs> { }\r\n\r\n/** Content View Manager class.\r\n * @public\r\n */\r\nexport class ContentViewManager {\r\n private static _mouseDown: boolean = false;\r\n private static _activeContent?: React.ReactNode;\r\n\r\n /** Gets the [[MouseDownChangedEvent]] */\r\n public static readonly onMouseDownChangedEvent = new MouseDownChangedEvent();\r\n\r\n /** Determines if the mouse is down in a content view */\r\n public static get isMouseDown(): boolean {\r\n return this._mouseDown;\r\n }\r\n\r\n /** Sets the mouse down status for a content view */\r\n public static setMouseDown(mouseDown: boolean): void {\r\n this._mouseDown = mouseDown;\r\n this.onMouseDownChangedEvent.emit({ mouseDown });\r\n }\r\n\r\n /** Gets the [[ActiveContentChangedEvent]] */\r\n public static readonly onActiveContentChangedEvent = new ActiveContentChangedEvent();\r\n\r\n /** Fires when floating contents are added or removed */\r\n\r\n public static readonly onAvailableContentChangedEvent = new UiEvent<{ contentId: string }>();\r\n\r\n /** Gets the active content as a React.ReactNode. */\r\n public static getActiveContent(): React.ReactNode | undefined {\r\n return this._activeContent;\r\n }\r\n\r\n private static getControlFromElement(content: React.ReactNode, activeContentGroup: ContentGroup | undefined, floatingControls: ContentControl[] | undefined, logIfNotFound = false) {\r\n if (floatingControls?.length) {\r\n // if we find a React node that matches exactly, return its containing control\r\n let control = floatingControls.find((contentControl) => contentControl.reactNode === content);\r\n if (control)\r\n return control;\r\n\r\n // if we don't find a React node that matches exactly, rely on the id specified by the creator\r\n let controlId: string;\r\n if (content && (content as React.ReactElement<any>).key) {\r\n const key = ((content as React.ReactElement<any>).key as string);\r\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\r\n controlId = key.split(\"::\", 1)[0];\r\n }\r\n floatingControls.forEach ((contentControl: ContentControl) => {\r\n const node = contentControl.reactNode;\r\n const key = ((node as React.ReactElement<any>).key as string);\r\n const nodeId = key && key.split(\"::\", 1)[0];\r\n if (nodeId === controlId)\r\n control = contentControl;\r\n });\r\n if (control)\r\n return control;\r\n }\r\n\r\n // if it's not a floating control, look through the content area views\r\n // istanbul ignore else\r\n if (activeContentGroup) {\r\n const activeContentControl = activeContentGroup.getControlFromElement(content);\r\n if (activeContentControl)\r\n return activeContentControl;\r\n }\r\n\r\n if (logIfNotFound)\r\n Logger.logError(UiFramework.loggerCategory(this), `getControlFromElement: no control found for element`);\r\n\r\n return undefined;\r\n }\r\n\r\n /** Return the active ContentControl. */\r\n public static getActiveContentControl(): ContentControl | undefined {\r\n let activeContentControl: ContentControl | undefined;\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n\r\n // istanbul ignore else\r\n if (this._activeContent && activeFrontstageDef) {\r\n const activeContentGroup = activeFrontstageDef.contentGroup;\r\n activeContentControl = this.getControlFromElement(this._activeContent, activeContentGroup, activeFrontstageDef.floatingContentControls);\r\n }\r\n\r\n return activeContentControl;\r\n }\r\n\r\n public static addFloatingContentControl(contentControl?: ContentControl) {\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n // istanbul ignore else\r\n if (activeFrontstageDef && contentControl) {\r\n activeFrontstageDef.addFloatingContentControl(contentControl);\r\n }\r\n }\r\n\r\n public static dropFloatingContentControl(contentControl?: ContentControl) {\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n // istanbul ignore else\r\n if (activeFrontstageDef && contentControl)\r\n activeFrontstageDef.dropFloatingContentControl(contentControl);\r\n }\r\n\r\n /** Sets the active [[ContentControl]] */\r\n public static setActiveContent(activeContent?: React.ReactNode, forceEventProcessing = false): void {\r\n // istanbul ignore else\r\n if (this._activeContent !== activeContent || forceEventProcessing) {\r\n const oldContent = this._activeContent;\r\n this._activeContent = activeContent;\r\n\r\n const activeFrontstageDef = FrontstageManager.activeFrontstageDef;\r\n\r\n // istanbul ignore else\r\n if (activeFrontstageDef) {\r\n const activeContentGroup = activeFrontstageDef.contentGroup;\r\n\r\n // istanbul ignore else\r\n const oldContentControl = this.getControlFromElement(oldContent, activeContentGroup, activeFrontstageDef.floatingContentControls);\r\n const activeContentControl = this.getControlFromElement(activeContent, activeContentGroup, activeFrontstageDef.floatingContentControls, true);\r\n\r\n // Only call setActiveView if going to or coming from a non-viewport ContentControl\r\n // istanbul ignore else\r\n if (activeContentControl) {\r\n // istanbul ignore next\r\n const doSetActiveView =\r\n forceEventProcessing || (!activeContentControl.viewport ||\r\n (/* istanbul ignore next */ oldContentControl && /* istanbul ignore next */ !oldContentControl.viewport));\r\n\r\n // istanbul ignore else\r\n if (doSetActiveView) {\r\n activeFrontstageDef.setActiveView(activeContentControl, oldContentControl);\r\n this.onActiveContentChangedEvent.emit({ activeContent, oldContent });\r\n } else {\r\n if (activeContentControl.viewport && activeContentControl.viewport !== IModelApp.viewManager.selectedView) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n IModelApp.viewManager.setSelectedView(activeContentControl.viewport);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /** Refreshes the active [[ContentControl]] */\r\n public static refreshActiveContent(activeContent: React.ReactNode) {\r\n ContentLayoutManager.refreshActiveLayout();\r\n this.setActiveContent(activeContent, true);\r\n }\r\n\r\n /**\r\n * Determines if content displays a Sheet view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentSheetView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isSheetView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a Drawing view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentDrawingView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isDrawingView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a Spatial view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentSpatialView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isSpatialView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a Orthographic view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContentOrthographicView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.isOrthographicView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if content displays a 3d view.\r\n * @param content ContentControl to check\r\n */\r\n public static isContent3dView(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.is3dView(content.viewport));\r\n }\r\n\r\n /**\r\n * Determines if viewport supports use of a camera.\r\n * @param content ContentControl to check\r\n */\r\n public static contentSupportsCamera(content: ContentControl | undefined): boolean {\r\n if (!content || !content.viewport)\r\n return false;\r\n return (ViewUtilities.viewSupportsCamera(content.viewport));\r\n }\r\n}\r\n"]}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import "./FloatingViewportContent.css";
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { ScreenViewport } from "@itwin/core-frontend";
|
|
7
|
+
import { ViewStateProp } from "@itwin/imodel-components-react";
|
|
7
8
|
/**
|
|
8
9
|
* @beta
|
|
9
10
|
*/
|
|
@@ -12,8 +13,10 @@ export interface FloatingViewportContentProps {
|
|
|
12
13
|
onContextMenu?: (e: React.MouseEvent) => boolean;
|
|
13
14
|
/** viewport/content control uniqueId */
|
|
14
15
|
contentId: string;
|
|
15
|
-
/** The initial view state used to create the viewport */
|
|
16
|
-
initialViewState:
|
|
16
|
+
/** The initial view state used to create the viewport, or a function that returns it (will refresh when the function changes) */
|
|
17
|
+
initialViewState: ViewStateProp;
|
|
18
|
+
/** Function to get a reference to the ScreenViewport */
|
|
19
|
+
viewportRef?: React.Ref<ScreenViewport>;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* FloatingViewportContent component that creates its own [FloatingViewportContentControl].
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAa,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAqB,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAUlF;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,wFAAwF;IACxF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,wCAAwC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,iIAAiI;IACjI,gBAAgB,EAAE,aAAa,CAAC;IAChC,wDAAwD;IACxD,WAAW,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACzC;AAED;;;;;GAKG;AAEH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,eAqE1E"}
|
|
@@ -17,6 +17,7 @@ const ViewportContentControl_1 = require("./ViewportContentControl");
|
|
|
17
17
|
const ContentViewManager_1 = require("./ContentViewManager");
|
|
18
18
|
const UiShowHideManager_1 = require("../utils/UiShowHideManager");
|
|
19
19
|
const ContentLayout_1 = require("./ContentLayout");
|
|
20
|
+
const core_react_1 = require("@itwin/core-react");
|
|
20
21
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
22
|
const FloatingViewport = (0, presentation_components_1.viewWithUnifiedSelection)(imodel_components_react_1.ViewportComponent);
|
|
22
23
|
/**
|
|
@@ -27,10 +28,14 @@ const FloatingViewport = (0, presentation_components_1.viewWithUnifiedSelection)
|
|
|
27
28
|
*/
|
|
28
29
|
// istanbul ignore next
|
|
29
30
|
function FloatingViewportContent(props) {
|
|
30
|
-
const { contentId, initialViewState } = props;
|
|
31
|
+
const { contentId, initialViewState, viewportRef } = props;
|
|
31
32
|
const [viewport, setViewport] = React.useState();
|
|
32
33
|
const contentControl = React.useRef();
|
|
33
|
-
const
|
|
34
|
+
const viewState = React.useMemo(() => typeof initialViewState === "function" ? initialViewState() : initialViewState, [initialViewState]);
|
|
35
|
+
const ref = React.useCallback((v) => {
|
|
36
|
+
setViewport(v);
|
|
37
|
+
}, []);
|
|
38
|
+
const onViewportRef = (0, core_react_1.useRefs)(ref, ...(viewportRef ? [viewportRef] : []));
|
|
34
39
|
React.useEffect(() => {
|
|
35
40
|
if (!contentControl.current) {
|
|
36
41
|
contentControl.current = new ViewportContentControl_1.FloatingViewportContentControl(contentId, contentId, null);
|
|
@@ -43,19 +48,25 @@ function FloatingViewportContent(props) {
|
|
|
43
48
|
}
|
|
44
49
|
};
|
|
45
50
|
}, [contentId]);
|
|
46
|
-
const viewPortControl = React.useMemo(() =>
|
|
51
|
+
const viewPortControl = React.useMemo(() => {
|
|
52
|
+
const node = React.createElement(FloatingViewport, { viewportRef: onViewportRef, imodel: viewState.iModel, viewState: viewState, onContextMenu: props.onContextMenu, controlId: contentId });
|
|
53
|
+
let control = node;
|
|
54
|
+
if (!node.key) {
|
|
55
|
+
const additionalProps = { key: contentId };
|
|
56
|
+
control = React.cloneElement(node, additionalProps);
|
|
57
|
+
}
|
|
58
|
+
return control;
|
|
59
|
+
}, [onViewportRef, props.onContextMenu, viewState, contentId]);
|
|
47
60
|
React.useEffect(() => {
|
|
48
61
|
if (viewport && contentControl.current) {
|
|
49
62
|
contentControl.current.viewport = viewport;
|
|
50
63
|
if (null === contentControl.current.reactNode) {
|
|
51
64
|
contentControl.current.reactNode = viewPortControl;
|
|
52
65
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
contentControl.current.processViewSelectorChange(initialViewState.iModel, initialViewState.id, initialViewState, initialViewState.name);
|
|
56
|
-
}
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
67
|
+
contentControl.current.viewport.changeView(viewState);
|
|
57
68
|
}
|
|
58
|
-
}, [
|
|
69
|
+
}, [viewState, viewPortControl, viewport]);
|
|
59
70
|
React.useEffect(() => {
|
|
60
71
|
const onViewClose = (vp) => {
|
|
61
72
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yCAAuC;AACvC,+BAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"FloatingViewportContent.js","sourceRoot":"","sources":["../../../../src/appui-react/content/FloatingViewportContent.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,yCAAuC;AACvC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SAAS,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3C,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,WAAW,GAAG,CAAC,EAAkB,EAAE,EAAE;;YACzC,IAAI,CAAA,MAAA,cAAc,CAAC,OAAO,0CAAE,QAAQ,MAAK,EAAE,EAAE;gBAC3C,uCAAkB,CAAC,0BAA0B,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;gBACtE,cAAc,CAAC,OAAO,GAAG,SAAS,CAAC;aACpC;QACH,CAAC,CAAC;QACF,OAAO,yBAAS,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACpE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,6BAAK,WAAW,EAAE,qCAAiB,CAAC,sBAAsB,EAAE,SAAS,EAAC,4BAA4B,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE;QAChJ,oBAAC,8BAAc,IAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAI,CACzF,CACP,CAAC;AACJ,CAAC;AArED,0DAqEC","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 \"./FloatingViewportContent.css\";\r\nimport * as React from \"react\";\r\nimport { IModelApp, ScreenViewport } from \"@itwin/core-frontend\";\r\nimport { viewWithUnifiedSelection } from \"@itwin/presentation-components\";\r\nimport { ViewportComponent, ViewStateProp } from \"@itwin/imodel-components-react\";\r\nimport { FloatingViewportContentControl } from \"./ViewportContentControl\";\r\nimport { ContentViewManager } from \"./ContentViewManager\";\r\nimport { UiShowHideManager } from \"../utils/UiShowHideManager\";\r\nimport { ContentWrapper } from \"./ContentLayout\";\r\nimport { useRefs } from \"@itwin/core-react\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst FloatingViewport = viewWithUnifiedSelection(ViewportComponent);\r\n\r\n/**\r\n * @beta\r\n */\r\nexport interface FloatingViewportContentProps {\r\n /** callback used to construct context menu when user right-clicks on canvas/viewport */\r\n onContextMenu?: (e: React.MouseEvent) => boolean;\r\n /** viewport/content control uniqueId */\r\n contentId: string;\r\n /** The initial view state used to create the viewport, or a function that returns it (will refresh when the function changes) */\r\n initialViewState: ViewStateProp;\r\n /** Function to get a reference to the ScreenViewport */\r\n viewportRef?: React.Ref<ScreenViewport>;\r\n}\r\n\r\n/**\r\n * FloatingViewportContent component that creates its own [FloatingViewportContentControl].\r\n * This allows it to be recognized as an \"active\" content control so that tools operate on this\r\n * content.\r\n * @beta\r\n */\r\n// istanbul ignore next\r\nexport function FloatingViewportContent(props: FloatingViewportContentProps) { // eslint-disable-line @typescript-eslint/naming-convention\r\n const { contentId, initialViewState, viewportRef } = props;\r\n const [viewport, setViewport] = React.useState<ScreenViewport | undefined>();\r\n const contentControl = React.useRef<FloatingViewportContentControl | undefined>();\r\n\r\n const viewState = React.useMemo(() => typeof initialViewState === \"function\" ? initialViewState() : initialViewState, [initialViewState]);\r\n const ref = React.useCallback((v: ScreenViewport) => {\r\n setViewport(v);\r\n }, []);\r\n const onViewportRef = useRefs(ref, ...(viewportRef ? [viewportRef] : []));\r\n\r\n React.useEffect(() => {\r\n if (!contentControl.current) {\r\n contentControl.current = new FloatingViewportContentControl(contentId, contentId, null);\r\n ContentViewManager.addFloatingContentControl(contentControl.current);\r\n }\r\n return () => {\r\n if (contentControl.current) {\r\n ContentViewManager.dropFloatingContentControl(contentControl.current);\r\n contentControl.current = undefined;\r\n }\r\n };\r\n }, [contentId]);\r\n\r\n const viewPortControl = React.useMemo(() => {\r\n\r\n const node = <FloatingViewport\r\n viewportRef={onViewportRef}\r\n imodel={viewState.iModel}\r\n viewState={viewState}\r\n onContextMenu={props.onContextMenu}\r\n controlId={contentId}\r\n />;\r\n let control = node;\r\n\r\n if (!(node as React.ReactElement<any>).key) {\r\n const additionalProps: any = { key:contentId };\r\n control = React.cloneElement(node, additionalProps);\r\n }\r\n return control;\r\n\r\n }, [onViewportRef, props.onContextMenu, viewState, contentId]);\r\n\r\n React.useEffect(() => {\r\n if (viewport && contentControl.current) {\r\n contentControl.current.viewport = viewport;\r\n if (null === contentControl.current.reactNode) {\r\n contentControl.current.reactNode = viewPortControl;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n contentControl.current.viewport.changeView(viewState);\r\n }\r\n }, [viewState, viewPortControl, viewport]);\r\n\r\n React.useEffect(() => {\r\n const onViewClose = (vp: ScreenViewport) => {\r\n if (contentControl.current?.viewport === vp) {\r\n ContentViewManager.dropFloatingContentControl(contentControl.current);\r\n contentControl.current = undefined;\r\n }\r\n };\r\n return IModelApp.viewManager.onViewClose.addListener(onViewClose);\r\n }, []);\r\n\r\n return (\r\n <div onMouseMove={UiShowHideManager.handleContentMouseMove} className=\"uifw-dialog-imodel-content\" style={{ height: \"100%\", position: \"relative\" }}>\r\n <ContentWrapper content={viewPortControl} style={{ height: \"100%\", position: \"relative\" }} />\r\n </div>\r\n );\r\n}\r\n"]}
|
|
@@ -232,8 +232,6 @@ export declare class FrontstageDef {
|
|
|
232
232
|
get isReady(): boolean;
|
|
233
233
|
/** @internal */
|
|
234
234
|
saveChildWindowSizeAndPosition(childWindowId: string, childWindow: Window): void;
|
|
235
|
-
/** @internal */
|
|
236
|
-
setFloatingWidgetBoundsInternal(floatingWidgetId: string, bounds: RectangleProps, inhibitNineZoneStateChangedEvent?: boolean): void;
|
|
237
235
|
/** Method used to possibly change a Popout Widget back to a docked widget if the user was the one closing the popout's child
|
|
238
236
|
* window (i.e. UiFramework.childWindowManager.isClosingChildWindow === false).
|
|
239
237
|
* @internal
|
|
@@ -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,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,
|
|
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,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E;;;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;;;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;IAkBjF,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"}
|
|
@@ -25,6 +25,7 @@ const Frontstage_1 = require("./Frontstage");
|
|
|
25
25
|
const FrontstageManager_1 = require("./FrontstageManager");
|
|
26
26
|
const TimeTracker_1 = require("../configurableui/TimeTracker");
|
|
27
27
|
const PopoutWidget_1 = require("../childwindow/PopoutWidget");
|
|
28
|
+
const Frontstage_2 = require("../widget-panels/Frontstage");
|
|
28
29
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
29
30
|
const ContentDialogManager_1 = require("../dialog/ContentDialogManager");
|
|
30
31
|
const Widget_1 = require("../widgets/Widget");
|
|
@@ -840,17 +841,6 @@ class FrontstageDef {
|
|
|
840
841
|
const bounds = core_react_1.Rectangle.createFromSize({ width, height }).offset({ x: childWindow.screenX, y: childWindow.screenY });
|
|
841
842
|
widgetDef.popoutBounds = bounds;
|
|
842
843
|
}
|
|
843
|
-
/** @internal */
|
|
844
|
-
setFloatingWidgetBoundsInternal(floatingWidgetId, bounds, inhibitNineZoneStateChangedEvent = false) {
|
|
845
|
-
// istanbul ignore else
|
|
846
|
-
if (this.nineZoneState) {
|
|
847
|
-
const newState = (0, appui_layout_react_1.setFloatingWidgetContainerBounds)(this.nineZoneState, floatingWidgetId, bounds);
|
|
848
|
-
if (inhibitNineZoneStateChangedEvent)
|
|
849
|
-
this._nineZoneState = newState; // set without triggering new render
|
|
850
|
-
else
|
|
851
|
-
this.nineZoneState = newState;
|
|
852
|
-
}
|
|
853
|
-
}
|
|
854
844
|
/** Method used to possibly change a Popout Widget back to a docked widget if the user was the one closing the popout's child
|
|
855
845
|
* window (i.e. UiFramework.childWindowManager.isClosingChildWindow === false).
|
|
856
846
|
* @internal
|
|
@@ -890,7 +880,17 @@ class FrontstageDef {
|
|
|
890
880
|
setFloatingWidgetContainerBounds(floatingWidgetId, bounds) {
|
|
891
881
|
if (!this.nineZoneState || !(floatingWidgetId in this.nineZoneState.floatingWidgets.byId))
|
|
892
882
|
return false;
|
|
893
|
-
this.
|
|
883
|
+
let state = (0, Frontstage_2.FrameworkStateReducer)(this.nineZoneState, {
|
|
884
|
+
type: "FLOATING_WIDGET_SET_BOUNDS",
|
|
885
|
+
id: floatingWidgetId,
|
|
886
|
+
bounds,
|
|
887
|
+
}, this);
|
|
888
|
+
state = (0, Frontstage_2.FrameworkStateReducer)(state, {
|
|
889
|
+
type: "FLOATING_WIDGET_SET_USER_SIZED",
|
|
890
|
+
id: floatingWidgetId,
|
|
891
|
+
userSized: true,
|
|
892
|
+
}, this);
|
|
893
|
+
this.nineZoneState = state;
|
|
894
894
|
return true;
|
|
895
895
|
}
|
|
896
896
|
getFloatingWidgetContainerIds() {
|