-
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.
feat: implementation dateRangeinput_dsfr + update
tags: doc, test pourquoi: - avoir l'equivalent du dateRangeinput de shiny en version dsfr quoi: - implementation de dateRangeinput_dsfr et updatedateRangeinput_dsfr dans un flat specifique - Modification daterange.js pour init value input - completion table_correspondance Issue #128
- Loading branch information
1 parent
e4a891e
commit 050be9d
Showing
18 changed files
with
480 additions
and
71 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
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,90 @@ | ||
# WARNING - Generated by {fusen} from /dev/flat_composants/flat_dateRangeInput.Rmd: do not edit by hand | ||
|
||
#' updateDateRangeInput_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 session la session, la valeur par défaut est getDefaultReactiveDomain(). | ||
#' @importFrom shiny updateCheckboxInput | ||
#' @return html | ||
#' | ||
#' @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 = "à"), | ||
#' actionButton_dsfr("go", "Change label"), | ||
#' 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) | ||
#' } | ||
updateDateRangeInput_dsfr <- function(inputId, | ||
label = NULL, | ||
start = NULL, | ||
end = NULL, | ||
session = shiny::getDefaultReactiveDomain()) { | ||
|
||
|
||
ns <- session$ns | ||
|
||
if (!is.null(label)) { | ||
session$sendCustomMessage("updateDateRangeInputLabel", | ||
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), | ||
end = end)) | ||
} | ||
} |
Oops, something went wrong.