Liferay.Loader.define("app-builder-workflow-web@1.0.40/js/components/autocomplete/AutocompleteDropDown.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/autocomplete', '@frontend-taglib-clay$clayui/drop-down', 'frontend-js-react-web$react', '../../../css/AutocompleteDropDown.scss'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = AutocompleteDropDown;

    var _autocomplete = _interopRequireDefault(require("@frontend-taglib-clay$clayui/autocomplete"));

    var _dropDown = _interopRequireDefault(require("@frontend-taglib-clay$clayui/drop-down"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    require("../../../css/AutocompleteDropDown.scss");

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    /**
     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
     *
     * The contents of this file are subject to the terms of the Liferay Enterprise
     * Subscription License ("License"). You may not use this file except in
     * compliance with the License. You can obtain a copy of the License by
     * contacting Liferay, Inc. See the License for the specific language governing
     * permissions and limitations under the License, including but not limited to
     * distribution rights of the Software.
     */
    function AutocompleteDropDown(_ref) {
      var active = _ref.active,
          activeItem = _ref.activeItem,
          _ref$emptyMessage = _ref.emptyMessage,
          emptyMessage = _ref$emptyMessage === void 0 ? Liferay.Language.get('no-results-were-found') : _ref$emptyMessage,
          _ref$emptyResultMessa = _ref.emptyResultMessage,
          emptyResultMessage = _ref$emptyResultMessa === void 0 ? Liferay.Language.get('no-results-were-found') : _ref$emptyResultMessa,
          _ref$id = _ref.id,
          id = _ref$id === void 0 ? '' : _ref$id,
          items = _ref.items,
          match = _ref.match,
          onSelect = _ref.onSelect,
          setActiveItem = _ref.setActiveItem;
      return (/*#__PURE__*/_react.default.createElement(_autocomplete.default.DropDown, {
          active: active
        }, /*#__PURE__*/_react.default.createElement(_dropDown.default.ItemList, {
          id: "dropDownList".concat(id)
        }, items.length > 0 ? items.map(function (item, index) {
          return (/*#__PURE__*/_react.default.createElement(_autocomplete.default.Item, {
              className: index === activeItem ? 'active' : '',
              key: index,
              match: match,
              onMouseDown: function onMouseDown() {
                return onSelect(item);
              },
              onMouseOver: function onMouseOver() {
                return setActiveItem(index);
              },
              style: {
                cursor: 'pointer'
              },
              value: item.name
            })
          );
        }) : /*#__PURE__*/_react.default.createElement(_dropDown.default.Item, {
          className: "disabled"
        }, !match ? emptyMessage : emptyResultMessage)))
      );
    }
    //# sourceMappingURL=AutocompleteDropDown.es.js.map
  }
});
//# sourceMappingURL=AutocompleteDropDown.es.js.map