'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var ComboboxChip_styles = require('./ComboboxChip.styles.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

/**
 * Чип, отображающий выбранный элемент
 */
var ComboboxChip = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var value = _ref.value,
    text = _ref.text,
    index = _ref.index,
    disabled = _ref.disabled,
    readOnly = _ref.readOnly,
    onClick = _ref.onClick,
    onClear = _ref.onClear,
    onKeyDown = _ref.onKeyDown;
  var onClearHandle = function onClearHandle() {
    return onClear(value, text);
  };
  var onKeyDownHandle = function onKeyDownHandle(event) {
    onKeyDown === null || onKeyDown === void 0 || onKeyDown(value, text, index, event);
  };
  return /*#__PURE__*/React__default.default.createElement(ComboboxChip_styles.StyledChip, {
    ref: ref,
    tabIndex: -1,
    disabled: disabled,
    readOnly: readOnly,
    onClick: onClick,
    onClear: onClearHandle,
    onKeyDown: onKeyDownHandle,
    text: "".concat(text)
  });
});

exports.ComboboxChip = ComboboxChip;
//# sourceMappingURL=ComboboxChip.js.map
