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

import { defineComponent, computed, createVNode, isVNode } from 'vue';
import { usePrefixClass } from '../../hooks/useConfig.js';
import { Button } from '../../button/index.js';
import { useConfig } from '../../config-provider/useConfig.js';
import 'lodash/cloneDeep';
import 'lodash/isFunction';
import 'lodash/isString';
import '../../config-provider/context.js';
import 'lodash/mergeWith';
import 'lodash/merge';
import 'lodash/isArray';
import '../../_common/js/global-config/default-config.js';
import '../../_common/js/global-config/locale/zh_CN.js';
import '@babel/runtime/helpers/typeof';
import '../../_chunks/dep-e041f5b0.js';
import 'dayjs';
import '../../utils/withInstall.js';
import '../../button/button.js';
import '@babel/runtime/helpers/toConsumableArray';
import '@babel/runtime/helpers/defineProperty';
import '../../loading/index.js';
import '../../loading/directive.js';
import '../../loading/plugin.js';
import '../../utils/dom.js';
import '../../utils/easing.js';
import '../../loading/loading.js';
import '@babel/runtime/helpers/slicedToArray';
import '../../utils/render-tnode.js';
import 'lodash/isEmpty';
import 'lodash/isObject';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../hooks/useTeleport.js';
import '../../loading/props.js';
import '../../loading/icon/gradient.js';
import '../../_common/js/loading/circle-adapter.js';
import '../../_common/js/utils/set-style.js';
import '../../_common/js/utils/helper.js';
import '@babel/runtime/helpers/objectWithoutProperties';
import 'lodash/isNull';
import 'lodash/isUndefined';
import 'lodash/isNumber';
import '../../hooks/useRipple.js';
import '../../utils/set-style.js';
import '../../hooks/useKeepAnimation.js';
import '../../form/hooks.js';
import '../../hooks/tnode.js';
import '../../button/props.js';

function _isSlot(s) {
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
}
var TDateFooter = 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 = usePrefixClass("date-picker__footer");
    var presetsClass = usePrefixClass("date-picker__presets");
    var _useConfig = useConfig("datePicker"),
      t = _useConfig.t,
      globalConfig = _useConfig.globalConfig;
    var footerClass = computed(function () {
      return [COMPONENT_NAME.value, "".concat(COMPONENT_NAME.value, "--").concat(props.presetsPlacement)];
    });
    return function () {
      var _slot;
      return createVNode("div", {
        "class": footerClass.value
      }, [createVNode("div", {
        "class": presetsClass.value
      }, [props.presets && Object.keys(props.presets).map(function (key) {
        return createVNode(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 && createVNode(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];
        }
      })]);
    };
  }
});

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