UNPKG

choerodon-ui

Version:

An enterprise-class UI design language and React-based implementation

60 lines (51 loc) 1.59 kB
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray"; import * as React from 'react'; import classNames from 'classnames'; import { Row, Col } from '../grid'; function getGrid(grid, t) { return grid && grid[t] && Math.floor(24 / grid[t]); } var Grid = function Grid(props) { var renderContent = function renderContent() { var column = props.column, prefixCls = props.prefixCls; if (column) { var col = column; var cols = []; while (col && col > 0) { cols.push(React.createElement(Col, { span: getGrid(props, 'column'), xs: getGrid(props, 'xs'), sm: getGrid(props, 'sm'), md: getGrid(props, 'md'), lg: getGrid(props, 'lg'), xl: getGrid(props, 'xl'), xxl: getGrid(props, 'xxl') }, React.createElement("div", { className: "".concat(prefixCls, "-content") }))); col--; } return cols; } return React.createElement(Col, null, React.createElement("div", { className: "".concat(prefixCls, "-content") })); }; var prefixCls = props.prefixCls, className = props.className, style = props.style, rows = props.rows, gutter = props.gutter; var rowList = React.createElement(Row, { gutter: gutter }, _toConsumableArray(Array(rows)).map(function () { return renderContent(); })); return React.createElement("div", { className: classNames(prefixCls, className), style: style }, rowList); }; export default Grid; //# sourceMappingURL=Grid.js.map