import { defineComponent, useModel, resolveDirective, openBlock, createElementBlock, createElementVNode, renderSlot, createTextVNode, toDisplayString, createVNode, mergeProps, withDirectives, unref, Fragment, renderList, createCommentVNode, mergeModels } from 'vue';
import './week-day-list.vue.mjs';
import { ElEmpty } from 'element-plus';
import script$1 from './week-day-list.vue2.mjs';

"use strict";
const _hoisted_1 = { class: "me-week-calendar" };
const _hoisted_2 = { class: "first-td" };
const _hoisted_3 = { colspan: "2" };
const _hoisted_4 = { key: 0 };
const _hoisted_5 = { colspan: "3" };
const _hoisted_6 = {
  key: 0,
  style: { "margin-top": "10px" }
};
const __default__ = defineComponent({
  name: "me-week-calendar"
});
var script = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: /* @__PURE__ */ mergeModels({
    data: { type: Array, required: false, default: () => [] },
    loading: { type: Boolean, required: false, default: false },
    rowHeaderLabel: { type: String, required: false, default: "\u65F6\u95F4" },
    colHeaderLabel: { type: String, required: false, default: "\u5458\u5DE5" },
    prevWeekLabel: { type: String, required: false },
    nextWeekLabel: { type: String, required: false },
    weekLabels: { type: Array, required: false }
  }, {
    "modelValue": { type: null },
    "modelModifiers": {}
  }),
  emits: /* @__PURE__ */ mergeModels(["change"], ["update:modelValue"]),
  setup(__props, { emit: __emit }) {
    const props = __props;
    const day = useModel(__props, "modelValue");
    const emit = __emit;
    const handleChange = () => {
      emit("change", day.value);
    };
    return (_ctx, _cache) => {
      const _directive_loading = resolveDirective("loading");
      return openBlock(), createElementBlock("table", _hoisted_1, [
        _cache[2] || (_cache[2] = createElementVNode(
          "colgroup",
          null,
          [
            createElementVNode("col", { style: { "width": "170px" } }),
            createElementVNode("col"),
            createElementVNode("col", { style: { "width": "100px" } })
          ],
          -1
          /* CACHED */
        )),
        createElementVNode("thead", null, [
          createElementVNode("tr", null, [
            createElementVNode("td", _hoisted_2, [
              _cache[1] || (_cache[1] = createElementVNode(
                "svg",
                {
                  class: "thead-svg",
                  height: "100%",
                  width: "100%",
                  xmlns: "http://www.w3.org/2000/svg"
                },
                [
                  createElementVNode("line", {
                    stroke: "var(--border-color)",
                    "stroke-width": "1",
                    x1: "0",
                    x2: "100%",
                    y1: "0",
                    y2: "100%"
                  })
                ],
                -1
                /* CACHED */
              )),
              createElementVNode("span", null, [
                renderSlot(_ctx.$slots, "colHeader", {}, () => [
                  createTextVNode(
                    toDisplayString(__props.colHeaderLabel),
                    1
                    /* TEXT */
                  )
                ])
              ]),
              createElementVNode("span", null, [
                renderSlot(_ctx.$slots, "rowHeader", {}, () => [
                  createTextVNode(
                    toDisplayString(__props.rowHeaderLabel),
                    1
                    /* TEXT */
                  )
                ])
              ])
            ]),
            createElementVNode("td", _hoisted_3, [
              createVNode(script$1, mergeProps(_ctx.$attrs, {
                modelValue: day.value,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => day.value = $event),
                onChange: handleChange
              }), null, 16, ["modelValue"])
            ])
          ])
        ]),
        withDirectives((openBlock(), createElementBlock("tbody", null, [
          !props.data.length ? (openBlock(), createElementBlock("tr", _hoisted_4, [
            createElementVNode("td", _hoisted_5, [
              createVNode(unref(ElEmpty))
            ])
          ])) : (openBlock(true), createElementBlock(
            Fragment,
            { key: 1 },
            renderList(props.data, (item, index) => {
              return openBlock(), createElementBlock("tr", {
                key: item.id
              }, [
                renderSlot(_ctx.$slots, "row", {
                  row: item,
                  index
                })
              ]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])), [
          [_directive_loading, props.loading]
        ]),
        _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_6, [
          renderSlot(_ctx.$slots, "footer")
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});

export { script as default };
//# sourceMappingURL=week-calendar.vue2.mjs.map
