/**
 * 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/zh_CN.js';
import '../../config-provider/type.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/index.js';
import '../../../chunks/log.js';
import '../../../chunks/_commonjsHelpers-2e6815bd.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/defineProperty-838e4192.js';
import '../../../chunks/set-style.js';
import '../../../chunks/helper2.js';
import '../../loading/style';
import '../../loading/type.js';
import '../../loading/plugin.js';
import '../../../utils/ripple.js';
import '../../button/props.js';
import '../../button/style';
import '../../button/type.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
