Liferay.Loader.define("portal-workflow-metrics-web@2.0.42/js/shared/components/toolbar-with-selection/ToolbarWithSelection.es", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/form', '@frontend-taglib-clay$clayui/management-toolbar', 'frontend-js-react-web$react', '../../util/lang.es'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports["default"] = void 0;

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

    var _managementToolbar = _interopRequireDefault(require("@frontend-taglib-clay$clayui/management-toolbar"));

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

    var _lang = require("../../util/lang.es");

    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.
     */
    var ToolbarWithSelection = function ToolbarWithSelection(_ref) {
      var active = _ref.active,
          checked = _ref.checked,
          children = _ref.children,
          handleCheck = _ref.handleCheck,
          handleClear = _ref.handleClear,
          handleSelectAll = _ref.handleSelectAll,
          indeterminate = _ref.indeterminate,
          selectAll = _ref.selectAll,
          selectedCount = _ref.selectedCount,
          totalCount = _ref.totalCount;
      return _react["default"].createElement(_managementToolbar["default"], {
        active: active,
        className: "mb-0 show-quick-actions-on-hover"
      }, _react["default"].createElement(_managementToolbar["default"].ItemList, {
        expand: true
      }, _react["default"].createElement(_managementToolbar["default"].Item, {
        className: "ml-2"
      }, _react["default"].createElement(_form.ClayCheckbox, {
        checked: checked,
        "data-testid": "checkAllButton",
        indeterminate: indeterminate,
        onChange: handleCheck
      })), active && _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_managementToolbar["default"].Item, null, _react["default"].createElement("span", {
        className: "ml-0 mr-0 navbar-text",
        "data-testid": "toolbarLabel"
      }, selectAll ? Liferay.Language.get('all-selected') : (0, _lang.sub)(Liferay.Language.get('x-of-x-selected'), [selectedCount, totalCount]))), _react["default"].createElement(_managementToolbar["default"].Item, null, _react["default"].createElement("button", {
        className: "btn btn-sm btn-unstyled font-weight-bold nav-link",
        "data-testid": "clear",
        onClick: handleClear
      }, Liferay.Language.get('clear'))), !selectAll && checked && _react["default"].createElement(_managementToolbar["default"].Item, null, _react["default"].createElement("button", {
        className: "btn btn-sm btn-unstyled font-weight-bold nav-link",
        "data-testid": "selectAll",
        onClick: handleSelectAll
      }, Liferay.Language.get('select-all')))), children));
    };

    var _default = ToolbarWithSelection;
    exports["default"] = _default;
    //# sourceMappingURL=ToolbarWithSelection.es.js.map
  }
});
//# sourceMappingURL=ToolbarWithSelection.es.js.map