/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

'use strict';

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

var vue = require('vue');
var hooks_useConfig = require('../../hooks/useConfig.js');
var button_index = require('../../button/index.js');
var configProvider_useConfig = require('../../config-provider/useConfig.js');
require('lodash/cloneDeep');
require('lodash/isFunction');
require('lodash/isString');
require('../../config-provider/context.js');
require('lodash/mergeWith');
require('lodash/merge');
require('lodash/isArray');
require('../../_common/js/global-config/default-config.js');
require('../../_common/js/global-config/locale/zh_CN.js');
require('@babel/runtime/helpers/typeof');
require('../../_chunks/dep-f4db2590.js');
require('dayjs');
require('../../utils/withInstall.js');
require('../../button/button.js');
require('@babel/runtime/helpers/toConsumableArray');
require('@babel/runtime/helpers/defineProperty');
require('../../loading/index.js');
require('../../loading/directive.js');
require('../../loading/plugin.js');
require('../../utils/dom.js');
require('../../utils/easing.js');
require('../../loading/loading.js');
require('@babel/runtime/helpers/slicedToArray');
require('../../utils/render-tnode.js');
require('lodash/isEmpty');
require('lodash/isObject');
require('lodash/camelCase');
require('lodash/kebabCase');
require('../../hooks/useTeleport.js');
require('../../loading/props.js');
require('../../loading/icon/gradient.js');
require('../../_common/js/loading/circle-adapter.js');
require('../../_common/js/utils/set-style.js');
require('../../_common/js/utils/helper.js');
require('@babel/runtime/helpers/objectWithoutProperties');
require('lodash/isNull');
require('lodash/isUndefined');
require('lodash/isNumber');
require('../../hooks/useRipple.js');
require('../../utils/set-style.js');
require('../../hooks/useKeepAnimation.js');
require('../../form/hooks.js');
require('../../hooks/tnode.js');
require('../../button/props.js');

function _isSlot(s) {
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
}
var TDateFooter = vue.defineComponent({
  name: "TDatePickerTable",
  props: {
    enableTimePicker: Boolean,
    presetsPlacement: String,
    presets: Object,
    selectedValue: [Date, String, Number],
    onPresetClick: Function,
    onConfirmClick: Function
  },
  setup: function setup(props) {
    var COMPONENT_NAME = hooks_useConfig.usePrefixClass("date-picker__footer");
    var presetsClass = hooks_useConfig.usePrefixClass("date-picker__presets");
    var _useConfig = configProvider_useConfig.useConfig("datePicker"),
      t = _useConfig.t,
      globalConfig = _useConfig.globalConfig;
    var footerClass = vue.computed(function () {
      return [COMPONENT_NAME.value, "".concat(COMPONENT_NAME.value, "--").concat(props.presetsPlacement)];
    });
    return function () {
      var _slot;
      return vue.createVNode("div", {
        "class": footerClass.value
      }, [vue.createVNode("div", {
        "class": presetsClass.value
      }, [props.presets && Object.keys(props.presets).map(function (key) {
        return vue.createVNode(button_index.Button, {
          "key": key,
          "size": "small",
          "variant": "text",
          "onClick": function onClick(e) {
            var _props$onPresetClick;
            return (_props$onPresetClick = props.onPresetClick) === null || _props$onPresetClick === void 0 ? void 0 : _props$onPresetClick.call(props, props.presets[key], {
              e: e
            });
          }
        }, _isSlot(key) ? key : {
          "default": function _default() {
            return [key];
          }
        });
      })]), props.enableTimePicker && vue.createVNode(button_index.Button, {
        "disabled": !props.selectedValue,
        "size": "small",
        "theme": "primary",
        "onClick": function onClick(e) {
          var _props$onConfirmClick;
          return (_props$onConfirmClick = props.onConfirmClick) === null || _props$onConfirmClick === void 0 ? void 0 : _props$onConfirmClick.call(props, {
            e: e
          });
        }
      }, _isSlot(_slot = t(globalConfig.value.confirm)) ? _slot : {
        "default": function _default() {
          return [_slot];
        }
      })]);
    };
  }
});

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