/**
 * ldesign v0.2.14
 * (c) 2022/11/2 16:16 built by swimly
 * @license MIT
 */

import { defineComponent, computed } from '@vue/composition-api';
import { usePrefixClass } from '../../../hooks/use-config.js';
import { Button } from '../../button/index.js';
import { useConfig } from '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import 'lodash';
import '../../../_chunks/dep-def4c2ce.js';
import '../../../utils/with-install.js';
import 'vue';
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-70c789e5.js';
import '../../../_chunks/dep-5210251b.js';
import '../../../utils/easing.js';
import '../../../utils/render-node.js';
import '../../../utils/transfer-dom.js';
import '../../config-provider/config-receiver.js';
import 'lodash/mergeWith';
import '../../../utils/mixins.js';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../../_chunks/dep-eb467ddf.js';
import '../../../_chunks/dep-cf772670.js';
import '../../../_chunks/dep-47d77fc8.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 => {
          var _this$onPresetClick;
          return (_this$onPresetClick = this.onPresetClick) === null || _this$onPresetClick === void 0 ? void 0 : _this$onPresetClick.call(this, this.presets[key], {
            e
          });
        }
      }
    }, [key]))]), this.enableTimePicker && h("l-button", {
      "props": {
        ...{
          size: "small",
          theme: "primary",
          disabled: !this.selectedValue,
          onClick: e => {
            var _this$onConfirmClick;
            return (_this$onConfirmClick = this.onConfirmClick) === null || _this$onConfirmClick === void 0 ? void 0 : _this$onConfirmClick.call(this, {
              e
            });
          }
        }
      }
    }, [t(global.confirm)])]);
  }
});

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