/**
 * ldesign v0.4.6
 * (c) 2023 ldesign
 * @license MIT
 */

import '../../hooks/useConfig.js';
import { getWeeks, getQuarters, getMonths, getYears, flagActive } from '../../_common/js/date-picker/utils.js';
import { useConfig } from '../../config-provider/useConfig.js';
import '@vue/composition-api';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-be599ec8.js';
import 'dayjs';
import '../../_chunks/dep-67ff4010.js';
import '../../config-provider/type.js';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/objectDestructuringEmpty';
import '@babel/runtime/helpers/extends';
import '@babel/runtime/helpers/defineProperty';
import 'lodash/isFunction';
import '../../_chunks/dep-2de45821.js';
import 'lodash/chunk';

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",
    dayjsLocale: global.value.dayjsLocale
  };
  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=useTableData.js.map
