Skip to content

Commit

Permalink
feat(dock-manager): add support for floating panes
Browse files Browse the repository at this point in the history
  • Loading branch information
epetrow committed Dec 16, 2024
1 parent 271f7af commit 39d1952
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/default/scss/dock-manager/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@
z-index: 10;
}

.k-dock-manager-window:has(.k-pane) .k-window-content {
padding: 0;
}

}

@mixin kendo-dock-navigator--layout() {
Expand Down
4 changes: 4 additions & 0 deletions packages/fluent/scss/dock-manager/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@
border-radius: var( --kendo-dock-manager-dock-preview-border-radius, #{$kendo-dock-manager-dock-preview-border-radius} );
}

.k-dock-manager-window:has(.k-pane) .k-window-content {
padding: 0;
}

}

@mixin kendo-dock-indicator--layout() {
Expand Down
120 changes: 120 additions & 0 deletions packages/html/src/dock-manager/tests/dock-manager-floating-panes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import { Button } from "../../button";
import { MenuButton } from "../../menu-button";
import { SplitterPane } from "../../splitter";
import { TabStripNormal, TabStripItem, TabStripContent } from "../../tabstrip";
import { WindowNormal } from "../../window";
import { DockManagerSplitter, PaneScrollable } from "../";

const style = `
.k-window {
position: relative;
top: 1rem;
}
`;

export default () => (
<>
<style>{style}</style>
<div id="test-area" className="k-d-grid k-grid-cols-2">
<section>
<span>Floating Pane</span>
<WindowNormal
className="k-dock-manager-window"
title="Pane Title"
actions={["window-minimize", "window", "more-vertical"]}
children={
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Consequatur error repudiandaecorrupti qui. Ipsum corporis, voluptates numquam distinctio et dolorem illum. Ipsa, laborumsoluta cum asperiores sit fuga iure ad.
Deleniti veniam totam debitis quidem vitae id sunt, fuga at ipsa sed deserunt nulla ipsumquam!
</p>
}/>
</section>
<section>
<span>Floating Pane with TabStrip</span>
<WindowNormal
style={{ width: "466px" }}
className="k-dock-manager-window"
title="Pane Title 1"
actions={["window-minimize", "window", "more-vertical"]}
children={
<TabStripNormal
tabStripItems={
<>
<TabStripItem
first
value="Pane Title 1"
active
actions={
<>
<Button fillMode="flat" icon="pin"></Button>
<MenuButton
fillMode="flat"
icon="more-vertical"
showArrow={false}
></MenuButton>
</>
}
></TabStripItem>
<TabStripItem
last
value="Pane Title 2"
actions={
<>
<Button fillMode="flat" icon="pin"></Button>
<MenuButton
fillMode="flat"
icon="more-vertical"
showArrow={false}
></MenuButton>
</>
}
></TabStripItem>
</>
}>
<TabStripContent active>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Commodi suscipit porro optio veritatis obcaecati nostrum molestias dolor maxime! Molestias ducimus placeat quia possimus esse atque odio, a recusandae iste exercitationem.
</TabStripContent>
</TabStripNormal>
}/>
</section>
<section>
<span>Floating Pane with Splitter</span>
<WindowNormal
className="k-dock-manager-window"
title="Pane Title 1"
actions={["window-minimize", "window", "more-vertical"]}
children={
<>
<DockManagerSplitter>
<SplitterPane>
<PaneScrollable title="Pane Title 1" actions={
<>
<Button fillMode="flat" icon="pin"></Button>
<MenuButton fillMode="flat" icon="more-vertical" showArrow={false}></MenuButton>
</>
}>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusamus perspiciatis mollitia dicta expedita numquam reprehenderit assumenda rem eum id voluptas laborum pariatur ab alias iure accusantium blanditiis, corporis, ut maxime?
</p>
</PaneScrollable>
</SplitterPane>
<SplitterPane>
<PaneScrollable title="Pane Title 2" actions={
<>
<Button fillMode="flat" icon="pin"></Button>
<MenuButton fillMode="flat" icon="more-vertical" showArrow={false}></MenuButton>
</>
}>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusamus perspiciatis mollitia dicta expedita numquam reprehenderit assumenda rem eum id voluptas laborum pariatur ab alias iure accusantium blanditiis, corporis, ut maxime?
</p>
</PaneScrollable>
</SplitterPane>

</DockManagerSplitter>
</>
}/>
</section>
</div>
</>
);
16 changes: 15 additions & 1 deletion packages/html/src/window/window.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ActionButtons } from '../action-buttons';
import { Button } from '../button';
import { MenuButton } from '../menu-button';
import { classNames, optionClassNames, ThemeColor } from '../misc';

export const WINDOW_CLASSNAME = `k-window`;
Expand Down Expand Up @@ -60,7 +61,20 @@ export const Window = (
{actions && <>
<div className="k-window-titlebar-actions">
{actions.map(actionName =>
<Button key={actionName} icon={actionName} fillMode="flat" className="k-window-titlebar-action"></Button>
actionName === "more-vertical" ?
<MenuButton
key={actionName}
icon={actionName}
fillMode="flat"
showArrow={false}
className="k-window-titlebar-action"
></MenuButton> :
<Button
key={actionName}
icon={actionName}
fillMode="flat"
className="k-window-titlebar-action"
></Button>
)}
</div>
</>}
Expand Down

0 comments on commit 39d1952

Please sign in to comment.