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

import { defineComponent, computed } from '@vue/composition-api';
import { usePrefixClass } from '../../../hooks/useConfig.js';
import { Button } from '../../button/index.js';
import { useConfig } from '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
import '../../../_chunks/dep-b4fd1955.js';
import '../../../utils/withInstall.js';
import 'vue';
import 'lodash/capitalize';
import '../../../config.js';
import '../../button/button.js';
import '@ldesign/icons-vue';
import '../../loading/index.js';
import '../../loading/loading.js';
import '../../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../../_chunks/dep-eaa95999.js';
import '../../../_chunks/dep-102361be.js';
import '../../../utils/easing.js';
import '../../../utils/render-node.js';
import 'lodash';
import '../../../utils/transfer-dom.js';
import '../../config-provider/config-receiver.js';
import '../../../utils/mixins.js';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../../_chunks/dep-aacc31a3.js';
import '../../../_chunks/dep-c68dc4b6.js';
import '../../../_chunks/dep-1a6bca30.js';
import '../../loading/plugin.js';
import '../../../utils/ripple.js';
import '../../button/props.js';

var TDateFooter = defineComponent({
  name: "LDatePickerTable",
  components: {
    LButton: Button
  },
  props: {
    enableTimePicker: Boolean,
    presetsPlacement: String,
    presets: Object,
    selectedValue: [Date, String, Number],
    onPresetClick: Function,
    onConfirmClick: Function
  },
  setup(props) {
    const COMPONENT_NAME = usePrefixClass("date-picker__footer");
    const presetsClass = usePrefixClass("date-picker__presets");
    const {
      t,
      global
    } = useConfig("datePicker");
    const footerClass = computed(() => [COMPONENT_NAME.value, `${COMPONENT_NAME.value}--${props.presetsPlacement}`]);
    return {
      footerClass,
      presetsClass,
      global,
      t
    };
  },
  render() {
    const h = arguments[0];
    const {
      footerClass,
      presetsClass,
      global,
      t
    } = this;
    return h("div", {
      "class": footerClass
    }, [h("div", {
      "class": presetsClass
    }, [this.presets && Object.keys(this.presets).map(key => h("l-button", {
      "key": key,
      "attrs": {
        "size": "small",
        "variant": "text"
      },
      "on": {
        "click": e => this.onPresetClick?.(this.presets[key], {
          e
        })
      }
    }, [key]))]), this.enableTimePicker && h("l-button", {
      "props": {
        ...{
          size: "small",
          theme: "primary",
          disabled: !this.selectedValue,
          onClick: e => this.onConfirmClick?.({
            e
          })
        }
      }
    }, [t(global.confirm)])]);
  }
});

export { TDateFooter as default };
//# sourceMappingURL=Footer.js.map
