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

import { computed } from 'vue';
import isObject from 'lodash/isObject';
import '../../hooks/useConfig.js';
import { COMPONENT_NAME } from '../const.js';
import { getDayCn } from '../utils.js';
import { useConfig } from '../../config-provider/useConfig.js';
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-512eb181.js';
import 'dayjs';
import '../../_chunks/dep-ac28b67c.js';
import '../../config-provider/type.js';

function useColHeaders(props, state) {
  var _useConfig = useConfig(COMPONENT_NAME),
    t = _useConfig.t,
    globalConfig = _useConfig.globalConfig;
  var weekDipalyText = computed(function () {
    return props.week || t(globalConfig.value.week).split(",");
  });
  function getWeekDisplay(weekNum) {
    var weekText = weekDipalyText.value;
    return isObject(weekText) && weekText[weekNum - 1] ? weekText[weekNum - 1] : getDayCn(weekNum);
  }
  var cellColHeaders = computed(function () {
    var re = [];
    var min = 1;
    var max = 7;
    for (var i = state.realFirstDayOfWeek; i <= max; i++) {
      re.push({
        num: i,
        display: getWeekDisplay(i)
      });
    }
    if (state.realFirstDayOfWeek > min) {
      for (var _i = min; _i < state.realFirstDayOfWeek; _i++) {
        re.push({
          num: _i,
          display: getWeekDisplay(_i)
        });
      }
    }
    return re;
  });
  return {
    cellColHeaders: cellColHeaders
  };
}

export { useColHeaders };
//# sourceMappingURL=useColHeaders.js.map
