UNPKG

@nextcloud/vue

Version:
1 lines 2.08 kB
{"version":3,"file":"NcGuestContent.mjs","sources":["../../src/components/NcGuestContent/NcGuestContent.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### General description\n\nThis components provides a wrapper around guest page content.\nIt should be used as the main wrapper for guest pages, similar to `NcContent` for public and user pages.\nMeaning this component must be used as the root component for your application\nif you render the page using `OCP\\AppFramework\\Http\\TemplateResponse::RENDER_AS_GUEST`.\n\nIt can't be used multiple times on the same page.\n\n### Usage\n\n```html static\n<template>\n\t<NcGuestContent>\n\t\t<h2>Hello guest</h2>\n\t\t<span>How are you?</span>\n\t</NcGuestContent>\n</template>\n```\n</docs>\n\n<template>\n\t<div id=\"guest-content-vue\">\n\t\t<slot />\n\t</div>\n</template>\n\n<script>\n/**\n * Guest content container to be used for the guest content of your app\n */\nexport default {\n\tname: 'NcGuestContent',\n\tmounted() {\n\t\tdocument.getElementById('content').classList.add('nc-guest-content')\n\t},\n\n\tdestroyed() {\n\t\tdocument.getElementById('content').classList.remove('nc-guest-content')\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n#guest-content-vue {\n\tcolor: var(--color-main-text);\n\tbackground-color: var(--color-main-background);\n\tmin-width: 0;\n\tborder-radius: var(--border-radius-large);\n\tbox-shadow: 0 0 10px var(--color-box-shadow);\n\theight: fit-content;\n\tpadding: 15px;\n\tmargin: 20px auto;\n}\n</style>\n\n<style lang=\"scss\">\n#content.nc-guest-content {\n\t// Enable scrolling\n\toverflow: auto;\n\n\t// Fix box being cutoff at the bottom\n\tmargin-bottom: 0;\n\theight: calc(var(--body-height) + var(--body-container-margin));\n}\n</style>\n"],"names":[],"mappings":";AAqCA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AACA,aAAA,eAAA,SAAA,EAAA,UAAA,IAAA,kBAAA;AAAA,EACA;AAAA,EAEA,YAAA;AACA,aAAA,eAAA,SAAA,EAAA,UAAA,OAAA,kBAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}