From b5b0ba177472206e685635e28c48ebfd0e4f4bab Mon Sep 17 00:00:00 2001 From: Carson Date: Mon, 22 Mar 2021 09:43:05 -0500 Subject: [PATCH] remove card argument (at least for now) --- R/bootstrap.R | 39 +++++++------------------------ man/tabsetPanel.Rd | 2 -- tests/testthat/_snaps/tabPanel.md | 37 ----------------------------- tests/testthat/test-tabPanel.R | 2 -- 4 files changed, 9 insertions(+), 71 deletions(-) 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 -
-
- -
-
-
-
a
-
b
-
c
-
-
-
- # navbarPage() markup is correct Code diff --git a/tests/testthat/test-tabPanel.R b/tests/testthat/test-tabPanel.R index 663d7ec932..efbde03a9f 100644 --- a/tests/testthat/test-tabPanel.R +++ b/tests/testthat/test-tabPanel.R @@ -54,8 +54,6 @@ test_that("tabsetPanel() markup is correct", { # BS4 expect_snapshot_bslib(default) expect_snapshot_bslib(pills) - card <- tabset_panel(!!!panels, card = TRUE) - expect_snapshot_bslib(card) }) test_that("navbarPage() markup is correct", {