|
|
|
@@ -12,11 +12,17 @@ dots2list <- function(...) { |
|
|
|
} |
|
|
|
|
|
|
|
map_arg <- function(..., .f, .args = NULL) { |
|
|
|
mapply(.f, ..., MoreArgs = compact(.args), SIMPLIFY = FALSE, USE.NAMES = TRUE) |
|
|
|
.args <- compact(.args) |
|
|
|
if (is.null(.args)) { |
|
|
|
mapply(.f, ..., SIMPLIFY = FALSE, USE.NAMES = TRUE) |
|
|
|
} else { |
|
|
|
mapply(.f, ..., MoreArgs = compact(.args), SIMPLIFY = FALSE, USE.NAMES = TRUE) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
compact <- function(x) { |
|
|
|
x[!vapply(x, is.null, logical(1))] |
|
|
|
x <- x[!vapply(x, is.null, logical(1))] |
|
|
|
if (length(x)) x else NULL |
|
|
|
} |
|
|
|
|
|
|
|
tag_function <- function(.tag = "div") { |
|
|
|
@@ -57,9 +63,9 @@ validate_value <- function(value = NULL, choices, several.ok = TRUE, value_name |
|
|
|
} else if (!is.null(value) && !length(value)) NULL |
|
|
|
} |
|
|
|
|
|
|
|
is_html <- function(x) inherits(class(x), "html") |
|
|
|
is_tagList <- function(x) inherits(class(x), "shiny.tag.list") |
|
|
|
is_tag <- function(x) inherits(class(x), "shiny.tag") |
|
|
|
is_html <- function(x) inherits(x, "html") |
|
|
|
is_tagList <- function(x) inherits(x, "shiny.tag.list") |
|
|
|
is_tag <- function(x) inherits(x, "shiny.tag") |
|
|
|
is_htmlish <- function(x) is_html(x) | is_tag(x) | is_tagList(x) |
|
|
|
|
|
|
|
c_is <- function(x) { |