/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

'use strict';

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

var VueCompositionAPI = require('@vue/composition-api');
var format = require('../../../chunks/format.js');
var hooks_useConfig = require('../../../hooks/useConfig.js');
var components_datePicker_hooks_useTableData = require('../hooks/use-table-data.js');
var components_datePicker_hooks_useDisabledDate = require('../hooks/use-disabled-date.js');
var components_datePicker_panel_extraContent = require('./extra-content.js');
var components_datePicker_panel_panelContent = require('./panel-content.js');
var components_configProvider_useConfig = require('../../config-provider/useConfig.js');
require('../../../chunks/dayjs.min-0f6442fd.js');
require('../../../chunks/_commonjsHelpers-fe796db6.js');
require('../../../chunks/log.js');
require('../../../chunks/utils.js');
require('../../../chunks/defineProperty-19da3d4c.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');
require('dayjs');
require('../../../chunks/_commonjsHelpers.js');
require('lodash/isObject');
require('../base/Footer.js');
require('../../button/index.js');
require('../../../utils/withInstall.js');
require('vue');
require('lodash/capitalize');
require('../../../config.js');
require('../../button/button.js');
require('@ldesign/icons-vue');
require('../../loading/index.js');
require('../../loading/loading.js');
require('../../../utils/dom.js');
require('raf');
require('lodash/isString');
require('../../../utils/easing.js');
require('../../../utils/render-node.js');
require('lodash');
require('../../../utils/transfer-dom.js');
require('../../config-provider/config-receiver.js');
require('../../../utils/mixins.js');
require('../../loading/props.js');
require('../../loading/icon/gradient.js');
require('../../../chunks/set-style.js');
require('../../../chunks/helper2.js');
require('../../loading/plugin.js');
require('../../../utils/ripple.js');
require('../../button/props.js');
require('../../../chunks/helper.js');
require('../base/Header.js');
require('../../pagination/index.js');
require('../../../utils/map-props.js');
require('../../pagination/pagination-mini.js');
require('../../../hooks/useGlobalIcon.js');
require('../../pagination/props.js');
require('../../pagination/pagination.js');
require('../../input-number/index.js');
require('../../input-number/input-number.js');
require('../../input/index.js');
require('../../input/input.js');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../../utils/helper.js');
require('../../../utils/event.js');
require('../../input/props.js');
require('../../input/group.js');
require('../../input-number/props.js');
require('../../input-number/hooks/use-input-number.js');
require('../../../chunks/isArray-6b6e7094.js');
require('../../../chunks/isNumber-13851330.js');
require('../../../hooks/useCommonClassName.js');
require('../../../hooks/useVModel.js');
require('../../../hooks/useFormDisabled.js');
require('../../select/index.js');
require('../../select/select.js');
require('lodash/isFunction');
require('lodash/debounce');
require('lodash/get');
require('lodash/cloneDeep');
require('lodash/isArray');
require('../../../hooks/useDefaultValue.js');
require('../../../hooks/lnode.js');
require('lodash/isEmpty');
require('../../../hooks/render-lnode.js');
require('../../popup/index.js');
require('../../popup/popup.js');
require('@popperjs/core');
require('../../popup/props.js');
require('../../popup/container.js');
require('../../tag/index.js');
require('../../tag/tag.js');
require('../../tag/props.js');
require('../../tag/check-tag.js');
require('../../select-input/index.js');
require('../../select-input/select-input.js');
require('../../select-input/props.js');
require('../../select-input/hooks/use-single.js');
require('lodash/pick');
require('../../select-input/hooks/use-multiple.js');
require('../../tag-input/index.js');
require('../../tag-input/tag-input.js');
require('../../tag-input/props.js');
require('../../tag-input/hooks/use-tag-scroll.js');
require('../../tag-input/hooks/use-tag-list.js');
require('../../tag-input/hooks/use-hover.js');
require('../../tag-input/hooks/use-drag-sorter.js');
require('../../select-input/hooks/use-overlay-innerstyle.js');
require('../../common/fake-arrow.js');
require('../../select/option.js');
require('../../checkbox/index.js');
require('../../checkbox/group.js');
require('lodash/intersection');
require('../../checkbox/checkbox.js');
require('../../checkbox/props.js');
require('../../../hooks/useLazyLoad.js');
require('../../../chunks/observe.js');
require('../../select/utils.js');
require('../../select/props.js');
require('../../select/select-panel.js');
require('../../../hooks/useVirtualScroll.js');
require('../../select/hooks/use-select-options.js');
require('../../select/option-group.js');
require('../../input-adornment/index.js');
require('../../input-adornment/input-adornment.js');
require('../../input-adornment/props.js');
require('../base/Table.js');
require('../base/Cell.js');
require('../../time-picker/panel/time-picker-panel.js');
require('../../../chunks/single-panel.js');
require('lodash/range');
require('lodash/padStart');
require('../../time-picker/panel/props.js');
require('../../time-picker/props.js');

var TSinglePanel = VueCompositionAPI.defineComponent({
  name: "LSinglePanel",
  props: {
    disableDate: [Object, Array, Function],
    mode: {
      type: String,
      default: "date"
    },
    format: String,
    presetsPlacement: {
      type: String,
      default: "bottom"
    },
    value: [String, Number, Array, Date],
    timePickerProps: Object,
    presets: Object,
    enableTimePicker: Boolean,
    firstDayOfWeek: Number,
    year: Number,
    month: Number,
    time: String,
    popupVisible: Boolean,
    onPanelClick: Function,
    onCellClick: Function,
    onCellMouseEnter: Function,
    onCellMouseLeave: Function,
    onJumperClick: Function,
    onConfirmClick: Function,
    onPresetClick: Function,
    onYearChange: Function,
    onMonthChange: Function,
    onTimePickerChange: Function
  },
  setup(props) {
    const COMPONENT_NAME = hooks_useConfig.usePrefixClass("date-picker__panel");
    const {
      global
    } = components_configProvider_useConfig.useConfig("datePicker");
    const {
      format: format$1
    } = format.getDefaultFormat({
      mode: props.mode,
      format: props.format,
      enableTimePicker: props.enableTimePicker
    });
    const disableDateOptions = VueCompositionAPI.computed(() => components_datePicker_hooks_useDisabledDate["default"]({
      format: format$1,
      mode: props.mode,
      disableDate: props.disableDate
    }));
    const tableData = VueCompositionAPI.computed(() => components_datePicker_hooks_useTableData["default"]({
      year: props.year,
      month: props.month,
      mode: props.mode,
      start: props.value ? format.parseToDayjs(props.value, format$1).toDate() : void 0,
      firstDayOfWeek: props.firstDayOfWeek || global.value.firstDayOfWeek,
      ...disableDateOptions.value
    }));
    const panelContentProps = VueCompositionAPI.computed(() => ({
      format: format$1,
      value: props.value,
      mode: props.mode,
      year: props.year,
      month: props.month,
      firstDayOfWeek: props.firstDayOfWeek || global.value.firstDayOfWeek,
      tableData: tableData.value,
      popupVisible: props.popupVisible,
      enableTimePicker: props.enableTimePicker,
      timePickerProps: props.timePickerProps,
      time: props.time,
      onMonthChange: props.onMonthChange,
      onYearChange: props.onYearChange,
      onJumperClick: props.onJumperClick,
      onCellClick: props.onCellClick,
      onCellMouseEnter: props.onCellMouseEnter,
      onCellMouseLeave: props.onCellMouseLeave,
      onTimePickerChange: props.onTimePickerChange
    }));
    const extraProps = VueCompositionAPI.computed(() => ({
      presets: props.presets,
      enableTimePicker: props.enableTimePicker,
      presetsPlacement: props.presetsPlacement,
      onPresetClick: props.onPresetClick,
      onConfirmClick: props.onConfirmClick,
      selectedValue: props.value
    }));
    return {
      COMPONENT_NAME,
      panelContentProps,
      extraProps
    };
  },
  render() {
    const h = arguments[0];
    const {
      COMPONENT_NAME,
      panelContentProps,
      extraProps
    } = this;
    return h("div", {
      "class": [COMPONENT_NAME, {
        [`${COMPONENT_NAME}--direction-row`]: ["left", "right"].includes(this.presetsPlacement)
      }],
      "on": {
        "click": e => this.onPanelClick?.({
          e
        })
      }
    }, [["top", "left"].includes(this.presetsPlacement) ? h(components_datePicker_panel_extraContent["default"], {
      "props": {
        ...extraProps
      }
    }) : null, h(components_datePicker_panel_panelContent["default"], {
      "props": {
        ...panelContentProps
      }
    }), ["bottom", "right"].includes(this.presetsPlacement) ? h(components_datePicker_panel_extraContent["default"], {
      "props": {
        ...extraProps
      }
    }) : null]);
  }
});

exports["default"] = TSinglePanel;
//# sourceMappingURL=single-panel.js.map
