import _extends from "@babel/runtime/helpers/extends";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import PropTypes from 'prop-types';
import { CommonListHighlight } from '../common/CommonListHighlight';
export var ListHighlight =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(ListHighlight, _React$Component);

  function ListHighlight() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = ListHighlight.prototype;

  _proto.getTextHighlightPattern = function getTextHighlightPattern() {
    return this.props.textHighlightPattern || this.context.listStore.textHighlightPattern;
  };

  _proto.getTextFilterPattern = function getTextFilterPattern() {
    return this.props.textFilterPattern || this.context.listStore.textFilterPattern;
  };

  _proto.render = function render() {
    return React.createElement(CommonListHighlight, _extends({}, this.props, {
      textHighlightPattern: this.getTextHighlightPattern(),
      textFilterPattern: this.getTextFilterPattern()
    }));
  };

  return ListHighlight;
}(React.Component);

_defineProperty(ListHighlight, "propTypes", CommonListHighlight.propTypes);

_defineProperty(ListHighlight, "defaultProps", CommonListHighlight.defaultProps);

_defineProperty(ListHighlight, "contextTypes", {
  listStore: PropTypes.object
});

_defineProperty(ListHighlight, "HIGHLIGHT_TYPE_BACKGROUND", CommonListHighlight.HIGHLIGHT_TYPE_BACKGROUND);

_defineProperty(ListHighlight, "HIGHLIGHT_TYPE_BOLD", CommonListHighlight.HIGHLIGHT_TYPE_BOLD);