diff --git a/src/components/NcAppContent/NcAppContent.vue b/src/components/NcAppContent/NcAppContent.vue index 4c3ba925..f922d156 100644 --- a/src/components/NcAppContent/NcAppContent.vue +++ b/src/components/NcAppContent/NcAppContent.vue @@ -78,16 +78,18 @@ The list size must be between the min and the max width value. - - + @@ -119,11 +120,11 @@ import NcAppDetailsToggle from './NcAppDetailsToggle.vue' import { useIsMobile } from '../../composables/useIsMobile/index.js' import { getBuilder } from '@nextcloud/browser-storage' -import { emit } from '@nextcloud/event-bus' import { useSwipe } from '@vueuse/core' import { Splitpanes, Pane } from 'splitpanes' import 'splitpanes/dist/splitpanes.css' +import { emit } from '@nextcloud/event-bus' const browserStorage = getBuilder('nextcloud').persist().build() @@ -139,7 +140,6 @@ export default { Pane, Splitpanes, }, - props: { /** * Allows to disable the control by swipe of the app navigation open state @@ -202,6 +202,19 @@ export default { type: String, default: null, }, + /** + * 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. + * On mobile screen `no-split` layout is forced. + */ + layout: { + type: String, + default: 'vertical-split', + validator(value) { + return ['no-split', 'vertical-split'].includes(value) + }, + }, }, emits: [ @@ -219,7 +232,7 @@ export default { return { contentHeight: 0, hasList: false, - + hasContent: false, swiping: {}, listPaneSize: this.restorePaneConfig(), } @@ -271,7 +284,7 @@ export default { }, updated() { - this.checkListSlot() + this.checkSlots() }, mounted() { @@ -281,7 +294,7 @@ export default { }) } - this.checkListSlot() + this.checkSlots() this.restorePaneConfig() }, @@ -320,11 +333,9 @@ export default { }, // $slots is not reactive, we need to update this manually - checkListSlot() { - const hasListSlot = !!this.$slots.list - if (this.hasList !== hasListSlot) { - this.hasList = hasListSlot - } + checkSlots() { + this.hasList = !!this.$slots.list + this.hasContent = !!this.$slots.default }, // browserStorage is not reactive, we need to update this manually @@ -370,7 +381,7 @@ export default { } // Mobile list/details handling -.app-content-wrapper--mobile { +.app-content-wrapper--no-split { &.app-content-wrapper--show-list :deep() { .app-content-list { display: flex; @@ -431,4 +442,10 @@ export default { } } } + +.app-content-wrapper--show-list { + :deep(.app-content-list) { + max-width: none; + } +} diff --git a/src/components/NcAppContent/NcAppDetailsToggle.vue b/src/components/NcAppContent/NcAppDetailsToggle.vue index 33801e39..ad46c17b 100644 --- a/src/components/NcAppContent/NcAppDetailsToggle.vue +++ b/src/components/NcAppContent/NcAppDetailsToggle.vue @@ -21,7 +21,11 @@ --> -