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

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var utils = require('../../../chunks/utils.js');
require('@vue/composition-api');
var components_configProvider_useConfig = require('../../config-provider/useConfig.js');
require('../../../chunks/defineProperty-838e4192.js');
require('../../../chunks/dayjs.min-c4f4ce86.js');
require('../../../chunks/_commonjsHelpers-2e6815bd.js');
require('../../../chunks/_isIndex-52887d1e.js');
require('../../../chunks/isFunction-91acade7.js');
require('../../../chunks/isObjectLike-c22c7e3b.js');
require('../../../chunks/isSymbol-a38a5184.js');
require('../../config-provider/context.js');
require('lodash');
require('../../../chunks/zh_CN.js');

function useTableData(props) {
  const {
    global
  } = components_configProvider_useConfig.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 = utils.getWeeks({
    year: props.year,
    month: props.month
  }, options);else if (props.mode === "week") data = utils.getWeeks({
    year: props.year,
    month: props.month
  }, options);else if (props.mode === "quarter") data = utils.getQuarters(props.year, options);else if (props.mode === "month") data = utils.getMonths(props.year, options);else if (props.mode === "year") data = utils.getYears(props.year, options);
  return utils.flagActive(data, {
    start: props.start,
    end: props.end,
    hoverStart: props.hoverStart,
    hoverEnd: props.hoverEnd,
    type: props.mode,
    isRange: props.isRange
  });
}

exports["default"] = useTableData;
//# sourceMappingURL=use-table-data.js.map
