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

'use strict';

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

require('@vue/composition-api');
var configProvider_useConfig = require('../../config-provider/useConfig.js');
var _common_js_datePicker_utils = require('../../_common/js/date-picker/utils.js');
require('../../config-provider/context.js');
require('lodash/merge');
require('lodash/mergeWith');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/extends');
require('@babel/runtime/helpers/defineProperty');
require('dayjs');
require('../../_chunks/dep-f8992a6f.js');
require('../../_chunks/dep-200196ec.js');
require('lodash/chunk');

function useTableData(props) {
  var _props$firstDayOfWeek;

  var _useConfig = configProvider_useConfig.useConfig("datePicker"),
      global = _useConfig.global;

  var options = {
    minDate: props.minDate,
    maxDate: props.maxDate,
    disableDate: props.disableDate,
    firstDayOfWeek: (_props$firstDayOfWeek = props.firstDayOfWeek) !== null && _props$firstDayOfWeek !== void 0 ? _props$firstDayOfWeek : global.value.firstDayOfWeek,
    monthLocal: global.value.months,
    quarterLocal: global.value.quarters,
    showWeekOfYear: props.mode === "week"
  };
  var data = [];

  if (props.mode === "date") {
    data = _common_js_datePicker_utils.getWeeks({
      year: props.year,
      month: props.month
    }, options);
  } else if (props.mode === "week") {
    data = _common_js_datePicker_utils.getWeeks({
      year: props.year,
      month: props.month
    }, options);
  } else if (props.mode === "quarter") {
    data = _common_js_datePicker_utils.getQuarters(props.year, options);
  } else if (props.mode === "month") {
    data = _common_js_datePicker_utils.getMonths(props.year, options);
  } else if (props.mode === "year") {
    data = _common_js_datePicker_utils.getYears(props.year, options);
  }

  return _common_js_datePicker_utils.flagActive(data, {
    start: props.start,
    end: props.end,
    hoverStart: props.hoverStart,
    hoverEnd: props.hoverEnd,
    type: props.mode,
    isRange: props.isRange
  });
}

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