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

'use strict';

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

var helper = require('../../../chunks/helper.js');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var VueCompositionAPI = require('@vue/composition-api');
var format = require('../../../chunks/format.js');
var hooks_useConfig = require('../../../hooks/use-config.js');
var components_datePicker_base_Header = require('../base/Header.js');
var components_datePicker_base_Table = require('../base/Table.js');
var components_timePicker_panel_timePickerPanel = require('../../time-picker/panel/time-picker-panel.js');
require('../../../chunks/dayjs.min-12eb376c.js');
require('@babel/runtime/helpers/typeof');
require('../../../chunks/_commonjsHelpers-ea2bee21.js');
require('../../../chunks/utils2.js');
require('@babel/runtime/helpers/slicedToArray');
require('../../../chunks/defineProperty-28395935.js');
require('../../../chunks/_isIndex-1bf92538.js');
require('../../../chunks/isObjectLike-2443c6ff.js');
require('../../../chunks/log.js');
require('../../config-provider/useConfig.js');
require('../../config-provider/context.js');
require('lodash');
require('../../../chunks/zh_CN.js');
require('@babel/runtime/helpers/toConsumableArray');
require('../../jumper/jumper.js');
require('lodash/isObject');
require('@ldesign/icons-vue');
require('../../jumper/props.js');
require('../../../hooks/use-global-icon.js');
require('../../button/index.js');
require('../../button/button.js');
require('../../loading/index.js');
require('../../loading/loading.js');
require('../../loading/icon/gradient.js');
require('vue');
require('../../../chunks/set-style.js');
require('../../../chunks/helper2.js');
require('../../../config.js');
require('../../../utils/dom.js');
require('raf');
require('lodash/isString');
require('../../../utils/easing.js');
require('../../../utils/render-node.js');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../../utils/transfer-dom.js');
require('../../loading/props.js');
require('../../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../../utils/mixins.js');
require('../../../utils/with-install.js');
require('../../loading/plugin.js');
require('../../button/props.js');
require('../../../utils/ripple.js');
require('../../select/select.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('lodash/isFunction');
require('lodash/debounce');
require('lodash/get');
require('lodash/cloneDeep');
require('lodash/isArray');
require('../../../hooks/use-default-value.js');
require('../../../hooks/use-vmodel.js');
require('../../../hooks/lnode.js');
require('lodash/isEmpty');
require('../../../hooks/render-lnode.js');
require('../../select/props.js');
require('../../popup/index.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('../../../utils/helper.js');
require('../../popup/props.js');
require('../../popup/container.js');
require('../../../utils/map-props.js');
require('../../input/index.js');
require('../../input/input.js');
require('../../../utils/event.js');
require('../../input/props.js');
require('../../input/group.js');
require('../../tag/index.js');
require('../../tag/tag.js');
require('../../tag/props.js');
require('../../tag/check-tag.js');
require('../../select-input/index.js');
require('../../select-input/select-input.js');
require('../../select-input/props.js');
require('../../select-input/hooks/use-single.js');
require('lodash/pick');
require('../../select-input/hooks/use-multiple.js');
require('../../select-input/hooks/use-overlay-innerstyle.js');
require('../../common/fake-arrow.js');
require('../../select/option.js');
require('../../checkbox/index.js');
require('../../checkbox/group.js');
require('lodash/intersection');
require('../../checkbox/checkbox.js');
require('../../checkbox/props.js');
require('../../../hooks/use-lazy-load.js');
require('../../../chunks/observe.js');
require('../../select/utils.js');
require('../../../hooks/use-common-classname.js');
require('../../select/select-panel.js');
require('../../../hooks/use-virtual-scroll.js');
require('../../select/hooks/use-select-options.js');
require('../base/Cell.js');
require('dayjs');
require('../../../chunks/single-panel.js');
require('lodash/range');
require('lodash/padStart');
require('../../../chunks/_commonjsHelpers.js');
require('../../time-picker/panel/props.js');
require('../../time-picker/props.js');

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

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

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__default["default"](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; }
var TPanelContent = VueCompositionAPI.defineComponent({
  name: "LPanelContent",
  props: {
    mode: String,
    format: String,
    enableTimePicker: Boolean,
    timePickerProps: {
      type: Object,
      "default": function _default() {
        return {};
      }
    },
    value: [String, Number, Array, Date],
    year: Number,
    month: Number,
    tableData: Array,
    time: String,
    popupVisible: Boolean,
    firstDayOfWeek: Number,
    partial: String,
    onYearChange: Function,
    onMonthChange: Function,
    onJumperClick: Function,
    onCellMouseEnter: Function,
    onCellClick: Function,
    onCellMouseLeave: Function,
    onTimePickerChange: Function
  },
  setup: function setup(props) {
    var COMPONENT_NAME = hooks_useConfig.usePrefixClass("date-picker__panel");

    var _getDefaultFormat = format.getDefaultFormat({
      mode: props.mode,
      format: props.format,
      enableTimePicker: props.enableTimePicker
    }),
        timeFormat = _getDefaultFormat.timeFormat;

    var defaultTimeValue = "00:00:00";
    return {
      COMPONENT_NAME: COMPONENT_NAME,
      defaultTimeValue: defaultTimeValue,
      timeFormat: timeFormat
    };
  },
  render: function render() {
    var _this = this;

    var h = arguments[0];
    var COMPONENT_NAME = this.COMPONENT_NAME,
        defaultTimeValue = this.defaultTimeValue,
        timeFormat = this.timeFormat;
    return h("div", {
      "class": "".concat(COMPONENT_NAME, "-content")
    }, [h("div", {
      "class": "".concat(COMPONENT_NAME, "-").concat(this.mode)
    }, [h(components_datePicker_base_Header["default"], {
      "props": _objectSpread({}, {
        mode: this.mode,
        year: this.year,
        month: this.month,
        onMonthChange: function onMonthChange(val) {
          var _this$onMonthChange;

          return (_this$onMonthChange = _this.onMonthChange) === null || _this$onMonthChange === void 0 ? void 0 : _this$onMonthChange.call(_this, val, {
            partial: _this.partial
          });
        },
        onYearChange: function onYearChange(val) {
          var _this$onYearChange;

          return (_this$onYearChange = _this.onYearChange) === null || _this$onYearChange === void 0 ? void 0 : _this$onYearChange.call(_this, val, {
            partial: _this.partial
          });
        },
        onJumperClick: function onJumperClick(_ref) {
          var _this$onJumperClick;

          var trigger = _ref.trigger;
          return (_this$onJumperClick = _this.onJumperClick) === null || _this$onJumperClick === void 0 ? void 0 : _this$onJumperClick.call(_this, {
            trigger: trigger,
            partial: _this.partial
          });
        }
      })
    }), h(components_datePicker_base_Table["default"], {
      "props": _objectSpread({}, {
        mode: this.mode,
        data: this.tableData,
        time: this.time,
        value: this.value,
        format: this.format,
        firstDayOfWeek: this.firstDayOfWeek,
        onCellClick: function onCellClick(date, _ref2) {
          var _this$onCellClick;

          var e = _ref2.e;
          return (_this$onCellClick = _this.onCellClick) === null || _this$onCellClick === void 0 ? void 0 : _this$onCellClick.call(_this, date, {
            e: e,
            partial: _this.partial
          });
        },
        onCellMouseEnter: function onCellMouseEnter(date) {
          var _this$onCellMouseEnte;

          return (_this$onCellMouseEnte = _this.onCellMouseEnter) === null || _this$onCellMouseEnte === void 0 ? void 0 : _this$onCellMouseEnte.call(_this, date, {
            partial: _this.partial
          });
        },
        onCellMouseLeave: this.onCellMouseLeave
      })
    })]), this.enableTimePicker && h("div", {
      "class": "".concat(COMPONENT_NAME, "-time")
    }, [h("div", {
      "class": "".concat(COMPONENT_NAME, "-time-viewer")
    }, [this.time || defaultTimeValue]), h(components_timePicker_panel_timePickerPanel["default"], helper.helper([{}, {
      key: this.partial,
      props: _objectSpread({
        format: timeFormat,
        value: this.time || defaultTimeValue,
        onChange: this.onTimePickerChange,
        isShowPanel: this.popupVisible
      }, this.timePickerProps)
    }]))])]);
  }
});

exports["default"] = TPanelContent;
//# sourceMappingURL=panel-content.js.map
