import React__default, { forwardRef } from 'react';
import { StyledChip } from './ComboboxChip.styles.js';

/**
 * Чип, отображающий выбранный элемент
 */
var ComboboxChip = /*#__PURE__*/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.createElement(StyledChip, {
    ref: ref,
    tabIndex: -1,
    disabled: disabled,
    readOnly: readOnly,
    onClick: onClick,
    onClear: onClearHandle,
    onKeyDown: onKeyDownHandle,
    text: "".concat(text)
  });
});

export { ComboboxChip };
//# sourceMappingURL=ComboboxChip.js.map
