diff --git a/api/package.json b/api/package.json
index d5ac4192b..04ec61195 100644
--- a/api/package.json
+++ b/api/package.json
@@ -1,6 +1,6 @@
{
"name": "@devtable/api",
- "version": "10.19.0",
+ "version": "10.20.0",
"description": "",
"main": "index.js",
"scripts": {
diff --git a/dashboard/package.json b/dashboard/package.json
index 26cbbd1aa..bc80c9fdb 100644
--- a/dashboard/package.json
+++ b/dashboard/package.json
@@ -1,6 +1,6 @@
{
"name": "@devtable/dashboard",
- "version": "10.19.0",
+ "version": "10.20.0",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
diff --git a/dashboard/src/components/view/view-component/preview/index.tsx b/dashboard/src/components/view/view-component/preview/index.tsx
index eb485bbaa..c9da6de42 100644
--- a/dashboard/src/components/view/view-component/preview/index.tsx
+++ b/dashboard/src/components/view/view-component/preview/index.tsx
@@ -10,7 +10,7 @@ export const PreviewViewComponent = observer(({ view, children }: { view: ViewMe
case EViewComponentType.Modal:
return {children};
case EViewComponentType.Tabs:
- return {children};
+ return ;
case EViewComponentType.Division:
default:
return {children};
diff --git a/dashboard/src/components/view/view-component/preview/tabs.tsx b/dashboard/src/components/view/view-component/preview/tabs.tsx
index 378357cc1..a47a62e54 100644
--- a/dashboard/src/components/view/view-component/preview/tabs.tsx
+++ b/dashboard/src/components/view/view-component/preview/tabs.tsx
@@ -2,7 +2,7 @@ import { Box, Button, ColorInput, Overlay, Select, Stack, Sx, Tabs, TextInput }
import { useModals } from '@mantine/modals';
import { IconArrowsLeftRight, IconTrash } from '@tabler/icons-react';
import { observer } from 'mobx-react-lite';
-import { ReactNode, useMemo } from 'react';
+import { useMemo } from 'react';
import { Plus } from 'tabler-icons-react';
import { DashboardViewRender } from '~/components/view';
import { useEditContentModelContext } from '~/contexts';
@@ -10,6 +10,9 @@ import { EViewComponentType, TabModelInstance, ViewMetaInstance, ViewTabsConfigI
const getStyles = ({ variant, orientation }: ViewTabsConfigInstance) => {
const ret: Record = {
+ root: {
+ height: '100%',
+ },
tab: {},
panel: {
padding: '16px',
@@ -40,7 +43,7 @@ const getTabSX = (t: TabModelInstance): Sx => {
return {};
};
-export const PreviewViewTabs = observer(({ children, view }: { children: ReactNode; view: ViewMetaInstance }) => {
+export const PreviewViewTabs = observer(({ view }: { view: ViewMetaInstance }) => {
const modals = useModals();
const model = useEditContentModelContext();
const options = useMemo(
@@ -64,71 +67,69 @@ export const PreviewViewTabs = observer(({ children, view }: { children: ReactNo
const onlyOneTabLeft = config.tabs.length === 0;
return (
-
- 0 ? config.tabs[0].id : '0'}
- styles={getStyles(config)}
- >
-
- {config.tabs.map((t) => (
-
- {t.name ?? t.id}
-
- ))}
-
-
+ 0 ? config.tabs[0].id : '0'}
+ styles={getStyles(config)}
+ >
+
+ {config.tabs.map((t) => (
+
+ {t.name ?? t.id}
-
- {config.tabs.map((t, i) => {
- const tabView = model.views.findByID(t.view_id);
- return (
-
-
-
-
-
- t.setName(e.currentTarget.value)} />
-
-
+ ))}
+
+
+
+
+ {config.tabs.map((t, i) => {
+ const tabView = model.views.findByID(t.view_id);
+ return (
+
+
+
- {tabView && (
- }
- gradient={{ from: 'cyan', to: 'indigo' }}
- onClick={() => model.views.setIDOfVIE(tabView.id)}
- >
- Swith to View: {tabView.name}
-
- )}
+
+ t.setName(e.currentTarget.value)} />
+
+
+ {tabView && (
-
-
+ )}
+
+
+
+
- {tabView && }
-
- );
- })}
-
- {children}
-
+ {tabView && }
+
+ );
+ })}
+
);
});
diff --git a/dashboard/src/components/view/view-component/render/index.tsx b/dashboard/src/components/view/view-component/render/index.tsx
index 660563e3f..5d1f97281 100644
--- a/dashboard/src/components/view/view-component/render/index.tsx
+++ b/dashboard/src/components/view/view-component/render/index.tsx
@@ -10,7 +10,7 @@ export const RenderViewComponent = observer(({ view, children }: { view: ViewMet
case EViewComponentType.Modal:
return {children};
case EViewComponentType.Tabs:
- return {children};
+ return ;
case EViewComponentType.Division:
default:
return {children};
diff --git a/dashboard/src/components/view/view-component/render/tabs.tsx b/dashboard/src/components/view/view-component/render/tabs.tsx
index 97dc9d0ce..13ffc86cd 100644
--- a/dashboard/src/components/view/view-component/render/tabs.tsx
+++ b/dashboard/src/components/view/view-component/render/tabs.tsx
@@ -1,6 +1,5 @@
-import { Box, Sx, Tabs } from '@mantine/core';
+import { Sx, Tabs } from '@mantine/core';
import { observer } from 'mobx-react-lite';
-import { ReactNode } from 'react';
import { DashboardViewRender } from '~/components/view';
import { useRenderContentModelContext } from '~/contexts';
import { TabModelInstance, ViewMetaInstance, ViewTabsConfigInstance } from '~/model';
@@ -12,42 +11,45 @@ const getTabSX = (t: TabModelInstance): Sx => {
return {};
};
-export const RenderViewTabs = observer(({ children, view }: { children: ReactNode; view: ViewMetaInstance }) => {
+export const RenderViewTabs = observer(({ view }: { view: ViewMetaInstance }) => {
const model = useRenderContentModelContext();
const config = view.config as ViewTabsConfigInstance;
return (
-
- 0 ? config.tabs[0].id : '0'}
- styles={{
- panel: {
- padding: config.orientation === 'horizontal' ? '16px 0px' : '0',
- },
- }}
- keepMounted={false}
- >
-
- {config.tabs.map((t) => (
-
- {t.name ?? t.id}
-
- ))}
-
- {config.tabs.map((t) => {
- const tabView = model.views.findByID(t.view_id);
- if (!tabView) {
- return null;
- }
- return (
-
-
-
- );
- })}
-
- {children}
-
+ 0 ? config.tabs[0].id : '0'}
+ styles={{
+ root: {
+ height: '100%',
+ },
+ panel: {
+ padding: config.orientation === 'horizontal' ? '16px 0px' : '0',
+ height: '100%',
+ overflow: 'auto',
+ },
+ }}
+ keepMounted={false}
+ >
+
+ {config.tabs.map((t) => (
+
+ {t.name ?? t.id}
+
+ ))}
+
+ {config.tabs.map((t) => {
+ const tabView = model.views.findByID(t.view_id);
+ if (!tabView) {
+ return null;
+ }
+ return (
+
+
+
+ );
+ })}
+
);
});
diff --git a/dashboard/src/dashboard-editor/ui/header/sub-header.tsx b/dashboard/src/dashboard-editor/ui/header/sub-header.tsx
index 9abcbba01..2b6163a92 100644
--- a/dashboard/src/dashboard-editor/ui/header/sub-header.tsx
+++ b/dashboard/src/dashboard-editor/ui/header/sub-header.tsx
@@ -2,6 +2,7 @@ import { Box, Button, Group, Sx } from '@mantine/core';
import { IconPlaylistAdd } from '@tabler/icons-react';
import { observer } from 'mobx-react-lite';
import { useEditContentModelContext } from '~/contexts';
+import { EViewComponentType } from '~/model';
const SubHeaderSx: Sx = {
position: 'fixed',
@@ -16,6 +17,7 @@ const SubHeaderSx: Sx = {
export const SubHeader = observer(() => {
const model = useEditContentModelContext();
+ const cant = model.views.VIE?.type === EViewComponentType.Tabs;
return (
@@ -24,7 +26,7 @@ export const SubHeader = observer(() => {
color="blue"
radius={0}
size="xs"
- disabled={!model.views.VIE}
+ disabled={!model.views.VIE || cant}
onClick={() => model.addANewPanel(model.views.idOfVIE)}
leftIcon={}
sx={{
diff --git a/dashboard/src/dashboard-editor/ui/settings/navbar/add-item-button/add-a-panel.tsx b/dashboard/src/dashboard-editor/ui/settings/navbar/add-item-button/add-a-panel.tsx
index f555853de..f2cc38c77 100644
--- a/dashboard/src/dashboard-editor/ui/settings/navbar/add-item-button/add-a-panel.tsx
+++ b/dashboard/src/dashboard-editor/ui/settings/navbar/add-item-button/add-a-panel.tsx
@@ -2,6 +2,7 @@ import { Button } from '@mantine/core';
import { IconPlus } from '@tabler/icons-react';
import { observer } from 'mobx-react-lite';
import { useEditContentModelContext } from '~/contexts';
+import { EViewComponentType } from '~/model';
interface IAddAPanel {
parentID?: string;
@@ -13,7 +14,7 @@ export const AddAPanel = observer(({ parentID }: IAddAPanel) => {
return null;
}
const view = model.views.findByID(parentID);
- if (!view) {
+ if (!view || view.type === EViewComponentType.Tabs) {
return null;
}
return (
diff --git a/package.json b/package.json
index 823ddfa45..6b59d09c5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@devtable/root",
- "version": "10.19.0",
+ "version": "10.20.0",
"private": true,
"workspaces": [
"api",
diff --git a/settings-form/package.json b/settings-form/package.json
index 17b4903ca..090a18d02 100644
--- a/settings-form/package.json
+++ b/settings-form/package.json
@@ -1,6 +1,6 @@
{
"name": "@devtable/settings-form",
- "version": "10.19.0",
+ "version": "10.20.0",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
diff --git a/website/package.json b/website/package.json
index 8789135d4..141190576 100644
--- a/website/package.json
+++ b/website/package.json
@@ -2,7 +2,7 @@
"name": "@devtable/website",
"private": true,
"license": "Apache-2.0",
- "version": "10.19.0",
+ "version": "10.20.0",
"scripts": {
"dev": "vite",
"preview": "vite preview"