/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 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('../../../chunks/defineProperty-56324511.js');
require('../../../chunks/dayjs.min-be98bc0e.js');
require('../../../chunks/_commonjsHelpers-8b4be15a.js');
require('../../../chunks/_isIndex-9a2ec669.js');
require('../../../chunks/isObjectLike-a2de5c2f.js');
require('../../config-provider/context.js');
require('lodash');
require('../../../chunks/zh_CN.js');

function useTableData(props) {
  const {
    global
  } = components_configProvider_useConfig.useConfig("datePicker");
  const options = {
    minDate: props.minDate,
    maxDate: props.maxDate,
    disableDate: props.disableDate,
    firstDayOfWeek: props.firstDayOfWeek ?? global.value.firstDayOfWeek,
    monthLocal: global.value.months,
    quarterLocal: global.value.quarters,
    showWeekOfYear: props.mode === "week"
  };
  let 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
