import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { Fragment as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, guardReactiveProps as o, normalizeClass as s, normalizeProps as c, normalizeStyle as l, openBlock as u, renderList as d, renderSlot as f, resolveComponent as p, toDisplayString as m, withCtx as h, withModifiers as g } from "vue";
//#region src/components/wt-context-menu/wt-context-menu.vue
var _ = { class: "wt-context-menu" }, v = ["onClick"], y = /*#__PURE__*/ e({
	__name: "wt-context-menu",
	props: {
		options: {
			type: Array,
			required: !0,
			description: "[{ text, disabled, ... anything you need }]"
		},
		visible: {
			type: Boolean,
			default: !1
		},
		width: {
			type: [String],
			default: "auto"
		},
		minWidth: {
			type: [String],
			default: "160px"
		},
		maxWidth: {
			type: [String],
			default: "300px"
		},
		disabled: {
			type: Boolean,
			default: !1
		},
		pt: {
			type: Object,
			default: () => null
		},
		tooltipTriggers: {
			type: Array,
			default: () => ["click", "touch"]
		}
	},
	emits: ["click", "update:visible"],
	setup(e, { emit: y }) {
		let b = y;
		function x({ option: e, index: t, hide: n }) {
			b("click", {
				option: e,
				index: t
			}), n();
		}
		return (y, b) => {
			let S = p("wt-popover");
			return u(), n("div", _, [a(S, {
				visible: e.visible,
				disabled: e.disabled,
				pt: e.pt,
				unstyled: "",
				placement: "bottom-end",
				class: "wt-context-menu__floating-wrapper"
			}, {
				activator: h(({ toggle: e, show: t }) => [f(y.$slots, "activator", c(o({
					toggle: e,
					show: t
				})), void 0, !0)]),
				default: h(({ hide: a }) => [r("ul", {
					style: l(`width: ${e.width}; min-width: ${e.minWidth}; max-width: ${e.maxWidth};`),
					class: "wt-context-menu__menu typo-body-2"
				}, [(u(!0), n(t, null, d(e.options, (e, t) => (u(), n("li", {
					key: t,
					class: "wt-context-menu__option-wrapper"
				}, [r("a", {
					class: s([[{ "wt-context-menu__option--disabled": e.disabled }], "wt-context-menu__option"]),
					href: "#",
					onClick: g((n) => x({
						option: e,
						index: t,
						hide: a
					}), ["prevent"])
				}, [f(y.$slots, "option", c(o(e)), () => [i(m(e.text || e), 1)], !0)], 10, v)]))), 128))], 4)]),
				_: 3
			}, 8, [
				"visible",
				"disabled",
				"pt"
			])]);
		};
	}
}, [["__scopeId", "data-v-fdfb8299"]]);
//#endregion
export { y as default };
