Skip to content

Commit

Permalink
inline parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Apr 21, 2024
1 parent 33f3bd2 commit 7cc061b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 51 deletions.
95 changes: 45 additions & 50 deletions R/import-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,60 +37,55 @@ import_file_ui <- function(id,
class = "datamods-import",
html_dependency_datamods(),
title,
tags$div(
class = "datamods-file-import",
tags$div(
fileInput(
inputId = ns("file"),
label = i18n("Upload a file:"),
buttonLabel = i18n("Browse..."),
placeholder = i18n("No file selected"),
accept = file_extensions,
width = "100%"
)
tagAppendAttributes(
fileInput(
inputId = ns("file"),
label = i18n("Upload a file:"),
buttonLabel = i18n("Browse..."),
placeholder = i18n("No file selected"),
accept = file_extensions,
width = "100%"
),
tags$div(
tags$label(
class = "control-label",
style = css(visibility = "hidden", width = "100%", marginBottom = "0.5rem"),
"Parameters",
`for` = ns("settings")
class = "mb-0"
),
tags$p(phosphoricons::ph("gear", title = "parameters"), i18n("Parameters")),
fluidRow(
column(
width = 6,
numericInputIcon(
inputId = ns("skip_rows"),
label = i18n("Number of rows to skip before reading data:"),
value = 0,
min = 0,
icon = list("n ="),
width = "100%"
),
dropMenu(
placement = "bottom-end",
actionButton(
inputId = ns("settings"),
label = phosphoricons::ph("gear", title = "parameters"),
class = "btn-block"
),
numericInputIcon(
inputId = ns("skip_rows"),
label = i18n("Number of rows to skip before reading data:"),
value = 0,
min = 0,
icon = list("n =")
),
tagAppendChild(
textInputIcon(
inputId = ns("na_label"),
label = i18n("Missing values character(s):"),
value = ",NA",
icon = list("NA")
),
shiny::helpText(ph("info"), "if several use a comma (',') to separate them")
),
tagAppendChild(
textInputIcon(
inputId = ns("dec"),
label = i18n("Decimal separator:"),
value = ".",
icon = list("0.00")
inputId = ns("na_label"),
label = i18n("Missing values character(s):"),
value = ",NA",
icon = list("NA"),
width = "100%"
),
textInputIcon(
inputId = ns("encoding"),
label = i18n("Encoding:"),
value = "UTF-8",
icon = phosphoricons::ph("text-aa")
)
shiny::helpText(ph("info"), "if several use a comma (',') to separate them")
)
),
column(
width = 6,
textInputIcon(
inputId = ns("dec"),
label = i18n("Decimal separator:"),
value = ".",
icon = list("0.00"),
width = "100%"
),
textInputIcon(
inputId = ns("encoding"),
label = i18n("Encoding:"),
value = "UTF-8",
icon = phosphoricons::ph("text-aa"),
width = "100%"
)
)
),
Expand Down
2 changes: 1 addition & 1 deletion examples/modal.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ library(datamods)

ui <- fluidPage(
# Try with different Bootstrap version
# theme = bslib::bs_theme(version = 5, preset = "bootstrap"),
theme = bslib::bs_theme(version = 5, preset = "bootstrap"),
fluidRow(
column(
width = 4,
Expand Down

0 comments on commit 7cc061b

Please sign in to comment.