| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.Gallery = void 0; |
| 4 |
const tslib_1 = require("tslib"); |
| 5 |
const jsx_runtime_1 = require("react/jsx-runtime"); |
| 6 |
const react_styles_1 = require("@patternfly/react-styles"); |
| 7 |
const gallery_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/layouts/Gallery/gallery")); |
| 8 |
const l_gallery_GridTemplateColumns_min_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/l_gallery_GridTemplateColumns_min')); |
| 9 |
const l_gallery_GridTemplateColumns_max_1 = tslib_1.__importDefault(require('@patternfly/react-tokens/dist/js/l_gallery_GridTemplateColumns_max')); |
| 10 |
const Gallery = (_a) => { |
| 11 |
var { children = null, className = '', component = 'div', hasGutter = false, minWidths, maxWidths } = _a, props = tslib_1.__rest(_a, ["children", "className", "component", "hasGutter", "minWidths", "maxWidths"]); |
| 12 |
const minWidthStyles = {}; |
| 13 |
const Component = component; |
| 14 |
if (minWidths) { |
| 15 |
Object.entries(minWidths || {}).map(([breakpoint, value]) => (minWidthStyles[`${l_gallery_GridTemplateColumns_min_1.default.name}${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`] = |
| 16 |
value)); |
| 17 |
} |
| 18 |
const maxWidthStyles = {}; |
| 19 |
if (maxWidths) { |
| 20 |
Object.entries(maxWidths || {}).map(([breakpoint, value]) => (maxWidthStyles[`${l_gallery_GridTemplateColumns_max_1.default.name}${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`] = |
| 21 |
value)); |
| 22 |
} |
| 23 |
const widthStyles = Object.assign(Object.assign({}, minWidthStyles), maxWidthStyles); |
| 24 |
return ((0, jsx_runtime_1.jsx)(Component, Object.assign({ className: (0, react_styles_1.css)(gallery_1.default.gallery, hasGutter && gallery_1.default.modifiers.gutter, className) }, props, ((minWidths || maxWidths) && { style: Object.assign(Object.assign({}, widthStyles), props.style) }), { children: children }))); |
| 25 |
}; |
| 26 |
exports.Gallery = Gallery; |
| 27 |
exports.Gallery.displayName = 'Gallery'; |
| 28 |
//# sourceMappingURL=Gallery.js.map |