Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
crubier committed Jun 3, 2024
1 parent bbdb99d commit cffd742
Show file tree
Hide file tree
Showing 9 changed files with 1,030 additions and 78 deletions.
2 changes: 1 addition & 1 deletion packages/docs/docs/core/panels/add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ api.addPanel({
api.addPanel({
id: 'panel_2',
component: 'default',
floating: { x: 10, y: 10, width: 300, height: 300 },
floating: { left: 10, top: 10, width: 300, height: 300 },
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ const GroupAction = (props: {
}
onClick={() => {
if (group) {
props.api.addFloatingGroup(group);
props.api.addFloatingGroup(group, undefined, {
position: {
width: 400,
height: 300,
top: 50,
right: 50,
}
});
}
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const PanelAction = (props: {
position: {
width: 400,
height: 300,
bottom: 20,
right: 20,
bottom: 50,
right: 50,
}
});
}
Expand Down
16 changes: 11 additions & 5 deletions packages/docs/sandboxes/react/dockview/floating-groups/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function addFloatingPanel2(api: DockviewApi) {
id: (++panelCount).toString(),
title: `Tab ${panelCount}`,
component: 'default',
floating: { width: 250, height: 150, x: 50, y: 50 },
floating: { width: 250, height: 150, left: 50, top: 50 },
});
}

Expand Down Expand Up @@ -217,9 +217,8 @@ export const DockviewPersistence = (props: { theme?: string }) => {
setDisableFloatingGroups((x) => !x);
}}
>
{`${
disableFloatingGroups ? 'Enable' : 'Disable'
} floating groups`}
{`${disableFloatingGroups ? 'Enable' : 'Disable'
} floating groups`}
</button>
</div>
<div
Expand Down Expand Up @@ -275,7 +274,14 @@ const RightComponent = (props: IDockviewHeaderActionsProps) => {
const group = props.containerApi.addGroup();
props.group.api.moveTo({ group });
} else {
props.containerApi.addFloatingGroup(props.group);
props.containerApi.addFloatingGroup(props.group, undefined, {
position: {
width: 400,
height: 300,
bottom: 50,
right: 50,
}
});
}
};

Expand Down
1,036 changes: 974 additions & 62 deletions packages/docs/src/generated/api.output.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export const GroupActions = (props: {
onClick={() => {
const panel = props.api?.getGroup(x);
if (panel) {
props.api?.addFloatingGroup(panel);
props.api?.addFloatingGroup(panel, undefined, {
position: {
width: 400,
height: 300,
bottom: 50,
right: 50,
}
});
}
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ export const PanelActions = (props: {
onClick={() => {
const panel = props.api?.getPanel(x);
if (panel) {
props.api?.addFloatingGroup(panel);
props.api?.addFloatingGroup(panel, undefined, {
position: {
width: 400,
height: 300,
bottom: 50,
right: 50,
}
});
}
}}
>
Expand Down
14 changes: 10 additions & 4 deletions packages/docs/templates/dockview/floating-groups/react/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ export const DockviewPersistence = (props: { theme?: string }) => {
setDisableFloatingGroups((x) => !x);
}}
>
{`${
disableFloatingGroups ? 'Enable' : 'Disable'
} floating groups`}
{`${disableFloatingGroups ? 'Enable' : 'Disable'
} floating groups`}
</button>
</div>
<div
Expand Down Expand Up @@ -265,7 +264,14 @@ const RightComponent = (props: IDockviewHeaderActionsProps) => {
const group = props.containerApi.addGroup();
props.group.api.moveTo({ group });
} else {
props.containerApi.addFloatingGroup(props.group);
props.containerApi.addFloatingGroup(props.group, undefined, {
position: {
width: 400,
height: 300,
bottom: 50,
right: 50,
}
});
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ const RightAction = defineComponent({
const group = this.params.containerApi.addGroup();
this.group.api.moveTo({ group });
} else {
this.containerApi.addFloatingGroup(this.params.group);
this.containerApi.addFloatingGroup(this.params.group, undefined, {
position: {
width: 400,
height: 300,
bottom: 50,
right: 50,
}
});
}
},
},
Expand Down

0 comments on commit cffd742

Please sign in to comment.