"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VMSelect = exports.VMDatePicker = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _antd = require("antd");

var _zh_CN = _interopRequireDefault(require("antd/es/date-picker/locale/zh_CN"));

require("moment/locale/zh-cn");

var _useSettings3 = _interopRequireDefault(require("../vm-hooks/useSettings"));

require("./style");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var RangePicker = _antd.DatePicker.RangePicker;
/**
 * 二次封装的日期选择器
 * @param props
 * @returns
 */

var VMDatePicker = function VMDatePicker(props) {
  var _useSettings = (0, _useSettings3["default"])(),
      theme = _useSettings.theme;

  return /*#__PURE__*/_react["default"].createElement(RangePicker, _extends({
    className: "vm-range-picker ".concat(theme),
    dropdownClassName: "vm-range-picker-dropdown ".concat(theme),
    allowClear: false
  }, props, {
    locale: _zh_CN["default"]
  }));
};

exports.VMDatePicker = VMDatePicker;

var VMSelect = function VMSelect(props) {
  var _useSettings2 = (0, _useSettings3["default"])(),
      theme = _useSettings2.theme;

  return /*#__PURE__*/_react["default"].createElement(_antd.Select, _extends({
    className: "vm-select ".concat(theme),
    dropdownClassName: "vm-select-dropdown ".concat(theme)
  }, props), props.children);
};

exports.VMSelect = VMSelect;
VMSelect.propTypes = {
  children: _propTypes["default"].element
};
//# sourceMappingURL=index.js.map
