-
-
{children}
+
+
{hasFooter &&
{footer}
}
);
-});
-DockPanel.displayName = 'DockPanel';
+ if (!resizable) return panel;
+
+ if (!initialResizeMeasurements) {
+ return (
+
+ );
+ }
+
+ const resizeLayoutStyle: DockPanelStyle = {
+ height: placement === 'left' || placement === 'right' ? panelStyle['--dock-panel-height'] : undefined,
+ maxHeight: panelStyle['--dock-panel-max-height'],
+ zIndex: style?.zIndex,
+ '--dock-panel-gap': panelStyle['--dock-panel-gap'],
+ '--dock-panel-rail-size': panelStyle['--dock-panel-rail-size'],
+ '--dock-panel-layer': panelStyle['--dock-panel-layer'],
+ };
+
+ return (
+
+
+ {panel}
+
+
+ );
+};
/**
- * Shared layout for one DockPanel and its underlying application content.
- * Expanded panels are out of flow. A minimized panel occupies a separate grid track,
- * so the workspace resizes without being obscured by the rail.
- * Keep the layout mounted when opening/closing the panel to preserve application state.
+ * Expanded panels overlay the workspace; minimized panels reserve a grid track.
+ * Keep the layout mounted when opening/closing panels to preserve workspace state.
*/
-export interface DockPanelLayoutProps extends Omit
, 'children'> {
- /** Required. Underlying application content, such as a map, editor or table. */
+export interface DockPanelLayoutProps {
+ /** Underlying application content. */
children: ReactNode;
- /** Optional. One DockPanel, or a layout-aware wrapper containing it. Null means closed. */
+ /** One DockPanel or a layout-aware wrapper containing it. Null means closed. */
panel?: ReactNode;
+ /** Additional workspace layout class names. */
+ className?: string;
+ /** Workspace layout styles, including its height. */
+ style?: CSSProperties;
}
-export const DockPanelLayout = forwardRef(
- ({ children, panel, className, ...rest }, ref) => (
-
-
- {children}
-
- {panel}
-
- )
+export const DockPanelLayout = ({ children, panel, className, style }: DockPanelLayoutProps): JSX.Element => (
+
);
-DockPanelLayout.displayName = 'DockPanelLayout';
-
export default DockPanel;