# ---- Regex Gadget UI ---- #' @inheritParams regex_gadget regexplain_gadget_ui <- function(text = NULL, pattern = NULL, start_page = "Text") { miniPage( shiny::includeCSS(system.file("styles", "groups.css", package = "regexplain")), shiny::includeCSS(system.file("styles", "gadget.css", package = "regexplain")), gadgetTitleBar( "RegExplain", right = miniTitleBarButton("done", "Send RegEx To Console", TRUE) ), miniTabstripPanel( selected = match.arg(start_page, c("Text", "RegEx", "Output", "Help")), # --- UI - Tab - Text ---- miniTabPanel( "Text", icon = icon('file-text-o'), miniContentPanel( fillCol( textAreaInputAlt('text', label = "Text to search or parse", value = paste(text, collapse = "\n"), resize = "both", width = "100%", height="90%", placeholder = "Paste, enter, or edit your sample text here.") ) ) ), # ---- UI - Tab - Regex ---- miniTabPanel( "RegEx", icon = icon('terminal'), miniContentPanel( tags$div( id = "regexPage", class = "container-fluid", style = "height: 90%", fluidRow( id = "regexInput", tags$div( class = "col-12", textInputCode( 'pattern', 'RegEx', width = "100%", value = pattern, placeholder = "Standard RegEx, e.g. \\w+_\\d{2,4}\\s+", tags$span(class = "input-group-btn", actionButton("library_show", "Library", class = "btn-primary") ) ) ) ), fluidRow( id = "regexOptions", checkboxGroupInput( 'regex_options', label = HTML( '