| 
									
										
										
										
											2021-10-20 15:34:52 +02:00
										 |  |  | # This is needed to make data.table's and shiny's symbols available within the | 
					
						
							|  |  |  | # package. | 
					
						
							|  |  |  | #' @import data.table | 
					
						
							|  |  |  | #' @import shiny | 
					
						
							|  |  |  | NULL | 
					
						
							| 
									
										
										
										
											2024-02-18 14:29:23 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #' Add a help popover to a control. | 
					
						
							|  |  |  | #' | 
					
						
							|  |  |  | #' @param title Title of the help popover. | 
					
						
							|  |  |  | #' @param help Content of the help popover. | 
					
						
							|  |  |  | #' @param child The control to add the popover to. | 
					
						
							|  |  |  | #' | 
					
						
							|  |  |  | #' @noRd | 
					
						
							|  |  |  | popover <- function(title, help, child) { | 
					
						
							|  |  |  |   div( | 
					
						
							|  |  |  |     style = "display: flex;", | 
					
						
							|  |  |  |     child, | 
					
						
							|  |  |  |     div( | 
					
						
							|  |  |  |       style = "margin-left: 5px;", | 
					
						
							|  |  |  |       bslib::popover( | 
					
						
							|  |  |  |         bsicons::bs_icon("question-circle"), | 
					
						
							|  |  |  |         title = title, | 
					
						
							|  |  |  |         help, | 
					
						
							|  |  |  |         options = list(offset = c(0, 10)) | 
					
						
							|  |  |  |       ) | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |   ) | 
					
						
							| 
									
										
										
										
											2024-02-18 15:11:46 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #' An information label. | 
					
						
							|  |  |  | #' | 
					
						
							|  |  |  | #' @param info Information text. | 
					
						
							|  |  |  | #' | 
					
						
							|  |  |  | #' @noRd | 
					
						
							|  |  |  | info <- function(info) { | 
					
						
							|  |  |  |   div( | 
					
						
							|  |  |  |     style = "display: flex; margin: 1rem", | 
					
						
							|  |  |  |     div( | 
					
						
							|  |  |  |       style = "margin-right: 10px", | 
					
						
							|  |  |  |       bsicons::bs_icon("info-circle") | 
					
						
							|  |  |  |     ), | 
					
						
							|  |  |  |     info | 
					
						
							|  |  |  |   ) | 
					
						
							| 
									
										
										
										
											2024-02-18 14:29:23 +01:00
										 |  |  | } |