Skip to content

Commit

Permalink
added getDefaultReactiveDomain() as default for session
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Nov 16, 2021
1 parent 3db057f commit 7550090
Show file tree
Hide file tree
Showing 37 changed files with 105 additions and 52 deletions.
2 changes: 1 addition & 1 deletion R/color-pickr.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ colorPickr <- function(inputId,
#' @export
#'
#' @rdname colorPickr
updateColorPickr <- function(session, inputId, value = NULL, action = NULL) {
updateColorPickr <- function(session = getDefaultReactiveDomain(), inputId, value = NULL, action = NULL) {
if (!is.null(action)) {
action <- match.arg(action, c("disable", "enable", "hide", "show"))
}
Expand Down
2 changes: 1 addition & 1 deletion R/input-airDatepicker.R
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ airYearpickerInput <- function(inputId, label = NULL, value = NULL, ...) {
#' demoAirDatepicker("update")
#'
#' }
updateAirDateInput <- function(session,
updateAirDateInput <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
Expand Down
9 changes: 6 additions & 3 deletions R/input-autonumeric.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ formatNumericInput <- function(inputId,
#'
#' shinyApp(ui, server)
#' }
updateCurrencyInput <- function(session, inputId,
updateCurrencyInput <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
format = NULL) {
Expand All @@ -199,7 +200,8 @@ updateCurrencyInput <- function(session, inputId,
}

#' @rdname formaNumericInputUpdate
updateFormatNumericInput <- function(session, inputId,
updateFormatNumericInput <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
format = NULL) {
Expand Down Expand Up @@ -597,7 +599,8 @@ autonumericInput <- function(inputId, label, value,
#'
#' shinyApp(ui, server)
#' }
updateAutonumericInput <- function(session, inputId,
updateAutonumericInput <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
options = NULL) {
Expand Down
2 changes: 1 addition & 1 deletion R/input-awesomecheckbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ awesomeCheckboxGroup <- function(inputId,
#' shinyApp(ui = ui, server = server)
#'
#' }
updateAwesomeCheckboxGroup <- function(session,
updateAwesomeCheckboxGroup <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
choices = NULL,
Expand Down
2 changes: 1 addition & 1 deletion R/input-awesomeradio.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ awesomeRadio <- function(inputId,
#' shinyApp(ui = ui, server = server)
#'
#' }
updateAwesomeRadio <- function(session,
updateAwesomeRadio <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
choices = NULL,
Expand Down
4 changes: 2 additions & 2 deletions R/input-icon.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ textInputIcon <- function(inputId,
#'
#' if (interactive())
#' shinyApp(ui, server)
updateTextInputIcon <- function(session,
updateTextInputIcon <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
Expand Down Expand Up @@ -235,7 +235,7 @@ numericInputIcon <- function(inputId,
#'
#' if (interactive())
#' shinyApp(ui, server)
updateNumericInputIcon <- function(session,
updateNumericInputIcon <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
Expand Down
6 changes: 5 additions & 1 deletion R/input-knob.R
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ knobInput <- function(inputId, label, value,
#' shinyApp(ui = ui, server = server)
#'
#' }
updateKnobInput <- function(session, inputId, label = NULL, value = NULL, options = NULL) {
updateKnobInput <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL,
options = NULL) {
message <- dropNulls(list(label = label, value = value, options = options))
session$sendInputMessage(inputId, message)
}
Expand Down
8 changes: 6 additions & 2 deletions R/input-noUiSlider.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,14 @@ wNumbFormat <- function(decimals = NULL, mark = NULL,
#' demoNoUiSlider("update")
#'
#' }
updateNoUiSliderInput <- function(session, inputId, value = NULL, range = NULL, disable = FALSE) {
updateNoUiSliderInput <- function(session = getDefaultReactiveDomain(),
inputId,
value = NULL,
range = NULL,
disable = FALSE) {
if (!is.null(range) && length(range) != 2) {
range <- NULL
warning("'range' must be of lentgh 2, value will be ignored.")
warning("'range' must be of length 2, value will be ignored.")
}
message <- dropNulls(list(value = value, range = range, disable = disable))
session$sendInputMessage(inputId, message)
Expand Down
5 changes: 4 additions & 1 deletion R/input-numericRange.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ numericRangeInput <- function(inputId,
#' @inheritParams numericRangeInput
#' @export
#'
updateNumericRangeInput <- function(session, inputId, label = NULL, value = NULL) {
updateNumericRangeInput <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL) {

value <- c(min(value), max(value))

Expand Down
12 changes: 6 additions & 6 deletions R/input-pretty.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ prettySwitch <- function(inputId,
#' @export
#'
#' @example examples/updatePrettySwitch.R
updatePrettySwitch <- function(session,
updatePrettySwitch <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL) {
Expand Down Expand Up @@ -196,7 +196,7 @@ prettyToggle <- function(inputId,
#' @export
#'
#' @example examples/updatePrettyToggle.R
updatePrettyToggle <- function(session,
updatePrettyToggle <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL) {
Expand Down Expand Up @@ -309,7 +309,7 @@ prettyCheckbox <- function(inputId,
#' @export
#'
#' @example examples/updatePrettyCheckbox.R
updatePrettyCheckbox <- function(session,
updatePrettyCheckbox <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
value = NULL) {
Expand Down Expand Up @@ -523,7 +523,7 @@ generatePretty <- function(inputId,
#' @export
#'
#' @example examples/updatePrettyCheckboxGroup.R
updatePrettyCheckboxGroup <- function(session,
updatePrettyCheckboxGroup <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
choices = NULL,
Expand All @@ -540,7 +540,7 @@ updatePrettyCheckboxGroup <- function(session,



updatePrettyOptions <- function(session,
updatePrettyOptions <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
choices = NULL,
Expand Down Expand Up @@ -709,7 +709,7 @@ prettyRadioButtons <- function(inputId,
#' @export
#'
#' @example examples/updatePrettyRadioButtons.R
updatePrettyRadioButtons <- function(session,
updatePrettyRadioButtons <- function(session = getDefaultReactiveDomain(),
inputId,
label = NULL,
choices = NULL,
Expand Down
4 changes: 3 additions & 1 deletion R/input-spectrum.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ spectrumInput <- function(inputId, label, choices = NULL, selected = NULL,
#' shinyApp(ui, server)
#'
#' }
updateSpectrumInput <- function(session, inputId, selected) {
updateSpectrumInput <- function(session = getDefaultReactiveDomain(),
inputId,
selected) {
session$sendInputMessage(inputId, list(value = selected))
}

Expand Down
3 changes: 2 additions & 1 deletion R/input-switch.R
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ switchInput <- function(inputId,
#' shinyApp(ui = ui, server = server)
#'
#' }
updateSwitchInput <- function(session, inputId,
updateSwitchInput <- function(session = getDefaultReactiveDomain(),
inputId,
value = NULL, label = NULL,
onLabel = NULL, offLabel = NULL,
onStatus = NULL, offStatus = NULL,
Expand Down
11 changes: 8 additions & 3 deletions R/progressBars.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ progressBar <- function(id,
#' @export
#'
#' @rdname progress-bar
updateProgressBar <- function(session, id, value, total = NULL,
title = NULL, status = NULL,
range_value = NULL, commas = TRUE,
updateProgressBar <- function(session = getDefaultReactiveDomain(),
id,
value,
total = NULL,
title = NULL,
status = NULL,
range_value = NULL,
commas = TRUE,
unit_mark = "%") {
message <- "update-progressBar-shinyWidgets"
if (!is.null(range_value)) {
Expand Down
8 changes: 4 additions & 4 deletions R/sweetalert.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ useSweetAlert <- function(theme = c("sweetalert2",
#'
#' @example examples/show_alert.R
#' @example examples/show_alert-ouput.R
sendSweetAlert <- function(session,
sendSweetAlert <- function(session = getDefaultReactiveDomain(),
title = "Title",
text = NULL,
type = NULL,
Expand Down Expand Up @@ -204,7 +204,7 @@ show_alert <- function(title = "Title",
#' @examples
#' # ------------------------------------
#' @example examples/ask_confirmation-options.R
confirmSweetAlert <- function(session,
confirmSweetAlert <- function(session = getDefaultReactiveDomain(),
inputId,
title = NULL,
text = NULL,
Expand Down Expand Up @@ -358,7 +358,7 @@ ask_confirmation <- function(inputId,
#' [closeSweetAlert()].
#'
#' @example examples/sweetalert-input.R
inputSweetAlert <- function(session,
inputSweetAlert <- function(session = getDefaultReactiveDomain(),
inputId,
title = NULL,
text = NULL,
Expand Down Expand Up @@ -486,7 +486,7 @@ inputSweetAlert <- function(session,
#' shinyApp(ui = ui, server = server)
#'
#' }
progressSweetAlert <- function(session,
progressSweetAlert <- function(session = getDefaultReactiveDomain(),
id,
value,
total = NULL,
Expand Down
7 changes: 6 additions & 1 deletion man/colorPickr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/formaNumericInputUpdate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/inputSweetAlert.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/progress-bar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/progressSweetAlert.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sweetalert-confirmation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/sweetalert.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/updateAirDateInput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/updateAutonumericInput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/updateAwesomeCheckboxGroup.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/updateAwesomeRadio.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion man/updateKnobInput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/updateNoUiSliderInput.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7550090

Please sign in to comment.