diff --git a/R/actionbutton_dsfr.R b/R/actionbutton_dsfr.R index 40fa98a..5937e98 100644 --- a/R/actionbutton_dsfr.R +++ b/R/actionbutton_dsfr.R @@ -7,14 +7,14 @@ #' @param class des classes a ajouter si necessaire #' #' @return html -#' +#' @seealso [actionButton()] Pour en savoir plus sur la création de boutons d'action avec Shiny. [Documentation externe](https://shiny.posit.co/r/reference/shiny/latest/actionbutton) #' @export #' #' @examples #' if (interactive()) { #' library(shiny) #' library(shinygouv) -#' +#' #' ui <- fluidPage_dsfr( #' header = header_dsfr( #' intitule = "Intitule", @@ -38,7 +38,7 @@ #' paste("Vous avez cliqu\u00e9", input$test, "fois sur le bouton") #' }) #' } -#' +#' #' shinyApp(ui, server) #' } actionButton_dsfr <- function( diff --git a/R/checkboxgroupinput_dsfr.R b/R/checkboxgroupinput_dsfr.R index 9e8b7d4..6caf892 100644 --- a/R/checkboxgroupinput_dsfr.R +++ b/R/checkboxgroupinput_dsfr.R @@ -8,37 +8,39 @@ #' @param selected Valeurs préselectionnées #' @param inline Si TRUE, positionne les choix en ligne (c'est-à-dire horizontalement). #' @return html +#' @seealso [checkboxGroupInput()] Pour en savoir plus sur la fonction originelle de Shiny. +#' [Documentation externe](https://shiny.posit.co/r/reference/shiny/latest/checkboxgroupinput) #' #' @export #' #' @examples #' if (interactive()) { -#' +#' #' library(shiny) -#' +#' #' ui <- fluidPage_dsfr( #' checkboxGroupInput_dsfr("checkboxes", "Variables to show:", #' c("Cylinders" = "cyl", #' "Transmission" = "am", #' "Gears" = "gear"), inline = TRUE) #' ) -#' +#' #' server <- function(input, output, session) { #' observeEvent(input$checkboxes, { #' print(input$checkboxes) #' }) #' } -#' +#' #' shinyApp(ui, server) #' } checkboxGroupInput_dsfr <- function(inputId, label, choices = NULL, selected = NULL, inline = FALSE) { - + # check les params assertthat::assert_that(is.character(inputId)) assertthat::assert_that(is.character(label)) assertthat::assert_that(is.logical(inline)) - + # if choices is null then choices_value and choice_names must be not empty with the same length # assertthat::assert_that(!is.null(choices) | (length(choice_values) > 0 & length(choice_values) == length(choice_names))) # diff --git a/R/checkboxinput_dsfr.R b/R/checkboxinput_dsfr.R index b820554..57d542c 100644 --- a/R/checkboxinput_dsfr.R +++ b/R/checkboxinput_dsfr.R @@ -9,6 +9,8 @@ #' @param label id de l'input sans indexation #' #' @return html +#' @seealso [checkboxInput()] Pour en savoir plus sur la fonction Shiny originelle, +#' consultez [checkboxInput()](https://shiny.posit.co/r/reference/shiny/latest/checkboxinput). #' #' @export #' @@ -21,12 +23,12 @@ checkboxInput_dsfr <- function(inputId, label, value = FALSE) { - + # check les params assertthat::assert_that(is.character(inputId)) assertthat::assert_that(is.character(label)) assertthat::assert_that(is.logical(value)) - + checkboxInput_dsfr_template( inputId, label = label, diff --git a/R/column_dsfr.R b/R/column_dsfr.R index c3cdba2..c11cab8 100644 --- a/R/column_dsfr.R +++ b/R/column_dsfr.R @@ -8,7 +8,9 @@ #' @param extra_class ajout de class pour la column_dsfr (voir la page officiel du CSS) #' #' @return shiny.tag.list -#' +#' @seealso [column()] Pour en savoir plus sur la fonction originelle de Shiny. +#' [Documentation externe](https://shiny.posit.co/r/reference/shiny/latest/column.html) + #' @importFrom htmltools tagList #' #' @export diff --git a/R/daterangeinput_dsfr.R b/R/daterangeinput_dsfr.R index b5f87f7..ec0bc08 100644 --- a/R/daterangeinput_dsfr.R +++ b/R/daterangeinput_dsfr.R @@ -7,11 +7,11 @@ #' @param start character La date de début au format aaaa-mm-jj. Si NULL (valeur par défaut), la date utilisée est la date du jour. #' @param end character La date de fin au format aaaa-mm-jj. Si NULL (valeur par défaut), la date utilisée est la date du jour. #' @param separator character Chaîne à afficher entre les zones de saisie de début et de fin de dates. -#' +#' #' @importFrom assertthat assert_that #' @importFrom purrr map #' @return html -#' +#' @seealso [daterangeinput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/daterangeinput) #' @export #' #' @examples @@ -19,7 +19,7 @@ #' if (interactive()) { #' library(shiny) #' library(shinygouv) -#' +#' #' ui <- fluidPage_dsfr( #' header = header_dsfr( #' intitule = "Intitule", @@ -36,14 +36,14 @@ #' ) #' ) #' server <- function(input, output, session) { -#' +#' #' observeEvent(input$daterange1, { #' print(input$daterange1) -#' }) -#' +#' }) +#' #' } -#' -#' +#' +#' #' shinyApp(ui, server) #' } dateRangeInput_dsfr <- function( @@ -58,19 +58,19 @@ dateRangeInput_dsfr <- function( assertthat::assert_that(is.character(separator)) assertthat::assert_that(is.character(label)) - + if (isTRUE(is.null(start))) { start <- Sys.Date() } else { assertthat::assert_that(is.character(start)) } - + if (isTRUE(is.null(end))) { end <- Sys.Date() } else { assertthat::assert_that(is.character(end)) } - + dateRangeInput_dsfr_template( inputId = inputId, label = label, diff --git a/R/fileinput_dsfr.R b/R/fileinput_dsfr.R index 03d8132..dfb60da 100644 --- a/R/fileinput_dsfr.R +++ b/R/fileinput_dsfr.R @@ -10,13 +10,14 @@ #' @return html #' @importFrom assertthat assert_that #' @export -#' +#' @seealso [fileInput()] Pour en savoir plus sur la fonction originelle de Shiny. +#' [Documentation externe](https://shiny.posit.co/r/reference/shiny/latest/fileinput) #' @examples -#' +#' #' if (interactive()) { #' ui <- fluidPage_dsfr( #' fluidRow_dsfr( -#' column_dsfr(width = 4, +#' column_dsfr(width = 4, #' fileInput_dsfr(inputId = "file1", label = "Importez vos données", message = "seul le format csv est pris en charge"), #' br(), #' checkboxInput_dsfr(inputId = "header", label = "Utiliser les en-tetes du fichier") @@ -26,23 +27,23 @@ #' ) #' ) #' ) -#' +#' #' server <- function(input, output) { #' output$contenu <- renderTable({ #' file <- input$file1 #' ext <- tools::file_ext(file$datapath) -#' +#' #' req(file) #' validate(need(ext == "csv", "Veuillez choisir un fichier csv svp")) -#' +#' #' read.csv2(file$datapath, header = input$header, nrows = 12) #' }) #' } -#' +#' #' shinyApp(ui, server) #' } -#' -#' +#' +#' fileInput_dsfr <- function( inputId, label, diff --git a/R/fluidpage_dsfr.R b/R/fluidpage_dsfr.R index b910946..8aacf39 100644 --- a/R/fluidpage_dsfr.R +++ b/R/fluidpage_dsfr.R @@ -12,7 +12,7 @@ #' @return html #' #' @importFrom htmltools tagList -#' +#' @seealso [fluidPage](https://shiny.posit.co/r/reference/shiny/latest/fluidpage) #' @export #' #' @examples diff --git a/R/fluidrow_dsfr.R b/R/fluidrow_dsfr.R index 4c2f271..5f41eee 100644 --- a/R/fluidrow_dsfr.R +++ b/R/fluidrow_dsfr.R @@ -8,7 +8,7 @@ #' #' @return shiny.tag.list #' @importFrom htmltools tagList -#' +#' @seealso [fluidPage](https://shiny.posit.co/r/reference/shiny/latest/fluidpage) #' @export #' @examples #' if (interactive()) { diff --git a/R/modaldialog_dsfr.R b/R/modaldialog_dsfr.R index 8c48a72..df767ea 100644 --- a/R/modaldialog_dsfr.R +++ b/R/modaldialog_dsfr.R @@ -8,7 +8,7 @@ #' @param title titre du modal #' @param footer footer du modal #' @return html -#' +#' @seealso [modaldialog() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/modaldialog) #' @export #' @importFrom htmltools tagList #' @examples @@ -63,7 +63,7 @@ modalDialog_dsfr <- function( #' @param ui TODO #' @param inputId TODO #' @param session TODO -#' +#' @seealso [showmodal() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/showmodal) #' @export showModal_dsfr <- function( ui, @@ -84,7 +84,7 @@ showModal_dsfr <- function( #' #' @param inputId TODO #' @param session TODO -#' +#' @seealso [removemodal() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/showmodal) #' @export removeModal_dsfr <- function( inputId = "fr-modal-1", diff --git a/R/navbarpage_dsfr.R b/R/navbarpage_dsfr.R index 7f55640..0cd3fa2 100644 --- a/R/navbarpage_dsfr.R +++ b/R/navbarpage_dsfr.R @@ -3,14 +3,13 @@ #' Page avec navbar #' #' @return html -#' +#' @seealso [navbarPage() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/navbarpage). #' @export #' @param ... Une list de navbarPanel_dsfr #' @param title Titre de l'application (Attention, différent de shiny::navbarPage) #' @param id Id de la navbar #' @param header header_dsfr() #' @param footer pied de page -#' #' @examples #' library(shiny) #' # Define UI diff --git a/R/numericinput_dsfr.R b/R/numericinput_dsfr.R index 2129c05..91f4957 100644 --- a/R/numericinput_dsfr.R +++ b/R/numericinput_dsfr.R @@ -11,7 +11,7 @@ #' @param step pas utilisé entre 2 valeurs #' #' @return html -#' +#' @seealso [numericInput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/numericinput) #' @export #' #' @examples diff --git a/R/radiobuttons_dsfr.R b/R/radiobuttons_dsfr.R index 0298917..cb1bd08 100644 --- a/R/radiobuttons_dsfr.R +++ b/R/radiobuttons_dsfr.R @@ -9,9 +9,8 @@ #' @param inline Si TRUE, positionne les choix en ligne (c'est-à-dire horizontalement). #' @param class des classes a ajouter si necessaire #' @return html -#' +#' @seealso [radioButtons](https://shiny.posit.co/r/reference/shiny/latest/radiobuttons) #' @export -#' #' @examples #' radioButtons_dsfr( #' inputId = "test", label = "Test", choices = c("A", "B"), class = NULL diff --git a/R/radiogroupbuttons_dsfr.R b/R/radiogroupbuttons_dsfr.R index 01e1f33..d15029c 100644 --- a/R/radiogroupbuttons_dsfr.R +++ b/R/radiogroupbuttons_dsfr.R @@ -8,7 +8,7 @@ #' @param selected Element sélectionné (NULL par défaut) #' @param inline Si TRUE, positionne les choix en ligne (c'est-à-dire horizontalement). #' @return html -#' +#' @seealso [radioGroupButtons() in Shiny](https://rdrr.io/cran/shinyWidgets/man/radioGroupButtons.html) #' @export #' #' @examples diff --git a/R/selectinput_dsfr.R b/R/selectinput_dsfr.R index 0fa795e..ad19e90 100644 --- a/R/selectinput_dsfr.R +++ b/R/selectinput_dsfr.R @@ -9,7 +9,7 @@ #' @importFrom assertthat assert_that #' @importFrom purrr map #' @return html -#' +#' @seealso [selectInput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/selectinput) #' @export #' #' @examples @@ -50,7 +50,7 @@ #' ), #' selected = "gear" #' ) -#' +#' #' ) #' #' ) diff --git a/R/sliderinput_dsfr.R b/R/sliderinput_dsfr.R index e20d63c..2ea7226 100644 --- a/R/sliderinput_dsfr.R +++ b/R/sliderinput_dsfr.R @@ -4,6 +4,8 @@ #' #' @inherit shiny::sliderInput #' @inherit shiny::updateSliderInput +#' @seealso [selectInput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/sliderinput) #' @export sliderInput_dsfr <- shiny::sliderInput updateSliderInput_dsfr <- shiny::updateSliderInput + diff --git a/R/tableoutput_dsfr.R b/R/tableoutput_dsfr.R index 9a7604d..46fc22b 100644 --- a/R/tableoutput_dsfr.R +++ b/R/tableoutput_dsfr.R @@ -4,11 +4,11 @@ #' #' @param outputId nom d'output a partir duquel lire la table #' @return html -#' +#' @seealso [tableoutput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/rendertable) #' @export #' #' @examples -#' +#' #' if (interactive()) { #' # table example #' shinyApp( diff --git a/R/tabpanel.R b/R/tabpanel.R index d989770..ff983ec 100644 --- a/R/tabpanel.R +++ b/R/tabpanel.R @@ -6,12 +6,10 @@ #' @param ... liste de tabPanel_dsfr #' @param title titre du tabset #' @param content contenu du tabset -#' +#' @seealso [tabsetpanel() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/tabsetpanel) #' @return html -#' #' @export #' @rdname tabPanel -#' #' @examples #' if (interactive()){ #' library(shiny) diff --git a/R/updatecheckboxgroupinput_dsfr.R b/R/updatecheckboxgroupinput_dsfr.R index a167c4f..b98a954 100644 --- a/R/updatecheckboxgroupinput_dsfr.R +++ b/R/updatecheckboxgroupinput_dsfr.R @@ -10,14 +10,14 @@ #' @param inline Si TRUE, positionne les choix en ligne (c'est-à-dire horizontalement). #' @importFrom shiny updateCheckboxInput #' @return html -#' +#' @seealso [updatecheckboxgroupinput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updatecheckboxgroupinput) #' @export #' @examples #' ## Only run examples in interactive R sessions #' if (interactive()) { -#' +#' #' library(shiny) -#' +#' #' ui <- fluidPage_dsfr( #' checkboxGroupInput_dsfr( #' "variable", "Variables to show:", @@ -28,13 +28,13 @@ #' actionButton_dsfr("go", "Change for inline and choices"), #' actionButton_dsfr("go2", "Change without inline and choices") #' ) -#' +#' #' server <- function(input, output, session) { #' observeEvent(input$variable, { #' print(input$variable) #' }) -#' -#' +#' +#' #' observeEvent(input$go, { #' updateCheckboxGroupInput_dsfr( #' session = session, @@ -44,10 +44,10 @@ #' selected = "a", #' inline = TRUE #' ) -#' +#' #' }) -#' -#' +#' +#' #' observeEvent(input$go2, { #' updateCheckboxGroupInput_dsfr( #' session = session, @@ -57,9 +57,9 @@ #' selected = "a", #' inline = FALSE #' ) -#' +#' #' }) -#' +#' #' } #' shinyApp(ui, server) #' } @@ -69,19 +69,19 @@ updateCheckboxGroupInput_dsfr <- function(inputId, selected = NULL, inline = FALSE, session = shiny::getDefaultReactiveDomain()) { - + ns <- session$ns - + if (!is.null(selected)) { selected <- as.character(selected) } - + if (is.null(names(choices))) { nom_choix <- choices } else { nom_choix <- names(choices) } - + if (!is.null(choices)) { tag <- checkboxGroupInput_dsfr( inputId = ns(inputId), @@ -91,18 +91,18 @@ updateCheckboxGroupInput_dsfr <- function(inputId, selected = selected ) %>% htmltools::tagQuery() - + choices <- tag$find(".shiny-options-group")$selectedTags() choices <- as.character(choices) } - + message <- utils::getFromNamespace("dropNulls", "shiny")(list( label = label, options = choices, value = selected )) session$sendInputMessage(inputId, message) - + # Choices have to changes to set up inline if (!is.null(choices)) { update_inline(ns(inputId), inline, session) diff --git a/R/updatecheckboxinput_dsfr.R b/R/updatecheckboxinput_dsfr.R index b17c6b4..281df1b 100644 --- a/R/updatecheckboxinput_dsfr.R +++ b/R/updatecheckboxinput_dsfr.R @@ -11,7 +11,7 @@ #' #' @importFrom shiny updateCheckboxInput #' @return html -#' +#' @seealso [updatecheckboxinput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updatecheckboxinput) #' @export #' @examples #' ## Only run examples in interactive R sessions @@ -21,7 +21,7 @@ #' actionButton_dsfr("go", "Change") #' ) #' server <- function(input, output, session) { -#' +#' #' observeEvent(input$go, { #' updateCheckboxInput_dsfr( #' session = session, @@ -30,7 +30,7 @@ #' value = TRUE #' ) #' }) -#' +#' #' observeEvent(input$inCheckboxInput, { #' message(input$inCheckboxInput) #' }) @@ -41,12 +41,12 @@ updateCheckboxInput_dsfr <- function(inputId, label = NULL, value = NULL, session = shiny::getDefaultReactiveDomain()) { - + ns <- session$ns - + updateCheckboxInput(session = session, inputId = inputId, label = label, value = value) - + } diff --git a/R/updatedaterangeinput_dsfr.R b/R/updatedaterangeinput_dsfr.R index 2be892d..b85ddde 100644 --- a/R/updatedaterangeinput_dsfr.R +++ b/R/updatedaterangeinput_dsfr.R @@ -9,14 +9,14 @@ #' @param session la session, la valeur par défaut est getDefaultReactiveDomain(). #' @importFrom shiny updateCheckboxInput #' @return html -#' +#' @seealso [updatedaterangeinput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updatedaterangeinput) #' @export #' @examples #' ## Only run examples in interactive R sessions #' if (interactive()) { -#' +#' #' library(shiny) -#' +#' #' ui <- fluidPage_dsfr( #' dateRangeInput_dsfr(inputId = "daterange1", #' label = "Date range:", start = "2001-01-01",separator = "à"), @@ -24,40 +24,40 @@ #' actionButton_dsfr("go2", "Change start"), #' actionButton_dsfr("go3", "Change end") #' ) -#' +#' #' server <- function(input, output, session) { #' observeEvent(input$daterange1, { #' print(input$daterange1) #' }) -#' -#' +#' +#' #' observeEvent(input$go, { #' updateDateRangeInput_dsfr( #' session = session, #' inputId = "daterange1", #' label = "new label" #' ) -#' +#' #' }) -#' -#' +#' +#' #' observeEvent(input$go2, { #' updateDateRangeInput_dsfr( #' session = session, #' inputId = "daterange1", #' start = "2000-01-01" #' ) -#' +#' #' }) -#' +#' #' observeEvent(input$go3, { #' updateDateRangeInput_dsfr( #' session = session, #' inputId = "daterange1", #' end = "2020-01-01" #' ) -#' -#' }) +#' +#' }) #' } #' shinyApp(ui, server) #' } @@ -66,8 +66,8 @@ updateDateRangeInput_dsfr <- function(inputId, start = NULL, end = NULL, session = shiny::getDefaultReactiveDomain()) { - - + + ns <- session$ns if (!is.null(label)) { @@ -75,13 +75,13 @@ updateDateRangeInput_dsfr <- function(inputId, list(inputId = ns(inputId), label = label)) } - + if (!is.null(start)) { session$sendCustomMessage("updateDateRangeInputStart", list(inputId = ns(inputId), start = start)) } - + if (!is.null(end)) { session$sendCustomMessage("updateDateRangeInputEnd", list(inputId = ns(inputId), diff --git a/R/updatenumericinput_dsfr.R b/R/updatenumericinput_dsfr.R index cb7f84b..2f999f4 100644 --- a/R/updatenumericinput_dsfr.R +++ b/R/updatenumericinput_dsfr.R @@ -12,7 +12,7 @@ #' #' @importFrom shiny updateNumericInput #' @return html -#' +#' @seealso [updatenumericinput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updatenumericinput) #' @export #' @examples #' ## Only run examples in interactive R sessions diff --git a/R/updateradiobuttons_dsfr.R b/R/updateradiobuttons_dsfr.R index d9c4c52..2b2668d 100644 --- a/R/updateradiobuttons_dsfr.R +++ b/R/updateradiobuttons_dsfr.R @@ -12,7 +12,7 @@ #' @importFrom htmltools tagList #' @importFrom purrr pmap #' @return html -#' +#' @seealso [updateradiobuttons() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updateradiobuttons) #' @export #' @examples #' ## Only run examples in interactive R sessions diff --git a/R/updateselectinput_dsfr.R b/R/updateselectinput_dsfr.R index 9436f29..5f85365 100644 --- a/R/updateselectinput_dsfr.R +++ b/R/updateselectinput_dsfr.R @@ -10,7 +10,7 @@ #' #' @importFrom shiny updateSelectInput #' @return html -#' +#' @seealso [updateselectinput() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updateselectinput) #' @export #' @examples #' ## Only run examples in interactive R sessions diff --git a/R/updatetabsetpanel_dsfr.R b/R/updatetabsetpanel_dsfr.R index dc37973..c3d13af 100644 --- a/R/updatetabsetpanel_dsfr.R +++ b/R/updatetabsetpanel_dsfr.R @@ -8,7 +8,7 @@ #' #' @importFrom shiny updateNumericInput #' @return html -#' +#' @seealso [updatetabsetpanel() in Shiny](https://shiny.posit.co/r/reference/shiny/latest/updatetabsetpanel) #' @export #' @examples #' if (interactive()){ diff --git a/R/withspinner_dsfr.R b/R/withspinner_dsfr.R index b715f36..6c040a5 100644 --- a/R/withspinner_dsfr.R +++ b/R/withspinner_dsfr.R @@ -4,7 +4,6 @@ #' @importFrom htmltools HTML #' @return an html code #' @examples addWithSpinner() -#' #' @noRd addWithSpinner <- function() { HTML('
') @@ -16,7 +15,6 @@ addWithSpinner <- function() { #' @param inputId id du spinner #' @param session session #' @return side effect. Masque le spinner -#' #' @noRd hideSpinner_dsfr <- function( inputId, @@ -31,7 +29,6 @@ hideSpinner_dsfr <- function( #' @param inputId id du spinner #' @param session session #' @return side effect. Affiche le spinner -#' #' @noRd showSpinner_dsfr <- function( inputId, @@ -48,6 +45,7 @@ showSpinner_dsfr <- function( #' @param session session shiny #' #' @return html +#' @seealso [withSpinner() in Shinycssloaders](https://www.rdocumentation.org/packages/shinycssloaders/versions/1.0.0/topics/withSpinner) #' @export #' @examples #' if (interactive()) { diff --git a/man/actionButton_dsfr.Rd b/man/actionButton_dsfr.Rd index e312af1..1e5d0b1 100644 --- a/man/actionButton_dsfr.Rd +++ b/man/actionButton_dsfr.Rd @@ -51,3 +51,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\code{\link[=actionButton]{actionButton()}} Pour en savoir plus sur la création de boutons d'action avec Shiny. \href{https://shiny.posit.co/r/reference/shiny/latest/actionbutton}{Documentation externe} +} diff --git a/man/checkboxGroupInput_dsfr.Rd b/man/checkboxGroupInput_dsfr.Rd index e7b1295..02c2615 100644 --- a/man/checkboxGroupInput_dsfr.Rd +++ b/man/checkboxGroupInput_dsfr.Rd @@ -31,22 +31,26 @@ checkboxGroupInput_dsfr } \examples{ if (interactive()) { - + library(shiny) - + ui <- fluidPage_dsfr( checkboxGroupInput_dsfr("checkboxes", "Variables to show:", c("Cylinders" = "cyl", "Transmission" = "am", "Gears" = "gear"), inline = TRUE) ) - + server <- function(input, output, session) { observeEvent(input$checkboxes, { print(input$checkboxes) }) } - + shinyApp(ui, server) } } +\seealso{ +\code{\link[=checkboxGroupInput]{checkboxGroupInput()}} Pour en savoir plus sur la fonction originelle de Shiny. +\href{https://shiny.posit.co/r/reference/shiny/latest/checkboxgroupinput}{Documentation externe} +} diff --git a/man/checkboxInput_dsfr.Rd b/man/checkboxInput_dsfr.Rd index 1042d1b..044d68b 100644 --- a/man/checkboxInput_dsfr.Rd +++ b/man/checkboxInput_dsfr.Rd @@ -26,3 +26,7 @@ checkboxInput_dsfr( inputId = 'test', label = 'test', value = TRUE ) } +\seealso{ +\code{\link[=checkboxInput]{checkboxInput()}} Pour en savoir plus sur la fonction Shiny originelle, +consultez \href{https://shiny.posit.co/r/reference/shiny/latest/checkboxinput}{checkboxInput()}. +} diff --git a/man/column_dsfr.Rd b/man/column_dsfr.Rd index 0e57938..82066a7 100644 --- a/man/column_dsfr.Rd +++ b/man/column_dsfr.Rd @@ -35,3 +35,7 @@ if (interactive()) { ) } } +\seealso{ +\code{\link[=column]{column()}} Pour en savoir plus sur la fonction originelle de Shiny. +\href{https://shiny.posit.co/r/reference/shiny/latest/column.html}{Documentation externe} +} diff --git a/man/dateRangeInput_dsfr.Rd b/man/dateRangeInput_dsfr.Rd index 339c275..4fc1dc6 100644 --- a/man/dateRangeInput_dsfr.Rd +++ b/man/dateRangeInput_dsfr.Rd @@ -28,7 +28,7 @@ dateRangeInput_dsfr if (interactive()) { library(shiny) library(shinygouv) - + ui <- fluidPage_dsfr( header = header_dsfr( intitule = "Intitule", @@ -48,11 +48,14 @@ if (interactive()) { observeEvent(input$daterange1, { print(input$daterange1) - }) + }) } - + shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/daterangeinput}{daterangeinput() in Shiny} +} diff --git a/man/fileInput_dsfr.Rd b/man/fileInput_dsfr.Rd index c70f76b..2de8c47 100644 --- a/man/fileInput_dsfr.Rd +++ b/man/fileInput_dsfr.Rd @@ -24,7 +24,7 @@ fileInput_dsfr if (interactive()) { ui <- fluidPage_dsfr( fluidRow_dsfr( - column_dsfr(width = 4, + column_dsfr(width = 4, fileInput_dsfr(inputId = "file1", label = "Importez vos données", message = "seul le format csv est pris en charge"), br(), checkboxInput_dsfr(inputId = "header", label = "Utiliser les en-tetes du fichier") @@ -34,21 +34,25 @@ if (interactive()) { ) ) ) - + server <- function(input, output) { output$contenu <- renderTable({ file <- input$file1 ext <- tools::file_ext(file$datapath) - + req(file) validate(need(ext == "csv", "Veuillez choisir un fichier csv svp")) - + read.csv2(file$datapath, header = input$header, nrows = 12) }) } - + shinyApp(ui, server) } } +\seealso{ +\code{\link[=fileInput]{fileInput()}} Pour en savoir plus sur la fonction originelle de Shiny. +\href{https://shiny.posit.co/r/reference/shiny/latest/fileinput}{Documentation externe} +} diff --git a/man/fluidPage_dsfr.Rd b/man/fluidPage_dsfr.Rd index 45a5a88..135e1ee 100644 --- a/man/fluidPage_dsfr.Rd +++ b/man/fluidPage_dsfr.Rd @@ -50,3 +50,6 @@ if (interactive()) { ) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/fluidpage}{fluidPage} +} diff --git a/man/fluidRow_dsfr.Rd b/man/fluidRow_dsfr.Rd index 6809d3b..c1f47e7 100644 --- a/man/fluidRow_dsfr.Rd +++ b/man/fluidRow_dsfr.Rd @@ -30,3 +30,6 @@ if (interactive()) { ) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/fluidpage}{fluidPage} +} diff --git a/man/modalDialog_dsfr.Rd b/man/modalDialog_dsfr.Rd index f20a492..885e10c 100644 --- a/man/modalDialog_dsfr.Rd +++ b/man/modalDialog_dsfr.Rd @@ -51,3 +51,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/modaldialog}{modaldialog() in Shiny} +} diff --git a/man/navbarPage_dsfr.Rd b/man/navbarPage_dsfr.Rd index 07e1d54..eea3c81 100644 --- a/man/navbarPage_dsfr.Rd +++ b/man/navbarPage_dsfr.Rd @@ -116,3 +116,6 @@ if (interactive()) { shinyApp(ui = ui, server = server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/navbarpage}{navbarPage() in Shiny}. +} diff --git a/man/numericInput_dsfr.Rd b/man/numericInput_dsfr.Rd index 5010d7a..6d3d6b0 100644 --- a/man/numericInput_dsfr.Rd +++ b/man/numericInput_dsfr.Rd @@ -68,3 +68,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/numericinput}{numericInput() in Shiny} +} diff --git a/man/radioButtons_dsfr.Rd b/man/radioButtons_dsfr.Rd index f09b2c2..526d1d2 100644 --- a/man/radioButtons_dsfr.Rd +++ b/man/radioButtons_dsfr.Rd @@ -46,3 +46,6 @@ radioButtons_dsfr( inline = TRUE ) } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/radiobuttons}{radioButtons} +} diff --git a/man/selectInput_dsfr.Rd b/man/selectInput_dsfr.Rd index 853a5b8..d2c9e25 100644 --- a/man/selectInput_dsfr.Rd +++ b/man/selectInput_dsfr.Rd @@ -59,7 +59,7 @@ selectInput_dsfr( ), selected = "gear" ) - + ) ) @@ -70,3 +70,6 @@ selectInput_dsfr( shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/selectinput}{selectInput() in Shiny} +} diff --git a/man/sliderInput_dsfr.Rd b/man/sliderInput_dsfr.Rd index 0463088..37e9bcb 100644 --- a/man/sliderInput_dsfr.Rd +++ b/man/sliderInput_dsfr.Rd @@ -135,21 +135,5 @@ shinyApp(ui, server) } } \seealso{ -\code{\link[shiny:updateSliderInput]{updateSliderInput()}} - -Other input elements: -\code{\link[shiny]{actionButton}()}, -\code{\link[shiny]{checkboxGroupInput}()}, -\code{\link[shiny]{checkboxInput}()}, -\code{\link[shiny]{dateInput}()}, -\code{\link[shiny]{dateRangeInput}()}, -\code{\link[shiny]{fileInput}()}, -\code{\link[shiny]{numericInput}()}, -\code{\link[shiny]{passwordInput}()}, -\code{\link[shiny]{radioButtons}()}, -\code{\link[shiny]{selectInput}()}, -\code{\link[shiny]{submitButton}()}, -\code{\link[shiny]{textAreaInput}()}, -\code{\link[shiny]{textInput}()}, -\code{\link[shiny]{varSelectInput}()} +\href{https://shiny.posit.co/r/reference/shiny/latest/sliderinput}{selectInput() in Shiny} } diff --git a/man/tabPanel.Rd b/man/tabPanel.Rd index c7e570e..d017f6e 100644 --- a/man/tabPanel.Rd +++ b/man/tabPanel.Rd @@ -60,3 +60,6 @@ if (interactive()){ ) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/tabpanel}{tabpanel() in Shiny} +} diff --git a/man/tableOutput_dsfr.Rd b/man/tableOutput_dsfr.Rd index cfc253f..3a16af6 100644 --- a/man/tableOutput_dsfr.Rd +++ b/man/tableOutput_dsfr.Rd @@ -33,3 +33,6 @@ if (interactive()) { ) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/rendertable}{tableoutput() in Shiny} +} diff --git a/man/updateCheckboxGroupInput_dsfr.Rd b/man/updateCheckboxGroupInput_dsfr.Rd index 5ef5b3a..0c9e3f8 100644 --- a/man/updateCheckboxGroupInput_dsfr.Rd +++ b/man/updateCheckboxGroupInput_dsfr.Rd @@ -35,9 +35,9 @@ updateCheckboxGroupInput_dsfr \examples{ ## Only run examples in interactive R sessions if (interactive()) { - + library(shiny) - + ui <- fluidPage_dsfr( checkboxGroupInput_dsfr( "variable", "Variables to show:", @@ -48,13 +48,13 @@ if (interactive()) { actionButton_dsfr("go", "Change for inline and choices"), actionButton_dsfr("go2", "Change without inline and choices") ) - + server <- function(input, output, session) { observeEvent(input$variable, { print(input$variable) }) - - + + observeEvent(input$go, { updateCheckboxGroupInput_dsfr( session = session, @@ -64,10 +64,10 @@ if (interactive()) { selected = "a", inline = TRUE ) - + }) - - + + observeEvent(input$go2, { updateCheckboxGroupInput_dsfr( session = session, @@ -77,10 +77,13 @@ if (interactive()) { selected = "a", inline = FALSE ) - + }) - + } shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updatecheckboxgroupinput}{updatecheckboxgroupinput() in Shiny} +} diff --git a/man/updateCheckboxInput_dsfr.Rd b/man/updateCheckboxInput_dsfr.Rd index c1fd5cd..c32c7d6 100644 --- a/man/updateCheckboxInput_dsfr.Rd +++ b/man/updateCheckboxInput_dsfr.Rd @@ -34,7 +34,7 @@ if (interactive()) { actionButton_dsfr("go", "Change") ) server <- function(input, output, session) { - + observeEvent(input$go, { updateCheckboxInput_dsfr( session = session, @@ -43,7 +43,7 @@ if (interactive()) { value = TRUE ) }) - + observeEvent(input$inCheckboxInput, { message(input$inCheckboxInput) }) @@ -51,3 +51,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updatecheckboxinput}{updatecheckboxinput() in Shiny} +} diff --git a/man/updateDateRangeInput_dsfr.Rd b/man/updateDateRangeInput_dsfr.Rd index 053055f..659d2bf 100644 --- a/man/updateDateRangeInput_dsfr.Rd +++ b/man/updateDateRangeInput_dsfr.Rd @@ -32,9 +32,9 @@ updateDateRangeInput_dsfr \examples{ ## Only run examples in interactive R sessions if (interactive()) { - + library(shiny) - + ui <- fluidPage_dsfr( dateRangeInput_dsfr(inputId = "daterange1", label = "Date range:", start = "2001-01-01",separator = "à"), @@ -42,41 +42,44 @@ if (interactive()) { actionButton_dsfr("go2", "Change start"), actionButton_dsfr("go3", "Change end") ) - + server <- function(input, output, session) { observeEvent(input$daterange1, { print(input$daterange1) }) - - + + observeEvent(input$go, { updateDateRangeInput_dsfr( session = session, inputId = "daterange1", label = "new label" ) - + }) - - + + observeEvent(input$go2, { updateDateRangeInput_dsfr( session = session, inputId = "daterange1", start = "2000-01-01" ) - + }) - + observeEvent(input$go3, { updateDateRangeInput_dsfr( session = session, inputId = "daterange1", end = "2020-01-01" ) - - }) + + }) } shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updatedaterangeinput}{updatedaterangeinput() in Shiny} +} diff --git a/man/updateNumericInput_dsfr.Rd b/man/updateNumericInput_dsfr.Rd index d44e456..b671c4f 100644 --- a/man/updateNumericInput_dsfr.Rd +++ b/man/updateNumericInput_dsfr.Rd @@ -137,3 +137,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updatenumericinput}{updatenumericinput() in Shiny} +} diff --git a/man/updateRadioButtons_dsfr.Rd b/man/updateRadioButtons_dsfr.Rd index fc69138..da1f30d 100644 --- a/man/updateRadioButtons_dsfr.Rd +++ b/man/updateRadioButtons_dsfr.Rd @@ -65,3 +65,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updateradiobuttons}{updateradiobuttons() in Shiny} +} diff --git a/man/updateSelectInput_dsfr.Rd b/man/updateSelectInput_dsfr.Rd index 9c36255..c18faca 100644 --- a/man/updateSelectInput_dsfr.Rd +++ b/man/updateSelectInput_dsfr.Rd @@ -82,3 +82,6 @@ if (interactive()) { shinyApp(ui, server) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updateselectinput}{updateselectinput() in Shiny} +} diff --git a/man/updateTabsetPanel_dsfr.Rd b/man/updateTabsetPanel_dsfr.Rd index 35fc293..89cb3b1 100644 --- a/man/updateTabsetPanel_dsfr.Rd +++ b/man/updateTabsetPanel_dsfr.Rd @@ -90,3 +90,6 @@ if (interactive()){ ) } } +\seealso{ +\href{https://shiny.posit.co/r/reference/shiny/latest/updatetabsetpanel}{updatetabsetpanel() in Shiny} +} diff --git a/tests/testthat/test-convert_file_to_dsfr.R b/tests/testthat/test-convert_file_to_dsfr.R index c56ee22..dfe7bf9 100644 --- a/tests/testthat/test-convert_file_to_dsfr.R +++ b/tests/testthat/test-convert_file_to_dsfr.R @@ -8,6 +8,7 @@ test_that("convert_file_to_dsfr works", { mydir <- tempfile(pattern = "app") dir.create(mydir) + options(repos = c(CRAN = "https://cran.r-project.org")) golem::install_dev_deps( force_install = TRUE )