UNPKG

2.3 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.ToolbarGroup = exports.ToolbarGroupVariant = void 0;
4const tslib_1 = require("tslib");
5const React = tslib_1.__importStar(require("react"));
6const toolbar_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/Toolbar/toolbar"));
7const react_styles_1 = require("@patternfly/react-styles");
8const util_1 = require("../../helpers/util");
9const Page_1 = require("../Page/Page");
10var ToolbarGroupVariant;
11(function (ToolbarGroupVariant) {
12 ToolbarGroupVariant["filter-group"] = "filter-group";
13 ToolbarGroupVariant["icon-button-group"] = "icon-button-group";
14 ToolbarGroupVariant["button-group"] = "button-group";
15})(ToolbarGroupVariant = exports.ToolbarGroupVariant || (exports.ToolbarGroupVariant = {}));
16class ToolbarGroupWithRef extends React.Component {
17 render() {
18 const _a = this.props, { visibility, visiblity, alignment, spacer, spaceItems, className, variant, children, innerRef } = _a, props = tslib_1.__rest(_a, ["visibility", "visiblity", "alignment", "spacer", "spaceItems", "className", "variant", "children", "innerRef"]);
19 if (visiblity !== undefined) {
20 // eslint-disable-next-line no-console
21 console.warn('The ToolbarGroup visiblity prop has been deprecated. ' +
22 'Please use the correctly spelled visibility prop instead.');
23 }
24 return (React.createElement(Page_1.PageContext.Consumer, null, ({ width, getBreakpoint }) => (React.createElement("div", Object.assign({ className: react_styles_1.css(toolbar_1.default.toolbarGroup, variant && toolbar_1.default.modifiers[util_1.toCamel(variant)], util_1.formatBreakpointMods(visibility || visiblity, toolbar_1.default, '', getBreakpoint(width)), util_1.formatBreakpointMods(alignment, toolbar_1.default, '', getBreakpoint(width)), util_1.formatBreakpointMods(spacer, toolbar_1.default, '', getBreakpoint(width)), util_1.formatBreakpointMods(spaceItems, toolbar_1.default, '', getBreakpoint(width)), className) }, props, { ref: innerRef }), children))));
25 }
26}
27exports.ToolbarGroup = React.forwardRef((props, ref) => (React.createElement(ToolbarGroupWithRef, Object.assign({}, props, { innerRef: ref }))));
28//# sourceMappingURL=ToolbarGroup.js.map
\No newline at end of file