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

78 lines (77 loc) 3.29 kB
import '../mt-inheritance-switch.css'; "use strict"; const vue = require("vue"); const mtIcon_vue_vue_type_style_index_0_lang = require("../mt-icon.vue_vue_type_style_index_0_lang-0a28c7b6.js"); const MtTooltip = require("./MtTooltip.js"); const vueI18n = require("vue-i18n"); const _pluginVue_exportHelper = require("../_plugin-vue_export-helper-9c783a34.js"); require("../floating-ui.vue-48d5c774.js"); require("../floating-ui.dom-fe395b67.js"); require("../useIsInsideTooltip-f4674e27.js"); require("../index-ab705c2a.js"); const _hoisted_1 = ["disabled", "aria-label"]; const _sfc_main = /* @__PURE__ */ vue.defineComponent({ __name: "mt-inheritance-switch", props: { isInherited: { type: Boolean }, disabled: { type: Boolean } }, emits: ["inheritanceRemove", "inheritanceRestore"], setup(__props) { const { t } = vueI18n.useI18n({ messages: { en: { tooltipRemoveInheritance: "Remove inheritance", tooltipRestoreInheritance: "Restore inheritance", linkInheritance: "Link inheritance", unlinkInheritance: "Unlink inheritance" }, de: { tooltipRemoveInheritance: "Vererbung entfernen", tooltipRestoreInheritance: "Vererbung wiederherstellen", linkInheritance: "Vererbung verknüpfen", unlinkInheritance: "Vererbung trennen" } } }); return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(MtTooltip, { content: _ctx.isInherited ? vue.unref(t)("tooltipRemoveInheritance") : vue.unref(t)("tooltipRestoreInheritance") }, { default: vue.withCtx((props) => [ vue.createElementVNode("button", vue.mergeProps(props, { class: [ "mt-inheritance-switch", { "mt-inheritance-switch--disabled": _ctx.disabled, "mt-inheritance-switch--is-inherited": _ctx.isInherited, "mt-inheritance-switch--is-not-inherited": !_ctx.isInherited } ], disabled: _ctx.disabled, "aria-label": _ctx.isInherited ? vue.unref(t)("unlinkInheritance") : vue.unref(t)("linkInheritance"), onClick: _cache[0] || (_cache[0] = ($event) => _ctx.isInherited ? _ctx.$emit("inheritanceRemove") : _ctx.$emit("inheritanceRestore")) }), [ _ctx.isInherited ? (vue.openBlock(), vue.createBlock(mtIcon_vue_vue_type_style_index_0_lang._sfc_main, { key: 0, "data-testid": "mt-inheritance-switch-icon", multicolor: true, name: "regular-link-horizontal", size: "14" })) : (vue.openBlock(), vue.createBlock(mtIcon_vue_vue_type_style_index_0_lang._sfc_main, { key: 1, multicolor: true, name: "regular-link-horizontal-slash", size: "14" })) ], 16, _hoisted_1) ]), _: 1 }, 8, ["content"]); }; } }); const mtInheritanceSwitch_vue_vue_type_style_index_0_scoped_b7efaa46_lang = ""; const MtInheritanceSwitch = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-b7efaa46"]]); module.exports = MtInheritanceSwitch; //# sourceMappingURL=MtInheritanceSwitch.js.map