@shopware-ag/meteor-component-library
Version:
The meteor component library is a Vue component library developed by Shopware. It is based on the [Meteor Design System](https://shopware.design/).
62 lines (61 loc) • 2.5 kB
JavaScript
import '../mt-field-label.css';
"use strict";
const vue = require("vue");
const MtInheritanceSwitch = require("./MtInheritanceSwitch.js");
const _pluginVue_exportHelper = require("../_plugin-vue_export-helper-9c783a34.js");
require("../mt-icon.vue_vue_type_style_index_0_lang-0a28c7b6.js");
require("./MtTooltip.js");
require("../floating-ui.vue-48d5c774.js");
require("../floating-ui.dom-fe395b67.js");
require("../useIsInsideTooltip-f4674e27.js");
require("../index-ab705c2a.js");
require("vue-i18n");
const _hoisted_1 = ["for"];
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
__name: "mt-field-label",
props: {
for: {},
hasError: { type: Boolean },
required: { type: Boolean },
inheritance: { default: "none" },
disabled: { type: Boolean }
},
emits: ["update:inheritance"],
setup(__props) {
const props = __props;
const classes = vue.computed(() => [
"mt-field-label",
{
"mt-field-label--with-error": props.hasError,
"mt-field-label--is-required": props.required,
"mt-field-label--has-linked-inheritance": props.inheritance === "linked"
}
]);
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("label", {
for: props.for,
class: vue.normalizeClass(classes.value),
onMousedown: _cache[2] || (_cache[2] = (event) => {
const target = event.target;
if (target.closest("button, input, select, textarea"))
return;
if (!event.defaultPrevented && event.detail > 1)
event.preventDefault();
})
}, [
_ctx.inheritance !== "none" ? (vue.openBlock(), vue.createBlock(MtInheritanceSwitch, {
key: 0,
"is-inherited": _ctx.inheritance === "linked",
disabled: _ctx.disabled,
onInheritanceRemove: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:inheritance", "unlinked")),
onInheritanceRestore: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:inheritance", "linked"))
}, null, 8, ["is-inherited", "disabled"])) : vue.createCommentVNode("", true),
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
], 42, _hoisted_1);
};
}
});
const mtFieldLabel_vue_vue_type_style_index_0_scoped_aef4539e_lang = "";
const MtFieldLabel = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-aef4539e"]]);
module.exports = MtFieldLabel;
//# sourceMappingURL=MtFieldLabel.js.map