UNPKG

@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/).

63 lines (62 loc) 2.53 kB
import '../mt-field-label.css'; import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot } from "vue"; import MtInheritanceSwitch from "./MtInheritanceSwitch.js"; import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.mjs"; import "../mt-icon.vue_vue_type_style_index_0_lang-2cc5f73e.mjs"; import "./MtTooltip.js"; import "../floating-ui.vue-fe27ebef.mjs"; import "../floating-ui.dom-f450fda4.mjs"; import "../useIsInsideTooltip-0c3bd290.mjs"; import "../index-221bad05.mjs"; import "vue-i18n"; const _hoisted_1 = ["for"]; const _sfc_main = /* @__PURE__ */ 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 = 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 openBlock(), createElementBlock("label", { for: props.for, class: 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" ? (openBlock(), 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"])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default", {}, void 0, true) ], 42, _hoisted_1); }; } }); const mtFieldLabel_vue_vue_type_style_index_0_scoped_aef4539e_lang = ""; const MtFieldLabel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-aef4539e"]]); export { MtFieldLabel as default }; //# sourceMappingURL=MtFieldLabel.js.map