1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import { css } from '@patternfly/react-styles';
|
4 | import styles from '@patternfly/react-styles/css/layouts/Gallery/gallery';
|
5 | export const Gallery = (_a) => {
|
6 | var { children = null, className = '', component = 'div', hasGutter = false, minWidths, maxWidths } = _a, props = __rest(_a, ["children", "className", "component", "hasGutter", "minWidths", "maxWidths"]);
|
7 | const minWidthStyles = {};
|
8 | const Component = component;
|
9 | if (minWidths) {
|
10 | Object.entries(minWidths || {}).map(([breakpoint, value]) => (minWidthStyles[`--pf-l-gallery--GridTemplateColumns--min${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`] = value));
|
11 | }
|
12 | const maxWidthStyles = {};
|
13 | if (maxWidths) {
|
14 | Object.entries(maxWidths || {}).map(([breakpoint, value]) => (maxWidthStyles[`--pf-l-gallery--GridTemplateColumns--max${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`] = value));
|
15 | }
|
16 | const widthStyles = Object.assign(Object.assign({}, minWidthStyles), maxWidthStyles);
|
17 | return (React.createElement(Component, Object.assign({ className: css(styles.gallery, hasGutter && styles.modifiers.gutter, className) }, props, ((minWidths || maxWidths) && { style: Object.assign(Object.assign({}, widthStyles), props.style) })), children));
|
18 | };
|
19 | Gallery.displayName = 'Gallery';
|
20 |
|
\ | No newline at end of file |