import { defineComponent, useTemplateRef, computed, resolveComponent, createBlock, openBlock, Teleport, createElementBlock, createCommentVNode, withModifiers, createElementVNode, normalizeStyle, normalizeClass, renderSlot, createVNode, withCtx, createTextVNode } from 'vue';

"use strict";
const _hoisted_1 = { class: "ll-calendar__contextmenu-actions" };
var _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "calendar-context-menu",
  props: {
    open: { type: Boolean, required: true },
    style: { type: Object, required: true },
    event: { required: true },
    currentEditableEvent: { type: Object, required: true },
    boundaryStyle: { type: Object, required: false }
  },
  emits: ["close", "edit", "copy", "remove"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const menuRef = useTemplateRef("menuRef");
    const canDelete = computed(() => props.currentEditableEvent.delete !== false);
    const closeMenu = () => {
      emit("close");
    };
    __expose({
      menuRef
    });
    return (_ctx, _cache) => {
      const _component_ll_button = resolveComponent("ll-button");
      return openBlock(), createBlock(Teleport, { to: "body" }, [
        __props.open ? (openBlock(), createElementBlock(
          "div",
          {
            key: 0,
            class: "ll-calendar__contextmenu-layer",
            onClick: _cache[4] || (_cache[4] = withModifiers(($event) => emit("close"), ["self"])),
            onContextmenu: _cache[5] || (_cache[5] = withModifiers(() => {
            }, ["prevent"]))
          },
          [
            createElementVNode(
              "div",
              {
                ref: "boundaryRef",
                class: "ll-calendar__boundary-proxy",
                style: normalizeStyle(__props.boundaryStyle),
                "aria-hidden": "true"
              },
              [
                createElementVNode(
                  "div",
                  {
                    ref_key: "menuRef",
                    ref: menuRef,
                    class: normalizeClass([`ll-calendar__contextmenu`, `ll-calendar__teleport-layer`]),
                    style: normalizeStyle(__props.style),
                    onClick: _cache[3] || (_cache[3] = withModifiers(() => {
                    }, ["stop"]))
                  },
                  [
                    renderSlot(_ctx.$slots, "event-contextmenu", {
                      event: __props.event,
                      close: closeMenu,
                      edit: () => emit("edit"),
                      copy: () => emit("copy"),
                      remove: () => emit("remove")
                    }, () => [
                      createElementVNode("div", _hoisted_1, [
                        createVNode(_component_ll_button, {
                          size: "small",
                          onClick: _cache[0] || (_cache[0] = ($event) => emit("edit"))
                        }, {
                          default: withCtx(() => [..._cache[6] || (_cache[6] = [
                            createTextVNode(
                              "\u7F16\u8F91",
                              -1
                              /* CACHED */
                            )
                          ])]),
                          _: 1
                          /* STABLE */
                        }),
                        createVNode(_component_ll_button, {
                          size: "small",
                          onClick: _cache[1] || (_cache[1] = ($event) => emit("copy"))
                        }, {
                          default: withCtx(() => [..._cache[7] || (_cache[7] = [
                            createTextVNode(
                              "\u590D\u5236",
                              -1
                              /* CACHED */
                            )
                          ])]),
                          _: 1
                          /* STABLE */
                        }),
                        createVNode(_component_ll_button, {
                          disabled: !canDelete.value,
                          size: "small",
                          danger: "",
                          onClick: _cache[2] || (_cache[2] = ($event) => emit("remove"))
                        }, {
                          default: withCtx(() => [..._cache[8] || (_cache[8] = [
                            createTextVNode(
                              " \u5220\u9664 ",
                              -1
                              /* CACHED */
                            )
                          ])]),
                          _: 1
                          /* STABLE */
                        }, 8, ["disabled"])
                      ])
                    ])
                  ],
                  4
                  /* STYLE */
                )
              ],
              4
              /* STYLE */
            )
          ],
          32
          /* NEED_HYDRATION */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=calendar-context-menu.vue2.mjs.map
