UNPKG

@porsche-design-system/components-react

Version:

Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.

28 lines (24 loc) 1.45 kB
'use strict'; var jsxRuntime = require('react/jsx-runtime'); var splitChildren = require('../../splitChildren.cjs'); var react = require('react'); var minifyCss = require('../../minifyCss.cjs'); var stripFocusAndHoverStyles = require('../../stripFocusAndHoverStyles.cjs'); var stylesEntry = require('../../../../../../components/dist/styles/esm/styles-entry.cjs'); /** * @slot {"name": "", "description": "Default slot to render p-grid-item tags." } * * @deprecated since v3.0.0, will be removed with next major release. Use native CSS Grid instead. */ class DSRGrid extends react.Component { host; render() { const { children, namedSlotChildren, otherChildren } = splitChildren.splitChildren(this.props.children); const manipulatedChildren = children.map((child) => typeof child === 'object' && 'props' in child && otherChildren.includes(child) ? { ...child, props: { ...child.props, gutter: this.props.gutter } } : child); const style = minifyCss.minifyCss(stripFocusAndHoverStyles.stripFocusAndHoverStyles(stylesEntry.getGridCss(this.props.direction, this.props.wrap))); return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("template", { shadowroot: "open", shadowrootmode: "open", children: [jsxRuntime.jsx("style", { dangerouslySetInnerHTML: { __html: style } }), jsxRuntime.jsx("slot", {})] }), manipulatedChildren] })); } } exports.DSRGrid = DSRGrid;