"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _datePicker = _interopRequireDefault(require("@alifd/next/lib/date-picker2"));
var React = _interopRequireWildcard(require("react"));
var _dayjs = _interopRequireDefault(require("dayjs"));
var _excluded = ["type", "style", "disabled", "placeholder", "defaultValue", "value", "size", "label", "hasClear", "followTrigger"];
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var RangePicker = _datePicker["default"].RangePicker;

// const defaultVal = "2020-02-02";
var defaultRangeVal = ["2020-01-01", "2020-02-02"];
function customizeFormatter(v) {
  return "DATE: " + v.format("YYYY/MM/DD");
}
var RangePreset = {
  '今天': [(0, _dayjs["default"])(), (0, _dayjs["default"])()],
  '本月': [(0, _dayjs["default"])().startOf('month'), (0, _dayjs["default"])().endOf('month')]
};
var RangePickerName = function RangePickerName(_ref) {
  var type = _ref.type,
    _ref$style = _ref.style,
    style = _ref$style === void 0 ? {} : _ref$style,
    disabled = _ref.disabled,
    placeholder = _ref.placeholder,
    defaultValue = _ref.defaultValue,
    value = _ref.value,
    size = _ref.size,
    label = _ref.label,
    hasClear = _ref.hasClear,
    followTrigger = _ref.followTrigger,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var _style = style || {};
  var _otherProps = otherProps || {};
  _otherProps.style = _style;
  return /*#__PURE__*/React.createElement(_datePicker["default"], (0, _extends2["default"])({
    className: style.DatePicker2,
    popupClassName: "datesty",
    label: label,
    disabled: disabled,
    placeholder: placeholder,
    hasClear: hasClear,
    value: value,
    showTime: true
  }, otherProps, {
    size: size,
    defaultValue: defaultValue,
    format: "YYYY/MM/DD HH:mm:ss"
  }));
};
RangePickerName.displayName = 'RangePickerName';
var _default = RangePickerName;
exports["default"] = _default;