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

'use strict';

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

require('vue');
var configProvider_useConfig = require('../../config-provider/useConfig.js');
var _common_js_datePicker_utils = require('../../_common/js/date-picker/utils.js');
require('lodash/cloneDeep');
require('lodash/isFunction');
require('lodash/isString');
require('../../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('lodash/isArray');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('../../_chunks/dep-7f0559c3.js');
require('dayjs');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/objectDestructuringEmpty');
require('@babel/runtime/helpers/extends');
require('@babel/runtime/helpers/defineProperty');
require('../../_chunks/dep-69993bc1.js');
require('lodash/chunk');

function useTableData(props) {
  var _props$firstDayOfWeek;
  var _useConfig = configProvider_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 = _common_js_datePicker_utils.getWeeks({
    year: props.year,
    month: props.month
  }, options);else if (props.mode === "week") data = _common_js_datePicker_utils.getWeeks({
    year: props.year,
    month: props.month
  }, options);else if (props.mode === "quarter") data = _common_js_datePicker_utils.getQuarters(props.year, options);else if (props.mode === "month") data = _common_js_datePicker_utils.getMonths(props.year, options);else if (props.mode === "year") data = _common_js_datePicker_utils.getYears(props.year, options);
  return _common_js_datePicker_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=useTableData.js.map
