'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('./week-day-list.vue.js');
var elementPlus = require('element-plus');
var weekDayList_vue_vue_type_script_setup_true_lang = require('./week-day-list.vue2.js');

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

exports.default = script;
//# sourceMappingURL=week-calendar.vue2.js.map
