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

79 lines (78 loc) 3.17 kB
import '../mt-inheritance-switch.css'; import { defineComponent, openBlock, createBlock, unref, withCtx, createElementVNode, mergeProps } from "vue"; import { _ as _sfc_main$1 } from "../mt-icon.vue_vue_type_style_index_0_lang-2cc5f73e.mjs"; import MtTooltip from "./MtTooltip.js"; import { useI18n } from "vue-i18n"; import { _ as _export_sfc } from "../_plugin-vue_export-helper-cc2b3d55.mjs"; import "../floating-ui.vue-fe27ebef.mjs"; import "../floating-ui.dom-f450fda4.mjs"; import "../useIsInsideTooltip-0c3bd290.mjs"; import "../index-221bad05.mjs"; const _hoisted_1 = ["disabled", "aria-label"]; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "mt-inheritance-switch", props: { isInherited: { type: Boolean }, disabled: { type: Boolean } }, emits: ["inheritanceRemove", "inheritanceRestore"], setup(__props) { const { t } = 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 openBlock(), createBlock(MtTooltip, { content: _ctx.isInherited ? unref(t)("tooltipRemoveInheritance") : unref(t)("tooltipRestoreInheritance") }, { default: withCtx((props) => [ createElementVNode("button", 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 ? unref(t)("unlinkInheritance") : unref(t)("linkInheritance"), onClick: _cache[0] || (_cache[0] = ($event) => _ctx.isInherited ? _ctx.$emit("inheritanceRemove") : _ctx.$emit("inheritanceRestore")) }), [ _ctx.isInherited ? (openBlock(), createBlock(_sfc_main$1, { key: 0, "data-testid": "mt-inheritance-switch-icon", multicolor: true, name: "regular-link-horizontal", size: "14" })) : (openBlock(), createBlock(_sfc_main$1, { 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__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b7efaa46"]]); export { MtInheritanceSwitch as default }; //# sourceMappingURL=MtInheritanceSwitch.js.map