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

import { g as getWeeks, c as getQuarters, d as getMonths, f as getYears, h as flagActive } from '../../../chunks/utils2.js';
import '../../../hooks/use-config.js';
import { useConfig } from '../../config-provider/useConfig.js';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/typeof';
import '../../../chunks/defineProperty-28395935.js';
import '../../../chunks/dayjs.min-12eb376c.js';
import '../../../chunks/_commonjsHelpers-ea2bee21.js';
import '../../../chunks/_isIndex-1bf92538.js';
import '../../../chunks/isObjectLike-2443c6ff.js';
import '@vue/composition-api';
import '../../config-provider/context.js';
import 'lodash';
import '../../../chunks/zh_CN.js';
import '../../config-provider/type.js';

function useTableData(props) {
  var _props$firstDayOfWeek;

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

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

export { useTableData as default };
//# sourceMappingURL=use-table-data.js.map
