"use strict";

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

exports.__esModule = true;
exports.ListHighlight = void 0;

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

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

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

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

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

var _CommonListHighlight = require("../common/CommonListHighlight");

var ListHighlight =
/*#__PURE__*/
function (_React$Component) {
  (0, _inheritsLoose2.default)(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.default.createElement(_CommonListHighlight.CommonListHighlight, (0, _extends2.default)({}, this.props, {
      textHighlightPattern: this.getTextHighlightPattern(),
      textFilterPattern: this.getTextFilterPattern()
    }));
  };

  return ListHighlight;
}(_react.default.Component);

exports.ListHighlight = ListHighlight;
(0, _defineProperty2.default)(ListHighlight, "propTypes", _CommonListHighlight.CommonListHighlight.propTypes);
(0, _defineProperty2.default)(ListHighlight, "defaultProps", _CommonListHighlight.CommonListHighlight.defaultProps);
(0, _defineProperty2.default)(ListHighlight, "contextTypes", {
  listStore: _propTypes.default.object
});
(0, _defineProperty2.default)(ListHighlight, "HIGHLIGHT_TYPE_BACKGROUND", _CommonListHighlight.CommonListHighlight.HIGHLIGHT_TYPE_BACKGROUND);
(0, _defineProperty2.default)(ListHighlight, "HIGHLIGHT_TYPE_BOLD", _CommonListHighlight.CommonListHighlight.HIGHLIGHT_TYPE_BOLD);