Skip to content

Commit

Permalink
better select input styling
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Jun 23, 2024
1 parent bcb56a3 commit 94956f9
Show file tree
Hide file tree
Showing 19 changed files with 128 additions and 109 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1.9000
RoxygenNote: 7.3.1
URL: https://github.com/RinteRface/shiny386
BugReports: https://github.com/RinteRface/shiny386/issues
Imports:
htmltools,
htmltools (>= 0.5.2),
shiny,
magrittr,
httpuv
24 changes: 23 additions & 1 deletion R/inputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,10 @@ update_checkbox_group_input_386 <- function (session, inputId, label = NULL, cho


#' Create a Bootstrap 386 select input
#'
#' @note Incompatible with selectize. Set to FALSE
#' by default to have correct CSS rendering.
#'
#' @inheritParams shiny::selectInput
#' @export
#' @examples
Expand All @@ -627,7 +631,25 @@ update_checkbox_group_input_386 <- function (session, inputId, label = NULL, cho
#' shinyApp(ui, server)
#'
#' }
select_input_386 <- shiny::selectInput
select_input_386 <- function(
inputId, label, choices, selected = NULL, multiple = FALSE,
selectize = FALSE, width = NULL, size = NULL
) {
args <- as.list(match.call())[-1]
defaults <- formals(sys.function())
defaults <- defaults[!(names(defaults) %in% names(args))]

htmltools::tagQuery(
do.call(
shiny::selectInput,
dropNulls(c(args, defaults))
)
)$
find("select")$
addClass("custom-select")$
removeClass("form-control")$
allTags()
}



Expand Down
3 changes: 1 addition & 2 deletions R/shiny386-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
#' @name shiny386
#' @import htmltools
#' @import shiny
#' @docType package
NULL
"_PACKAGE"
12 changes: 1 addition & 11 deletions man/checkbox_group_input_386.Rd

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

11 changes: 7 additions & 4 deletions man/modal.Rd

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

16 changes: 11 additions & 5 deletions man/navbar.Rd

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

36 changes: 13 additions & 23 deletions man/radio_input_386.Rd

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

8 changes: 6 additions & 2 deletions man/select_input_386.Rd

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

13 changes: 13 additions & 0 deletions man/shiny386.Rd

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

2 changes: 1 addition & 1 deletion man/tab_panel_386.Rd

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

14 changes: 8 additions & 6 deletions man/tabset_panel_386.Rd

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

12 changes: 1 addition & 11 deletions man/update_checkbox_group_input_386.Rd

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

4 changes: 2 additions & 2 deletions man/update_checkbox_input_386.Rd

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

36 changes: 13 additions & 23 deletions man/update_radio_input_386.Rd

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

6 changes: 3 additions & 3 deletions man/update_select_input_386.Rd

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

Loading

0 comments on commit 94956f9

Please sign in to comment.