Liferay.Loader.define("app-builder-web@1.0.76/js/components/upper-toolbar/UpperToolbar.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/form', 'frontend-js-react-web$classnames', 'frontend-js-react-web$react', '../button/Button.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.UpperToolbarItem = exports.UpperToolbarInput = exports.UpperToolbarGroup = exports.UpperToolbarButton = exports.default = void 0;

    var _form = require("@frontend-taglib-clay$clayui/form");

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

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

    var _Button = _interopRequireDefault(require("../button/Button.es"));

    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;
    }

    var UpperToolbar = function UpperToolbar(_ref) {
      var children = _ref.children,
          _ref$className = _ref.className,
          className = _ref$className === void 0 ? '' : _ref$className;
      return (/*#__PURE__*/_react.default.createElement("nav", {
          className: (0, _classnames.default)('app-builder-upper-toolbar', 'component-tbar', 'subnav-tbar-light', 'tbar', className)
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "container-fluid container-fluid-max-xl"
        }, /*#__PURE__*/_react.default.createElement("ul", {
          className: "tbar-nav"
        }, children)))
      );
    };

    var UpperToolbarButton = function UpperToolbarButton(_ref2) {
      var children = _ref2.children,
          otherProps = _objectWithoutProperties(_ref2, ["children"]);

      return (/*#__PURE__*/_react.default.createElement(_form.ClayInput.GroupItem, null, /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
          className: "ml-3",
          small: true
        }, otherProps), children))
      );
    };

    exports.UpperToolbarButton = UpperToolbarButton;

    var UpperToolbarInput = function UpperToolbarInput(_ref3) {
      var _ref3$onChange = _ref3.onChange,
          onChange = _ref3$onChange === void 0 ? function () {} : _ref3$onChange,
          placeholder = _ref3.placeholder,
          otherProps = _objectWithoutProperties(_ref3, ["onChange", "placeholder"]);

      return (/*#__PURE__*/_react.default.createElement(UpperToolbarItem, {
          expand: true
        }, /*#__PURE__*/_react.default.createElement(_form.ClayInput.Group, null, /*#__PURE__*/_react.default.createElement(_form.ClayInput.GroupItem, null, /*#__PURE__*/_react.default.createElement(_form.ClayInput, _extends({
          "aria-label": placeholder,
          className: "form-control-inline",
          onChange: onChange,
          placeholder: placeholder,
          type: "text"
        }, otherProps)))))
      );
    };

    exports.UpperToolbarInput = UpperToolbarInput;

    var UpperToolbarItem = function UpperToolbarItem(_ref4) {
      var children = _ref4.children,
          className = _ref4.className,
          expand = _ref4.expand;
      return (/*#__PURE__*/_react.default.createElement("li", {
          className: (0, _classnames.default)(className, 'tbar-item', {
            'tbar-item-expand': expand
          })
        }, /*#__PURE__*/_react.default.createElement("div", {
          className: "tbar-section"
        }, children))
      );
    };

    exports.UpperToolbarItem = UpperToolbarItem;

    var UpperToolbarGroup = function UpperToolbarGroup(_ref5) {
      var children = _ref5.children;
      return (/*#__PURE__*/_react.default.createElement(UpperToolbarItem, null, /*#__PURE__*/_react.default.createElement(_form.ClayInput.Group, null, children))
      );
    };

    exports.UpperToolbarGroup = UpperToolbarGroup;
    UpperToolbar.Button = UpperToolbarButton;
    UpperToolbar.Group = UpperToolbarGroup;
    UpperToolbar.Input = UpperToolbarInput;
    UpperToolbar.Item = UpperToolbarItem;
    var _default = UpperToolbar;
    exports.default = _default;
    //# sourceMappingURL=UpperToolbar.es.js.map
  }
});
//# sourceMappingURL=UpperToolbar.es.js.map