# ---- 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( fillCol( flex = c(1, 3), fillCol( flex = c(1, 1), fillRow( flex = c(6, 1), textInputCode('pattern', 'RegEx', width = "100%", value = pattern, placeholder = "Standard RegEx, e.g. \\w+_\\d{2,4}\\s+"), tags$div(style = "margin-top: 23px; margin-left:6px;", actionButton("library_show", "Library", class = "btn-success")) ), checkboxGroupInput( 'regex_options', label = HTML( '