/**
 * ldesign v0.4.2
 * (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';
import 'lodash/cloneDeep';
import 'lodash/isFunction';
import 'lodash/isString';
import '../../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
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-2e5d8948.js';
import 'dayjs';
import '../../_chunks/dep-4580aabe.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 '../../_chunks/dep-99cc55df.js';
import 'lodash/chunk';

function useTableData(props) {
  var _props$firstDayOfWeek;
  var _useConfig = useConfig("datePicker"),
    globalConfig = _useConfig.globalConfig;
  var options = {
    minDate: props.minDate,
    maxDate: props.maxDate,
    disableDate: props.disableDate,
    firstDayOfWeek: (_props$firstDayOfWeek = props.firstDayOfWeek) !== null && _props$firstDayOfWeek !== void 0 ? _props$firstDayOfWeek : globalConfig.value.firstDayOfWeek,
    monthLocal: globalConfig.value.months,
    quarterLocal: globalConfig.value.quarters,
    showWeekOfYear: props.mode === "week",
    dayjsLocale: globalConfig.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
