@itwin/appui-react 5.8.0 → 5.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/lib/appui-react/content/ContentLayout.d.ts.map +1 -1
- package/lib/appui-react/content/ContentLayout.js +3 -2
- package/lib/appui-react/content/ContentLayout.js.map +1 -1
- package/lib/appui-react/hooks/useSafeContext.d.ts +7 -0
- package/lib/appui-react/hooks/useSafeContext.d.ts.map +1 -0
- package/lib/appui-react/hooks/useSafeContext.js +17 -0
- package/lib/appui-react/hooks/useSafeContext.js.map +1 -0
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.d.ts +2 -2
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.js +2 -1
- package/lib/appui-react/toolbar/new-toolbars/ActionItem.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/CustomItem.d.ts +2 -2
- package/lib/appui-react/toolbar/new-toolbars/CustomItem.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/CustomItem.js +3 -2
- package/lib/appui-react/toolbar/new-toolbars/CustomItem.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts +2 -3
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.js +6 -7
- package/lib/appui-react/toolbar/new-toolbars/GroupItem.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Item.d.ts +3 -5
- package/lib/appui-react/toolbar/new-toolbars/Item.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Item.js +15 -19
- package/lib/appui-react/toolbar/new-toolbars/Item.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/OverflowButton.d.ts +0 -1
- package/lib/appui-react/toolbar/new-toolbars/OverflowButton.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/OverflowButton.js +3 -2
- package/lib/appui-react/toolbar/new-toolbars/OverflowButton.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Separator.d.ts +8 -0
- package/lib/appui-react/toolbar/new-toolbars/Separator.d.ts.map +1 -0
- package/lib/appui-react/toolbar/new-toolbars/Separator.js +19 -0
- package/lib/appui-react/toolbar/new-toolbars/Separator.js.map +1 -0
- package/lib/appui-react/toolbar/new-toolbars/Separator.scss +32 -0
- package/lib/appui-react/toolbar/new-toolbars/Surface.d.ts +5 -3
- package/lib/appui-react/toolbar/new-toolbars/Surface.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Surface.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Surface.scss +4 -2
- package/lib/appui-react/toolbar/new-toolbars/ToolGroup.d.ts +0 -5
- package/lib/appui-react/toolbar/new-toolbars/ToolGroup.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/ToolGroup.js +50 -19
- package/lib/appui-react/toolbar/new-toolbars/ToolGroup.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.d.ts +5 -0
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.d.ts.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.js +45 -12
- package/lib/appui-react/toolbar/new-toolbars/Toolbar.js.map +1 -1
- package/lib/appui-react/toolbar/new-toolbars/useOverflow.js +2 -2
- package/lib/appui-react/toolbar/new-toolbars/useOverflow.js.map +1 -1
- package/lib/appui-react/widget-panels/useWidgetDirection.d.ts +1 -1
- package/lib/appui-react/widget-panels/useWidgetDirection.js +1 -1
- package/lib/appui-react/widget-panels/useWidgetDirection.js.map +1 -1
- package/lib/appui-react/widgets/useWidget.d.ts +5 -1
- package/lib/appui-react/widgets/useWidget.d.ts.map +1 -1
- package/lib/appui-react/widgets/useWidget.js +5 -1
- package/lib/appui-react/widgets/useWidget.js.map +1 -1
- package/lib/cjs/appui-react/toolbar/new-toolbars/Separator.scss +32 -0
- package/lib/cjs/appui-react/toolbar/new-toolbars/Surface.scss +4 -2
- package/lib/esm/appui-react/toolbar/new-toolbars/Separator.scss +32 -0
- package/lib/esm/appui-react/toolbar/new-toolbars/Surface.scss +4 -2
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Change Log - @itwin/appui-react
|
|
2
2
|
|
|
3
|
+
## 5.9.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8dc0f72: Fix active strip edge case with single vs multiple viewports
|
|
8
|
+
- @itwin/components-react@5.9.1
|
|
9
|
+
- @itwin/core-react@5.9.1
|
|
10
|
+
- @itwin/imodel-components-react@5.9.1
|
|
11
|
+
|
|
12
|
+
## 5.9.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- 1be3f19: Bump the release tag of `useWidget` and `useWidgetDirection` hooks from `@alpha` to `@public`.
|
|
17
|
+
- 6e9d137: Update `Toolbar` component to render a separator between items of different groups. This is a visual change based on the previous toolbar implementation.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [1be3f19]
|
|
22
|
+
- @itwin/imodel-components-react@5.9.0
|
|
23
|
+
- @itwin/components-react@5.9.0
|
|
24
|
+
- @itwin/core-react@5.9.0
|
|
25
|
+
|
|
3
26
|
## 5.8.0
|
|
4
27
|
|
|
5
28
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.d.ts","sourceRoot":"","sources":["../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAE9B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAA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AO,CAAC,UAAU,CAAC,CAAc;IAEjC,iCAAiC;IAC1B,EAAE,EAAE,MAAM,CAAM;IACvB,iCAAiC;IAC1B,WAAW,EAAE,MAAM,CAAM;gBACpB,WAAW,EAAE,kBAAkB;IAO3C,8CAA8C;IAC9C,IAAW,SAAS,IAAI,WAAW,GAAG,SAAS,CAE9C;IAED;;OAEG;IACI,MAAM,IAAI,kBAAkB;IAInC;;OAEG;IACI,mBAAmB,CACxB,YAAY,EAAE,KAAK,CAAC,SAAS,EAAE,EAC/B,SAAS,EAAE,OAAO,GACjB,KAAK,CAAC,SAAS,GAAG,SAAS;IAiB9B,qEAAqE;IAC9D,qBAAqB,IAAI,MAAM,EAAE;IAmBxC,OAAO,CAAC,gCAAgC;IA+BxC,OAAO,CAAC,8BAA8B;IAgCtC,gBAAgB;WACF,WAAW,CACvB,WAAW,EAAE,mBAAmB,GAC/B,WAAW,GAAG,SAAS;CAS3B;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,aAAa,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;;GAGG;AAEH,qBAAa,2BAA4B,SAAQ,OAAO,CAAC,+BAA+B,CAAC;CAAG;AAE5F;;GAEG;AAEH,MAAM,WAAW,2BAA4B,SAAQ,WAAW;IAC9D,aAAa,EAAE,gBAAgB,CAAC;IAChC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,2BAA2B,4BAsD/D"}
|
|
@@ -59,8 +59,9 @@ export function ContentWrapper(props) {
|
|
|
59
59
|
setHasMultipleContents((activeFrontstageDef &&
|
|
60
60
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
61
61
|
!!activeFrontstageDef.floatingContentControls?.length) ||
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
63
|
+
(activeFrontstageDef?.contentGroup?.getContentControls().length ??
|
|
64
|
+
0) > 1);
|
|
64
65
|
});
|
|
65
66
|
}, [activeFrontstageDef, content]);
|
|
66
67
|
const handleMouseDown = React.useCallback(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAUtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;IACrD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAClD,4DAA4D;QAC5D,OAAO,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,CACxB,cAA+B,EACX,EAAE;QACtB,IAAI,SAA6B,CAAC;QAClC,IAAI,cAAc,IAAK,cAA0C,CAAC,GAAG,EAAE,CAAC;YACtE,MAAM,G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BAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC/C,gBAAgB,CACa,CAC5B,CACP,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAC9C,SAAS,CACV,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,2BAA2B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\nimport \"./ContentLayout.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/components-react\";\nimport { SplitPane } from \"./split-pane/SplitPane.js\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ContentGroup } from \"./ContentGroup.js\";\nimport type {\n ContentLayoutProps,\n LayoutFragmentProps,\n LayoutHorizontalSplitProps,\n LayoutSplitPropsBase,\n LayoutVerticalSplitProps,\n} from \"./ContentLayoutProps.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { ContentOverlay, useContentOverlayStore } from \"./ContentOverlay.js\";\nimport { useConditionalValue } from \"../hooks/useConditionalValue.js\";\n\n/** Properties for [[ContentWrapper]] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface ContentWrapperProps extends CommonProps {\n content: React.ReactNode;\n contentIndex: number | undefined;\n}\n\n/** ContentWrapper React component.\n * @internal\n */\nexport function ContentWrapper(props: ContentWrapperProps) {\n const { content, contentIndex } = props;\n const activeFrontstageDef = useActiveFrontstageDef();\n const [isActive, setIsActive] = React.useState(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return content === UiFramework.content.getActive();\n });\n\n const contentControlKey = (\n contentControl: React.ReactNode\n ): string | undefined => {\n let controlId: string | undefined;\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\n const key = (contentControl as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n controlId = key.split(\"::\", 1)[0];\n }\n return controlId;\n };\n\n const [hasMultipleContents, setHasMultipleContents] = React.useState(\n () =>\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1\n );\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setIsActive(content === UiFramework.content.getActive());\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onActiveContentChangedEvent.addListener(\n (args) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentIsIdentical = content === args.activeContent;\n if (contentIsIdentical) {\n setIsActive(contentIsIdentical);\n } else {\n const contentId = contentControlKey(content);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const activeContentId = contentControlKey(args.activeContent);\n setIsActive(!!contentId && contentId === activeContentId);\n }\n\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n (activeFrontstageDef?.contentGroup?.contentPropsList.length ?? 0) >\n 1\n );\n }\n );\n }, [activeFrontstageDef, content]);\n\n const handleMouseDown = React.useCallback(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.setActive(content);\n setIsActive(true);\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onAvailableContentChangedEvent.addListener(\n () => {\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef]);\n\n const renderActiveStrip = useRenderActiveStrip(contentIndex);\n const contentOverlays = useContentOverlayStore();\n\n const active =\n renderActiveStrip !== undefined\n ? renderActiveStrip\n : isActive && (hasMultipleContents || contentOverlays > 1);\n return (\n <ContentOverlay\n className={classnames(\"uifw-contentlayout-wrapper\", props.className)}\n style={props.style}\n active={active}\n onMouseDown={handleMouseDown}\n role=\"presentation\"\n >\n {content}\n </ContentOverlay>\n );\n}\n\nfunction useRenderActiveStrip(contentIndex: number | undefined) {\n const contentGroup = React.useContext(ContentLayoutContext);\n const contentProps =\n contentIndex === undefined\n ? undefined\n : contentGroup?.contentPropsList[contentIndex];\n const renderActiveStrip = contentProps?.renderActiveStrip;\n const getValue = React.useCallback(() => {\n if (renderActiveStrip === undefined) return undefined;\n if (typeof renderActiveStrip === \"boolean\") return renderActiveStrip;\n return renderActiveStrip.getValue();\n }, [renderActiveStrip]);\n const eventIds = React.useMemo(() => {\n if (renderActiveStrip === undefined) return [];\n if (typeof renderActiveStrip === \"boolean\") return [];\n return renderActiveStrip.eventIds;\n }, [renderActiveStrip]);\n return useConditionalValue(getValue, eventIds);\n}\n\n/** Properties for the [[SplitContainer]] component */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface SplitContainerProps extends CommonProps {\n contentA: React.ReactNode;\n contentB: React.ReactNode;\n orientation: Orientation;\n percentage: number;\n resizable: boolean;\n minSizeTopLeft: number;\n minSizeBottomRight: number;\n splitterStateId?: string;\n onSplitterChange?: (size: number, percentage: number) => void;\n}\n\n/** Split Container class.\n */\nclass SplitContainer extends React.Component<SplitContainerProps> {\n private _containerDiv: HTMLDivElement | null = null;\n\n constructor(props: SplitContainerProps) {\n super(props);\n }\n\n private _onSplitterChange = (size: number): void => {\n let percentage = 0;\n\n if (this._containerDiv && size > 0) {\n if (this.props.orientation === Orientation.Horizontal) {\n const height = this._containerDiv.getBoundingClientRect().height;\n if (height > 0) percentage = size / height;\n } else {\n const width = this._containerDiv.getBoundingClientRect().width;\n if (width > 0) percentage = size / width;\n }\n\n if (this.props.onSplitterChange)\n this.props.onSplitterChange(size, percentage);\n }\n };\n\n public override render(): React.ReactNode {\n const orientation =\n this.props.orientation === Orientation.Horizontal\n ? \"horizontal\"\n : \"vertical\";\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\n const minSizeTopLeft = this.props.minSizeTopLeft;\n const minSizeBottomRight = -this.props.minSizeBottomRight;\n\n return (\n <div\n ref={(e) => {\n this._containerDiv = e;\n }}\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n >\n <SplitPane\n split={orientation}\n minSize={minSizeTopLeft}\n maxSize={minSizeBottomRight}\n defaultSize={defaultSize}\n onChange={this._onSplitterChange}\n allowResize={this.props.resizable}\n >\n {this.props.contentA}\n {this.props.contentB}\n </SplitPane>\n </div>\n );\n }\n}\n\n/** Properties for [[SingleContentContainer]] component\n */\ninterface SingleContentProps\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n extends CommonProps,\n Pick<ContentWrapperProps, \"contentIndex\"> {\n content: React.ReactNode;\n}\n\n/** Single Content Container class. */\nclass SingleContentContainer extends React.Component<SingleContentProps> {\n public override render(): React.ReactNode {\n return (\n <div\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n data-testid=\"single-content-container\"\n >\n <ContentWrapper\n content={this.props.content}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={this.props.contentIndex}\n />\n </div>\n );\n }\n}\n\n/** Common interface for HorizontalSplit and VerticalSplit. */\ninterface LayoutSplit {\n createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode;\n isLocked: boolean;\n}\n\n/** Minimum split size */\nconst MIN_SPLIT_SIZE = 6;\n\n/** Base Split class.\n */\nclass BaseSplit {\n public defaultPercentage: number;\n public stateId: string = \"\";\n public isLocked: boolean = false;\n\n constructor(props: LayoutSplitPropsBase) {\n this.defaultPercentage = props.percentage;\n\n if (props.id) this.stateId = props.id;\n\n if (props.lock) this.isLocked = props.lock;\n }\n}\n\n/** Horizontal Split class.\n */\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\n private _topIndex: number = -1;\n private _bottomIndex: number = -1;\n private _topSplit?: LayoutSplit;\n private _bottomSplit?: LayoutSplit;\n private _props: LayoutHorizontalSplitProps;\n private _minSizeTop: number = MIN_SPLIT_SIZE;\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutHorizontalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.top === \"number\") {\n this._topIndex = props.top;\n } else {\n this._topSplit = ContentLayoutDef.createSplit(props.top);\n }\n\n if (typeof props.bottom === \"number\") {\n this._bottomIndex = props.bottom;\n } else {\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\n }\n\n if (props.minSizeTop)\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\n\n if (props.minSizeBottom)\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const topContent = !this._topSplit ? (\n <ContentWrapper\n content={contentNodes[this._topIndex]}\n contentIndex={this._topIndex}\n />\n ) : (\n this._topSplit.createContentContainer(contentNodes, resizable)\n );\n const bottomContent = !this._bottomSplit ? (\n <ContentWrapper\n content={contentNodes[this._bottomIndex]}\n contentIndex={this._bottomIndex}\n />\n ) : (\n this._bottomSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={topContent}\n contentB={bottomContent}\n orientation={Orientation.Horizontal}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeTop}\n minSizeBottomRight={this._minSizeBottom}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Vertical Split class.\n */\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\n private _leftIndex: number = -1;\n private _rightIndex: number = -1;\n private _leftSplit?: LayoutSplit;\n private _rightSplit?: LayoutSplit;\n private _props: LayoutVerticalSplitProps;\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\n private _minSizeRight: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutVerticalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.left === \"number\") {\n this._leftIndex = props.left;\n } else {\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\n }\n\n if (typeof props.right === \"number\") {\n this._rightIndex = props.right;\n } else {\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\n }\n\n if (props.minSizeLeft)\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\n\n if (props.minSizeRight)\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const leftContent = !this._leftSplit ? (\n <ContentWrapper\n content={contentNodes[this._leftIndex]}\n contentIndex={this._leftIndex}\n />\n ) : (\n this._leftSplit.createContentContainer(contentNodes, resizable)\n );\n const rightContent = !this._rightSplit ? (\n <ContentWrapper\n content={contentNodes[this._rightIndex]}\n contentIndex={this._rightIndex}\n />\n ) : (\n this._rightSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={leftContent}\n contentB={rightContent}\n orientation={Orientation.Vertical}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeLeft}\n minSizeBottomRight={this._minSizeRight}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Content Layout Definition class.\n * @public\n */\nexport class ContentLayoutDef {\n private _layoutProps: ContentLayoutProps;\n private _rootSplit?: LayoutSplit;\n\n /** ID for this Content Layout */\n public id: string = \"\";\n /** Description of the layout. */\n public description: string = \"\";\n constructor(layoutProps: ContentLayoutProps) {\n this._layoutProps = layoutProps;\n this.id = layoutProps.id;\n if (layoutProps.description !== undefined)\n this.description = layoutProps.description;\n }\n\n /** @deprecated in 4.16.0. Used internally. */\n public get rootSplit(): LayoutSplit | undefined {\n return this._rootSplit;\n }\n\n /** Creates [[ContentLayoutProps]] for JSON purposes\n * @public\n */\n public toJSON(): ContentLayoutProps {\n return this._layoutProps;\n }\n\n /** Fill a layout container with React nodes for each content view.\n * @deprecated in 4.16.0. Used internally.\n */\n public fillLayoutContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode | undefined {\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (this.rootSplit) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.rootSplit.createContentContainer(contentNodes, resizable);\n }\n\n if (contentNodes.length > 0)\n return (\n <SingleContentContainer content={contentNodes[0]} contentIndex={0} />\n );\n\n return undefined;\n }\n\n /** Gets the indexes of content views used in this Content Layout. */\n public getUsedContentIndexes(): number[] {\n let allContentIndexes: number[] = [];\n\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\n allContentIndexes.push(0);\n else {\n allContentIndexes = allContentIndexes.concat(\n this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit)\n );\n allContentIndexes = allContentIndexes.concat(\n this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit)\n );\n }\n\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\n\n return uniqueContentIndexes;\n }\n\n private getHorizontalSplitContentIndexes(\n splitProps?: LayoutHorizontalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.top === \"number\") contentIndexes.push(splitProps.top);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit)\n );\n }\n\n if (typeof splitProps.bottom === \"number\")\n contentIndexes.push(splitProps.bottom);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n private getVerticalSplitContentIndexes(\n splitProps?: LayoutVerticalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.left === \"number\")\n contentIndexes.push(splitProps.left);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit)\n );\n }\n\n if (typeof splitProps.right === \"number\")\n contentIndexes.push(splitProps.right);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n /** @internal */\n public static createSplit(\n fragmentDef: LayoutFragmentProps\n ): LayoutSplit | undefined {\n if (fragmentDef.horizontalSplit) {\n return new HorizontalSplit(fragmentDef.horizontalSplit);\n } else if (fragmentDef.verticalSplit) {\n return new VerticalSplit(fragmentDef.verticalSplit);\n }\n\n return undefined;\n }\n}\n\n/** Content Layout Activated Event Args class.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ContentLayoutActivatedEventArgs {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout Activated Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> {}\n\n/** Properties for the [[ContentLayout]] React component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ContentLayoutComponentProps extends CommonProps {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout React component.\n * @public\n */\nexport function ContentLayout(props: ContentLayoutComponentProps) {\n const [contentLayoutDef, setContentLayoutDef] =\n React.useState<ContentLayoutDef>(props.contentLayout);\n const [contentGroupId, setContentGroupId] = React.useState<\n ContentGroup[\"id\"]\n >(props.contentGroup.groupId);\n const [contentGroup, setContentGroup] = React.useState<ContentGroup>(\n props.contentGroup\n );\n const [contentNodes, setContentNodes] = React.useState<React.ReactNode[]>(\n () => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return props.contentGroup.getContentNodes();\n }\n );\n\n React.useEffect(() => {\n return UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(\n (args) => {\n setContentLayoutDef(args.contentLayout);\n setContentGroupId(args.contentGroup.groupId);\n setContentGroup(args.contentGroup);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setContentNodes(args.contentGroup.getContentNodes());\n }\n );\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n if (!contentContainer) return null;\n\n return (\n <div\n id=\"uifw-contentlayout-div\"\n className={props.className}\n style={props.style}\n key={`${contentGroupId}-${contentLayoutDef.id}`}\n onMouseDown={() => {\n UiFramework.content.setMouseDown(true);\n }}\n onMouseUp={() => {\n UiFramework.content.setMouseDown(false);\n }}\n role=\"presentation\"\n >\n <ContentLayoutContext.Provider value={contentGroup}>\n {contentContainer}\n </ContentLayoutContext.Provider>\n </div>\n );\n}\n\nconst ContentLayoutContext = React.createContext<ContentGroup | undefined>(\n undefined\n);\nContentLayoutContext.displayName = \"uifw:ContentLayoutContext\";\n"]}
|
|
1
|
+
{"version":3,"file":"ContentLayout.js","sourceRoot":"","sources":["../../../src/appui-react/content/ContentLayout.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,sBAAsB,CAAC;AAC9B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAUtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACxC,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;IACrD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE;QAClD,4DAA4D;QAC5D,OAAO,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,CACxB,cAA+B,EACX,EAAE;QACtB,IAAI,SAA6B,CAAC;QAClC,IAAI,cAAc,IAAK,cAA0C,CAAC,GAAG,EAAE,CAAC;YACtE,MAAM,GAAG,GA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,cAAc;QAEnB,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,IAC/C,gBAAgB,CACa,CAC5B,CACP,CAAC;AACJ,CAAC;AAED,MAAM,oBAAoB,GAAG,KAAK,CAAC,aAAa,CAC9C,SAAS,CACV,CAAC;AACF,oBAAoB,CAAC,WAAW,GAAG,2BAA2B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ContentView\n */\n\nimport \"./ContentLayout.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { UiEvent } from \"@itwin/appui-abstract\";\nimport { Orientation } from \"@itwin/components-react\";\nimport { SplitPane } from \"./split-pane/SplitPane.js\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport type { ContentGroup } from \"./ContentGroup.js\";\nimport type {\n ContentLayoutProps,\n LayoutFragmentProps,\n LayoutHorizontalSplitProps,\n LayoutSplitPropsBase,\n LayoutVerticalSplitProps,\n} from \"./ContentLayoutProps.js\";\nimport { useActiveFrontstageDef } from \"../frontstage/FrontstageDef.js\";\nimport { UiFramework } from \"../UiFramework.js\";\nimport { ContentOverlay, useContentOverlayStore } from \"./ContentOverlay.js\";\nimport { useConditionalValue } from \"../hooks/useConditionalValue.js\";\n\n/** Properties for [[ContentWrapper]] */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface ContentWrapperProps extends CommonProps {\n content: React.ReactNode;\n contentIndex: number | undefined;\n}\n\n/** ContentWrapper React component.\n * @internal\n */\nexport function ContentWrapper(props: ContentWrapperProps) {\n const { content, contentIndex } = props;\n const activeFrontstageDef = useActiveFrontstageDef();\n const [isActive, setIsActive] = React.useState(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return content === UiFramework.content.getActive();\n });\n\n const contentControlKey = (\n contentControl: React.ReactNode\n ): string | undefined => {\n let controlId: string | undefined;\n if (contentControl && (contentControl as React.ReactElement<any>).key) {\n const key = (contentControl as React.ReactElement<any>).key as string;\n // key has format `${contentProps.id}::${this.groupId}` which is stored as unique id\n controlId = key.split(\"::\", 1)[0];\n }\n return controlId;\n };\n\n const [hasMultipleContents, setHasMultipleContents] = React.useState(\n () =>\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ?? 0) > 1\n );\n\n React.useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setIsActive(content === UiFramework.content.getActive());\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onActiveContentChangedEvent.addListener(\n (args) => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentIsIdentical = content === args.activeContent;\n if (contentIsIdentical) {\n setIsActive(contentIsIdentical);\n } else {\n const contentId = contentControlKey(content);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const activeContentId = contentControlKey(args.activeContent);\n setIsActive(!!contentId && contentId === activeContentId);\n }\n\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef, content]);\n\n const handleMouseDown = React.useCallback(() => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n UiFramework.content.setActive(content);\n setIsActive(true);\n }, [content]);\n\n React.useEffect(() => {\n return UiFramework.content.onAvailableContentChangedEvent.addListener(\n () => {\n setHasMultipleContents(\n (activeFrontstageDef &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n !!activeFrontstageDef.floatingContentControls?.length) ||\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (activeFrontstageDef?.contentGroup?.getContentControls().length ??\n 0) > 1\n );\n }\n );\n }, [activeFrontstageDef]);\n\n const renderActiveStrip = useRenderActiveStrip(contentIndex);\n const contentOverlays = useContentOverlayStore();\n\n const active =\n renderActiveStrip !== undefined\n ? renderActiveStrip\n : isActive && (hasMultipleContents || contentOverlays > 1);\n return (\n <ContentOverlay\n className={classnames(\"uifw-contentlayout-wrapper\", props.className)}\n style={props.style}\n active={active}\n onMouseDown={handleMouseDown}\n role=\"presentation\"\n >\n {content}\n </ContentOverlay>\n );\n}\n\nfunction useRenderActiveStrip(contentIndex: number | undefined) {\n const contentGroup = React.useContext(ContentLayoutContext);\n const contentProps =\n contentIndex === undefined\n ? undefined\n : contentGroup?.contentPropsList[contentIndex];\n const renderActiveStrip = contentProps?.renderActiveStrip;\n const getValue = React.useCallback(() => {\n if (renderActiveStrip === undefined) return undefined;\n if (typeof renderActiveStrip === \"boolean\") return renderActiveStrip;\n return renderActiveStrip.getValue();\n }, [renderActiveStrip]);\n const eventIds = React.useMemo(() => {\n if (renderActiveStrip === undefined) return [];\n if (typeof renderActiveStrip === \"boolean\") return [];\n return renderActiveStrip.eventIds;\n }, [renderActiveStrip]);\n return useConditionalValue(getValue, eventIds);\n}\n\n/** Properties for the [[SplitContainer]] component */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\ninterface SplitContainerProps extends CommonProps {\n contentA: React.ReactNode;\n contentB: React.ReactNode;\n orientation: Orientation;\n percentage: number;\n resizable: boolean;\n minSizeTopLeft: number;\n minSizeBottomRight: number;\n splitterStateId?: string;\n onSplitterChange?: (size: number, percentage: number) => void;\n}\n\n/** Split Container class.\n */\nclass SplitContainer extends React.Component<SplitContainerProps> {\n private _containerDiv: HTMLDivElement | null = null;\n\n constructor(props: SplitContainerProps) {\n super(props);\n }\n\n private _onSplitterChange = (size: number): void => {\n let percentage = 0;\n\n if (this._containerDiv && size > 0) {\n if (this.props.orientation === Orientation.Horizontal) {\n const height = this._containerDiv.getBoundingClientRect().height;\n if (height > 0) percentage = size / height;\n } else {\n const width = this._containerDiv.getBoundingClientRect().width;\n if (width > 0) percentage = size / width;\n }\n\n if (this.props.onSplitterChange)\n this.props.onSplitterChange(size, percentage);\n }\n };\n\n public override render(): React.ReactNode {\n const orientation =\n this.props.orientation === Orientation.Horizontal\n ? \"horizontal\"\n : \"vertical\";\n const defaultSize = `${(this.props.percentage * 100).toString()}%`;\n const minSizeTopLeft = this.props.minSizeTopLeft;\n const minSizeBottomRight = -this.props.minSizeBottomRight;\n\n return (\n <div\n ref={(e) => {\n this._containerDiv = e;\n }}\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n >\n <SplitPane\n split={orientation}\n minSize={minSizeTopLeft}\n maxSize={minSizeBottomRight}\n defaultSize={defaultSize}\n onChange={this._onSplitterChange}\n allowResize={this.props.resizable}\n >\n {this.props.contentA}\n {this.props.contentB}\n </SplitPane>\n </div>\n );\n }\n}\n\n/** Properties for [[SingleContentContainer]] component\n */\ninterface SingleContentProps\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n extends CommonProps,\n Pick<ContentWrapperProps, \"contentIndex\"> {\n content: React.ReactNode;\n}\n\n/** Single Content Container class. */\nclass SingleContentContainer extends React.Component<SingleContentProps> {\n public override render(): React.ReactNode {\n return (\n <div\n className={classnames(\n \"uifw-contentlayout-full-size\",\n this.props.className\n )}\n style={this.props.style}\n data-testid=\"single-content-container\"\n >\n <ContentWrapper\n content={this.props.content}\n style={{ height: \"100%\", position: \"relative\" }}\n contentIndex={this.props.contentIndex}\n />\n </div>\n );\n }\n}\n\n/** Common interface for HorizontalSplit and VerticalSplit. */\ninterface LayoutSplit {\n createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode;\n isLocked: boolean;\n}\n\n/** Minimum split size */\nconst MIN_SPLIT_SIZE = 6;\n\n/** Base Split class.\n */\nclass BaseSplit {\n public defaultPercentage: number;\n public stateId: string = \"\";\n public isLocked: boolean = false;\n\n constructor(props: LayoutSplitPropsBase) {\n this.defaultPercentage = props.percentage;\n\n if (props.id) this.stateId = props.id;\n\n if (props.lock) this.isLocked = props.lock;\n }\n}\n\n/** Horizontal Split class.\n */\nclass HorizontalSplit extends BaseSplit implements LayoutSplit {\n private _topIndex: number = -1;\n private _bottomIndex: number = -1;\n private _topSplit?: LayoutSplit;\n private _bottomSplit?: LayoutSplit;\n private _props: LayoutHorizontalSplitProps;\n private _minSizeTop: number = MIN_SPLIT_SIZE;\n private _minSizeBottom: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutHorizontalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.top === \"number\") {\n this._topIndex = props.top;\n } else {\n this._topSplit = ContentLayoutDef.createSplit(props.top);\n }\n\n if (typeof props.bottom === \"number\") {\n this._bottomIndex = props.bottom;\n } else {\n this._bottomSplit = ContentLayoutDef.createSplit(props.bottom);\n }\n\n if (props.minSizeTop)\n this._minSizeTop = Math.max(props.minSizeTop, MIN_SPLIT_SIZE);\n\n if (props.minSizeBottom)\n this._minSizeBottom = Math.max(props.minSizeBottom, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const topContent = !this._topSplit ? (\n <ContentWrapper\n content={contentNodes[this._topIndex]}\n contentIndex={this._topIndex}\n />\n ) : (\n this._topSplit.createContentContainer(contentNodes, resizable)\n );\n const bottomContent = !this._bottomSplit ? (\n <ContentWrapper\n content={contentNodes[this._bottomIndex]}\n contentIndex={this._bottomIndex}\n />\n ) : (\n this._bottomSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={topContent}\n contentB={bottomContent}\n orientation={Orientation.Horizontal}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeTop}\n minSizeBottomRight={this._minSizeBottom}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Vertical Split class.\n */\nclass VerticalSplit extends BaseSplit implements LayoutSplit {\n private _leftIndex: number = -1;\n private _rightIndex: number = -1;\n private _leftSplit?: LayoutSplit;\n private _rightSplit?: LayoutSplit;\n private _props: LayoutVerticalSplitProps;\n private _minSizeLeft: number = MIN_SPLIT_SIZE;\n private _minSizeRight: number = MIN_SPLIT_SIZE;\n\n constructor(props: LayoutVerticalSplitProps) {\n super(props);\n\n this._props = props;\n\n if (typeof props.left === \"number\") {\n this._leftIndex = props.left;\n } else {\n this._leftSplit = ContentLayoutDef.createSplit(props.left);\n }\n\n if (typeof props.right === \"number\") {\n this._rightIndex = props.right;\n } else {\n this._rightSplit = ContentLayoutDef.createSplit(props.right);\n }\n\n if (props.minSizeLeft)\n this._minSizeLeft = Math.max(props.minSizeLeft, MIN_SPLIT_SIZE);\n\n if (props.minSizeRight)\n this._minSizeRight = Math.max(props.minSizeRight, MIN_SPLIT_SIZE);\n }\n\n private _handleSplitterChange = (_size: number, percentage: number): void => {\n this._props.percentage = percentage;\n };\n\n public createContentContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode {\n if (this.isLocked) resizable = false;\n\n const leftContent = !this._leftSplit ? (\n <ContentWrapper\n content={contentNodes[this._leftIndex]}\n contentIndex={this._leftIndex}\n />\n ) : (\n this._leftSplit.createContentContainer(contentNodes, resizable)\n );\n const rightContent = !this._rightSplit ? (\n <ContentWrapper\n content={contentNodes[this._rightIndex]}\n contentIndex={this._rightIndex}\n />\n ) : (\n this._rightSplit.createContentContainer(contentNodes, resizable)\n );\n\n return (\n <SplitContainer\n contentA={leftContent}\n contentB={rightContent}\n orientation={Orientation.Vertical}\n percentage={this.defaultPercentage}\n resizable={resizable}\n minSizeTopLeft={this._minSizeLeft}\n minSizeBottomRight={this._minSizeRight}\n splitterStateId={this.stateId}\n onSplitterChange={this._handleSplitterChange}\n />\n );\n }\n}\n\n/** Content Layout Definition class.\n * @public\n */\nexport class ContentLayoutDef {\n private _layoutProps: ContentLayoutProps;\n private _rootSplit?: LayoutSplit;\n\n /** ID for this Content Layout */\n public id: string = \"\";\n /** Description of the layout. */\n public description: string = \"\";\n constructor(layoutProps: ContentLayoutProps) {\n this._layoutProps = layoutProps;\n this.id = layoutProps.id;\n if (layoutProps.description !== undefined)\n this.description = layoutProps.description;\n }\n\n /** @deprecated in 4.16.0. Used internally. */\n public get rootSplit(): LayoutSplit | undefined {\n return this._rootSplit;\n }\n\n /** Creates [[ContentLayoutProps]] for JSON purposes\n * @public\n */\n public toJSON(): ContentLayoutProps {\n return this._layoutProps;\n }\n\n /** Fill a layout container with React nodes for each content view.\n * @deprecated in 4.16.0. Used internally.\n */\n public fillLayoutContainer(\n contentNodes: React.ReactNode[],\n resizable: boolean\n ): React.ReactNode | undefined {\n this._rootSplit = ContentLayoutDef.createSplit(this._layoutProps);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n if (this.rootSplit) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return this.rootSplit.createContentContainer(contentNodes, resizable);\n }\n\n if (contentNodes.length > 0)\n return (\n <SingleContentContainer content={contentNodes[0]} contentIndex={0} />\n );\n\n return undefined;\n }\n\n /** Gets the indexes of content views used in this Content Layout. */\n public getUsedContentIndexes(): number[] {\n let allContentIndexes: number[] = [];\n\n if (!this._layoutProps.horizontalSplit && !this._layoutProps.verticalSplit)\n allContentIndexes.push(0);\n else {\n allContentIndexes = allContentIndexes.concat(\n this.getHorizontalSplitContentIndexes(this._layoutProps.horizontalSplit)\n );\n allContentIndexes = allContentIndexes.concat(\n this.getVerticalSplitContentIndexes(this._layoutProps.verticalSplit)\n );\n }\n\n const uniqueContentIndexes = [...new Set(allContentIndexes)];\n\n return uniqueContentIndexes;\n }\n\n private getHorizontalSplitContentIndexes(\n splitProps?: LayoutHorizontalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.top === \"number\") contentIndexes.push(splitProps.top);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.top.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.top.verticalSplit)\n );\n }\n\n if (typeof splitProps.bottom === \"number\")\n contentIndexes.push(splitProps.bottom);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.bottom.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.bottom.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n private getVerticalSplitContentIndexes(\n splitProps?: LayoutVerticalSplitProps\n ): number[] {\n let contentIndexes: number[] = [];\n\n if (!splitProps) return contentIndexes;\n\n if (typeof splitProps.left === \"number\")\n contentIndexes.push(splitProps.left);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.left.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.left.verticalSplit)\n );\n }\n\n if (typeof splitProps.right === \"number\")\n contentIndexes.push(splitProps.right);\n else {\n contentIndexes = contentIndexes.concat(\n this.getHorizontalSplitContentIndexes(splitProps.right.horizontalSplit)\n );\n contentIndexes = contentIndexes.concat(\n this.getVerticalSplitContentIndexes(splitProps.right.verticalSplit)\n );\n }\n\n return contentIndexes;\n }\n\n /** @internal */\n public static createSplit(\n fragmentDef: LayoutFragmentProps\n ): LayoutSplit | undefined {\n if (fragmentDef.horizontalSplit) {\n return new HorizontalSplit(fragmentDef.horizontalSplit);\n } else if (fragmentDef.verticalSplit) {\n return new VerticalSplit(fragmentDef.verticalSplit);\n }\n\n return undefined;\n }\n}\n\n/** Content Layout Activated Event Args class.\n * @public\n * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.\n */\nexport interface ContentLayoutActivatedEventArgs {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout Activated Event class.\n * @public\n * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport class ContentLayoutActivatedEvent extends UiEvent<ContentLayoutActivatedEventArgs> {}\n\n/** Properties for the [[ContentLayout]] React component.\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/no-deprecated\nexport interface ContentLayoutComponentProps extends CommonProps {\n contentLayout: ContentLayoutDef;\n contentGroup: ContentGroup;\n}\n\n/** Content Layout React component.\n * @public\n */\nexport function ContentLayout(props: ContentLayoutComponentProps) {\n const [contentLayoutDef, setContentLayoutDef] =\n React.useState<ContentLayoutDef>(props.contentLayout);\n const [contentGroupId, setContentGroupId] = React.useState<\n ContentGroup[\"id\"]\n >(props.contentGroup.groupId);\n const [contentGroup, setContentGroup] = React.useState<ContentGroup>(\n props.contentGroup\n );\n const [contentNodes, setContentNodes] = React.useState<React.ReactNode[]>(\n () => {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return props.contentGroup.getContentNodes();\n }\n );\n\n React.useEffect(() => {\n return UiFramework.frontstages.onContentLayoutActivatedEvent.addListener(\n (args) => {\n setContentLayoutDef(args.contentLayout);\n setContentGroupId(args.contentGroup.groupId);\n setContentGroup(args.contentGroup);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n setContentNodes(args.contentGroup.getContentNodes());\n }\n );\n }, []);\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const contentContainer = contentLayoutDef.fillLayoutContainer(\n contentNodes,\n true\n );\n if (!contentContainer) return null;\n\n return (\n <div\n id=\"uifw-contentlayout-div\"\n className={props.className}\n style={props.style}\n key={`${contentGroupId}-${contentLayoutDef.id}`}\n onMouseDown={() => {\n UiFramework.content.setMouseDown(true);\n }}\n onMouseUp={() => {\n UiFramework.content.setMouseDown(false);\n }}\n role=\"presentation\"\n >\n <ContentLayoutContext.Provider value={contentGroup}>\n {contentContainer}\n </ContentLayoutContext.Provider>\n </div>\n );\n}\n\nconst ContentLayoutContext = React.createContext<ContentGroup | undefined>(\n undefined\n);\nContentLayoutContext.displayName = \"uifw:ContentLayoutContext\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSafeContext.d.ts","sourceRoot":"","sources":["../../../src/appui-react/hooks/useSafeContext.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAQ1D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Hooks
|
|
7
|
+
*/
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export function useSafeContext(context) {
|
|
11
|
+
const value = React.useContext(context);
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
throw new Error(`${context.displayName || "Context"} is undefined`);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=useSafeContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSafeContext.js","sourceRoot":"","sources":["../../../src/appui-react/hooks/useSafeContext.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gBAAgB;AAChB,MAAM,UAAU,cAAc,CAAI,OAAyB;IACzD,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAExC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,IAAI,SAAS,eAAe,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Hooks\n */\n\nimport * as React from \"react\";\n\n/** @internal */\nexport function useSafeContext<C>(context: React.Context<C>) {\n const value = React.useContext(context);\n\n if (value === undefined) {\n throw new Error(`${context.displayName || \"Context\"} is undefined`);\n }\n\n return value;\n}\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { ToolbarActionItem } from "../../toolbar/ToolbarItem.js";
|
|
6
|
-
|
|
7
|
-
export interface ActionItemProps {
|
|
6
|
+
interface ActionItemProps {
|
|
8
7
|
item: ToolbarActionItem;
|
|
9
8
|
}
|
|
10
9
|
/** @internal */
|
|
11
10
|
export declare const ActionItem: React.ForwardRefExoticComponent<ActionItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=ActionItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/ActionItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/ActionItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAOtE,UAAU,eAAe;IACvB,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,gBAAgB;AAChB,eAAO,MAAM,UAAU,2FAkBtB,CAAC"}
|
|
@@ -10,9 +10,10 @@ import { ToolGroupOverflowContext } from "./OverflowButton.js";
|
|
|
10
10
|
import { Item } from "./Item.js";
|
|
11
11
|
import { GroupMenuItem } from "./GroupItem.js";
|
|
12
12
|
import { ToolbarContext } from "./Toolbar.js";
|
|
13
|
+
import { useSafeContext } from "../../hooks/useSafeContext.js";
|
|
13
14
|
/** @internal */
|
|
14
15
|
export const ActionItem = React.forwardRef(function ActionItem({ item }, ref) {
|
|
15
|
-
const { onItemExecuted } =
|
|
16
|
+
const { onItemExecuted } = useSafeContext(ToolbarContext);
|
|
16
17
|
const overflowContext = React.useContext(ToolGroupOverflowContext);
|
|
17
18
|
if (overflowContext) {
|
|
18
19
|
return React.createElement(GroupMenuItem, { item: item, onClose: overflowContext.onClose });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionItem.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/ActionItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionItem.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/ActionItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAM/D,gBAAgB;AAChB,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CACxC,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG;IAC/B,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,wBAAwB,CAAC,CAAC;IACnE,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,oBAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,GAAI,CAAC;IACzE,CAAC;IACD,OAAO,CACL,oBAAC,IAAI,IACH,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,GACD,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport type { ToolbarActionItem } from \"../../toolbar/ToolbarItem.js\";\nimport { ToolGroupOverflowContext } from \"./OverflowButton.js\";\nimport { Item } from \"./Item.js\";\nimport { GroupMenuItem } from \"./GroupItem.js\";\nimport { ToolbarContext } from \"./Toolbar.js\";\nimport { useSafeContext } from \"../../hooks/useSafeContext.js\";\n\ninterface ActionItemProps {\n item: ToolbarActionItem;\n}\n\n/** @internal */\nexport const ActionItem = React.forwardRef<HTMLButtonElement, ActionItemProps>(\n function ActionItem({ item }, ref) {\n const { onItemExecuted } = useSafeContext(ToolbarContext);\n const overflowContext = React.useContext(ToolGroupOverflowContext);\n if (overflowContext) {\n return <GroupMenuItem item={item} onClose={overflowContext.onClose} />;\n }\n return (\n <Item\n ref={ref}\n item={item}\n onClick={() => {\n item.execute();\n onItemExecuted?.(item);\n }}\n />\n );\n }\n);\n"]}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { ToolbarCustomItem } from "../../toolbar/ToolbarItem.js";
|
|
6
|
-
|
|
7
|
-
export interface CustomItemProps {
|
|
6
|
+
interface CustomItemProps {
|
|
8
7
|
item: ToolbarCustomItem;
|
|
9
8
|
}
|
|
10
9
|
/** @internal */
|
|
11
10
|
export declare const CustomItem: React.ForwardRefExoticComponent<CustomItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=CustomItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/CustomItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/CustomItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAQtE,UAAU,eAAe;IACvB,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,gBAAgB;AAChB,eAAO,MAAM,UAAU,2FA2BtB,CAAC"}
|
|
@@ -12,10 +12,11 @@ import { Item } from "./Item.js";
|
|
|
12
12
|
import { GroupMenuItem, usePopoverPlacement } from "./GroupItem.js";
|
|
13
13
|
import { ToolGroupOverflowContext } from "./OverflowButton.js";
|
|
14
14
|
import { ToolbarContext } from "./Toolbar.js";
|
|
15
|
+
import { useSafeContext } from "../../hooks/useSafeContext.js";
|
|
15
16
|
/** @internal */
|
|
16
17
|
export const CustomItem = React.forwardRef(function CustomItem({ item }, ref) {
|
|
17
18
|
const placement = usePopoverPlacement();
|
|
18
|
-
const
|
|
19
|
+
const { setPopoverOpen } = useSafeContext(ToolbarContext);
|
|
19
20
|
const overflowContext = React.useContext(ToolGroupOverflowContext);
|
|
20
21
|
if (overflowContext) {
|
|
21
22
|
return React.createElement(GroupMenuItem, { item: item, onClose: overflowContext.onClose });
|
|
@@ -25,7 +26,7 @@ export const CustomItem = React.forwardRef(function CustomItem({ item }, ref) {
|
|
|
25
26
|
React.createElement(MenuExtraContent, { key: 0 }, item.panelContent),
|
|
26
27
|
];
|
|
27
28
|
}, placement: placement, onVisibleChange: (newVisible) => {
|
|
28
|
-
|
|
29
|
+
setPopoverOpen(newVisible);
|
|
29
30
|
} },
|
|
30
31
|
React.createElement(Item, { ref: ref, item: item },
|
|
31
32
|
React.createElement(ExpandIndicator, null))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomItem.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/CustomItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAA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AAO,EAAE,eAAe,CAAC,OAAO,GAAI,CAAC;IACzE,CAAC;IACD,OAAO,CACL,oBAAC,YAAY,IACX,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;gBACL,oBAAC,gBAAgB,IAAC,GAAG,EAAE,CAAC,IAAG,IAAI,CAAC,YAAY,CAAoB;aACjE,CAAC;QACJ,CAAC,EACD,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,CAAC,UAAU,EAAE,EAAE;YAC9B,cAAc,CAAC,UAAU,CAAC,CAAC;QAC7B,CAAC;QAED,oBAAC,IAAI,IAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI;YACxB,oBAAC,eAAe,OAAG,CACd,CACM,CAChB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport { DropdownMenu, MenuExtraContent } from \"@itwin/itwinui-react\";\nimport type { ToolbarCustomItem } from \"../../toolbar/ToolbarItem.js\";\nimport { ExpandIndicator } from \"./ExpandIndicator.js\";\nimport { Item } from \"./Item.js\";\nimport { GroupMenuItem, usePopoverPlacement } from \"./GroupItem.js\";\nimport { ToolGroupOverflowContext } from \"./OverflowButton.js\";\nimport { ToolbarContext } from \"./Toolbar.js\";\nimport { useSafeContext } from \"../../hooks/useSafeContext.js\";\n\ninterface CustomItemProps {\n item: ToolbarCustomItem;\n}\n\n/** @internal */\nexport const CustomItem = React.forwardRef<HTMLButtonElement, CustomItemProps>(\n function CustomItem({ item }, ref) {\n const placement = usePopoverPlacement();\n const { setPopoverOpen } = useSafeContext(ToolbarContext);\n const overflowContext = React.useContext(ToolGroupOverflowContext);\n\n if (overflowContext) {\n return <GroupMenuItem item={item} onClose={overflowContext.onClose} />;\n }\n return (\n <DropdownMenu\n menuItems={() => {\n return [\n <MenuExtraContent key={0}>{item.panelContent}</MenuExtraContent>,\n ];\n }}\n placement={placement}\n onVisibleChange={(newVisible) => {\n setPopoverOpen(newVisible);\n }}\n >\n <Item ref={ref} item={item}>\n <ExpandIndicator />\n </Item>\n </DropdownMenu>\n );\n }\n);\n"]}
|
|
@@ -4,14 +4,13 @@
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import type { ToolbarItem } from "../../toolbar/ToolbarItem.js";
|
|
6
6
|
import { type ToolbarGroupItem } from "../../toolbar/ToolbarItem.js";
|
|
7
|
-
|
|
8
|
-
export interface GroupItemProps {
|
|
7
|
+
interface GroupItemProps {
|
|
9
8
|
item: ToolbarGroupItem;
|
|
10
9
|
}
|
|
11
10
|
/** @internal */
|
|
12
11
|
export declare const GroupItem: React.ForwardRefExoticComponent<GroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
12
|
/** @internal */
|
|
14
|
-
export declare function usePopoverPlacement(): "top-end" | "top-start" | "
|
|
13
|
+
export declare function usePopoverPlacement(): "top-end" | "top-start" | "bottom-end" | "bottom-start" | "left-end" | "left-start" | "right-end" | "right-start";
|
|
15
14
|
interface GroupMenuItemProps {
|
|
16
15
|
item: ToolbarItem;
|
|
17
16
|
onClose?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/GroupItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"GroupItem.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/GroupItem.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAStC,UAAU,cAAc;IACtB,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,gBAAgB;AAChB,eAAO,MAAM,SAAS,0FAyBrB,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,mBAAmB,sHAGlC;AAED,UAAU,kBAAkB;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,gBAAgB;AAChB,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,kBAAkB,4BAwClE"}
|
|
@@ -15,10 +15,11 @@ import { Item } from "./Item.js";
|
|
|
15
15
|
import { Badge } from "./Badge.js";
|
|
16
16
|
import { ToolGroupOverflowContext } from "./OverflowButton.js";
|
|
17
17
|
import { ToolbarContext } from "./Toolbar.js";
|
|
18
|
+
import { useSafeContext } from "../../hooks/useSafeContext.js";
|
|
18
19
|
/** @internal */
|
|
19
20
|
export const GroupItem = React.forwardRef(function GroupItem({ item }, ref) {
|
|
20
21
|
const placement = usePopoverPlacement();
|
|
21
|
-
const
|
|
22
|
+
const { setPopoverOpen } = useSafeContext(ToolbarContext);
|
|
22
23
|
const overflowContext = React.useContext(ToolGroupOverflowContext);
|
|
23
24
|
if (overflowContext) {
|
|
24
25
|
return React.createElement(GroupMenuItem, { item: item, onClose: overflowContext.onClose });
|
|
@@ -26,21 +27,19 @@ export const GroupItem = React.forwardRef(function GroupItem({ item }, ref) {
|
|
|
26
27
|
return (React.createElement(DropdownMenu, { menuItems: (close) => {
|
|
27
28
|
return toMenuItems(item, close);
|
|
28
29
|
}, placement: placement, onVisibleChange: (newVisible) => {
|
|
29
|
-
|
|
30
|
+
setPopoverOpen(newVisible);
|
|
30
31
|
} },
|
|
31
32
|
React.createElement(Item, { item: item, ref: ref },
|
|
32
33
|
React.createElement(ExpandIndicator, null))));
|
|
33
34
|
});
|
|
34
35
|
/** @internal */
|
|
35
36
|
export function usePopoverPlacement() {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
return undefined;
|
|
39
|
-
return `${context.expandsTo}-${context.panelAlignment}`;
|
|
37
|
+
const { expandsTo, panelAlignment } = useSafeContext(ToolbarContext);
|
|
38
|
+
return `${expandsTo}-${panelAlignment}`;
|
|
40
39
|
}
|
|
41
40
|
/** @internal */
|
|
42
41
|
export function GroupMenuItem({ item, onClose }) {
|
|
43
|
-
const { onItemExecuted } =
|
|
42
|
+
const { onItemExecuted } = useSafeContext(ToolbarContext);
|
|
44
43
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
45
44
|
const iconSpec = useConditionalProp(item.icon);
|
|
46
45
|
const label = useConditionalProp(item.label);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupItem.js","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/GroupItem.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EA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C;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Toolbar\n */\n\nimport * as React from \"react\";\nimport { Icon } from \"@itwin/core-react\";\nimport { DropdownMenu, MenuExtraContent, MenuItem } from \"@itwin/itwinui-react\";\nimport type { ToolbarItem } from \"../../toolbar/ToolbarItem.js\";\nimport {\n isToolbarActionItem,\n isToolbarCustomItem,\n isToolbarGroupItem,\n type ToolbarGroupItem,\n} from \"../../toolbar/ToolbarItem.js\";\nimport { useConditionalProp } from \"../../hooks/useConditionalProp.js\";\nimport { ExpandIndicator } from \"./ExpandIndicator.js\";\nimport { Item } from \"./Item.js\";\nimport { Badge } from \"./Badge.js\";\nimport { ToolGroupOverflowContext } from \"./OverflowButton.js\";\nimport { ToolbarContext } from \"./Toolbar.js\";\nimport { useSafeContext } from \"../../hooks/useSafeContext.js\";\n\ninterface GroupItemProps {\n item: ToolbarGroupItem;\n}\n\n/** @internal */\nexport const GroupItem = React.forwardRef<HTMLButtonElement, GroupItemProps>(\n function GroupItem({ item }, ref) {\n const placement = usePopoverPlacement();\n const { setPopoverOpen } = useSafeContext(ToolbarContext);\n const overflowContext = React.useContext(ToolGroupOverflowContext);\n\n if (overflowContext) {\n return <GroupMenuItem item={item} onClose={overflowContext.onClose} />;\n }\n return (\n <DropdownMenu\n menuItems={(close) => {\n return toMenuItems(item, close);\n }}\n placement={placement}\n onVisibleChange={(newVisible) => {\n setPopoverOpen(newVisible);\n }}\n >\n <Item item={item} ref={ref}>\n <ExpandIndicator />\n </Item>\n </DropdownMenu>\n );\n }\n);\n\n/** @internal */\nexport function usePopoverPlacement() {\n const { expandsTo, panelAlignment } = useSafeContext(ToolbarContext);\n return `${expandsTo}-${panelAlignment}` as const;\n}\n\ninterface GroupMenuItemProps {\n item: ToolbarItem;\n onClose?: () => void;\n}\n\n/** @internal */\nexport function GroupMenuItem({ item, onClose }: GroupMenuItemProps) {\n const { onItemExecuted } = useSafeContext(ToolbarContext);\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const iconSpec = useConditionalProp(item.icon);\n const label = useConditionalProp(item.label);\n const isDisabled = useConditionalProp(item.isDisabled);\n const isHidden = useConditionalProp(item.isHidden);\n const isActive = useConditionalProp(item.isActive);\n\n if (isHidden) {\n return null;\n }\n\n const subMenuItems = isDisabled ? undefined : toMenuItems(item, onClose);\n const startIcon = item.iconNode ? (\n <>{item.iconNode}</>\n ) : (\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n <Icon iconSpec={iconSpec} />\n );\n return (\n <MenuItem\n startIcon={startIcon}\n disabled={isDisabled}\n subMenuItems={subMenuItems}\n onClick={() => {\n if (isToolbarActionItem(item)) {\n item.execute();\n onItemExecuted?.(item);\n onClose?.();\n }\n }}\n isSelected={isActive}\n data-item-id={item.id}\n >\n {/* eslint-disable-next-line @typescript-eslint/no-deprecated */}\n <Badge badge={item.badge} badgeKind={item.badgeKind} />\n {label}\n </MenuItem>\n );\n}\n\nfunction toMenuItems(item: ToolbarItem, onClose?: () => void) {\n if (isToolbarGroupItem(item)) {\n return item.items.map((groupItem) => {\n return (\n <GroupMenuItem key={groupItem.id} item={groupItem} onClose={onClose} />\n );\n });\n }\n if (isToolbarCustomItem(item)) {\n return [\n <MenuExtraContent key={item.id}>{item.panelContent}</MenuExtraContent>,\n ];\n }\n return [];\n}\n"]}
|
|
@@ -4,18 +4,16 @@
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { IconButton } from "@itwin/itwinui-react";
|
|
6
6
|
import type { ToolbarItem } from "../../toolbar/ToolbarItem.js";
|
|
7
|
-
|
|
8
|
-
export interface ItemProps extends Partial<React.ComponentProps<typeof IconButton>> {
|
|
7
|
+
interface ItemProps extends Partial<React.ComponentProps<typeof IconButton>> {
|
|
9
8
|
item: ToolbarItem;
|
|
10
9
|
}
|
|
11
10
|
/** @internal */
|
|
12
11
|
export declare const Item: React.ForwardRefExoticComponent<Omit<ItemProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
13
12
|
/** @internal */
|
|
14
|
-
export declare function useExpandsTo(): "top" | "left" | "right" | "bottom";
|
|
15
|
-
/** @internal */
|
|
16
13
|
export declare function useLabelProps(): {
|
|
17
|
-
readonly placement: "top" | "
|
|
14
|
+
readonly placement: "top" | "bottom" | "left" | "right";
|
|
18
15
|
readonly visible: boolean;
|
|
19
16
|
readonly onVisibleChange: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
17
|
};
|
|
18
|
+
export {};
|
|
21
19
|
//# sourceMappingURL=Item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/Item.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/toolbar/new-toolbars/Item.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAOhE,UAAU,SAAU,SAAQ,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;IAC1E,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,gBAAgB;AAChB,eAAO,MAAM,IAAI,kGAsChB,CAAC;AAEF,gBAAgB;AAChB,wBAAgB,aAAa;;;;EAS5B"}
|
|
@@ -6,43 +6,39 @@
|
|
|
6
6
|
* @module Toolbar
|
|
7
7
|
*/
|
|
8
8
|
import * as React from "react";
|
|
9
|
-
import { assert } from "@itwin/core-bentley";
|
|
10
9
|
import { Icon } from "@itwin/core-react";
|
|
11
10
|
import { IconButton } from "@itwin/itwinui-react";
|
|
12
11
|
import { useConditionalProp } from "../../hooks/useConditionalProp.js";
|
|
13
12
|
import { Badge } from "./Badge.js";
|
|
14
|
-
import { ToolbarContext } from "./Toolbar.js";
|
|
13
|
+
import { ToolbarContext, ToolbarItemContext } from "./Toolbar.js";
|
|
14
|
+
import { useSafeContext } from "../../hooks/useSafeContext.js";
|
|
15
|
+
import { Separator } from "./Separator.js";
|
|
15
16
|
/** @internal */
|
|
16
17
|
export const Item = React.forwardRef(function Item(props, ref) {
|
|
17
18
|
const { item, ...other } = props;
|
|
19
|
+
const { renderSeparator } = useSafeContext(ToolbarItemContext);
|
|
18
20
|
const label = useConditionalProp(item.label);
|
|
19
21
|
const isDisabled = useConditionalProp(item.isDisabled);
|
|
20
22
|
const isHidden = useConditionalProp(item.isHidden);
|
|
21
23
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
22
24
|
const iconSpec = useConditionalProp(item.icon);
|
|
23
25
|
const labelProps = useLabelProps();
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
return (React.createElement(React.Fragment, null,
|
|
27
|
+
isHidden ? undefined : (React.createElement(IconButton, { styleType: "borderless", disabled: isDisabled, isActive: item.isActive, label: label, labelProps: labelProps, style: props.style, ref: ref, "data-item-id": item.id, ...other },
|
|
28
|
+
item.iconNode ?? (
|
|
29
|
+
/* eslint-disable-next-line @typescript-eslint/no-deprecated */
|
|
30
|
+
React.createElement(Icon, { iconSpec: iconSpec })),
|
|
31
|
+
React.createElement(Badge, { badge: item.badge, badgeKind: item.badgeKind }),
|
|
32
|
+
props.children)),
|
|
33
|
+
renderSeparator && React.createElement(Separator, null)));
|
|
30
34
|
});
|
|
31
35
|
/** @internal */
|
|
32
|
-
export function useExpandsTo() {
|
|
33
|
-
const context = React.useContext(ToolbarContext);
|
|
34
|
-
assert(!!context);
|
|
35
|
-
const { expandsTo } = context;
|
|
36
|
-
return expandsTo;
|
|
37
|
-
}
|
|
38
|
-
/** @internal */
|
|
39
36
|
export function useLabelProps() {
|
|
40
|
-
const
|
|
37
|
+
const { popoverOpen, expandsTo } = useSafeContext(ToolbarContext);
|
|
41
38
|
const [internalVisible, setInternalVisible] = React.useState(false);
|
|
42
|
-
const visible =
|
|
43
|
-
const placement = useExpandsTo();
|
|
39
|
+
const visible = popoverOpen ? false : internalVisible;
|
|
44
40
|
return {
|
|
45
|
-
placement,
|
|
41
|
+
placement: expandsTo,
|
|
46
42
|
visible,
|
|
47
43
|
onVisibleChange: setInternalVisible,
|
|
48
44
|
};
|