UNPKG

choerodon-ui

Version:

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

60 lines (51 loc) 1.67 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( /*#__PURE__*/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') }, /*#__PURE__*/React.createElement("div", { className: "".concat(prefixCls, "-content") }))); col--; } return cols; } return /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/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 = /*#__PURE__*/React.createElement(Row, { gutter: gutter }, _toConsumableArray(Array(rows)).map(function () { return renderContent(); })); return /*#__PURE__*/React.createElement("div", { className: classNames(prefixCls, className), style: style }, rowList); }; export default Grid; //# sourceMappingURL=Grid.js.map