1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';
|
4 | import { css } from '@patternfly/react-styles';
|
5 | import { formatBreakpointMods, toCamel } from '../../helpers/util';
|
6 | import { PageContext } from '../Page/Page';
|
7 | export var ToolbarGroupVariant;
|
8 | (function (ToolbarGroupVariant) {
|
9 | ToolbarGroupVariant["filter-group"] = "filter-group";
|
10 | ToolbarGroupVariant["icon-button-group"] = "icon-button-group";
|
11 | ToolbarGroupVariant["button-group"] = "button-group";
|
12 | })(ToolbarGroupVariant || (ToolbarGroupVariant = {}));
|
13 | class ToolbarGroupWithRef extends React.Component {
|
14 | render() {
|
15 | const _a = this.props, { visibility, visiblity, alignment, spacer, spaceItems, className, variant, children, innerRef } = _a, props = __rest(_a, ["visibility", "visiblity", "alignment", "spacer", "spaceItems", "className", "variant", "children", "innerRef"]);
|
16 | if (visiblity !== undefined) {
|
17 |
|
18 | console.warn('The ToolbarGroup visiblity prop has been deprecated. ' +
|
19 | 'Please use the correctly spelled visibility prop instead.');
|
20 | }
|
21 | return (React.createElement(PageContext.Consumer, null, ({ width, getBreakpoint }) => (React.createElement("div", Object.assign({ className: css(styles.toolbarGroup, variant && styles.modifiers[toCamel(variant)], formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)), formatBreakpointMods(alignment, styles, '', getBreakpoint(width)), formatBreakpointMods(spacer, styles, '', getBreakpoint(width)), formatBreakpointMods(spaceItems, styles, '', getBreakpoint(width)), className) }, props, { ref: innerRef }), children))));
|
22 | }
|
23 | }
|
24 | export const ToolbarGroup = React.forwardRef((props, ref) => (React.createElement(ToolbarGroupWithRef, Object.assign({}, props, { innerRef: ref }))));
|
25 |
|
\ | No newline at end of file |