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

'use strict';

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

var VueCompositionAPI = require('@vue/composition-api');
var hooks_useConfig = require('../../../hooks/use-config.js');
var components_button_index = require('../../button/index.js');
var components_configProvider_useConfig = require('../../config-provider/useConfig.js');
require('../../config-provider/context.js');
require('lodash');
require('../../../chunks/zh_CN.js');
require('../../../utils/with-install.js');
require('vue');
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('../../../chunks/log.js');
require('../../../chunks/_commonjsHelpers-2e6815bd.js');
require('../../../utils/easing.js');
require('../../../utils/render-node.js');
require('../../../utils/transfer-dom.js');
require('../../config-provider/config-receiver.js');
require('lodash/mergeWith');
require('../../../utils/mixins.js');
require('../../loading/props.js');
require('../../loading/icon/gradient.js');
require('../../../chunks/defineProperty-838e4192.js');
require('../../../chunks/set-style.js');
require('../../../chunks/helper2.js');
require('../../loading/plugin.js');
require('../../../utils/ripple.js');
require('../../button/props.js');

var TDateFooter = VueCompositionAPI.defineComponent({
  name: "LDatePickerTable",
  components: {
    LButton: components_button_index.Button
  },
  props: {
    enableTimePicker: Boolean,
    presetsPlacement: String,
    presets: Object,
    selectedValue: [Date, String, Number],
    onPresetClick: Function,
    onConfirmClick: Function
  },
  setup(props) {
    const COMPONENT_NAME = hooks_useConfig.usePrefixClass("date-picker__footer");
    const presetsClass = hooks_useConfig.usePrefixClass("date-picker__presets");
    const {
      t,
      global
    } = components_configProvider_useConfig.useConfig("datePicker");
    const footerClass = VueCompositionAPI.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)])]);
  }
});

exports["default"] = TDateFooter;
//# sourceMappingURL=Footer.js.map
