From 19cf8a3cffeec2256a726c0c5a44bf5307ad6c1e Mon Sep 17 00:00:00 2001 From: DivadNojnarg Date: Thu, 26 Sep 2024 00:29:53 +0200 Subject: [PATCH] clean R CMD check --- .Rbuildignore | 1 + DESCRIPTION | 2 ++ R/layout.R | 13 ++++++++----- R/user-feedback.R | 2 +- R/utils-shiny.R | 5 +++-- man/shiny386.Rd | 1 + man/tabset_panel_386.Rd | 2 ++ 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 44b1be9..a52acf6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,4 @@ ^.vscode$ ^index\.md$ ^README\.Rmd$ +^index\.Rmd$ \ No newline at end of file diff --git a/DESCRIPTION b/DESCRIPTION index f551493..01555d7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,5 +21,7 @@ Imports: htmltools, shiny, httpuv +Suggests: + bslib Depends: R (>= 2.10) diff --git a/R/layout.R b/R/layout.R index 9f61fc1..51e9cea 100644 --- a/R/layout.R +++ b/R/layout.R @@ -21,12 +21,14 @@ page_386 <- function(..., title = NULL) { tags$meta(`http-equiv` = "X-UA-Compatible", content = "IE=edge") ), # body - tags$body( - div( - class = "container", - ... + use_bs4_deps( + tags$body( + div( + class = "container", + ... + ) ) - ) %>% use_bs4_deps() + ) ) } @@ -34,6 +36,7 @@ page_386 <- function(..., title = NULL) { #' Create a Bootstrap 386 tabset panel #' @inheritParams shiny::tabsetPanel +#' @param position Tabs position (left or right). #' @export #' @examples #' if (interactive()) { diff --git a/R/user-feedback.R b/R/user-feedback.R index 012cd02..bdd10ac 100644 --- a/R/user-feedback.R +++ b/R/user-feedback.R @@ -37,7 +37,7 @@ toast_386 <- function(id, title = NULL, subtitle = NULL, ..., img = NULL) { `data-toggle` = "toast" ) - toast_wrapper %>% tagAppendChildren(toast_header, toast_body) + tagAppendChildren(toast_wrapper, toast_header, toast_body) } diff --git a/R/utils-shiny.R b/R/utils-shiny.R index 5aaa373..221fdb2 100644 --- a/R/utils-shiny.R +++ b/R/utils-shiny.R @@ -27,7 +27,7 @@ create_checkbox_tag <- function(inputId, label, value = FALSE, width = NULL, ) if (!is.null(value) && value) { - input_tag <- input_tag %>% tagAppendAttributes(checked = "checked") + input_tag <- tagAppendAttributes(input_tag, checked = "checked") } input_wrapper <- tags$div( @@ -37,7 +37,8 @@ create_checkbox_tag <- function(inputId, label, value = FALSE, width = NULL, } ) - input_wrapper %>% tagAppendChildren( + tagAppendChildren( + input_wrapper, input_tag, tags$label(class = "custom-control-label", `for` = inputId, label) ) diff --git a/man/shiny386.Rd b/man/shiny386.Rd index 968a7b5..be90ac9 100644 --- a/man/shiny386.Rd +++ b/man/shiny386.Rd @@ -12,6 +12,7 @@ Old school Bootstrap 4 template for Shiny Useful links: \itemize{ \item \url{https://github.com/RinteRface/shiny386} + \item \url{https://rinterface.github.io/shiny386} \item Report bugs at \url{https://github.com/RinteRface/shiny386/issues} } diff --git a/man/tabset_panel_386.Rd b/man/tabset_panel_386.Rd index 3ed05e7..dcc0dde 100644 --- a/man/tabset_panel_386.Rd +++ b/man/tabset_panel_386.Rd @@ -31,6 +31,8 @@ tab will be selected.} conjunction with \code{\link[shiny:tabPanelBody]{tabPanelBody()}} and \code{\link[shiny:updateTabsetPanel]{updateTabsetPanel()}} to control the active tab via other input controls. (See example below)} }} + +\item{position}{Tabs position (left or right).} } \description{ Create a Bootstrap 386 tabset panel