-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 130-composant-implementation-de-fileinput # Conflicts: # NAMESPACE # inst/v1.9.3/table_correspondance_shiny_dsfr.csv
- Loading branch information
Showing
35 changed files
with
1,379 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# WARNING - Generated by {fusen} from /dev/flat_composants/flat_dateRangeInput.Rmd: do not edit by hand | ||
|
||
#' dateRangeInput_dsfr | ||
#' | ||
#' @param inputId inputId | ||
#' @param label label | ||
#' @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 | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' ## Only run examples in interactive R sessions | ||
#' if (interactive()) { | ||
#' library(shiny) | ||
#' library(shinygouv) | ||
#' | ||
#' ui <- fluidPage_dsfr( | ||
#' header = header_dsfr( | ||
#' intitule = "Intitule", | ||
#' officiel = "Officiel", | ||
#' nom_site_service = "Nom du site / service", | ||
#' baseline = "baseline - precisions sur l organisation", | ||
#' class = "fr-m-1w" | ||
#' ), | ||
#' title = "Exemple", | ||
#' fluidRow_dsfr( | ||
#' # sans vecteur nommé | ||
#' dateRangeInput_dsfr(inputId = "daterange1", | ||
#' label = "Date range:", start = "2001-01-01",separator = "à") | ||
#' ) | ||
#' ) | ||
#' server <- function(input, output, session) { | ||
#' | ||
#' observeEvent(input$daterange1, { | ||
#' print(input$daterange1) | ||
#' }) | ||
#' | ||
#' } | ||
#' | ||
#' | ||
#' shinyApp(ui, server) | ||
#' } | ||
dateRangeInput_dsfr <- function( | ||
inputId, | ||
label, | ||
start = NULL, | ||
end = NULL, | ||
separator = "to" | ||
) { | ||
# check les params | ||
assertthat::assert_that(is.character(inputId)) | ||
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, | ||
start = start, | ||
end = end, | ||
separator = separator | ||
) #%>% | ||
#parse_html() | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# WARNING - Generated by {fusen} from /dev/flat_composants/flat_dateRangeInput.Rmd: do not edit by hand | ||
|
||
#' dateRangeInput_dsfr_template | ||
#' | ||
#' @param inputId inputId | ||
#' @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 label label | ||
#' @param separator character Chaîne à afficher entre les zones de saisie de début et de fin de dates. | ||
#' | ||
#' @importFrom htmltools htmlTemplate | ||
#' @importFrom purrr pmap | ||
#' @return html | ||
#' @noRd | ||
dateRangeInput_dsfr_template <- function( | ||
inputId, | ||
label, | ||
start, | ||
end, | ||
separator | ||
) { | ||
|
||
|
||
htmltools::htmlTemplate( | ||
filename = system.file( | ||
get_dsfr_version(with_v = TRUE), | ||
"composant", | ||
"dateRangeInput.html", | ||
package = "shinygouv" | ||
), | ||
inputId = inputId, | ||
label = label, | ||
start = start, | ||
end = end, | ||
separator = separator | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.