Skip to content

Commit

Permalink
Merging "develop"
Browse files Browse the repository at this point in the history
Merge branch 'develop' into navbar_page

Conflicts:
	man/update_multiple_checkbox.Rd
  • Loading branch information
Ashley Baldry committed May 3, 2022
2 parents 94c2f7b + 64eef81 commit 142ee9a
Show file tree
Hide file tree
Showing 19 changed files with 258 additions and 56 deletions.
1 change: 0 additions & 1 deletion .Rbuildignore
Expand Up @@ -21,4 +21,3 @@
^CODE_OF_CONDUCT.md$
^doc/*
^Meta$
^vignettes$
15 changes: 9 additions & 6 deletions .github/workflows/main.yml
Expand Up @@ -12,20 +12,23 @@ jobs:
fail-fast: false
matrix:
config:
- { os: windows-latest, r: '3.6'}
- { os: macOS-latest, r: '3.6'}
- { os: ubuntu-18.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"}
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'release', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'oldrel', cran: "https://demo.rstudiopm.com/all/__linux__/bionic/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- uses: r-lib/actions/setup-pandoc@master

Expand Down Expand Up @@ -53,7 +56,7 @@ jobs:
- name: Install vctrs
if: runner.os == 'macos'
run: Rscript -e "remotes::install_cran('Rcpp')"

- name: Install dependencies
run: Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')"

Expand All @@ -68,6 +71,6 @@ jobs:
path: check

- name: Test coverage
if: matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6'
if: matrix.config.os == 'ubuntu-18.04' && matrix.config.r == 'release'
run: |
Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
6 changes: 3 additions & 3 deletions DESCRIPTION
Expand Up @@ -16,13 +16,13 @@ Authors@R: c(person("Filip", "Stachura", email = "filip@appsilon.com", role = "a
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 = "dev+shinysemantic@appsilon.com", role = "cre"),
person("Developers", "Appsilon", email = "support+opensource@appsilon.com", role = "cre"),
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 -
<http://fomantic-ui.com/> (before Semantic). It also supports
<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
Expand Down Expand Up @@ -52,4 +52,4 @@ Suggests:
plotly,
rmarkdown,
markdown
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
5 changes: 3 additions & 2 deletions R/checkbox.R
Expand Up @@ -55,7 +55,8 @@ checkbox_input <- function(input_id, label = "", type = NULL, is_marked = TRUE,
#' @rdname checkbox
#' @export
checkboxInput <- function(inputId, label = "", value = FALSE, width = NULL){
warn_unsupported_args(c("width"))
if (!is.null(width))
warn_unsupported_args(c("width"))
checkbox_input(inputId, label, is_marked = value)
}

Expand Down Expand Up @@ -156,7 +157,7 @@ multiple_checkbox <- function(input_id, label, choices, choices_value = choices,
#' @param input_id The id of the input object
#' @param choices All available options one can select from. If no need to update then leave as \code{NULL}
#' @param choices_value What reactive value should be used for corresponding choice.
#' @param value The initially selected value.
#' @param selected The initially selected value.
#' @param label The label linked to the input
#'
#' @examples
Expand Down
43 changes: 28 additions & 15 deletions R/modal.R
Expand Up @@ -96,6 +96,7 @@
#' })
#' shinyApp(ui, server)
#' }
#'
#' ## Changing attributes of header and content.
#' if (interactive()) {
#' library(shiny)
Expand Down Expand Up @@ -123,24 +124,36 @@
#' }
#' shinyApp(ui, server)
#' }
#'
#' ## Modal that closes automatically after specific time
#' if (interactive()) {
#' library(shiny)
#' library(shiny.semantic)
#' shinyApp(
#' ui = semanticPage(
#' actionButton("show", "Show modal dialog")
#' ),
#' server = function(input, output) {
#' observeEvent(input$show, {
#' showModal(modalDialog(
#' ui <- function() {
#' shinyUI(
#' semanticPage(
#' actionButton("show", "Show modal dialog")
#' )
#' )
#' }
#'
#' server <- shinyServer(function(input, output, session) {
#' observeEvent(input$show, {
#' create_modal(
#' modal(
#' id = "simple-modal",
#' title = "Important message",
#' "This modal will close after 3 sec.", easyClose = FALSE
#' ))
#' Sys.sleep(3)
#' removeModal()
#' })
#' }
#' )
#' header = "Example modal",
#' content = "This modal will close after 3 sec.",
#' footer = NULL,
#' )
#' )
#' Sys.sleep(3)
#' hide_modal(id = "simple-modal")
#' })
#' })
#'
#' shinyApp(ui = ui(), server = server)
#' }
#'
#' @rdname modal
Expand Down Expand Up @@ -263,7 +276,7 @@ attach_rule <- function(id, behavior, target, value) {
#' @param id ID of the modal that will be displayed.
#' @param session The \code{session} object passed to function given to
#' \code{shinyServer}.
#' @param asis A boolean indicating if the id must be handled as is (TRUE) or
#' @param asis A boolean indicating if the id must be handled as is (TRUE) or
#' will be it must be namespaced (FALSE)
#' @seealso modal
#'
Expand Down
11 changes: 10 additions & 1 deletion R/step.R
Expand Up @@ -116,7 +116,16 @@ single_step <- function(id, title, description = NULL, icon_class = NULL,
)
}


#' Toggle step state
#'
#' @param id ID of step to be toggled
#' @param state State of the step, \code{TRUE} stands for enabled
#' @param automatic_steps Whether to toggle focus of next step automatically
#' @param asis When used inside of Shiny module, \code{TRUE} will disable adding
#' the namespace to \code{id}
#'
#' @seealso steps
#'
#' @rdname toggle_step_state
#' @export
toggle_step_state <- function(id, state = TRUE, automatic_steps = TRUE,
Expand Down
2 changes: 2 additions & 0 deletions R/utils.R
Expand Up @@ -73,6 +73,8 @@ warn_unsupported_args <- function(args) {
to_wrn <- paste0(as.character(names(args)), collapse = ',')
else if (class(args) == "character")
to_wrn <- paste0(args, collapse = ',')
else if (is.null(args))
return()
else
stop("Wrong input type!")
if (nchar(to_wrn) >= 1)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -245,11 +245,11 @@ install.packages("shiny", version='0.14.2.9001')
- adding more semantic components
- new version release on CRAN

## Appsilon Data Science
## Appsilon

<img src="https://avatars0.githubusercontent.com/u/6096772" align="right" alt="" width="6%" />

Appsilon is the **Full Service Certified RStudio Partner**. Learn more
at [appsilon.com](https://appsilon.com).

Get in touch [dev@appsilon.com](dev@appsilon.com)
Get in touch [support+opensource@appsilon.com](support+opensource@appsilon.com)
28 changes: 28 additions & 0 deletions examples/modal/app_6.R
@@ -0,0 +1,28 @@
library(shiny)
library(shiny.semantic)

ui <- function() {
shinyUI(
semanticPage(
actionButton("show", "Show modal dialog")
)
)
}

server <- shinyServer(function(input, output, session) {
observeEvent(input$show, {
create_modal(
modal(
id = "simple-modal",
title = "Important message",
header = "Example modal",
content = "This modal will close after 3 sec.",
footer = NULL,
)
)
Sys.sleep(3)
hide_modal(id = "simple-modal")
})
})

shinyApp(ui = ui(), server = server)
41 changes: 27 additions & 14 deletions man/modal.Rd

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

9 changes: 6 additions & 3 deletions man/show_modal.Rd

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

34 changes: 34 additions & 0 deletions man/single_step.Rd

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

0 comments on commit 142ee9a

Please sign in to comment.