You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					33 lines
				
				700 B
			
		
		
			
		
	
	
					33 lines
				
				700 B
			| 
								 
											2 years ago
										 
									 | 
							
								/* eslint-disable */
							 | 
						||
| 
								 | 
							
								var style = require('../wxs/style.wxs');
							 | 
						||
| 
								 | 
							
								var addUnit = require('../wxs/add-unit.wxs');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function wrapperStyle(data) {
							 | 
						||
| 
								 | 
							
								  var width = 100 / data.columnNum + '%';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return style({
							 | 
						||
| 
								 | 
							
								    width: width,
							 | 
						||
| 
								 | 
							
								    'padding-top': data.square ? width : null,
							 | 
						||
| 
								 | 
							
								    'padding-right': addUnit(data.gutter),
							 | 
						||
| 
								 | 
							
								    'margin-top':
							 | 
						||
| 
								 | 
							
								      data.index >= data.columnNum && !data.square
							 | 
						||
| 
								 | 
							
								        ? addUnit(data.gutter)
							 | 
						||
| 
								 | 
							
								        : null,
							 | 
						||
| 
								 | 
							
								  });
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function contentStyle(data) {
							 | 
						||
| 
								 | 
							
								  return data.square
							 | 
						||
| 
								 | 
							
								    ? style({
							 | 
						||
| 
								 | 
							
								        right: addUnit(data.gutter),
							 | 
						||
| 
								 | 
							
								        bottom: addUnit(data.gutter),
							 | 
						||
| 
								 | 
							
								        height: 'auto',
							 | 
						||
| 
								 | 
							
								      })
							 | 
						||
| 
								 | 
							
								    : '';
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports = {
							 | 
						||
| 
								 | 
							
								  wrapperStyle: wrapperStyle,
							 | 
						||
| 
								 | 
							
								  contentStyle: contentStyle,
							 | 
						||
| 
								 | 
							
								};
							 |