Skip to content

Commit ea833ca

Browse files
authored
Merge pull request #5401 from nextcloud-libraries/feat/horizontal-split
Feat(NcAppContent) Add horizontal split for appcontent
2 parents 410e066 + 45792a6 commit ea833ca

File tree

1 file changed

+31
-17
lines changed

1 file changed

+31
-17
lines changed

src/components/NcAppContent/NcAppContent.vue

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ The list size must be between the min and the max width value.
8989

9090
<slot v-else />
9191
</div>
92-
<div v-else-if="layout === 'vertical-split'" class="app-content-wrapper">
93-
<Splitpanes class="default-theme"
92+
<div v-else-if="layout === 'vertical-split' || layout === 'horizontal-split'" class="app-content-wrapper">
93+
<Splitpanes :horizontal="layout === 'horizontal-split'"
94+
class="default-theme"
95+
:class="{ 'splitpanes--horizontal': layout === 'horizontal-split',
96+
'splitpanes--vertical': layout === 'vertical-split'
97+
}"
9498
@resized="handlePaneResize">
9599
<Pane class="splitpanes__pane-list"
96100
:size="listPaneSize || paneDefaults.list.size"
@@ -150,7 +154,8 @@ export default {
150154
},
151155
152156
/**
153-
* Allows you to set the default width of the resizable list in %
157+
* Allows you to set the default width of the resizable list in % on vertical-split
158+
* Allows you to set the default height of the resizable list in % on horizontal-split
154159
* Must be between listMinWidth and listMaxWidth
155160
*/
156161
listSize: {
@@ -159,15 +164,17 @@ export default {
159164
},
160165
161166
/**
162-
* Allows you to set the minimum width of the list column in %
167+
* Allows you to set the minimum width of the list column in % on vertical-split
168+
* Allows you to set the minimum height of the list column in % on horizontal-split
163169
*/
164170
listMinWidth: {
165171
type: Number,
166172
default: 15,
167173
},
168174
169175
/**
170-
* Allows you to set the maximum width of the list column in %
176+
* Allows you to set the maximum width of the list column in % on vertical-split
177+
* Allows you to set the maximum height of the list column in % on horizontal-split
171178
*/
172179
listMaxWidth: {
173180
type: Number,
@@ -206,13 +213,14 @@ export default {
206213
* Content layout used when there is a list together with content:
207214
* - `vertical-split` - a 2-column layout with list and default content separated vertically
208215
* - `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.
216+
* - 'horizontal-split' - a 2-column layout with list and default content separated horizontally
209217
* On mobile screen `no-split` layout is forced.
210218
*/
211219
layout: {
212220
type: String,
213221
default: 'vertical-split',
214222
validator(value) {
215-
return ['no-split', 'vertical-split'].includes(value)
223+
return ['no-split', 'vertical-split', 'horizontal-split'].includes(value)
216224
},
217225
},
218226
},
@@ -414,7 +422,6 @@ export default {
414422
&-list {
415423
min-width: 300px;
416424
position: sticky;
417-
top: var(--header-height);
418425
419426
@media only screen and (width < $breakpoint-mobile) {
420427
display: none;
@@ -429,16 +436,23 @@ export default {
429436
}
430437
}
431438
}
432-
433-
.splitpanes__splitter {
434-
width: 9px;
435-
margin-left: -5px;
436-
background-color: transparent;
437-
border-left: none;
438-
439-
&:before,
440-
&:after {
441-
display: none;
439+
.app-content-wrapper--vertical-split {
440+
.splitpanes__splitter {
441+
width: 9px;
442+
margin-left: -5px;
443+
background-color: transparent;
444+
border-left: none;
445+
446+
&:before,
447+
&:after {
448+
display: none;
449+
}
450+
}
451+
}
452+
.app-content-wrapper--horizontal-split {
453+
.splitpanes__splitter {
454+
height: 9px;
455+
margin-top: -5px;
442456
}
443457
}
444458
}

0 commit comments

Comments
 (0)