Liferay.Loader.define("app-builder-workflow-web@1.0.40/js/components/select-dropdown/SelectDropdown.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/button', '@frontend-taglib-clay$clayui/icon', 'app-builder-web/js/pages/apps/DropDownWithSearch.es', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = SelectDropdown;

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

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

    var _DropDownWithSearch = _interopRequireDefault(require("app-builder-web/js/pages/apps/DropDownWithSearch.es"));

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

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

    function _extends() {
      _extends = Object.assign || function (target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }return target;
      };return _extends.apply(this, arguments);
    }

    function _objectWithoutProperties(source, excluded) {
      if (source == null) return {};var target = _objectWithoutPropertiesLoose(source, excluded);var key, i;if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);for (i = 0; i < sourceSymbolKeys.length; i++) {
          key = sourceSymbolKeys[i];if (excluded.indexOf(key) >= 0) continue;if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;target[key] = source[key];
        }
      }return target;
    }

    function _objectWithoutPropertiesLoose(source, excluded) {
      if (source == null) return {};var target = {};var sourceKeys = Object.keys(source);var key, i;for (i = 0; i < sourceKeys.length; i++) {
        key = sourceKeys[i];if (excluded.indexOf(key) >= 0) continue;target[key] = source[key];
      }return target;
    }

    function SelectDropdown(_ref) {
      var ariaLabelId = _ref.ariaLabelId,
          emptyResultMessage = _ref.emptyResultMessage,
          _ref$items = _ref.items,
          items = _ref$items === void 0 ? [] : _ref$items,
          label = _ref.label,
          onSelect = _ref.onSelect,
          selectedValue = _ref.selectedValue,
          otherProps = _objectWithoutProperties(_ref, ["ariaLabelId", "emptyResultMessage", "items", "label", "onSelect", "selectedValue"]);

      var itemName = selectedValue || label;
      return (/*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DropDownWithSearch.default, _extends({
          isEmpty: items.length === 0,
          label: label,
          trigger: /*#__PURE__*/_react.default.createElement(_button.default, {
            "aria-labelledby": ariaLabelId,
            className: "clearfix w-100",
            displayType: "secondary"
          }, /*#__PURE__*/_react.default.createElement("span", {
            className: "float-left text-left text-truncate w90",
            title: itemName
          }, itemName), /*#__PURE__*/_react.default.createElement(_icon.default, {
            className: "dropdown-button-asset float-right",
            symbol: "caret-bottom"
          }))
        }, otherProps), /*#__PURE__*/_react.default.createElement(_DropDownWithSearch.default.Items, {
          emptyResultMessage: emptyResultMessage,
          items: items,
          onSelect: onSelect
        })))
      );
    }
    //# sourceMappingURL=SelectDropdown.es.js.map
  }
});
//# sourceMappingURL=SelectDropdown.es.js.map