Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre release changes 0.5.0 #451

Merged
merged 9 commits into from
Jan 17, 2024
Merged
72 changes: 37 additions & 35 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
Package: shiny.semantic
Type: Package
Package: shiny.semantic
Title: Semantic UI Support for Shiny
Version: 0.4.3.9002
Version: 0.5.0
Authors@R: c(person("Filip", "Stachura", email = "filip@appsilon.com", role = "aut"),
person("Dominik", "Krzeminski", email = "dominik@appsilon.com", role = "aut"),
person("Krystian", "Igras", email = "krystian@appsilon.com", role = "aut"),
person("Adam", "Forys", email = "adam@appsilon.com", role = "aut"),
person("Dominik", "Krzeminski", role = "aut"),
person("Krystian", "Igras", role = "aut"),
person("Adam", "Forys", role = "aut"),
person("Paweł", "Przytuła", email = "pawel@appsilon.com", role = "aut"),
person("Jakub", "Chojna", email = "jakub.chojna@appsilon.com", role = "aut"),
person("Olga", "Mierzwa-Sulima", email = "olga@appsilon.com", role = "aut"),
person("Jakub", "Nowicki", email = "opensource+kuba@appsilon.com", role = c("aut", "cre")),
person("Ashley", "Baldry", role = "ctb"),
person("Jakub", "Chojna", email = "jakub.chojna@appsilon.com", role = "ctb"),
person("Olga", "Mierzwa-Sulima", email = "olga@appsilon.com", role = "ctb"),
person("Pedro", "Manuel Coutinho da Silva", email = "pedro@appsilon.com", role = "ctb"),
person("Paweł", "Przytuła", email = "pawel@appsilon.com", role = "ctb"),
person("Kamil", "Żyła", email = "kamil@appsilon.com", role = "ctb"),
person("Rabii", "Bouhestine", email = "rabii@appsilon.com", role = "ctb"),
person("Developers", "Appsilon", email = "support+opensource@appsilon.com", role = "cre"),
person("Rabii", "Bouhestine", role = "ctb"),
person("Federico", "Rivandeira", email = "federico@appsilon.com", role = "ctb"),
person(family = "Appsilon Sp. z o.o.", role = c("cph")))
Description: Creating a great user interface for your Shiny apps
can be a hassle, especially if you want to work purely in R
and don't want to use, for instance HTML templates. This
package adds support for a powerful UI library Fomantic UI -
<https://fomantic-ui.com/> (before Semantic). It also supports
universal UI input binding that works with various DOM elements.
BugReports: https://github.com/Appsilon/shiny.semantic/issues
Encoding: UTF-8
LazyData: TRUE
Description: Creating a great user interface for your Shiny apps can be a
hassle, especially if you want to work purely in R and don't want to
use, for instance HTML templates. This package adds support for a
powerful UI library Fomantic UI - <https://fomantic-ui.com/> (before
Semantic). It also supports universal UI input binding that works with
various DOM elements.
License: MIT + file LICENSE
VignetteBuilder: knitr
URL: https://appsilon.github.io/shiny.semantic/, https://github.com/Appsilon/shiny.semantic
BugReports: https://github.com/Appsilon/shiny.semantic/issues
Imports:
shiny (>= 0.12.1),
glue,
grDevices,
htmltools (>= 0.2.6),
htmlwidgets (>= 0.8),
purrr (>= 0.2.2),
stats,
magrittr,
jsonlite,
grDevices,
glue,
magrittr,
purrr (>= 0.2.2),
R6,
semantic.assets (>= 1.1.0)
semantic.assets (>= 1.1.0),
shiny (>= 0.12.1),
stats
Suggests:
covr,
dplyr,
tibble,
knitr,
testthat,
lintr,
DT,
covr,
gapminder,
knitr,
leaflet,
plotly,
rmarkdown,
lintr,
markdown,
rcmdcheck,
mockery,
plotly,
rcmdcheck,
rmarkdown,
testthat,
tibble,
withr
VignetteBuilder:
knitr
Encoding: UTF-8
Language: en-US
LazyData: TRUE
RoxygenNote: 7.2.3
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

- `uirender` uses assets from `semantic.assets`.

- Replaced class to string comparisons.

- Replaced deprecated `purrr::when` call.

# [shiny.semantic 0.4.3](https://github.com/Appsilon/shiny.semantic/releases/tag/0.4.3)

- Removed inline-styled min-height from `<body>`.
Expand Down
12 changes: 6 additions & 6 deletions R/checkbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
#'
#' The following \code{type}s are allowed:
#' \itemize{
#' \item{NULL}{ The standard checkbox (default)}
#' \item{toggle}{ Each checkbox has a toggle form}
#' \item{slider}{ Each checkbox has a simple slider form}
#' \item{NULL} The standard checkbox (default)
#' \item{toggle} Each checkbox has a toggle form
#' \item{slider} Each checkbox has a simple slider form
#' }
#'
#' @rdname checkbox
Expand Down Expand Up @@ -85,9 +85,9 @@ toggle <- function(input_id, label = "", is_marked = TRUE, style = NULL) {
#' @details
#' The following \code{type}s are allowed:
#' \itemize{
#' \item{NULL}{The standard checkbox (default)}
#' \item{toggle}{Each checkbox has a toggle form}
#' \item{slider}{Each checkbox has a simple slider form}
#' \item{NULL} The standard checkbox (default)
#' \item{toggle} Each checkbox has a toggle form
#' \item{slider} Each checkbox has a simple slider form
#' }
#'
#' @rdname multiple_checkbox
Expand Down
38 changes: 18 additions & 20 deletions R/dropdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,25 @@ dropdown_input <- function(input_id, choices, choices_value = choices,
icon("dropdown"),
shiny::div(class = "default text", default_text),
menu(
purrr::when(
choices,
is.null(names(.)) ~
purrr::map2(
choices, choices_value,
~ shiny::div(class = "item", `data-value` = .y, .x)
),
!is.null(names(.)) ~
purrr::map(
seq_len(length(choices)), ~ {
shiny::tagList(
menu_header(names(choices)[.x], is_item = FALSE),
menu_divider(),
purrr::map2(
choices[[.x]], choices_value[[.x]],
~ shiny::div(class = "item", `data-value` = .y, .x)
)
if (is.null(names(choices))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style comment:
There are places in which we are using explicitly namespaced functions like here purrr::map and other places in which we don't. Why not using @importFrom purrr map map2 etc... in here?
If there is a reason to do so then it's fine, if not, then maybe we should start to consolidate the style.
If you think we should consolidate it then I can create an issue for it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We definitely should consolidate - if you could create an issue that would be great.

purrr::map2(
choices, choices_value,
~ shiny::div(class = "item", `data-value` = .y, .x)
)
} else {
purrr::map(
seq_len(length(choices)), ~ {
shiny::tagList(
menu_header(names(choices)[.x], is_item = FALSE),
menu_divider(),
purrr::map2(
choices[[.x]], choices_value[[.x]],
~ shiny::div(class = "item", `data-value` = .y, .x)
)
}
)
)
)
}
)
}
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion R/dsl.R
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ accordion <- function(accordion_list, fluid = TRUE, active_title = "",
div(class = paste("title", active), icon("dropdown"), x$title),
div(class = paste("content", active),
p(class = "transition hidden",
if (class(x$content) == "shiny.tag") x$content else div(x$content)
if (inherits(x$content, "shiny.tag")) x$content else div(x$content)
)
)
)
Expand Down
13 changes: 6 additions & 7 deletions R/input.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ uiinput <- function(..., class = "") {
#' @details
#' The following \code{type} s are allowed:
#' \itemize{
#' \item{text} {The standard input}
#' \item{textarea} {An extended space for text}
#' \item{password} {A censored version of the text input}
#' \item{email} {A special version of the text input specific for email addresses}
#' \item{url} {A special version of the text input specific for URLs}
#' \item{tel} {A special version of the text input specific for telephone numbers}
#' \item{text} The standard input
#' \item{textarea} An extended space for text
#' \item{password} A censored version of the text input
#' \item{email} A special version of the text input specific for email addresses
#' \item{url} A special version of the text input specific for URLs
#' \item{tel} A special version of the text input specific for telephone numbers
#' }
#'
#' The inputs are updateable by using \code{\link[shiny]{updateTextInput}} or
Expand Down Expand Up @@ -189,7 +189,6 @@ numeric_input <- function(input_id, label, value = NULL, min = NA, max = NA, ste
if (!is.null(value)) {
if (!is.numeric(value) & !grepl("^\\d*(\\.\\d*|)$", value)) stop("Non-numeric input detected")
}


input_tag <- tags$input(id = input_id, value = value, type = "number", placeholder = placeholder)
if (!is.na(min)) input_tag$attribs$min <- min
Expand Down
2 changes: 1 addition & 1 deletion R/layouts.R
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ sidebarLayout <- function(sidebarPanel,
#' shinyApp(ui, server)
#' }
split_layout <- function(..., cell_widths = NULL, cell_args = "", style = NULL){
if (class(cell_args) == "list")
if (inherits(cell_args, "list"))
stop("In this implementation of `split_layout` cell_args must be character with style css")
ui_elements <- list(...)
n_elems <- length(ui_elements)
Expand Down
2 changes: 1 addition & 1 deletion R/menu.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ horizontal_menu <- function(menu_items, active_location = "", logo = NULL) {
logo_ui <- ""
else {
number_items <- length(menu_items) + 1
if (class(logo) == "shiny.tag")
if (inherits(logo, "shiny.tag"))
logo_ui <- shiny::div(class = "item",
logo)
else
Expand Down
2 changes: 1 addition & 1 deletion R/rating.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rating_input <- function(input_id, label = "", value = 0, max = 3, icon = "star"
warning("Size value not supported.")
size <- ""
}
if (class(icon) == "shiny.tag") {
if (inherits(icon, "shiny.tag")) {
icon <- extract_icon_name(icon)
}
class <- glue::glue("ui {size} {color} rating")
Expand Down
2 changes: 1 addition & 1 deletion R/semantic_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ define_selection_type <- function(input_id, multiple) {
#' FALSE otherwise (default FALSE).
#' @param default_text Text to be visible on dropdown when nothing is selected.
#'
#'#'@examples
#' @examples
#' ## Only run examples in interactive R sessions
#' if (interactive()) {
#' library(shiny)
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ generate_random_id <- function(prefix, id_length = 20) {
#' @param args list or vector with extra arguments
#' @keywords internal
warn_unsupported_args <- function(args) {
if (class(args) == "list")
if (inherits(args, "list"))
to_wrn <- paste0(as.character(names(args)), collapse = ',')
else if (class(args) == "character")
else if (inherits(args, "character"))
to_wrn <- paste0(args, collapse = ',')
else if (is.null(args))
return()
Expand Down
6 changes: 3 additions & 3 deletions man/checkbox.Rd

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

6 changes: 3 additions & 3 deletions man/multiple_checkbox.Rd

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

31 changes: 16 additions & 15 deletions man/search_selection_api.Rd

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

12 changes: 6 additions & 6 deletions man/text_input.Rd

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

6 changes: 3 additions & 3 deletions vignettes/basics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ library(shiny.semantic)
```


In this tutorial we will walk you through the basics of `shiny.semantic`.
In this tutorial we will walk you through the basics of `shiny.semantic`.

## Quick Q&A

Expand Down Expand Up @@ -98,7 +98,7 @@ width = "400px", height = "150px")

### (b) Using predefined objects

If you are not that comfortable with web development, you can take advantage of the
If you are not that comfortable with web development, you can take advantage of the
number of elements that we implemented for you. See some examples below:

```{r echo = T, include = T, eval = FALSE, screenshot.force = FALSE}
Expand All @@ -107,7 +107,7 @@ text_input("txt", type = "text", placeholder = "Enter Text")
date_input("date")
```

For more components visit our [Components live demo website](https://demo.appsilon.com/apps/semantic)
For more components visit our [Components live demo website](https://connect.appsilon.com/shiny-semantic-components/)
or the `examples/` folder on our [repository](https://github.com/Appsilon/shiny.semantic/).

Little sneak-peak of what you can get is listed on the graphics below. Most of the components
Expand Down