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.
		
		
		
		
			
				
					27 lines
				
				606 B
			
		
		
			
		
	
	
					27 lines
				
				606 B
			| 
								 
											2 years ago
										 
									 | 
							
								/* eslint-disable */
							 | 
						||
| 
								 | 
							
								var style = require('../wxs/style.wxs');
							 | 
						||
| 
								 | 
							
								var addUnit = require('../wxs/add-unit.wxs');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function rootStyle(data) {
							 | 
						||
| 
								 | 
							
								  var currentColor = data.checked === data.activeValue ? data.activeColor : data.inactiveColor;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return style({
							 | 
						||
| 
								 | 
							
								    'font-size': addUnit(data.size),
							 | 
						||
| 
								 | 
							
								    'background-color': currentColor,
							 | 
						||
| 
								 | 
							
								  });
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								var BLUE = '#1989fa';
							 | 
						||
| 
								 | 
							
								var GRAY_DARK = '#969799';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								function loadingColor(data) {
							 | 
						||
| 
								 | 
							
								  return data.checked === data.activeValue
							 | 
						||
| 
								 | 
							
								    ? data.activeColor || BLUE
							 | 
						||
| 
								 | 
							
								    : data.inactiveColor || GRAY_DARK;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								module.exports = {
							 | 
						||
| 
								 | 
							
								  rootStyle: rootStyle,
							 | 
						||
| 
								 | 
							
								  loadingColor: loadingColor,
							 | 
						||
| 
								 | 
							
								};
							 |