Skip to content

Commit

Permalink
use packer for buttons group bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Aug 30, 2023
1 parent d9c38ba commit 16b0dec
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 185 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinyWidgets
Title: Custom Inputs Widgets for Shiny
Version: 0.7.6.9910
Version: 0.7.6.9920
Authors@R: c(
person("Victor", "Perrier", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Fanny", "Meyer", role = "aut"),
Expand Down
11 changes: 11 additions & 0 deletions R/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,14 @@ html_dependency_pickr <- function() {
script = "colorpickr.js"
)
}



html_dependency_buttons_group <- function() {
htmlDependency(
name = "sw-buttons-group",
version = packageVersion("shinyWidgets"),
src = c(file = system.file("packer", package = "shinyWidgets")),
script = "buttons-group.js"
)
}
6 changes: 3 additions & 3 deletions R/input-checkboxgroupbuttons.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ checkboxGroupButtons <- function(inputId,
if (size != "normal") {
divClass <- paste0(divClass, " btn-group-", size)
}
checkboxGroupButtonsTag <- tags$div(
tags$div(
class = "form-group shiny-input-container shiny-input-checkboxgroup shiny-input-container-inline",
style = css(width = validateCssUnit(width)),
label_input(inputId, label),
Expand Down Expand Up @@ -81,9 +81,9 @@ checkboxGroupButtons <- function(inputId,
)
})
)
)
),
html_dependency_buttons_group()
)
attachShinyWidgetsDep(checkboxGroupButtonsTag)
}


Expand Down
10 changes: 5 additions & 5 deletions R/input-radiogroupbuttons.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ radioGroupButtons <- function(inputId,
divClass <- paste0(divClass, " btn-group-", size)
}

TAG <- tags$div(
tags$div(
class = "form-group shiny-input-container shiny-input-radiogroup shiny-input-container-inline",
style = css(width = validateCssUnit(width)),
label_input(inputId, label),
Expand Down Expand Up @@ -96,9 +96,9 @@ radioGroupButtons <- function(inputId,
)
})
)
)
),
html_dependency_buttons_group()
)
attachShinyWidgetsDep(TAG)
}

#' @importFrom bslib is_bs_theme theme_version
Expand Down Expand Up @@ -133,8 +133,8 @@ markup_buttons_radio_bs3 <- function(inputId, choices, selected, status, size, c
tags$button(
class = paste0("btn radiobtn btn-", statusElement),
class = if (value %in% selected) "active",
if (displayIcon) tags$span(class="radio-btn-icon-yes", checkIcon$yes),
if (displayIcon) tags$span(class="radio-btn-icon-no", checkIcon$no),
if (displayIcon) tags$span(class = "radio-btn-icon-yes", checkIcon$yes),
if (displayIcon) tags$span(class = "radio-btn-icon-no", checkIcon$no),
disabled = if (isTRUE(disabled)) "disabled",
class = if (isTRUE(disabled)) "disabled",
tags$input(
Expand Down
145 changes: 0 additions & 145 deletions inst/assets/buttons-group/radioGroupButtons-bindings.js

This file was deleted.

2 changes: 1 addition & 1 deletion inst/assets/shinyWidgets-bindings.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/assets/shinyWidgets.min.css

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

Loading

0 comments on commit 16b0dec

Please sign in to comment.