/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

import { g as getWeeks, c as getQuarters, d as getMonths, f as getYears, h as flagActive } from '../../../_chunks/dep-52f1cb4f.js';
import '@vue/composition-api';
import { useConfig } from '../../config-provider/useConfig.js';
import '../../../_chunks/dep-aacc31a3.js';
import '../../../_chunks/dep-72951546.js';
import '../../../_chunks/dep-102361be.js';
import '../../../_chunks/dep-40693b6f.js';
import '../../../_chunks/dep-c3acb800.js';
import '../../../_chunks/dep-52c80d08.js';
import '../../../_chunks/dep-128cad98.js';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../../../_chunks/dep-b4fd1955.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
