import { createVNode } from 'vue';
import '../../../../../utils/index.mjs';
import DatePanel from '../DatePanel/index.mjs';
import { isSameWeek } from '../../utils/dateUtil.mjs';
import useMergeProps from '../../hooks/useMergeProps.mjs';
import { classNames } from '../../../../../utils/dom/class.mjs';

function WeekPanel(_props) {
  const props = useMergeProps(_props);
  const {
    prefixCls,
    generateConfig,
    locale,
    value
  } = props;
  const cellPrefixCls = `${prefixCls}-cell`;
  const prefixColumn = (date) => createVNode("td", {
    "key": "week",
    "class": classNames(cellPrefixCls, `${cellPrefixCls}-week`)
  }, [generateConfig.locale.getWeek(locale.locale, date)]);
  const rowPrefixCls = `${prefixCls}-week-panel-row`;
  const rowClassName = (date) => classNames(rowPrefixCls, {
    [`${rowPrefixCls}-selected`]: isSameWeek(generateConfig, locale.locale, value, date)
  });
  return createVNode(DatePanel, {
    ...props,
    "panelName": "week",
    "prefixColumn": prefixColumn,
    "rowClassName": rowClassName,
    "keyboardConfig": {
      onLeftRight: null
    }
  }, null);
}
WeekPanel.displayName = "WeekPanel";
WeekPanel.inheritAttrs = false;

export { WeekPanel as default };
//# sourceMappingURL=index.mjs.map
