/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { g as getWeeks, c as getQuarters, d as getMonths, f as getYears, h as flagActive } from '../../../chunks/utils.js';
import '../../../hooks/use-config.js';
import { useConfig } from '../../config-provider/useConfig.js';
import '../../../chunks/defineProperty-838e4192.js';
import '../../../chunks/dayjs.min-c4f4ce86.js';
import '../../../chunks/_commonjsHelpers-2e6815bd.js';
import '../../../chunks/_isIndex-52887d1e.js';
import '../../../chunks/isFunction-91acade7.js';
import '../../../chunks/isObjectLike-c22c7e3b.js';
import '../../../chunks/isSymbol-a38a5184.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) {
  const {
    global
  } = 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 = 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
