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

import _defineProperty from '@babel/runtime/helpers/defineProperty';
import { defineComponent, computed } from '@vue/composition-api';
import { usePrefixClass } from '../../hooks/useConfig.js';
import { Button } from '../../button/index.js';
import { useConfig } from '../../config-provider/useConfig.js';
import '../../config-provider/context.js';
import 'lodash/merge';
import 'lodash/mergeWith';
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-2cb61c79.js';
import 'dayjs';
import '../../utils/withInstall.js';
import 'vue';
import 'lodash/capitalize';
import '../../button/button.js';
import '../../loading/index.js';
import '../../loading/directive.js';
import 'lodash/isObject';
import 'lodash/mapKeys';
import 'lodash/isEqual';
import '../../loading/plugin.js';
import '../../config.js';
import '../../utils/dom.js';
import 'raf';
import 'lodash/isString';
import '../../utils/easing.js';
import '../../loading/loading.js';
import '../../utils/render-tnode.js';
import 'lodash/camelCase';
import 'lodash/kebabCase';
import '../../utils/transfer-dom.js';
import '../../config-provider/config-receiver.js';
import '../../utils/mixins.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/toConsumableArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/helpers/slicedToArray';
import 'lodash/isNull';
import 'lodash/isUndefined';
import 'lodash/isNumber';
import 'lodash/isArray';
import '../../utils/ripple.js';
import '../../button/props.js';

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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,
      global = _useConfig.global;
    var footerClass = computed(function () {
      return [COMPONENT_NAME.value, "".concat(COMPONENT_NAME.value, "--").concat(props.presetsPlacement)];
    });
    return {
      footerClass: footerClass,
      presetsClass: presetsClass,
      global: global,
      t: t
    };
  },
  render: function render() {
    var _this = this;
    var h = arguments[0];
    var footerClass = this.footerClass,
      presetsClass = this.presetsClass,
      global = this.global,
      t = this.t;
    return h("div", {
      "class": footerClass
    }, [h("div", {
      "class": presetsClass
    }, [this.presets && Object.keys(this.presets).map(function (key) {
      return h(Button, {
        "key": key,
        "attrs": {
          "size": "small",
          "variant": "text"
        },
        "on": {
          "click": function 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: e
            });
          }
        }
      }, [key]);
    })]), this.enableTimePicker && h(Button, {
      "props": _objectSpread({}, {
        size: "small",
        theme: "primary",
        disabled: !this.selectedValue,
        onClick: function onClick(e) {
          var _this$onConfirmClick;
          return (_this$onConfirmClick = _this.onConfirmClick) === null || _this$onConfirmClick === void 0 ? void 0 : _this$onConfirmClick.call(_this, {
            e: e
          });
        }
      })
    }, [t(global.confirm)])]);
  }
});

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