Skip to content

Commit

Permalink
Add horizontal split for appcontent
Browse files Browse the repository at this point in the history
Signed-off-by: greta <gretadoci@gmail.com>
  • Loading branch information
GretaD committed Mar 15, 2024
1 parent 1bb6ff4 commit 85af791
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions src/components/NcAppContent/NcAppContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ The list size must be between the min and the max width value.

<slot v-else />
</div>
<div v-else-if="layout === 'vertical-split'" class="app-content-wrapper">
<Splitpanes class="default-theme"
<div v-else-if="layout === 'vertical-split' || layout === 'horizontal-split'" class="app-content-wrapper">
<Splitpanes :horizontal="layout === 'horizontal-split'"
class="default-theme"
:class="{ 'splitpanes--horizontal': layout === 'horizontal-split',
'splitpanes--vertical': layout === 'vertical-split'
}"
@resized="handlePaneResize">
<Pane class="splitpanes__pane-list"
:size="listPaneSize || paneDefaults.list.size"
Expand Down Expand Up @@ -150,7 +154,7 @@ export default {
},
/**
* Allows you to set the default width of the resizable list in %
* Allows you to set the default height of the resizable list in % on horizontal-split
* Must be between listMinWidth and listMaxWidth
*/
listSize: {
Expand All @@ -159,15 +163,15 @@ export default {
},
/**
* Allows you to set the minimum width of the list column in %
* Allows you to set the minimum height of the list column in % on horizontal-split
*/
listMinWidth: {
type: Number,
default: 15,
},
/**
* Allows you to set the maximum width of the list column in %
* Allows you to set the maximum height of the list column in % on horizontal-split
*/
listMaxWidth: {
type: Number,
Expand Down Expand Up @@ -206,13 +210,14 @@ export default {
* Content layout used when there is a list together with content:
* - `vertical-split` - a 2-column layout with list and default content separated vertically
* - `no-split` - a single column layout; List is shown when `showDetails` is `false`, otherwise the default slot content is shown with a back button to return to the list.
* - 'horizontal-split' - a 2-column layout with list and default content separated horizontally
* On mobile screen `no-split` layout is forced.
*/
layout: {
type: String,
default: 'vertical-split',
validator(value) {
return ['no-split', 'vertical-split'].includes(value)
return ['no-split', 'vertical-split', 'horizontal-split'].includes(value)
},
},
},
Expand Down Expand Up @@ -414,7 +419,6 @@ export default {
&-list {
min-width: 300px;
position: sticky;
top: var(--header-height);
@media only screen and (width < $breakpoint-mobile) {
display: none;
Expand All @@ -429,16 +433,23 @@ export default {
}
}
}
.splitpanes__splitter {
width: 9px;
margin-left: -5px;
background-color: transparent;
border-left: none;
&:before,
&:after {
display: none;
.app-content-wrapper--vertical-split {
.splitpanes__splitter {
width: 9px;
margin-left: -5px;
background-color: transparent;
border-left: none;
&:before,
&:after {
display: none;
}
}
}
.app-content-wrapper--horizontal-split {
.splitpanes__splitter {
height: 9px;
margin-top: -5px;
}
}
}
Expand Down

0 comments on commit 85af791

Please sign in to comment.