-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from soraLib/dock-panel
Dock panel
- Loading branch information
Showing
45 changed files
with
2,144 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: Dock | ||
--- | ||
|
||
# Dock | ||
|
||
The panel for each module can be undocked to become a floating panel. Floating panels can be resized and moved anywhere within the browser panel. When docking a panel, you return the view to the original view with tabs side by side, or you can dock the panel to create a different view. You can also customize your interface by applying layouts. | ||
|
||
There are 4 states that a panel can be in: | ||
|
||
- Nest-docked | ||
|
||
Panels form tabbed groupings (also known as tab-docked). | ||
|
||
- Docked | ||
|
||
Panels have tabs and share the available space. | ||
|
||
- Side-docked | ||
|
||
Panels have title bars and are located at the right or left edges of the screen. | ||
|
||
- Floating | ||
|
||
Panels are not docked. | ||
|
||
## Basic usage | ||
|
||
:::demo | ||
|
||
dock/basic | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Resize | ||
--- | ||
|
||
# Resize | ||
|
||
Used to make any HTML element resizable. | ||
|
||
With the `direction` prop, we can define customed resize directions. | ||
|
||
## Basic usage | ||
|
||
:::demo | ||
|
||
resize/basic | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<s-dock class="bg-gray-400 dock-wrapper"> | ||
<s-dock-panel name="pane-A">Pane A Content</s-dock-panel> | ||
<s-dock-panel name="pane-B">Pane B Content</s-dock-panel> | ||
<s-dock-panel :workspace="true" name="workspace" | ||
>Workspace Content</s-dock-panel | ||
> | ||
<s-dock-panel name="pane-C">Pane c Content</s-dock-panel> | ||
</s-dock> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.dock-wrapper { | ||
height: 400px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<div class="mb-4"> | ||
<s-resize :initial-size="{ width: 300, height: 300 }" direction="right"> | ||
<div | ||
class="bg-light-50 h-full dark:bg-dark-50 flex items-center justify-center" | ||
> | ||
resize direction right | ||
</div> | ||
</s-resize> | ||
</div> | ||
|
||
<div style="height: 300px"> | ||
<s-resize | ||
class="absolute right-0" | ||
:initial-size="{ width: 300, height: 300 }" | ||
direction="left" | ||
> | ||
<div | ||
class="bg-light-50 h-full dark:bg-dark-50 flex items-center justify-center" | ||
> | ||
resize direction left | ||
</div> | ||
</s-resize> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { withInstall, withNoopInstall } from '@sa-ui/utils' | ||
import Dock from './src/dock.vue' | ||
import DockPanel from './src/dock-panel.vue' | ||
|
||
export const SDock = withInstall(Dock, { DockPanel }) | ||
export default SDock | ||
|
||
export const SDockPanel = withNoopInstall(DockPanel) | ||
|
||
export * from './src/dock' | ||
export * from './src/dock-panel' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { buildProps, definePropType } from '@sa-ui/utils' | ||
import type { ExtractPropTypes } from 'vue' | ||
import type DockPanel from './dock-panel.vue' | ||
|
||
export type DockPanelDirection = 'row' | 'column' | ||
// http://ps.bndh.gob.do/ProSourceFrontOffice/Documents/WebHelp/user_tasks/Docking_and_undocking_windows.htm | ||
export type DockState = 'nested-docked' | 'docked' | 'side-docked' | 'floating' | ||
|
||
export const dockPanelProps = buildProps({ | ||
name: { | ||
type: String, | ||
required: true, | ||
}, | ||
direction: { | ||
type: definePropType<DockPanelDirection>(String), | ||
default: 'row', | ||
}, | ||
nestable: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
workspace: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
} as const) | ||
export type DockPanelProps = ExtractPropTypes<typeof dockPanelProps> | ||
export type DockPanelInstance = InstanceType<typeof DockPanel> |
Oops, something went wrong.