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

import { h as helper } from '../../_chunks/dep-a4bd011a.js';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent } from '@vue/composition-api';
import { usePrefixClass } from '../../hooks/useConfig.js';
import TDateHeader from '../base/Header.js';
import TDateTable from '../base/Table.js';
import _TimePickerPanel from '../../time-picker/panel/time-picker-panel.js';
import { getDefaultFormat } from '../../_common/js/date-picker/format.js';
import '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '../../config-provider/type.js';
import '@babel/runtime/helpers/toConsumableArray';
import '../../jumper/jumper.js';
import 'lodash/isObject';
import 'tdesign-icons-vue';
import '../../jumper/props.js';
import '../../hooks/useGlobalIcon.js';
import '../../button/index.js';
import '../../button/button.js';
import '../../loading/index.js';
import '../../loading/loading.js';
import '../../loading/icon/gradient.js';
import '../../_common/js/loading/circle-adapter.js';
import '../../_common/js/utils/set-style.js';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import '../../config-provider/config-receiver.js';
import 'vue';
import '../../utils/mixins.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../utils/easing.js';
import '../../utils/render-tnode.js';
import '@babel/runtime/helpers/typeof';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../utils/transfer-dom.js';
import '../../loading/props.js';
import '../../utils/withInstall.js';
import 'lodash/capitalize';
import './style/index.js';
import '../../loading/type.js';
import '../../loading/plugin.js';
import '../../config.js';
import '../../button/props.js';
import '../../utils/ripple.js';
import '../../button/type.js';
import '../../select/select.js';
import 'lodash/isFunction';
import 'lodash/debounce';
import 'lodash/get';
import 'lodash/cloneDeep';
import 'lodash/isArray';
import '../../hooks/useDefaultValue.js';
import '../../hooks/useVModel.js';
import '../../hooks/tnode.js';
import 'lodash/isEmpty';
import '../../hooks/render-tnode.js';
import '../../select/props.js';
import '../../popup/index.js';
import '../../popup/popup.js';
import '@popperjs/core';
import '../../utils/helper.js';
import '../../popup/props.js';
import '../../popup/container.js';
import '../../utils/map-props.js';
import '../../popup/type.js';
import '../../input/index.js';
import '../../input/input.js';
import '../../utils/event.js';
import '../../input/props.js';
import '../../input/input-group.js';
import '../../input/type.js';
import '../../tag/index.js';
import '../../tag/tag.js';
import '../../tag/props.js';
import '../../tag/check-tag.js';
import '../../tag/check-tag-props.js';
import '../../tag/type.js';
import '../../select-input/index.js';
import '../../select-input/select-input.js';
import '../../select-input/props.js';
import '../../select-input/useSingle.js';
import 'lodash/pick';
import '../../select-input/useMultiple.js';
import '../../tag-input/index.js';
import '../../tag-input/tag-input.js';
import '../../tag-input/props.js';
import '../../tag-input/hooks/useTagScroll.js';
import '../../tag-input/useTagList.js';
import '../../tag-input/hooks/useHover.js';
import '../../tag-input/hooks/useDragSorter.js';
import '../../tag-input/type.js';
import '../../select-input/useOverlayInnerStyle.js';
import '../../select-input/type.js';
import '../../common-components/fake-arrow.js';
import '../../select/option.js';
import '../../select/option-props.js';
import '../../checkbox/index.js';
import '../../checkbox/group.js';
import 'lodash/intersection';
import '../../checkbox/checkbox.js';
import '../../checkbox/props.js';
import '../../checkbox/checkbox-group-props.js';
import '../../checkbox/type.js';
import '../../hooks/useLazyLoad.js';
import '../../_common/js/utils/observe.js';
import '../../select/util.js';
import '../../hooks/useCommonClassName.js';
import '../../select/select-panel.js';
import '../../hooks/useVirtualScroll.js';
import '../../select/hooks/useSelectOptions.js';
import '../base/Cell.js';
import '../../_common/js/date-picker/utils.js';
import '@babel/runtime/helpers/extends';
import 'dayjs';
import '../../_chunks/dep-a0d91f92.js';
import '../../_chunks/dep-b98966c0.js';
import 'lodash/chunk';
import '../../_common/js/time-picker/const.js';
import '../../time-picker/panel/props.js';
import '../../time-picker/props.js';
import '../../time-picker/panel/single-panel.js';
import 'lodash/range';
import 'lodash/padStart';
import '../../_common/js/time-picker/utils.js';
import '../../_common/js/log/index.js';
import '../../_common/js/log/log.js';

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; }
var TPanelContent = defineComponent({
  name: "TPanelContent",
  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 = usePrefixClass("date-picker__panel");

    var _getDefaultFormat = 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(TDateHeader, {
      "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(TDateTable, {
      "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(_TimePickerPanel, helper([{}, {
      key: this.partial,
      props: _objectSpread({
        format: timeFormat,
        value: this.time || defaultTimeValue,
        onChange: this.onTimePickerChange,
        isShowPanel: this.popupVisible
      }, this.timePickerProps)
    }]))])]);
  }
});

export { TPanelContent as default };
//# sourceMappingURL=PanelContent.js.map
