@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 2.3 kB
Source Map (JSON)
{"version":3,"file":"NcGuestContent-CfCh49o0.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\nGuest content container to be used for the guest content of your app.\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<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport { onMounted, onUnmounted } from 'vue'\n\ndefineSlots<{\n\tdefault?: Slot\n}>()\n\nonMounted(() => {\n\tdocument.getElementById('content')!.classList.add('nc-guest-content')\n})\n\nonUnmounted(() => {\n\tdocument.getElementById('content')!.classList.remove('nc-guest-content')\n})\n</script>\n\n<template>\n\t<div id=\"guest-content-vue\">\n\t\t<slot />\n\t</div>\n</template>\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-element);\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":["_openBlock","_createElementBlock","_renderSlot"],"mappings":";;;;;;AAqCA,cAAU,MAAM;AACf,eAAS,eAAe,SAAS,EAAG,UAAU,IAAI,kBAAkB;AAAA,IACrE,CAAC;AAED,gBAAY,MAAM;AACjB,eAAS,eAAe,SAAS,EAAG,UAAU,OAAO,kBAAkB;AAAA,IACxE,CAAC;;AAIA,aAAAA,UAAA,GAAAC,mBAEM,OAFN,YAEM;AAAA,QADLC,WAAQ,KAAA,QAAA,WAAA,CAAA,GAAA,QAAA,IAAA;AAAA,MAAA;;;;;"}