diff --git a/R/bootstrap.R b/R/bootstrap.R index 920d187023..087b863cb1 100644 --- a/R/bootstrap.R +++ b/R/bootstrap.R @@ -707,7 +707,6 @@ tabPanelBody <- function(value, ..., icon = NULL) { #' conjunction with [tabPanelBody()] and [updateTabsetPanel()] to control the #' active tab via other input controls. (See example below)} #' } -#' @param card whether to wrap the navigation controls and content into an 'output card'. This functionality currently requires a [bslib::bs_theme()] in the page layout with `version = 4` or higher. #' @param position This argument is deprecated; it has been discontinued in #' Bootstrap 3. #' @inheritParams navbarPage @@ -762,7 +761,6 @@ tabsetPanel <- function(..., type = c("tabs", "pills", "hidden"), header = NULL, footer = NULL, - card = FALSE, position = deprecated()) { if (lifecycle::is_present(position)) { shinyDeprecated( @@ -777,34 +775,15 @@ tabsetPanel <- function(..., type <- match.arg(type) tabset <- buildTabset(..., ulClass = paste0("nav nav-", type), id = id, selected = selected) - nav <- tabset$navList - if (card) { - nav <- tags$div( - class = "card-header", - tagFunction(function() { - if (getCurrentVersion() >= 4) { - return(NULL) - } - stop( - "`tabsetPanel(card = TRUE)` requires Bootstrap 4 or higher. ", - "Please supply `bslib::bs_theme()` to the UI's page layout function ", - "(e.g., `fluidPage(theme = bslib::bs_theme())`).", - call. = FALSE - ) - }), - tagAppendAttributes( - nav, class = paste0("card-header-", type) - ) - ) - } - - tabs <- tags$div(class = "tabbable", class = if (card) "card", nav) - content <- dropNulls(list(header, tabset$content, footer)) - if (card) { - tagAppendChild(tabs, tags$div(class = "card-body", !!!content)) - } else { - tagAppendChildren(tabs, content) - } + tags$div( + class = "tabbable", + !!!dropNulls(list( + tabset$navList, + header, + tabset$content, + footer + )) + ) } #' Create a navigation list panel diff --git a/man/tabsetPanel.Rd b/man/tabsetPanel.Rd index e503dbbb78..6836a5fa87 100644 --- a/man/tabsetPanel.Rd +++ b/man/tabsetPanel.Rd @@ -41,8 +41,6 @@ tabPanels.} \item{footer}{Tag or list of tags to display as a common footer below all tabPanels} -\item{card}{whether to wrap the navigation controls and content into an 'output card'. This functionality currently requires a \code{\link[bslib:bs_theme]{bslib::bs_theme()}} in the page layout with \code{version = 4} or higher.} - \item{position}{This argument is deprecated; it has been discontinued in Bootstrap 3.} } diff --git a/tests/testthat/_snaps/tabPanel.md b/tests/testthat/_snaps/tabPanel.md index e8687a2fd2..70f05f978b 100644 --- a/tests/testthat/_snaps/tabPanel.md +++ b/tests/testthat/_snaps/tabPanel.md @@ -138,43 +138,6 @@
---- - - Code - bslib_tags(x) - Output -