/**
 * tdesign v0.39.1-alpha.1
 * (c) 2022 tdesign
 * @license MIT
 */

'use strict';

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

var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var Vue = require('vue');
var config = require('../../config.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);

var name = "".concat(config.prefix, "-date-picker-cell");
var TDatePickerCell = Vue__default["default"].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__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--now"), now), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--active"), active), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--disabled"), disabled), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--highlight"), highlight), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--active-start"), startOfRange), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--active-end"), endOfRange), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--additional"), additional), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--first-day-of-month"), firstDayOfMonth), _defineProperty__default["default"](_ref, "".concat(config.prefix, "-date-picker__cell--last-day-of-month"), lastDayOfMonth), _ref)];
    return h("td", {
      "class": cellClass
    }, [h("div", {
      "class": "".concat(config.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(config.prefix, "-date-picker__cell-text")
    }, [{
      text: text
    }])])]);
  }
});

exports["default"] = TDatePickerCell;
//# sourceMappingURL=cell.js.map
