()
| 41 | }); |
| 42 | }, |
| 43 | render() { |
| 44 | let { basis, gutter, xs, sm, md, lg } = this.props; |
| 45 | let { windowWidth } = this.state; |
| 46 | |
| 47 | let columnStyle = { |
| 48 | minHeight: 1, |
| 49 | paddingLeft: (gutter / 2), |
| 50 | paddingRight: (gutter / 2), |
| 51 | }; |
| 52 | |
| 53 | // if no width control is provided fill available space |
| 54 | if (!basis && !xs && !sm && !md && !lg) { |
| 55 | columnStyle.flex = '1 1 auto'; |
| 56 | columnStyle.msFlex = '1 1 auto'; |
| 57 | columnStyle.WebkitFlex = '1 1 auto'; |
| 58 | } |
| 59 | |
| 60 | // set widths / flex-basis |
| 61 | if (basis) { |
| 62 | columnStyle.flex = '1 0 ' + basis; |
| 63 | columnStyle.msFlex = '1 0 ' + basis; |
| 64 | columnStyle.WebkitFlex = '1 0 ' + basis; |
| 65 | } else if (windowWidth < E.breakpoint.xs) { |
| 66 | columnStyle.width = xs; |
| 67 | } else if (windowWidth < E.breakpoint.sm) { |
| 68 | columnStyle.width = sm || xs; |
| 69 | } else if (windowWidth < E.breakpoint.md) { |
| 70 | columnStyle.width = md || sm || xs; |
| 71 | } else { |
| 72 | columnStyle.width = lg || md || sm || xs; |
| 73 | } |
| 74 | |
| 75 | if (!columnStyle.width) { |
| 76 | columnStyle.width = '100%'; |
| 77 | } |
| 78 | |
| 79 | if (columnStyle.width in E.fractions) { |
| 80 | columnStyle.width = E.fractions[columnStyle.width]; |
| 81 | } |
| 82 | |
| 83 | let props = blacklist(this.props, 'basis', 'gutter', 'style', 'xs', 'sm', 'md', 'lg'); |
| 84 | |
| 85 | return <div style={Object.assign(columnStyle, this.props.style)} {...props} />; |
| 86 | }, |
| 87 | }); |
no outgoing calls
no test coverage detected