@nextcloud/vue
Version:
Nextcloud vue components
107 lines (106 loc) • 3.87 kB
JavaScript
require('../assets/NcSettingsSection-_mX6UqM_.css');
;
const _l10n = require("./_l10n-CjO_W5Dt.cjs");
const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
_l10n.register(_l10n.t23);
const _sfc_main$1 = {
name: "HelpCircleIcon",
emits: ["click"],
props: {
title: {
type: String
},
fillColor: {
type: String,
default: "currentColor"
},
size: {
type: Number,
default: 24
}
}
};
var _sfc_render$1 = function render() {
var _vm = this, _c = _vm._self._c;
return _c("span", _vm._b({ staticClass: "material-design-icon help-circle-icon", attrs: { "aria-hidden": _vm.title ? null : "true", "aria-label": _vm.title, "role": "img" }, on: { "click": function($event) {
return _vm.$emit("click", $event);
} } }, "span", _vm.$attrs, false), [_c("svg", { staticClass: "material-design-icon__svg", attrs: { "fill": _vm.fillColor, "width": _vm.size, "height": _vm.size, "viewBox": "0 0 24 24" } }, [_c("path", { attrs: { "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" } }, [_vm.title ? _c("title", [_vm._v(_vm._s(_vm.title))]) : _vm._e()])])]);
};
var _sfc_staticRenderFns$1 = [];
var __component__$1 = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
_sfc_main$1,
_sfc_render$1,
_sfc_staticRenderFns$1,
false,
null,
null
);
const HelpCircle = __component__$1.exports;
const _sfc_main = {
name: "NcSettingsSection",
components: {
HelpCircle
},
props: {
name: {
type: String,
required: true
},
description: {
type: String,
default: ""
},
docUrl: {
type: String,
default: ""
},
/**
* Limit the width of the setting's content
*
* Setting this to false allows unrestricted (width) settings content.
* Note that the name and description have always a width limit.
* @deprecated Will be removed with next version and will not be used on Nextcloud 30+ (always forced to true)
*/
limitWidth: {
type: Boolean,
default: true
}
},
data() {
return {
docNameTranslated: _l10n.t("External documentation for {name}", {
name: this.name
})
};
},
computed: {
forceLimitWidth() {
if (this.limitWidth) {
return true;
}
const [major] = window._oc_config?.version.split(".", 2) ?? [];
return major && Number.parseInt(major) >= 30;
},
hasDescription() {
return this.description.length > 0;
},
hasDocUrl() {
return this.docUrl.length > 0;
}
}
};
var _sfc_render = function render2() {
var _vm = this, _c = _vm._self._c;
return _c("div", { staticClass: "settings-section", class: { "settings-section--limit-width": _vm.forceLimitWidth } }, [_c("h2", { staticClass: "settings-section__name" }, [_vm._v(" " + _vm._s(_vm.name) + " "), _vm.hasDocUrl ? _c("a", { staticClass: "settings-section__info", attrs: { "href": _vm.docUrl, "title": _vm.docNameTranslated, "aria-label": _vm.docNameTranslated, "target": "_blank", "rel": "noreferrer nofollow" } }, [_c("HelpCircle", { attrs: { "size": 20 } })], 1) : _vm._e()]), _vm.hasDescription ? _c("p", { staticClass: "settings-section__desc" }, [_vm._v(" " + _vm._s(_vm.description) + " ")]) : _vm._e(), _vm._t("default")], 2);
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns,
false,
null,
"6f6953b5"
);
const NcSettingsSection = __component__.exports;
exports.NcSettingsSection = NcSettingsSection;