/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 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-19da3d4c.js');
require('../../../chunks/dayjs.min-0f6442fd.js');
require('../../../chunks/_commonjsHelpers-fe796db6.js');
require('../../../chunks/_isIndex-8b06cfbb.js');
require('../../../chunks/isFunction-cb08cfdf.js');
require('../../../chunks/isObjectLike-51896b77.js');
require('../../../chunks/isSymbol-0ea4cedf.js');
require('../../config-provider/context.js');
require('lodash/merge');
require('lodash/mergeWith');
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
