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: LayoutDirection = LayoutDirection.Y + ) { + + const items: [IContainerProps, IContainerProps] | undefined = props.items; + const showBar: boolean = props.showBar ?? true; + const panles: string[] = props.panles ?? []; + const layout: LayoutDirection = props.layout ?? LayoutDirection.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 === LayoutDirection.Y ? "column" : undefined, + width: isRoot ? "100%" : selfLayout === LayoutDirection.X ? `${selfScale}%` : undefined, + height: isRoot ? "100%" : selfLayout === LayoutDirection.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] ?
+
+
+
: null} + {items && items[1] ? this.renderContainer(items[1], 100 - scale, layout) : null} +
+ } + + public render(): ReactNode { + return this.renderContainer(this.props); + } +} + +export { Container }; \ No newline at end of file diff --git a/source/Model/Layout.ts b/source/Model/Layout.ts new file mode 100644 index 0000000..5d6b224 --- /dev/null +++ b/source/Model/Layout.ts @@ -0,0 +1,21 @@ +import { Emitter } from "./Emitter"; + +enum LayoutDirection { + X = 1, + Y = 2 +} + +class ILayout { + items?: [ILayout, ILayout]; + panles?: string[]; + layout?: LayoutDirection; + scale?: number; +} + +class Layout extends Emitter<{}> { + + private data: ILayout = {}; + +}; + +export { Layout, ILayout, LayoutDirection }; \ No newline at end of file diff --git a/source/Page/SimulatorWeb/SimulatorWeb.tsx b/source/Page/SimulatorWeb/SimulatorWeb.tsx index 19694ac..8fef91d 100644 --- a/source/Page/SimulatorWeb/SimulatorWeb.tsx +++ b/source/Page/SimulatorWeb/SimulatorWeb.tsx @@ -6,6 +6,8 @@ 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 } from "@Component/Container/Container"; +import { LayoutDirection } from "@Model/Layout"; import "./SimulatorWeb.scss"; import { CommandBar } from "@Component/CommandBar/CommandBar"; @@ -72,7 +74,33 @@ class SimulatorWeb extends Component { height: `calc( 100% - ${45}px)` }}> -
+
}