/**
 * tdesign v0.41.7
 * (c) 2022 tdesign
 * @license MIT
 */

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import Vue from 'vue';
import { prefix } from '../../config.js';

var name = "".concat(prefix, "-date-picker-cell");
var TDatePickerCell = Vue.extend({
  props: {
    text: [String, Number],
    value: Date,
    active: Boolean,
    highlight: Boolean,
    disabled: Boolean,
    startOfRange: Boolean,
    endOfRange: Boolean,
    additional: Boolean,
    now: Boolean,
    firstDayOfMonth: Boolean,
    lastDayOfMonth: Boolean,
    onClick: Function,
    onMouseEnter: {
      type: Function
    }
  },
  render: function render() {
    var _ref;

    var h = arguments[0];
    var _this$$props = this.$props,
        text = _this$$props.text,
        value = _this$$props.value,
        active = _this$$props.active,
        highlight = _this$$props.highlight,
        disabled = _this$$props.disabled,
        startOfRange = _this$$props.startOfRange,
        endOfRange = _this$$props.endOfRange,
        additional = _this$$props.additional,
        now = _this$$props.now,
        firstDayOfMonth = _this$$props.firstDayOfMonth,
        lastDayOfMonth = _this$$props.lastDayOfMonth,
        onClick = _this$$props.onClick,
        onMouseEnter = _this$$props.onMouseEnter;
    var cellClass = [name, (_ref = {}, _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--now"), now), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--active"), active), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--disabled"), disabled), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--highlight"), highlight), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--active-start"), startOfRange), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--active-end"), endOfRange), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--additional"), additional), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--first-day-of-month"), firstDayOfMonth), _defineProperty(_ref, "".concat(prefix, "-date-picker__cell--last-day-of-month"), lastDayOfMonth), _ref)];
    return h("td", {
      "class": cellClass
    }, [h("div", {
      "class": "".concat(prefix, "-date-picker__cell-wrapper"),
      "on": {
        "click": function click(e) {
          if (!disabled) {
            onClick(value, {
              e: e
            });
          }
        },
        "mouseenter": function mouseenter() {
          return onMouseEnter && onMouseEnter(value);
        }
      }
    }, [h("span", {
      "class": "".concat(prefix, "-date-picker__cell-text")
    }, [{
      text: text
    }])])]);
  }
});

export { TDatePickerCell as default };
//# sourceMappingURL=cell.js.map
