"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

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

var _classnames = _interopRequireDefault(require("classnames"));

var _constants = require("../../constants");

var _FormField = _interopRequireDefault(require("../FormField"));

var _Select = _interopRequireDefault(require("../Select"));

// Copyright 1999-2020. Plesk International GmbH. All rights reserved.

/**
 * `FormFieldSelect` componentis is used for making a choice among a set of related options.
 * See description of `Select` for [the full list of properties](#!/Select) of this component.
 * @since 1.12.3
 */
const FormFieldSelect = ({
  size,
  baseClassName = "".concat(_constants.CLS_PREFIX, "form-field-select"),
  className,
  children,
  searchable,
  clearable,
  multiple,
  placeholder,
  ...props
}) => /*#__PURE__*/_react.default.createElement(_FormField.default, (0, _extends2.default)({
  className: (0, _classnames.default)(baseClassName, className)
}, props), ({
  getId,
  getName,
  setValue,
  getValue,
  isDisabled
}) => /*#__PURE__*/_react.default.createElement(_Select.default, {
  size: size,
  id: getId(),
  name: getName(),
  value: getValue(''),
  onChange: setValue,
  disabled: isDisabled(),
  searchable: searchable,
  clearable: clearable,
  multiple: multiple,
  placeholder: placeholder
}, children));

var _default = FormFieldSelect;
exports.default = _default;