diff --git a/source/Component/CommandBar/CommandBar.scss b/source/Component/CommandBar/CommandBar.scss index dbd174a..2024c22 100644 --- a/source/Component/CommandBar/CommandBar.scss +++ b/source/Component/CommandBar/CommandBar.scss @@ -10,6 +10,7 @@ div.command-bar { text-align: center; display: flex; justify-content: center; + transition: all 100ms ease-in-out; color: inherit; span.ms-Button-flexContainer i.ms-Icon { diff --git a/source/Component/CommandBar/CommandBar.tsx b/source/Component/CommandBar/CommandBar.tsx index f782fe2..05940e9 100644 --- a/source/Component/CommandBar/CommandBar.tsx +++ b/source/Component/CommandBar/CommandBar.tsx @@ -14,7 +14,7 @@ class CommandBar extends Component { render(): ReactNode { return
@@ -43,7 +43,7 @@ class CommandBar extends Component { i18nKey={param.i18NKey} directionalHint={DirectionalHint.rightCenter} > - {id} +} + +class Container extends Component { + + private renderPanel(panles: string[], showBar: boolean) { + return <> + {showBar ? + { + panles.map((panelId: string) => { + return
+
+
{panelId}
+
+ }) + }
: null + } + {getPanelById(panles[0])} + + } + + private renderContainer( + props: IContainerProps, + selfScale: number = 50, + selfLayout: ContaineLayout = ContaineLayout.Y + ) { + + const items: [IContainerProps, IContainerProps] | undefined = props.items; + const showBar: boolean = props.showBar ?? true; + const panles: string[] = props.panles ?? []; + const layout: ContaineLayout = props.layout ?? ContaineLayout.Y; + const scale: number = props.scale ?? 50; + const isRoot: boolean = !!props.isRoot; + + return 0 && !items ? " end-containe" : "")} + backgroundLevel={BackgroundLevel.Level4} + fontLevel={FontLevel.normal} + style={{ + flexDirection: layout === ContaineLayout.Y ? "column" : undefined, + width: isRoot ? "100%" : selfLayout === ContaineLayout.X ? `${selfScale}%` : undefined, + height: isRoot ? "100%" : selfLayout === ContaineLayout.Y ? `${selfScale}%` : undefined + }} + > + {panles.length > 0 && !items ? this.renderPanel(panles, showBar) : null} + {items && items[0] ? this.renderContainer(items[0], scale, layout) : null} + {items && items[1] ? this.renderContainer(items[1], 100 - scale, layout) : null} + + } + + public render(): ReactNode { + return this.renderContainer(this.props); + } +} + +export { Container, ContaineLayout }; \ No newline at end of file diff --git a/source/Page/SimulatorWeb/SimulatorWeb.tsx b/source/Page/SimulatorWeb/SimulatorWeb.tsx index 19694ac..53700c8 100644 --- a/source/Page/SimulatorWeb/SimulatorWeb.tsx +++ b/source/Page/SimulatorWeb/SimulatorWeb.tsx @@ -6,6 +6,7 @@ import { Entry } from "../Entry/Entry"; import { StatusProvider, Status } from "@Context/Status"; import { ClassicRenderer } from "@GLRender/ClassicRenderer"; import { initializeIcons } from '@fluentui/font-icons-mdl2'; +import { Container, ContaineLayout } from "@Component/Container/Container"; import "./SimulatorWeb.scss"; import { CommandBar } from "@Component/CommandBar/CommandBar"; @@ -72,7 +73,33 @@ class SimulatorWeb extends Component { height: `calc( 100% - ${45}px)` }}> -
+
}