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

'use strict';

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

var utils = require('../../../chunks/utils2.js');
require('@vue/composition-api');
var components_configProvider_useConfig = require('../../config-provider/useConfig.js');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/typeof');
require('../../../chunks/defineProperty-28395935.js');
require('../../../chunks/dayjs.min-12eb376c.js');
require('../../../chunks/_commonjsHelpers-ea2bee21.js');
require('../../../chunks/_isIndex-1bf92538.js');
require('../../../chunks/isObjectLike-2443c6ff.js');
require('../../config-provider/context.js');
require('lodash');
require('../../../chunks/zh_CN.js');

function useTableData(props) {
  var _props$firstDayOfWeek;

  var _useConfig = components_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 = utils.getWeeks({
      year: props.year,
      month: props.month
    }, options);
  } else if (props.mode === "week") {
    data = utils.getWeeks({
      year: props.year,
      month: props.month
    }, options);
  } else if (props.mode === "quarter") {
    data = utils.getQuarters(props.year, options);
  } else if (props.mode === "month") {
    data = utils.getMonths(props.year, options);
  } else if (props.mode === "year") {
    data = utils.getYears(props.year, options);
  }

  return 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=use-table-data.js.map
