@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 6.77 kB
Source Map (JSON)
{"version":3,"file":"NcSettingsSection-DYXU4pOK.mjs","sources":["../../node_modules/vue-material-design-icons/HelpCircle.vue","../../src/components/NcSettingsSection/NcSettingsSection.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon help-circle-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"HelpCircleIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### General description\n\nThis component is to be used in the settings section of nextcloud.\n\n### Examples\n\n```vue\n<template>\n\t<div>\n\t\t<NcSettingsSection name=\"Two-factor authentication\"\n\t\t\tdescription=\"Two-factor authentication can be enforced for all accounts and specific groups. If they do not have a two-factor provider configured, they will be unable to log into the system.\"\n\t\t\tdoc-url=\"https://docs.nextcloud.com/server/19/go.php?to=admin-2fa\">\n\t\t\t<NcCheckboxRadioSwitch type=\"switch\">\n\t\t\t\tEnforce two-factor authentication\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</NcSettingsSection>\n\n\t\t<NcSettingsSection name=\"Server-side encryption\"\n\t\t\tdescription=\"Server-side encryption makes it possible to encrypt files which are uploaded to this server. This comes with limitations like a performance penalty, so enable this only if needed.\">\n\t\t\t<NcCheckboxRadioSwitch type=\"switch\">\n\t\t\t\tEnable server-side encryption\n\t\t\t</NcCheckboxRadioSwitch>\n\t\t</NcSettingsSection>\n\n\t\t<NcSettingsSection name=\"OAuth 2.0 clients\"\n\t\t\tdescription=\"OAuth 2.0 allows external services to request access to Nextcloud.\"\n\t\t\tdoc-url=\"https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html\">\n\n\t\t\tAny content here\n\n\t\t</NcSettingsSection>\n\t</div>\n</template>\n```\n</docs>\n\n<script setup lang=\"ts\">\nimport type { Slot } from 'vue'\n\nimport HelpCircle from 'vue-material-design-icons/HelpCircle.vue'\nimport { t } from '../../l10n.ts'\n\nwithDefaults(defineProps<{\n\t/**\n\t * The name of the settings section.\n\t * This is used for the headline and needs to be set.\n\t */\n\tname: string\n\n\t/**\n\t * Further informational description of the section.\n\t */\n\tdescription?: string\n\n\t/**\n\t * The URL for the documentation about this section\n\t */\n\tdocUrl?: string\n}>(), {\n\tdescription: '',\n\tdocUrl: '',\n})\n\ndefineSlots<{\n\t/**\n\t * The section content.\n\t */\n\tdefault?: Slot\n}>()\n\n/**\n * Accessible name of the link element.\n * This should only provide a textual description of the \"help\"-icon.\n */\nconst ariaLabel = t('External documentation')\n</script>\n\n<template>\n\t<div class=\"settings-section\">\n\t\t<h2 class=\"settings-section__name\">\n\t\t\t{{ name }}\n\t\t\t<a\n\t\t\t\tv-if=\"docUrl\"\n\t\t\t\t:aria-label\n\t\t\t\tclass=\"settings-section__info\"\n\t\t\t\t:href=\"docUrl\"\n\t\t\t\trel=\"noreferrer nofollow\"\n\t\t\t\ttarget=\"_blank\"\n\t\t\t\t:title=\"ariaLabel\">\n\t\t\t\t<HelpCircle :size=\"20\" />\n\t\t\t</a>\n\t\t</h2>\n\t\t<p\n\t\t\tv-if=\"description\"\n\t\t\tclass=\"settings-section__desc\">\n\t\t\t{{ description }}\n\t\t</p>\n\t\t<slot />\n\t</div>\n</template>\n\n<style lang=\"scss\" scoped>\n$maxWidth: 900px;\n$sectionMargin: calc(var(--default-grid-baseline) * 7);\n\n.settings-section {\n\tdisplay: block;\n\tpadding: 0 0 calc(var(--default-grid-baseline) * 5) 0;\n\tmargin: $sectionMargin;\n\twidth: min($maxWidth, 100% - calc($sectionMargin * 2));\n\n\t&:not(:last-child) {\n\t\tborder-bottom: 1px solid var(--color-border);\n\t}\n\n\t&__name {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tmax-width: $maxWidth;\n\t\tmargin-top: 0; // Remove default heading margin\n\t}\n\n\t&__info {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: var(--default-clickable-area);\n\t\theight: var(--default-clickable-area);\n\t\t// make sure to properly align the icon with the text\n\t\tmargin: calc($icon-margin * -1);\n\t\tmargin-inline-start: 0;\n\t\tcolor: var(--color-text-maxcontrast);\n\n\t\t&:hover, &:focus, &:active {\n\t\t\tcolor: var(--color-main-text);\n\t\t}\n\t}\n\n\t&__desc {\n\t\tmargin-top: -.2em;\n\t\tmargin-bottom: 1em;\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tmax-width: $maxWidth;\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","_hoisted_3","_createElementBlock","_mergeProps","_createElementVNode","_openBlock","name","docUrl","_unref","_createVNode","description","_toDisplayString","_renderSlot"],"mappings":";;;AAoBA,MAAKA,cAAU;AAAA,EACb,MAAM;AAAA,EACN,OAAO,CAAC,OAAO;AAAA,EACf,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA;IAER,WAAW;AAAA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