Add tab renderer panel

This commit is contained in:
2022-03-02 21:02:54 +08:00
parent 19d77dceb0
commit 6f8451ea9b
10 changed files with 95 additions and 11 deletions
+9 -1
View File
@@ -94,15 +94,23 @@ div.app-container {
}
}
div.app-panel.has-padding {
padding: 10px;
}
div.app-panel {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 10px;
overflow: scroll;
-ms-overflow-style: none;
border: .8px solid rgba($color: #000000, $alpha: 0);
}
div.app-panel.hide-scrollbar::-webkit-scrollbar {
width : 0; /*高宽分别对应横竖滚动条的尺寸*/
height: 0;
}
div.app-panel::-webkit-scrollbar {
width : 8px; /*高宽分别对应横竖滚动条的尺寸*/
+8 -2
View File
@@ -39,6 +39,7 @@ class Container extends Component<IContainerProps> {
const classList: string[] = [];
const theme: Themes = this.props.theme ?? Themes.dark;
const showPanelId = focus ?? panles[0];
const showPanelInfo = getPanelInfoById(showPanelId as any);
classList.push(theme === Themes.light ? "light" : "dark");
classList.push(`background-${BackgroundLevel.Level3}`);
@@ -57,7 +58,7 @@ class Container extends Component<IContainerProps> {
const classList: string[] = ["app-tab-header-item"];
if (panelId === this.props.focusId) classList.push("active");
if (panelId === showPanelId) classList.push("tab");
const panelInfo = getPanelInfoById(showPanelId as any);
const panelInfo = getPanelInfoById(panelId as any);
return <LocalizationTooltipHost
i18nKey={panelInfo ? panelInfo.introKay as any : "Panel.Info.Notfound"}
@@ -89,7 +90,12 @@ class Container extends Component<IContainerProps> {
}
<div
onClick={() => this.props.onFocusTab ? this.props.onFocusTab(showPanelId) : undefined}
className={"app-panel" + (hasActivePanel ? " active" : "")}
className={[
"app-panel",
hasActivePanel ? "active" : "",
showPanelInfo?.hidePadding ? "" : "has-padding",
showPanelInfo?.hideScrollBar ? "hide-scrollbar" : ""
].filter(x => !!x).join(" ")}
draggable={false}
>
{getPanelById(showPanelId as any)}