dreamRs / shinyWidgets

Compare 874a04c ... +0 ... 293faec

Showing 1 of 5 files from the diff.
Other files ignored by Codecov

@@ -200,15 +200,61 @@
Loading
200 200
#' @export
201 201
#' @rdname html-dependencies
202 202
html_dependency_bttn <- function() {
203 -
  htmlDependency(
203 +
  bslib::bs_dependency_defer(bttnDependencyCSS)
204 +
}
205 +
206 +
207 +
#' @importFrom sass sass_file
208 +
#' @importFrom bslib bs_dependency is_bs_theme theme_version bs_get_variables bs_add_variables
209 +
bttnDependencyCSS <- function(theme) {
210 +
  if (!bslib::is_bs_theme(theme)) {
211 +
    return(htmlDependency(
212 +
      name = "bttn",
213 +
      version = "0.2.4",
214 +
      src = c(href = "shinyWidgets/bttn", file = "assets/bttn"),
215 +
      package = "shinyWidgets",
216 +
      stylesheet = "bttn.min.css"
217 +
    ))
218 +
  }
219 +
220 +
  if (is.na(bslib::bs_get_variables(theme, "royal"))) {
221 +
    theme <- bslib::bs_add_variables(theme, royal = "#bd2df5")
222 +
  }
223 +
224 +
  if (identical(bslib::theme_version(theme), "3")) {
225 +
    sass_vars <- list(
226 +
      "bttn--color-primary" = "$brand-primary",
227 +
      "bttn--color-success" = "$brand-success",
228 +
      "bttn--color-warning" = "$brand-warning",
229 +
      "bttn--color-danger" = "$brand-danger",
230 +
      "bttn--color-royal" = "$royal"
231 +
    )
232 +
  } else {
233 +
    sass_vars <- list(
234 +
      "bttn--color-primary" = "$primary",
235 +
      "bttn--color-success" = "$success",
236 +
      "bttn--color-warning" = "$warning",
237 +
      "bttn--color-danger" = "$danger",
238 +
      "bttn--color-royal" = "$royal"
239 +
    )
240 +
  }
241 +
  sass_input <- list(
242 +
    sass_vars,
243 +
    sass::sass_file(
244 +
      system.file(package = "shinyWidgets", "assets/bttn/bttn.scss")
245 +
    )
246 +
  )
247 +
248 +
  bslib::bs_dependency(
249 +
    input = sass_input,
250 +
    theme = theme,
204 251
    name = "bttn",
205 252
    version = "0.2.4",
206 -
    src = c(href = "shinyWidgets/bttn", file = "assets/bttn"),
207 -
    package = "shinyWidgets",
208 -
    stylesheet = "bttn.min.css"
253 +
    cache_key_extra = packageVersion("shinyWidgets")
209 254
  )
210 255
}
211 256
257 +
212 258
#' @export
213 259
#' @rdname html-dependencies
214 260
#' @importFrom bslib bs_dependency_defer

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
actionBttn.R 55.26%
addSpinner.R 95.93%
bootstrap-utils.R 45.45%
chooseSliderSkin.R 78.57%
color-pickr.R 0.00%
demos.R 0.00%
dependencies.R -7.65% 52.35%
drop-menu.R 75.90%
execute_safely.R 0.00%
input-actiongroupbuttons.R 100.00%
input-airDatepicker.R 75.50%
input-autonumeric.R 95.38%
input-awesomecheckbox.R 97.33%
input-awesomeradio.R 96.72%
input-checkboxgroupbuttons.R 97.53%
input-circlebutton.R 100.00%
input-colorselector.R 91.04%
input-dropdown.R 92.59%
input-icon.R 63.10%
input-knob.R 91.67%
input-materialswitch.R 100.00%
input-multi.R 92.68%
input-noUiSlider.R 86.44%
input-numericRange.R 82.14%
input-pretty.R 78.52%
input-radiogroupbuttons.R 96.59%
input-search.R 83.78%
input-selectpicker.R 73.40%
input-sliderText.R 97.73%
input-spectrum.R 92.31%
input-switch.R 95.24%
input-textaddon.R 100.00%
module-pickerGroup.R 100.00%
module-selectizeGroup.R 100.00%
module-utils.R 37.50%
onLoad.R 0.00%
pickerOptions.R 100.00%
progressBars.R 67.92%
set-background.R 90.00%
setShadow.R 81.82%
setSliderColor.R 0.00%
stati-card.R 0.00%
sw-dropdown.R 76.36%
sweetalert.R 59.91%
useArgonDash.R 0.00%
useBs4Dash.R 0.00%
useShinydashboard.R 0.00%
useShinydashboardPlus.R 0.00%
useTablerDash.R 0.00%
utils.R 64.84%
vertical-tab.R 83.96%
Folder Totals (51 files) 74.03%
Project Totals (51 files) 74.03%
Loading