/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

import { h as helper } from '../../_chunks/dep-b13ef886.js';
import _typeof from '@babel/runtime/helpers/typeof';
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import dayjs from 'dayjs';
import { c as commonjsGlobal } from '../../_chunks/dep-a66683a6.js';
import { g as getIEVersion } from '../../_chunks/dep-fc383775.js';
import props from './props.js';
import mixins from '../../utils/mixins.js';
import getConfigReceiverMixins from '../config-provider/config-receiver.js';
import { createMonthCellsData, createYearCellsData, getDayCn } from './utils.js';
import { emitEvent } from '../../utils/event.js';
import { LAST_MONTH_OF_YEAR, DEFAULT_YEAR_CELL_NUMINROW, MIN_YEAR, FIRST_MONTH_OF_YEAR } from './const.js';
import { Select, Option } from '../select/index.js';
import { RadioGroup, RadioButton } from '../radio/index.js';
import { Button } from '../button/index.js';
import { CheckTag } from '../tag/index.js';
import CalendarCellItem from './calendar-cell.js';
import RenderComponent from '../../utils/render-component.js';
import { renderLNodeJSX, renderLNodeJSXDefault } from '../../utils/render-node.js';
import '@babel/runtime/helpers/toConsumableArray';
import 'vue';
import 'lodash/mergeWith';
import 'lodash';
import '../config-provider/context.js';
import '../../_chunks/dep-a0f2090c.js';
import '../../utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import 'lodash/camelCase';
import '@vue/composition-api';
import '../select/select.js';
import 'lodash/isFunction';
import 'lodash/debounce';
import 'lodash/get';
import 'lodash/cloneDeep';
import 'lodash/isArray';
import '../../hooks/use-default-value.js';
import '../../hooks/use-vmodel.js';
import '../../hooks/lnode.js';
import 'lodash/isEmpty';
import 'lodash/kebabCase';
import '../../hooks/render-lnode.js';
import 'lodash/isString';
import 'lodash/isObject';
import '../config-provider/useConfig.js';
import '../select/props.js';
import '../loading/index.js';
import '../loading/loading.js';
import '../loading/icon/gradient.js';
import '../../_chunks/dep-33b15d9d.js';
import '../../_chunks/dep-85e8b23b.js';
import '../../config.js';
import '../../utils/dom.js';
import 'raf';
import '../../utils/easing.js';
import '../../utils/transfer-dom.js';
import '../loading/props.js';
import '../../utils/with-install.js';
import '../loading/plugin.js';
import '../popup/index.js';
import '../popup/popup.js';
import '@popperjs/core';
import '../popup/props.js';
import '../popup/container.js';
import '../../utils/map-props.js';
import '../input/index.js';
import '../input/input.js';
import '@ldesign/icons-vue';
import '../input/props.js';
import '../input/group.js';
import '../select-input/index.js';
import '../select-input/select-input.js';
import '../select-input/props.js';
import '../select-input/hooks/use-single.js';
import 'lodash/pick';
import '../../hooks/use-config.js';
import '../select-input/hooks/use-multiple.js';
import '../select-input/hooks/use-overlay-innerstyle.js';
import '../common/fake-arrow.js';
import '../select/option.js';
import '../../utils/ripple.js';
import '../checkbox/index.js';
import '../checkbox/group.js';
import 'lodash/intersection';
import '../checkbox/checkbox.js';
import '../checkbox/props.js';
import '../../hooks/use-lazy-load.js';
import '../../_chunks/dep-5d06368e.js';
import '../select/utils.js';
import '../../hooks/use-common-classname.js';
import '../select/select-panel.js';
import '../../hooks/use-virtual-scroll.js';
import '../select/hooks/use-select-options.js';
import '../tag/tag.js';
import '../tag/props.js';
import '../tag/check-tag.js';
import '../select/option-group.js';
import '../radio/radio.js';
import '../radio/props.js';
import '../radio/group.js';
import 'lodash/isNumber';
import '../radio/radio-button.js';
import '../button/button.js';
import '../button/props.js';

var calendar$1 = {exports: {}};

(function (module, exports) {
  !function (e, t) {
    module.exports = t() ;
  }(commonjsGlobal, function () {

    return function (e, t, a) {
      var n = "h:mm A",
          d = {
        lastDay: "[Yesterday at] " + n,
        sameDay: "[Today at] " + n,
        nextDay: "[Tomorrow at] " + n,
        nextWeek: "dddd [at] " + n,
        lastWeek: "[Last] dddd [at] " + n,
        sameElse: "MM/DD/YYYY"
      };

      t.prototype.calendar = function (e, t) {
        var n = t || this.$locale().calendar || d,
            o = a(e || void 0).startOf("d"),
            s = this.diff(o, "d", !0),
            i = "sameElse",
            f = s < -6 ? i : s < -1 ? "lastWeek" : s < 0 ? "lastDay" : s < 1 ? "sameDay" : s < 2 ? "nextDay" : s < 7 ? "nextWeek" : i,
            l = n[f] || d[f];
        return "function" == typeof l ? l.call(this, a()) : this.format(l);
      };
    };
  });
})(calendar$1);

var calendar = calendar$1.exports;

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
dayjs.extend(calendar);

var createDefaultCurDate = function createDefaultCurDate() {
  return dayjs(dayjs().format("YYYY-MM-DD"));
};

var getDefaultControllerConfigData = function getDefaultControllerConfigData() {
  var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  return {
    visible: visible,
    disabled: false,
    mode: {
      visible: true,
      radioGroupProps: {}
    },
    year: {
      visible: true,
      selectProps: {}
    },
    month: {
      visible: true,
      selectProps: {}
    },
    weekend: {
      visible: true,
      showWeekendButtonProps: {},
      hideWeekendButtonProps: {}
    },
    current: {
      visible: true,
      currentDayButtonProps: {},
      currentMonthButtonProps: {}
    }
  };
};

var _Calendar = mixins(getConfigReceiverMixins("calendar")).extend({
  name: "LCalendar",
  components: {
    TCheckTag: CheckTag,
    TSelect: Select,
    TOption: Option,
    TRadioGroup: RadioGroup,
    TRadioButton: RadioButton,
    TButton: Button,
    CalendarCellItem: CalendarCellItem,
    RenderComponent: RenderComponent
  },
  props: _objectSpread({}, props),
  data: function data() {
    return {
      curDate: null,
      curSelectedYear: null,
      curSelectedMonth: null,
      curSelectedMode: null,
      isShowWeekend: true,
      controlSize: "medium"
    };
  },
  computed: {
    realFirstDayOfWeek: function realFirstDayOfWeek() {
      var _ref, _this$firstDayOfWeek;

      return (_ref = (_this$firstDayOfWeek = this.firstDayOfWeek) !== null && _this$firstDayOfWeek !== void 0 ? _this$firstDayOfWeek : this.global.firstDayOfWeek) !== null && _ref !== void 0 ? _ref : 1;
    },
    TEXT_MAP: function TEXT_MAP() {
      var t = this.t,
          global = this.global;
      var r = {
        showWeekend: t(global.showWeekend),
        hideWeekend: t(global.hideWeekend),
        today: t(global.today),
        thisMonth: t(global.thisMonth)
      };
      return r;
    },
    weekDipalyText: function weekDipalyText() {
      return this.week || this.t(this.global.week).split(",");
    },
    calendarCls: function calendarCls() {
      return ["".concat(this.componentName), "".concat(this.componentName, "--").concat(this.theme)];
    },
    calendarPanelCls: function calendarPanelCls() {
      return ["".concat(this.componentName, "__panel"), "".concat(this.componentName, "__panel--").concat(this.curSelectedMode)];
    },
    isWeekRender: function isWeekRender() {
      return typeof this.week === "function";
    },
    rangeFromTo: function rangeFromTo() {
      if (!this.range || this.range.length < 2) {
        return null;
      }

      var _this$range = _slicedToArray(this.range, 2),
          v1 = _this$range[0],
          v2 = _this$range[1];

      if (dayjs(v1).isBefore(dayjs(v2))) {
        return {
          from: v1,
          to: v2
        };
      }

      return {
        from: v2,
        to: v1
      };
    },
    controllerOptions: function controllerOptions() {
      var dayJsFilterDate = dayjs("".concat(this.curSelectedYear, "-").concat(this.curSelectedMonth));
      var re = {
        isShowWeekend: this.isShowWeekend,
        filterDate: dayJsFilterDate.toDate(),
        formattedFilterDate: dayJsFilterDate.format(this.format),
        mode: this.curSelectedMode
      };
      return re;
    },
    cellColHeaders: function cellColHeaders() {
      var re = [];
      var min = 1;
      var max = 7;

      for (var i = this.realFirstDayOfWeek; i <= max; i++) {
        re.push({
          num: i,
          display: this.getWeekDisplay(i)
        });
      }

      if (this.realFirstDayOfWeek > min) {
        for (var _i = min; _i < this.realFirstDayOfWeek; _i++) {
          re.push({
            num: _i,
            display: this.getWeekDisplay(_i)
          });
        }
      }

      return re;
    },
    yearSelectOptionList: function yearSelectOptionList() {
      var re = [];
      var begin = this.curSelectedYear - 10;
      var end = this.curSelectedYear + 10;

      if (this.rangeFromTo && this.rangeFromTo.from && this.rangeFromTo.to) {
        begin = dayjs(this.rangeFromTo.from).year();
        end = dayjs(this.rangeFromTo.to).year();
      }

      if (begin < MIN_YEAR) {
        begin = MIN_YEAR;
      }

      if (end < MIN_YEAR) {
        end = MIN_YEAR;
      }

      for (var i = begin; i <= end; i++) {
        var disabled = this.checkMonthAndYearSelecterDisabled(i, this.curSelectedMonth);
        re.push({
          value: i,
          label: this.t(this.global.yearSelection, {
            year: i
          }),
          disabled: disabled
        });
      }

      return re;
    },
    monthSelectOptionList: function monthSelectOptionList() {
      var re = [];

      for (var i = FIRST_MONTH_OF_YEAR; i <= LAST_MONTH_OF_YEAR; i++) {
        var disabled = this.checkMonthAndYearSelecterDisabled(this.curSelectedYear, i);
        re.push({
          value: i,
          label: this.t(this.global.monthSelection, {
            month: i
          }),
          disabled: disabled
        });
      }

      return re;
    },
    modeSelectOptionList: function modeSelectOptionList() {
      return [{
        value: "month",
        label: this.t(this.global.monthRadio)
      }, {
        value: "year",
        label: this.t(this.global.yearRadio)
      }];
    },
    monthCellsData: function monthCellsData() {
      var realFirstDayOfWeek = this.realFirstDayOfWeek;
      var daysArr = createMonthCellsData(this.curSelectedYear, this.curSelectedMonth, realFirstDayOfWeek, this.curDate, this.format);
      return daysArr;
    },
    yearCellsData: function yearCellsData() {
      var re = [];
      var monthsArr = createYearCellsData(this.curSelectedYear, this.curDate, this.format);
      var rowCount = Math.ceil(monthsArr.length / DEFAULT_YEAR_CELL_NUMINROW);
      var index = 0;

      for (var i = 1; i <= rowCount; i++) {
        var row = [];

        for (var j = 1; j <= DEFAULT_YEAR_CELL_NUMINROW; j++) {
          row.push(monthsArr[index]);
          index += 1;
        }

        re.push(row);
      }

      return re;
    },
    controllerConfigData: function controllerConfigData() {
      var _ref2, _this$controllerConfi;

      var controllerConfig = (_ref2 = (_this$controllerConfi = this.controllerConfig) !== null && _this$controllerConfi !== void 0 ? _this$controllerConfi : this.global.controllerConfig) !== null && _ref2 !== void 0 ? _ref2 : true;

      if (typeof controllerConfig === "boolean") {
        return getDefaultControllerConfigData(controllerConfig);
      }

      return _objectSpread(_objectSpread({}, getDefaultControllerConfigData()), controllerConfig);
    },
    isControllerVisible: function isControllerVisible() {
      return this.controllerConfigData && this.controllerConfigData.visible;
    },
    weekendBtnText: function weekendBtnText() {
      return this.isShowWeekend ? this.TEXT_MAP.hideWeekend : this.TEXT_MAP.showWeekend;
    },
    weekendBtnVBind: function weekendBtnVBind() {
      var c = this.controllerConfigData.weekend;
      return this.isShowWeekend ? c.hideWeekendButtonProps : c.showWeekendButtonProps;
    },
    currentBtnText: function currentBtnText() {
      return this.curSelectedMode === "month" ? this.TEXT_MAP.today : this.TEXT_MAP.thisMonth;
    },
    currentBtnVBind: function currentBtnVBind() {
      var c = this.controllerConfigData.current;
      return this.curSelectedMode === "month" ? c.currentDayButtonProps : c.currentMonthButtonProps;
    },
    isModeVisible: function isModeVisible() {
      return this.checkControllerVisible("mode");
    },
    isYearVisible: function isYearVisible() {
      return this.checkControllerVisible("year");
    },
    isMonthVisible: function isMonthVisible() {
      return this.checkControllerVisible("month");
    },
    isWeekendToggleVisible: function isWeekendToggleVisible() {
      return this.checkControllerVisible("weekend");
    },
    isCurrentBtnVisible: function isCurrentBtnVisible() {
      return this.checkControllerVisible("current");
    },
    isModeDisabled: function isModeDisabled() {
      return this.checkControllerDisabled("mode", "radioGroupProps");
    },
    isYearDisabled: function isYearDisabled() {
      return this.checkControllerDisabled("year", "selectProps");
    },
    isMonthDisabled: function isMonthDisabled() {
      return this.checkControllerDisabled("month", "selectProps");
    },
    isWeekendToggleDisabled: function isWeekendToggleDisabled() {
      var p = this.isShowWeekend ? "hideWeekendButtonProps" : "showWeekendButtonProps";
      return this.checkControllerDisabled("weekend", p);
    },
    isCurrentBtnDisabled: function isCurrentBtnDisabled() {
      var p = this.curSelectedMode === "month" ? "currentDayButtonProps" : "currentMonthButtonProps";
      return this.checkControllerDisabled("current", p);
    },
    filterYearStr: function filterYearStr() {
      return "".concat(this.controllerOptions.filterDate.getFullYear());
    },
    filterMonthStr: function filterMonthStr() {
      return "".concat(this.controllerOptions.filterDate.getMonth() + 1);
    },
    filterYearMonth: function filterYearMonth() {
      return {
        year: this.filterYearStr,
        month: this.filterMonthStr
      };
    }
  },
  watch: {
    value: {
      handler: function handler(v) {
        this.setCurrentDate(v);
      },
      immediate: true
    },
    year: {
      handler: function handler(v) {
        this.setCurSelectedYear(v);
      },
      immediate: true
    },
    month: {
      handler: function handler(v) {
        this.setCurSelectedMonth(v);
      },
      immediate: true
    },
    mode: {
      handler: function handler(v) {
        this.curSelectedMode = v;
      },
      immediate: true
    },
    isShowWeekendDefault: {
      handler: function handler(v) {
        this.isShowWeekend = v;
      },
      immediate: true
    },
    filterYearMonth: {
      handler: function handler(v) {
        emitEvent(this, "month-change", v);
        this.controllerChange();
      }
    },
    curSelectedMode: function curSelectedMode() {
      this.handleIE();
    },
    isShowWeekend: function isShowWeekend() {
      this.handleIE();
    },
    isControllerVisible: function isControllerVisible() {
      this.handleIE();
    }
  },
  mounted: function mounted() {
    this.handleIE();
  },
  methods: {
    handleIE: function handleIE() {
      var _this = this;

      if (getIEVersion() <= 9) {
        this.$nextTick(function () {
          var element = _this.$el.children[_this.isControllerVisible ? 1 : 0];

          if (_this.curSelectedMode === "month") {
            element.setAttribute("is-show-weekend", "".concat(_this.isShowWeekend));
          } else {
            element.removeAttribute("is-show-weekend");
          }
        });
      }
    },
    getCalendarWeekSlotData: function getCalendarWeekSlotData(item) {
      return {
        day: item.num
      };
    },
    getWeekDisplay: function getWeekDisplay(weekNum) {
      var weekText = this.weekDipalyText;
      return _typeof(weekText) === "object" && weekText[weekNum - 1] ? weekText[weekNum - 1] : getDayCn(weekNum);
    },
    checkMonthCellItemShowed: function checkMonthCellItemShowed(cellData) {
      return this.isShowWeekend || cellData.day < 6;
    },
    createCalendarCell: function createCalendarCell(cellData) {
      return _objectSpread(_objectSpread({}, cellData), this.controllerOptions);
    },
    clickCell: function clickCell(e, cellData) {
      this.curDate = dayjs(cellData.date);
      var options = this.getCellClickEventOptions(e, cellData);
      emitEvent(this, "cell-click", options);
    },
    doubleClickCell: function doubleClickCell(e, cellData) {
      var options = this.getCellClickEventOptions(e, cellData);
      emitEvent(this, "cell-double-click", options);
    },
    rightClickCell: function rightClickCell(e, cellData) {
      if (this.preventCellContextmenu) {
        e.preventDefault();
      }

      var options = this.getCellClickEventOptions(e, cellData);
      emitEvent(this, "cell-right-click", options);
    },
    getCellClickEventOptions: function getCellClickEventOptions(e, cellData) {
      return {
        cell: this.createCalendarCell(cellData),
        e: e
      };
    },
    controllerChange: function controllerChange() {
      var options = this.controllerOptions;
      emitEvent(this, "controller-change", options);
    },
    onWeekendToggleClick: function onWeekendToggleClick() {
      this.isShowWeekend = !this.isShowWeekend;
      this.controllerChange();
    },
    checkMonthCellColHeaderVisibled: function checkMonthCellColHeaderVisibled(item) {
      var re = true;

      if (!this.isShowWeekend) {
        re = item.num !== 6 && item.num !== 7;
      }

      return re;
    },
    checkControllerDisabled: function checkControllerDisabled(name, propsName) {
      var re = false;
      var conf = this.controllerConfigData;

      if (conf && (conf.disabled || conf[name] && conf[name][propsName] && conf[name][propsName].disabled)) {
        re = true;
      }

      return re;
    },
    checkControllerVisible: function checkControllerVisible(name) {
      var re = true;
      var conf = this.controllerConfigData;

      if (!conf || !conf.visible || conf[name] === false || conf[name] && !conf[name].visible) {
        re = false;
      }

      return re;
    },
    toToday: function toToday() {
      var currentSelectDate = createDefaultCurDate();
      this.curSelectedYear = currentSelectDate.year();
      this.curSelectedMonth = parseInt(currentSelectDate.format("M"), 10);
    },
    setCurSelectedYear: function setCurSelectedYear(year) {
      var curSelectedYear = year ? parseInt("".concat(year), 10) : createDefaultCurDate().year();

      if (!isNaN(curSelectedYear) && curSelectedYear > 0) {
        this.curSelectedYear = curSelectedYear;
      }
    },
    setCurSelectedMonth: function setCurSelectedMonth(month) {
      var curSelectedMonth = month ? parseInt("".concat(month), 10) : parseInt(createDefaultCurDate().format("M"), 10);

      if (!isNaN(curSelectedMonth) && curSelectedMonth > 0 && curSelectedMonth <= 12) {
        this.curSelectedMonth = curSelectedMonth;
      }
    },
    setCurrentDate: function setCurrentDate(value) {
      this.curDate = value ? dayjs(value) : createDefaultCurDate();
    },
    checkMonthAndYearSelecterDisabled: function checkMonthAndYearSelecterDisabled(year, month) {
      var disabled = false;

      if (this.rangeFromTo && this.rangeFromTo.from && this.rangeFromTo.to) {
        var beginYear = dayjs(this.rangeFromTo.from).year();
        var endYear = dayjs(this.rangeFromTo.to).year();

        if (year === beginYear) {
          var beginMon = parseInt(dayjs(this.rangeFromTo.from).format("M"), 10);
          disabled = month < beginMon;
        } else if (year === endYear) {
          var endMon = parseInt(dayjs(this.rangeFromTo.to).format("M"), 10);
          disabled = month > endMon;
        }
      }

      return disabled;
    },
    renderControl: function renderControl() {
      var _this2 = this;

      var h = this.$createElement;
      var controllerOptions = this.controllerOptions;
      return h("div", {
        "class": "".concat(this.componentName, "__control")
      }, [h("div", {
        "class": "".concat(this.componentName, "__title")
      }, [renderLNodeJSX(this, "head", {
        params: controllerOptions
      })]), h("div", {
        "class": "".concat(this.componentName, "__control-section")
      }, [this.isYearVisible && h("div", {
        "class": "".concat(this.componentName, "__control-section-cell")
      }, [h("t-select", helper([{
        "attrs": {
          "size": this.controlSize,
          "disabled": this.isYearDisabled,
          "autoWidth": true
        }
      }, {
        "props": _objectSpread({}, this.controllerConfigData.year.selectProps)
      }, {
        "model": {
          value: _this2.curSelectedYear,
          callback: function callback($$v) {
            _this2.curSelectedYear = $$v;
          }
        }
      }]), [this.yearSelectOptionList.map(function (item) {
        return h("t-option", {
          "key": item.value,
          "attrs": {
            "value": item.value,
            "label": item.label,
            "disabled": item.disabled
          }
        }, [item.label]);
      })])]), this.curSelectedMode === "month" && this.isMonthVisible && h("div", {
        "class": "".concat(this.componentName, "__control-section-cell")
      }, [h("t-select", helper([{
        "attrs": {
          "size": this.controlSize,
          "disabled": this.isMonthDisabled,
          "autoWidth": true
        }
      }, {
        "props": _objectSpread({}, this.controllerConfigData.month.selectProps)
      }, {
        "model": {
          value: _this2.curSelectedMonth,
          callback: function callback($$v) {
            _this2.curSelectedMonth = $$v;
          }
        }
      }]), [this.monthSelectOptionList.map(function (item) {
        return h("t-option", {
          "key": item.value,
          "attrs": {
            "value": item.value,
            "label": item.label,
            "disabled": item.disabled
          }
        }, [item.label]);
      })])]), this.isModeVisible && h("div", {
        "class": "".concat(this.componentName, "__control-section-cell"),
        "style": "height: auto"
      }, [h("t-radio-group", helper([{
        "attrs": {
          "variant": "default-filled",
          "size": this.controlSize,
          "disabled": this.isModeDisabled
        }
      }, {
        "props": _objectSpread({}, this.controllerConfigData.mode.radioGroupProps)
      }, {
        "on": {
          "change": this.controllerChange
        },
        "model": {
          value: _this2.curSelectedMode,
          callback: function callback($$v) {
            _this2.curSelectedMode = $$v;
          }
        }
      }]), [this.modeSelectOptionList.map(function (item) {
        return h("t-radio-button", {
          "key": item.value,
          "attrs": {
            "value": item.value
          }
        }, [item.label]);
      })])]), this.theme === "full" && this.curSelectedMode === "month" && this.isWeekendToggleVisible && h("div", {
        "class": "".concat(this.componentName, "__control-section-cell")
      }, [h("t-check-tag", helper([{
        "class": "".concat(this.componentName, "__control-tag"),
        "attrs": {
          "defaultChecked": !this.isShowWeekend,
          "disabled": this.isWeekendToggleDisabled
        },
        "on": {
          "click": this.onWeekendToggleClick
        }
      }, {
        "props": _objectSpread({}, this.weekendBtnVBind)
      }]), [this.weekendBtnText])]), this.theme === "full" && this.isCurrentBtnVisible && h("div", {
        "class": "".concat(this.componentName, "__control-section-cell")
      }, [h("t-button", helper([{
        "attrs": {
          "size": this.controlSize,
          "disabled": this.isCurrentBtnDisabled
        },
        "on": {
          "click": function click() {
            _this2.toToday();
          }
        }
      }, {
        "props": _objectSpread({}, this.currentBtnVBind)
      }]), [this.currentBtnText])])])]);
    }
  },
  render: function render() {
    var _this3 = this;

    var h = arguments[0];
    var calendarCls = this.calendarCls,
        calendarPanelCls = this.calendarPanelCls,
        isControllerVisible = this.isControllerVisible,
        cellColHeaders = this.cellColHeaders,
        checkMonthCellColHeaderVisibled = this.checkMonthCellColHeaderVisibled;

    var monthBody = function monthBody() {
      return h("table", {
        "class": "".concat(_this3.componentName, "__table")
      }, [h("thead", {
        "class": "".concat(_this3.componentName, "__table-head")
      }, [h("tr", {
        "class": "".concat(_this3.componentName, "__table-head-row")
      }, [cellColHeaders.map(function (item, index) {
        return checkMonthCellColHeaderVisibled(item) && h("th", {
          "class": "".concat(_this3.componentName, "__table-head-cell")
        }, [Array.isArray(_this3.week) ? _this3.week[index] : renderLNodeJSXDefault(_this3, "week", {
          defaultNode: h("span", [item.display]),
          params: _this3.getCalendarWeekSlotData(item)
        })]);
      })])]), h("tbody", {
        "class": "".concat(_this3.componentName, "__table-body")
      }, [_this3.monthCellsData.map(function (week, weekIndex) {
        return h("tr", {
          "class": "".concat(_this3.componentName, "__table-body-row")
        }, [week.map(function (item, itemIndex) {
          return _this3.checkMonthCellItemShowed(item) && h("calendar-cell-item", {
            "key": "d-".concat(weekIndex, "-").concat(itemIndex),
            "attrs": {
              "item": item,
              "theme": _this3.theme,
              "t": _this3.t,
              "global": _this3.global,
              "cell": _this3.cell,
              "fillWithZero": _this3.fillWithZero
            },
            "on": {
              "click": function click(e) {
                return _this3.clickCell(e, item);
              },
              "dblclick": function dblclick(e) {
                return _this3.doubleClickCell(e, item);
              },
              "rightclick": function rightclick(e) {
                return _this3.rightClickCell(e, item);
              }
            },
            "scopedSlots": _objectSpread({}, _this3.$scopedSlots)
          });
        })]);
      })])]);
    };

    var yearBody = function yearBody() {
      return h("table", {
        "class": "".concat(_this3.componentName, "__table")
      }, [h("tbody", {
        "class": "".concat(_this3.componentName, "__table-body")
      }, [_this3.yearCellsData.map(function (cell, cellIndex) {
        return h("tr", {
          "class": "".concat(_this3.componentName, "__table-body-row")
        }, [cell.map(function (item, itemIndex) {
          return h("calendar-cell-item", {
            "key": "m-".concat(cellIndex, "-").concat(itemIndex),
            "attrs": {
              "item": item,
              "theme": _this3.theme,
              "t": _this3.t,
              "global": _this3.global,
              "cell": _this3.cell,
              "fillWithZero": _this3.fillWithZero
            },
            "on": {
              "click": function click(e) {
                return _this3.clickCell(e, item);
              },
              "dblclick": function dblclick(e) {
                return _this3.doubleClickCell(e, item);
              },
              "rightclick": function rightclick(e) {
                return _this3.rightClickCell(e, item);
              }
            },
            "scopedSlots": _objectSpread({}, _this3.$scopedSlots)
          });
        })]);
      })])]);
    };

    return h("div", {
      "class": calendarCls
    }, [isControllerVisible && this.renderControl(), h("div", {
      "class": calendarPanelCls
    }, [this.curSelectedMode === "month" ? monthBody() : yearBody()])]);
  }
});

export { _Calendar as default };
//# sourceMappingURL=calendar.js.map
