-
-
+
+
+
+
diff --git a/packages/docs/sandboxes/react/dockview/demo-dockview/src/groupActions.tsx b/packages/docs/sandboxes/react/dockview/demo-dockview/src/groupActions.tsx
index 57c9433ac..815621b72 100644
--- a/packages/docs/sandboxes/react/dockview/demo-dockview/src/groupActions.tsx
+++ b/packages/docs/sandboxes/react/dockview/demo-dockview/src/groupActions.tsx
@@ -88,14 +88,18 @@ const GroupAction = (props: {
}
onClick={() => {
if (group) {
+
props.api.addFloatingGroup(group, {
+ width: 400,
+ height: 300,
+ x: 50,
+ y: 50,
position: {
- width: 400,
- height: 300,
- top: 50,
+ bottom: 50,
right: 50,
},
});
+
}
}}
>
diff --git a/packages/docs/sandboxes/react/dockview/demo-dockview/src/panelBuilder.tsx b/packages/docs/sandboxes/react/dockview/demo-dockview/src/panelBuilder.tsx
new file mode 100644
index 000000000..e6d53e05a
--- /dev/null
+++ b/packages/docs/sandboxes/react/dockview/demo-dockview/src/panelBuilder.tsx
@@ -0,0 +1,115 @@
+import { DockviewApi } from 'dockview';
+import * as React from 'react';
+import { nextId } from './defaultLayout';
+
+export const PanelBuilder = (props: { api: DockviewApi; done: () => void }) => {
+ const [parameters, setParameters] = React.useState<{
+ initialWidth?: number;
+ initialHeight?: number;
+ maximumHeight?: number;
+ maximumWidth?: number;
+ minimumHeight?: number;
+ minimumWidth?: number;
+ }>({});
+ return (
+
+
+
{'Initial Width'}
+
+ setParameters((_) => ({
+ ..._,
+ initialWidth: Number(event.target.value),
+ }))
+ }
+ />
+
{'Initial Height'}
+
+ setParameters((_) => ({
+ ..._,
+ initialHeight: Number(event.target.value),
+ }))
+ }
+ />
+
{'Maximum Width'}
+
+ setParameters((_) => ({
+ ..._,
+ maximumWidth: Number(event.target.value),
+ }))
+ }
+ />
+
{'Maximum Height'}
+
+ setParameters((_) => ({
+ ..._,
+ maximumHeight: Number(event.target.value),
+ }))
+ }
+ />
+
{'Minimum Width'}
+
+ setParameters((_) => ({
+ ..._,
+ minimumWidth: Number(event.target.value),
+ }))
+ }
+ />
+
{'Minimum Height'}
+
+ setParameters((_) => ({
+ ..._,
+ minimumHeight: Number(event.target.value),
+ }))
+ }
+ />
+
+
+
+
+
+
+ );
+};
diff --git a/packages/docs/src/components/frameworkSpecific.tsx b/packages/docs/src/components/frameworkSpecific.tsx
index efe8eee7e..65ae1d549 100644
--- a/packages/docs/src/components/frameworkSpecific.tsx
+++ b/packages/docs/src/components/frameworkSpecific.tsx
@@ -10,7 +10,7 @@ export interface FrameworkDescriptor {
}
const frameworks: FrameworkDescriptor[] = [
- // { value: 'JavaScript', label: 'JavaScript', icon: 'img/js-icon.svg' },
+ { value: 'JavaScript', label: 'JavaScript', icon: 'img/js-icon.svg' },
{ value: 'React', label: 'React', icon: 'img/react-icon.svg' },
{ value: 'Vue', label: 'Vue', icon: 'img/vue-icon.svg' },
// { value: 'Angular', label: 'Angular' },
diff --git a/packages/docs/src/generated/api.output.json b/packages/docs/src/generated/api.output.json
index 5cb7c80fc..7ddc5d38b 100644
--- a/packages/docs/src/generated/api.output.json
+++ b/packages/docs/src/generated/api.output.json
@@ -9014,6 +9014,98 @@
}
}
},
+ {
+ "name": "maximumHeight",
+ "code": "number | undefined",
+ "kind": "accessor",
+ "value": {
+ "name": "maximumHeight",
+ "code": "number | undefined",
+ "kind": "getSignature",
+ "returnType": {
+ "type": "or",
+ "values": [
+ {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ {
+ "type": "intrinsic",
+ "value": "undefined"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "maximumWidth",
+ "code": "number | undefined",
+ "kind": "accessor",
+ "value": {
+ "name": "maximumWidth",
+ "code": "number | undefined",
+ "kind": "getSignature",
+ "returnType": {
+ "type": "or",
+ "values": [
+ {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ {
+ "type": "intrinsic",
+ "value": "undefined"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "minimumHeight",
+ "code": "number | undefined",
+ "kind": "accessor",
+ "value": {
+ "name": "minimumHeight",
+ "code": "number | undefined",
+ "kind": "getSignature",
+ "returnType": {
+ "type": "or",
+ "values": [
+ {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ {
+ "type": "intrinsic",
+ "value": "undefined"
+ }
+ ]
+ }
+ }
+ },
+ {
+ "name": "minimumWidth",
+ "code": "number | undefined",
+ "kind": "accessor",
+ "value": {
+ "name": "minimumWidth",
+ "code": "number | undefined",
+ "kind": "getSignature",
+ "returnType": {
+ "type": "or",
+ "values": [
+ {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ {
+ "type": "intrinsic",
+ "value": "undefined"
+ }
+ ]
+ }
+ }
+ },
{
"name": "params",
"code": "Parameters | undefined",
@@ -22780,19 +22872,6 @@
"isReadonly": true
}
},
- {
- "name": "parentElement",
- "code": "HTMLElement",
- "kind": "property",
- "type": {
- "type": "reference",
- "value": "HTMLElement",
- "source": "typescript"
- },
- "flags": {
- "isReadonly": true
- }
- },
{
"name": "proportionalLayout",
"code": "boolean",
@@ -23032,6 +23111,104 @@
],
"extends": []
},
+ "Contraints": {
+ "kind": "interface",
+ "name": "Contraints",
+ "children": [
+ {
+ "name": "maximumHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "maximumWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "minimumHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "minimumWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ }
+ ],
+ "extends": []
+ },
+ "CreateComponentOptions": {
+ "kind": "interface",
+ "name": "CreateComponentOptions",
+ "children": [
+ {
+ "name": "id",
+ "code": "string",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "string"
+ },
+ "flags": {},
+ "comment": {
+ "summary": [
+ {
+ "kind": "text",
+ "text": "The unqiue identifer of the component"
+ }
+ ]
+ }
+ },
+ {
+ "name": "name",
+ "code": "string",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "string"
+ },
+ "flags": {},
+ "comment": {
+ "summary": [
+ {
+ "kind": "text",
+ "text": "The component name, this should determine what is rendered."
+ }
+ ]
+ }
+ }
+ ],
+ "extends": []
+ },
"DockviewDndOverlayEvent": {
"kind": "interface",
"name": "DockviewDndOverlayEvent",
@@ -23156,13 +23333,13 @@
"children": [
{
"name": "createComponent",
- "code": "(options: { id: string, name: string }): IContentRenderer",
+ "code": "(options: CreateComponentOptions): IContentRenderer",
"kind": "property",
"type": {
"type": "reflection",
"value": {
"name": "__type",
- "code": "(options: { id: string, name: string }): IContentRenderer",
+ "code": "(options: CreateComponentOptions): IContentRenderer",
"kind": "typeLiteral",
"signatures": [
{
@@ -23171,36 +23348,11 @@
"parameters": [
{
"name": "options",
- "code": "options: { id: string, name: string }",
+ "code": "options: CreateComponentOptions",
"type": {
- "type": "reflection",
- "value": {
- "name": "__type",
- "code": "{ id: string, name: string }",
- "kind": "typeLiteral",
- "properties": [
- {
- "name": "id",
- "code": "string",
- "kind": "property",
- "type": {
- "type": "intrinsic",
- "value": "string"
- },
- "flags": {}
- },
- {
- "name": "name",
- "code": "string",
- "kind": "property",
- "type": {
- "type": "intrinsic",
- "value": "string"
- },
- "flags": {}
- }
- ]
- }
+ "type": "reference",
+ "value": "CreateComponentOptions",
+ "source": "dockview-core"
},
"kind": "parameter"
}
@@ -23210,7 +23362,7 @@
"value": "IContentRenderer",
"source": "dockview-core"
},
- "code": "(options: { id: string, name: string }): IContentRenderer",
+ "code": "(options: CreateComponentOptions): IContentRenderer",
"kind": "callSignature"
}
]
@@ -23343,13 +23495,13 @@
},
{
"name": "createTabComponent",
- "code": "(options: { id: string, name: string }): ITabRenderer | undefined",
+ "code": "(options: CreateComponentOptions): ITabRenderer | undefined",
"kind": "property",
"type": {
"type": "reflection",
"value": {
"name": "__type",
- "code": "(options: { id: string, name: string }): ITabRenderer | undefined",
+ "code": "(options: CreateComponentOptions): ITabRenderer | undefined",
"kind": "typeLiteral",
"signatures": [
{
@@ -23358,36 +23510,11 @@
"parameters": [
{
"name": "options",
- "code": "options: { id: string, name: string }",
+ "code": "options: CreateComponentOptions",
"type": {
- "type": "reflection",
- "value": {
- "name": "__type",
- "code": "{ id: string, name: string }",
- "kind": "typeLiteral",
- "properties": [
- {
- "name": "id",
- "code": "string",
- "kind": "property",
- "type": {
- "type": "intrinsic",
- "value": "string"
- },
- "flags": {}
- },
- {
- "name": "name",
- "code": "string",
- "kind": "property",
- "type": {
- "type": "intrinsic",
- "value": "string"
- },
- "flags": {}
- }
- ]
- }
+ "type": "reference",
+ "value": "CreateComponentOptions",
+ "source": "dockview-core"
},
"kind": "parameter"
}
@@ -23406,7 +23533,7 @@
}
]
},
- "code": "(options: { id: string, name: string }): ITabRenderer | undefined",
+ "code": "(options: CreateComponentOptions): ITabRenderer | undefined",
"kind": "callSignature"
}
]
@@ -26716,6 +26843,26 @@
"isReadonly": true
}
},
+ {
+ "name": "constraints",
+ "code": "Partial
",
+ "kind": "property",
+ "type": {
+ "type": "reference",
+ "value": "Partial",
+ "source": "typescript",
+ "typeArguments": [
+ {
+ "type": "reference",
+ "value": "Contraints",
+ "source": "dockview-core"
+ }
+ ]
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
{
"name": "hideHeader",
"code": "boolean",
@@ -26741,6 +26888,30 @@
"isReadonly": true
}
},
+ {
+ "name": "initialHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "initialWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
{
"name": "locked",
"code": "'no-drop-target' | boolean",
@@ -26865,6 +27036,26 @@
"isOptional": true
}
},
+ {
+ "name": "constraints",
+ "code": "Partial",
+ "kind": "property",
+ "type": {
+ "type": "reference",
+ "value": "Partial",
+ "source": "typescript",
+ "typeArguments": [
+ {
+ "type": "reference",
+ "value": "Contraints",
+ "source": "dockview-core"
+ }
+ ]
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
{
"name": "hideHeader",
"code": "boolean",
@@ -26887,6 +27078,30 @@
},
"flags": {}
},
+ {
+ "name": "initialHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "initialWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
{
"name": "locked",
"code": "'no-drop-target' | boolean",
@@ -26964,6 +27179,54 @@
},
"flags": {}
},
+ {
+ "name": "maximumHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "maximumWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "minimumHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "minimumWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
{
"name": "params",
"code": "",
@@ -31160,6 +31423,58 @@
"isReadonly": true
}
},
+ {
+ "name": "maximumHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true,
+ "isReadonly": true
+ }
+ },
+ {
+ "name": "maximumWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true,
+ "isReadonly": true
+ }
+ },
+ {
+ "name": "minimumHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true,
+ "isReadonly": true
+ }
+ },
+ {
+ "name": "minimumWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true,
+ "isReadonly": true
+ }
+ },
{
"name": "params",
"code": "Parameters | undefined",
@@ -37257,44 +37572,6 @@
"kind": "callSignature"
}
]
- },
- {
- "name": "updateParentGroup",
- "code": "(group: DockviewGroupPanel, visible: boolean): void",
- "kind": "method",
- "signature": [
- {
- "name": "updateParentGroup",
- "typeParameters": [],
- "parameters": [
- {
- "name": "group",
- "code": "group: DockviewGroupPanel",
- "type": {
- "type": "reference",
- "value": "DockviewGroupPanel",
- "source": "dockview-core"
- },
- "kind": "parameter"
- },
- {
- "name": "visible",
- "code": "visible: boolean",
- "type": {
- "type": "intrinsic",
- "value": "boolean"
- },
- "kind": "parameter"
- }
- ],
- "returnType": {
- "type": "intrinsic",
- "value": "void"
- },
- "code": "(group: DockviewGroupPanel, visible: boolean): void",
- "kind": "callSignature"
- }
- ]
}
],
"extends": [
@@ -41037,11 +41314,23 @@
},
"AddPanelOptions": {
"name": "AddPanelOptions",
- "code": "Partial & { component: string, id: string, inactive?: boolean, params?: P, renderer?: DockviewPanelRenderer, tabComponent?: string, title?: string }",
+ "code": "Partial & Partial & { component: string, id: string, inactive?: boolean, initialHeight?: number, initialWidth?: number, params?: P, renderer?: DockviewPanelRenderer, tabComponent?: string, title?: string }",
"typeParameters": [],
"type": {
"type": "intersection",
"values": [
+ {
+ "type": "reference",
+ "value": "Partial",
+ "source": "typescript",
+ "typeArguments": [
+ {
+ "type": "reference",
+ "value": "Contraints",
+ "source": "dockview-core"
+ }
+ ]
+ },
{
"type": "reference",
"value": "Partial",
@@ -41058,7 +41347,7 @@
"type": "reflection",
"value": {
"name": "__type",
- "code": "{ component: string, id: string, inactive?: boolean, params?: P, renderer?: DockviewPanelRenderer, tabComponent?: string, title?: string }",
+ "code": "{ component: string, id: string, inactive?: boolean, initialHeight?: number, initialWidth?: number, params?: P, renderer?: DockviewPanelRenderer, tabComponent?: string, title?: string }",
"kind": "typeLiteral",
"properties": [
{
@@ -41125,6 +41414,30 @@
]
}
},
+ {
+ "name": "initialHeight",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
+ {
+ "name": "initialWidth",
+ "code": "number",
+ "kind": "property",
+ "type": {
+ "type": "intrinsic",
+ "value": "number"
+ },
+ "flags": {
+ "isOptional": true
+ }
+ },
{
"name": "params",
"code": "P",
diff --git a/packages/docs/templates/dockview/demo-dockview/react/src/app.tsx b/packages/docs/templates/dockview/demo-dockview/react/src/app.tsx
index f369d6914..3ab3066da 100644
--- a/packages/docs/templates/dockview/demo-dockview/react/src/app.tsx
+++ b/packages/docs/templates/dockview/demo-dockview/react/src/app.tsx
@@ -50,9 +50,14 @@ const components = {
);
},
- iframe: () => {
+ iframe: (props: IDockviewPanelProps) => {
return (