New Upstream Snapshot - r-cran-shinybs
Ready changes
Summary
Merged new upstream version: 0.61.1+git20160701.1.c329f8c (was: 0.61.1).
Resulting package
Built on 2022-10-17T21:13 (took 10m8s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots r-cran-shinybs
Lintian Result
Diff
diff --git a/DESCRIPTION b/DESCRIPTION
index ca7c086..d138aa4 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,16 +1,14 @@
Package: shinyBS
Type: Package
-Title: Twitter Bootstrap Components for Shiny
-Version: 0.61.1
-Date: 2015-03-30
+Title: Extra Twitter Bootstrap Components for Shiny
+Version: 0.62
+Date: 2015-03-31
Author: Eric Bailey
-Maintainer: Eric Bailey <ebailey@idem.in.gov>
-Description: Adds additional Twitter Bootstrap components to Shiny.
-Imports: shiny (>= 0.11), htmltools
+Maintainer: Eric Bailey <eb11307@gmail.com>
+Description: Adds easy access to additional Twitter Bootstrap components to Shiny.
+Imports: shiny (>= 0.13.2), htmltools
URL: https://ebailey78.github.io/shinyBS
BugReports: https://github.com/ebailey78/shinyBS/issues
License: GPL-3
-Packaged: 2022-04-17 17:00:11 UTC; hornik
NeedsCompilation: no
-Repository: CRAN
-Date/Publication: 2022-04-17 17:43:50 UTC
+Packaged: 2022-10-17 21:08:57 UTC; root
diff --git a/MD5 b/MD5
deleted file mode 100644
index cd7c5ed..0000000
--- a/MD5
+++ /dev/null
@@ -1,65 +0,0 @@
-3527239eb189acea0931cffaaebc42d5 *DESCRIPTION
-8f14b2ffa82648dcf1a860b26e2c64bb *NAMESPACE
-dc82b1393f8723e9449cfa2adf4d1c39 *R/Alerts.R
-e9c65e20d49fff1a65f656965a185d44 *R/Buttons.R
-878451801f7d1c3bb9bd80a84b841966 *R/Collapses.R
-1ba2160a431803d37097738cde34d59f *R/Modals.R
-34c2ec9fe8058caa75fba186b0c5cec8 *R/Tooltips_and_Popovers.R
-f08c6f48f1bae3fc4fd2eba330fb9839 *R/addPopover.R
-ea338ba0d9241eb23ec3c0e0398a9010 *R/addTooltip.R
-eb96ad8e104f75521ec4238f963780ec *R/bsAlert.R
-5d9261c1cc8dd7c02d33ba12bb75090d *R/bsButton.R
-0aae63a5bc20629f979e9d43f84eec1b *R/bsCollapse.R
-07fcf84989b5967a834656e6d9c04233 *R/bsCollapsePanel.R
-4e6575e7a9413135f586a90e0123df1d *R/bsExample.R
-b33bbaf0328551badb418ed642e7fe36 *R/bsModal.R
-399cabbb385957d4c84080c639ab087f *R/bsPopover.R
-00eeb0e6763106a5cc716ad0622c91cd *R/bsTooltip.R
-351d02eeb4cb2f6d3b1f2f3c34c17d5e *R/closeAlert.R
-78da980a1eac95d08179f1967b691c7e *R/createAlert.R
-6e5bc175fa69a2c95a5df265156bd913 *R/misc.R
-0e3e545904cc4f60fc0530be8b9ef403 *R/popify.R
-8b7170e64e50034dce862944a97e5183 *R/removePopover.R
-8b337c15dae05e9ed0f7990d4fce1f3a *R/removeTooltip.R
-7ddc875dd0ee298648a13826aed08469 *R/tipify.R
-8e88e3272554dd325c894caa41e4c7b5 *R/toggleModal.R
-5617918ae0fdc1b77218be949c491512 *R/updateButton.R
-4c2a76360b739a5a3c172d13b22afd54 *R/updateCollapse.R
-d9f2ca8a61724c5e9eb0d103e0ca7b28 *inst/examples/Alerts/server.R
-d36e74357f0cdc5bd04c0b8afee50c4c *inst/examples/Alerts/ui.R
-f10236e851d0dd7b3668cb3900280cec *inst/examples/Buttons/server.R
-67566abeceb4b4f9c39b674570a6601d *inst/examples/Buttons/ui.R
-851ff13067c51f2b158bde712e40508e *inst/examples/Collapses/server.R
-045fcb9577620f4caed314948b1356c8 *inst/examples/Collapses/ui.R
-96037cd7df97d979aef7f48950e27ea6 *inst/examples/Modals/server.R
-93e9774be6f4c887507cc0f1acf6bbb8 *inst/examples/Modals/ui.R
-7f5831c166672c11d785c4e8f9d1713e *inst/examples/TooltipsandPopovers/server.R
-1a364656bb71c9c213d15418e04e1557 *inst/examples/TooltipsandPopovers/ui.R
-2fd7d2a3902ad5a80cff43a9d9f2263b *inst/tests/tipify_test.R
-8469195abc3b70603a5e7138399e93f3 *inst/tests/tipify_test2.R
-d41d8cd98f00b204e9800998ecf8427e *inst/www/shinyBS.css
-5f10387e282adadbeb726b3d03066e0a *inst/www/shinyBS.js
-f9a9226b73b6e9be4fc7b380310294df *man/Alerts.Rd
-8687b27e6debc28f72c3582104e95248 *man/Buttons.Rd
-e20db9f532ba5b01e3331cb713cb520a *man/Collapses.Rd
-d7208759df5fe79583f69d73612c27ac *man/Modals.Rd
-311bc0f4b6e00f4ecb9fa8cba048fc4b *man/Tooltips_and_Popovers.Rd
-25fc6ee4eaa275a244e14504c38cf84f *man/addPopover.Rd
-3d9f0fe1da816cb6174ebbaf20717dab *man/addTooltip.Rd
-2852163f9e6416bfd1ad1874dd114d0b *man/bsAlert.Rd
-3a8a81eb6646c02b360c7af3dcdeac9f *man/bsButton.Rd
-1303bcdfd21e1e69e212039a1e7b4826 *man/bsCollapse.Rd
-8baf9b19eff59152d1d234ef3ea0a70f *man/bsCollapsePanel.Rd
-15b685a2947b89ed136430ba404f3a11 *man/bsExample.Rd
-e0cf52feefb85528d66b7a567dcfd2f6 *man/bsModal.Rd
-d5a6930c361ee71a6c42e4a96d9fece0 *man/bsPopover.Rd
-f4e23260719f4b2839bc6438d1bfc359 *man/bsTooltip.Rd
-78f757f3b15661469b1dc4dc5173f760 *man/closeAlert.Rd
-d41672e5804b274c18c41f6664806d52 *man/createAlert.Rd
-2bd8761f19585bf4a6e8fed0b40b9c21 *man/popify.Rd
-e10f2d50dde0c892f31b547dcb637753 *man/removePopover.Rd
-decc485f82d63482260b955bfb7a2418 *man/removeTooltip.Rd
-909903acd5072191fc5c5771b655cd1a *man/tipify.Rd
-afcade05141146854326cccaf3c8dbfc *man/toggleModal.Rd
-3fc0a1cd5c78ee93d65f25dc03249f5b *man/updateButton.Rd
-513ff6a786bac6dd25926c93c18eb351 *man/updateCollapse.Rd
diff --git a/NAMESPACE b/NAMESPACE
index dbc22b5..f3c7843 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -1,23 +1,23 @@
-# Generated by roxygen2 (4.1.0): do not edit by hand
-
-importFrom("stats", "runif")
-
-export(addPopover)
-export(addTooltip)
-export(bsAlert)
-export(bsButton)
-export(bsCollapse)
-export(bsCollapsePanel)
-export(bsExample)
-export(bsModal)
-export(bsPopover)
-export(bsTooltip)
-export(closeAlert)
-export(createAlert)
-export(popify)
-export(removePopover)
-export(removeTooltip)
-export(tipify)
-export(toggleModal)
-export(updateButton)
-export(updateCollapse)
+# Generated by roxygen2 (4.1.0): do not edit by hand
+
+export(addPopover)
+export(addTooltip)
+export(bsAlert)
+export(bsButton)
+export(bsCollapse)
+export(bsCollapsePanel)
+export(bsExample)
+export(bsModal)
+export(bsPopover)
+export(bsTooltip)
+export(bsTypeahead)
+export(closeAlert)
+export(createAlert)
+export(popify)
+export(removePopover)
+export(removeTooltip)
+export(tipify)
+export(toggleModal)
+export(updateButton)
+export(updateCollapse)
+export(updateTypeahead)
diff --git a/R/Alerts.R b/R/Alerts.R
index 7490d49..95e3407 100644
--- a/R/Alerts.R
+++ b/R/Alerts.R
@@ -1,82 +1,82 @@
-#'Alerts
-#'
-#'Alerts allow you to communicate information to the user on the fly. Standard
-#'Bootstrap styling options give the user a hint at the type of information
-#'contained in the Alert.
-#'
-#'@section Components:
-#'There are three functions in the Alerts family:
-#' \describe{
-#' \item{\code{\link{bsAlert}}}{Used in the UI to create an anchor where your
-#' Alerts will be displayed.}
-#' \item{\code{\link{createAlert}}}{Used in the Server logic to create
-#' alerts. This would be used within a reactive context to display error
-#' or success messages to the user based on the status of that context.}
-#' \item{\code{\link{closeAlert}}}{Used in the Server logic to close an alert
-#' that is already open. By default, Alerts are dismissable by the user,
-#' but this offers you a way to close them programmatically.}
-#' }
-#'
-#'@details
-#'To create alerts in your Shiny app you must place \code{bsAlert} in your ui.
-#'This serves as an anchor that tells shinyBS where to place the alerts created
-#'with \code{createAlert}.
-#'
-#'Use \code{createAlert} in your server script to add alerts to the anchor
-#'you created with \code{bsAlert} in your ui. You can place \code{createAlert}
-#'in observers, reactives, or outputs. A common usage may be to have logic that
-#'validates a user's inputs. If they are valid produce the requested output, if
-#'not use \code{createAlert} to give the user info about what they need to
-#'change.
-#'
-#'@section Changes:
-#'\code{style} was called \code{type} in previous versions of shinyBS.
-#'
-#'\code{anchorId} was called \code{inputId} in previous versions of shinyBS.
-#'
-#'\code{content} was called \code{message} in previous versions of shinyBS.
-#'
-#'@examples
-#'
-#'library(shiny)
-#'library(shinyBS)
-#'app = shinyApp(
-#' ui =
-#' fluidPage(
-#' sidebarLayout(
-#' sidebarPanel(textInput("num1", NULL, value = 100),
-#' "divided by", textInput("num2", NULL, value = 20),
-#' "equals", textOutput("exampleOutput")),
-#' mainPanel(
-#' bsAlert("alert")
-#' )
-#' )
-#' ),
-#' server =
-#' function(input, output, session) {
-#' output$exampleOutput <- renderText({
-#' num1 <- as.numeric(input$num1)
-#' num2 <- as.numeric(input$num2)
-#'
-#' if(is.na(num1) | is.na(num2)) {
-#' createAlert(session, "alert", "exampleAlert", title = "Oops",
-#' content = "Both inputs should be numeric.", append = FALSE)
-#' } else if(num2 == 0) {
-#' createAlert(session, "alert", "exampleAlert", title = "Oops",
-#' content = "You cannot divide by 0.", append = FALSE)
-#' } else {
-#' closeAlert(session, "exampleAlert")
-#' return(num1/num2)
-#' }
-#'
-#' })
-#' }
-#')
-#'
-#'\dontrun{
-#' runApp(app)
-#'}
-#'@templateVar item_name Alerts
-#'@templateVar family_name Alerts
-#'@template footer
+#'Alerts
+#'
+#'Alerts allow you to communicate information to the user on the fly. Standard
+#'Bootstrap styling options give the user a hint at the type of information
+#'contained in the Alert.
+#'
+#'@section Components:
+#'There are three functions in the Alerts family:
+#' \describe{
+#' \item{\code{\link{bsAlert}}}{Used in the UI to create an anchor where your
+#' Alerts will be displayed.}
+#' \item{\code{\link{createAlert}}}{Used in the Server logic to create
+#' alerts. This would be used within a reactive context to display error
+#' or success messages to the user based on the status of that context.}
+#' \item{\code{\link{closeAlert}}}{Used in the Server logic to close an alert
+#' that is already open. By default, Alerts are dismissable by the user,
+#' but this offers you a way to close them programmatically.}
+#' }
+#'
+#'@details
+#'To create alerts in your Shiny app you must place \code{bsAlert} in your ui.
+#'This serves as an anchor that tells shinyBS where to place the alerts created
+#'with \code{createAlert}.
+#'
+#'Use \code{createAlert} in your server script to add alerts to the anchor
+#'you created with \code{bsAlert} in your ui. You can place \code{createAlert}
+#'in observers, reactives, or outputs. A common usage may be to have logic that
+#'validates a user's inputs. If they are valid produce the requested output, if
+#'not use \code{createAlert} to give the user info about what they need to
+#'change.
+#'
+#'@section Changes:
+#'\code{style} was called \code{type} in previous versions of shinyBS.
+#'
+#'\code{anchorId} was called \code{inputId} in previous versions of shinyBS.
+#'
+#'\code{content} was called \code{message} in previous versions of shinyBS.
+#'
+#'@examples
+#'
+#'library(shiny)
+#'library(shinyBS)
+#'app = shinyApp(
+#' ui =
+#' fluidPage(
+#' sidebarLayout(
+#' sidebarPanel(textInput("num1", NULL, value = 100),
+#' "divided by", textInput("num2", NULL, value = 20),
+#' "equals", textOutput("exampleOutput")),
+#' mainPanel(
+#' bsAlert("alert")
+#' )
+#' )
+#' ),
+#' server =
+#' function(input, output, session) {
+#' output$exampleOutput <- renderText({
+#' num1 <- as.numeric(input$num1)
+#' num2 <- as.numeric(input$num2)
+#'
+#' if(is.na(num1) | is.na(num2)) {
+#' createAlert(session, "alert", "exampleAlert", title = "Oops",
+#' content = "Both inputs should be numeric.", append = FALSE)
+#' } else if(num2 == 0) {
+#' createAlert(session, "alert", "exampleAlert", title = "Oops",
+#' content = "You cannot divide by 0.", append = FALSE)
+#' } else {
+#' closeAlert(session, "exampleAlert")
+#' return(num1/num2)
+#' }
+#'
+#' })
+#' }
+#')
+#'
+#'\dontrun{
+#' runApp(app)
+#'}
+#'@templateVar item_name Alerts
+#'@templateVar family_name Alerts
+#'@template footer
NULL
\ No newline at end of file
diff --git a/R/Buttons.R b/R/Buttons.R
index bd6be6c..f391998 100644
--- a/R/Buttons.R
+++ b/R/Buttons.R
@@ -1,115 +1,115 @@
-#'Buttons
-#'
-#'Twitter Bootstrap gives many options for styling buttons that aren't made
-#'available by standard Shiny. Use shinyBS to create buttons of different sizes,
-#'shapes, and colors.
-#'
-#'@section Components:
-#'There are two functions in the Buttons family:
-#' \describe{
-#' \item{\code{\link{bsButton}}}{Used in the UI to create a button. Buttons
-#' can be of the type \code{action} or \code{toggle}.}
-#' \item{\code{\link{updateButton}}}{Used in the Server logic to modify the
-#' state of a button created with \code{\link{bsButton}}}
-#' }
-#'
-#'@details
-#'Create a button in the UI with \code{\link{bsButton}}. If \code{type = "action"}
-#'the button will behave like the standard \code{\link{actionButton}} in shiny.
-#'If \code{type = "toggle"} the button will behave like a \code{\link{checkboxInput}}
-#'with an on and off state. It will return \code{TRUE} or \code{FALSE} to the Server
-#'depending on its state.
-#'
-#'You can update the style and state of a \code{\link{bsButton}} from the Server
-#'logic with \code{\link{updateButton}}. For example, a button could be set to
-#'\code{disabled = TRUE} until the user has made some other selections, then once
-#'those selections have been made, an observer on the Server could use \code{\link{updateButton}}
-#'to enable the button allowing the user to proceed. Alternatively, you could set
-#'the button to \code{style = "success"} to let them know that the button is ready
-#'to be clicked.
-#'
-#'@section Changes:
-#'\code{bsActionButton} and \code{bsToggleButton} were replaced with just
-#'\code{\link{bsButton}} with a \code{type} argument.
-#'
-#'\code{icon} was added to allow placing an icon in the button.
-#'
-#'@examples
-#'library(shiny)
-#'library(shinyBS)
-#'app = shinyApp(
-#' ui =
-#' fluidPage(
-#' sidebarLayout(
-#' sidebarPanel(
-#' sliderInput("bins",
-#' "Move the slider to see its effect on the button below:",
-#' min = 1,
-#' max = 50,
-#' value = 1),
-#' bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")),
-#' tags$p("Clicking the first button below changes the disabled state of the second button."),
-#' bsButton("togOne", label = "Toggle button disabled status",
-#' block = TRUE, type = "toggle", value = TRUE),
-#' bsButton("actOne", label = "Block Action Button", block = TRUE)
-#'
-#' ),
-#' mainPanel(
-#' textOutput("exampleText")
-#' )
-#' )
-#' ),
-#' server =
-#' function(input, output, session) {
-#' observeEvent(input$togOne, ({
-#' updateButton(session, "actOne", disabled = !input$togOne)
-#' }))
-#' observeEvent(input$bins, ({
-#'
-#' b <- input$bins
-#' disabled = NULL
-#' style = "default"
-#' icon = ""
-#'
-#' if(b < 5) {
-#' disabled = TRUE
-#' icon <- icon("ban")
-#' } else {
-#' disabled = FALSE
-#' }
-#'
-#' if(b < 15 | b > 35) {
-#' style = "danger"
-#' } else if(b < 20 | b > 30) {
-#' style = "warning"
-#' } else {
-#' style = "default"
-#' icon = icon("check")
-#' }
-#'
-#' updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon)
-#'
-#' }))
-#'
-#' output$exampleText <- renderText({
-#' input$actTwo
-#' b <- isolate(input$bins)
-#' txt = ""
-#' if((b > 5 & b < 15) | b > 35) {
-#' txt = "That was dangerous."
-#' } else if((b > 5 & b < 20) | b > 30) {
-#' txt = "I warned you about that."
-#' } else if(b >= 20 & b <= 30) {
-#' txt = "You have chosen... wisely."
-#' }
-#' return(txt)
-#' })
-#' }
-#')
-#'\dontrun{
-#' runApp(app)
-#'}
-#'@templateVar item_name Buttons
-#'@templateVar family_name Buttons
-#'@template footer
+#'Buttons
+#'
+#'Twitter Bootstrap gives many options for styling buttons that aren't made
+#'available by standard Shiny. Use shinyBS to create buttons of different sizes,
+#'shapes, and colors.
+#'
+#'@section Components:
+#'There are two functions in the Buttons family:
+#' \describe{
+#' \item{\code{\link{bsButton}}}{Used in the UI to create a button. Buttons
+#' can be of the type \code{action} or \code{toggle}.}
+#' \item{\code{\link{updateButton}}}{Used in the Server logic to modify the
+#' state of a button created with \code{\link{bsButton}}}
+#' }
+#'
+#'@details
+#'Create a button in the UI with \code{\link{bsButton}}. If \code{type = "action"}
+#'the button will behave like the standard \code{\link{actionButton}} in shiny.
+#'If \code{type = "toggle"} the button will behave like a \code{\link{checkboxInput}}
+#'with an on and off state. It will return \code{TRUE} or \code{FALSE} to the Server
+#'depending on its state.
+#'
+#'You can update the style and state of a \code{\link{bsButton}} from the Server
+#'logic with \code{\link{updateButton}}. For example, a button could be set to
+#'\code{disabled = TRUE} until the user has made some other selections, then once
+#'those selections have been made, an observer on the Server could use \code{\link{updateButton}}
+#'to enable the button allowing the user to proceed. Alternatively, you could set
+#'the button to \code{style = "success"} to let them know that the button is ready
+#'to be clicked.
+#'
+#'@section Changes:
+#'\code{bsActionButton} and \code{bsToggleButton} were replaced with just
+#'\code{\link{bsButton}} with a \code{type} argument.
+#'
+#'\code{icon} was added to allow placing an icon in the button.
+#'
+#'@examples
+#'library(shiny)
+#'library(shinyBS)
+#'app = shinyApp(
+#' ui =
+#' fluidPage(
+#' sidebarLayout(
+#' sidebarPanel(
+#' sliderInput("bins",
+#' "Move the slider to see its effect on the button below:",
+#' min = 1,
+#' max = 50,
+#' value = 1),
+#' bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")),
+#' tags$p("Clicking the first button below changes the disabled state of the second button."),
+#' bsButton("togOne", label = "Toggle button disabled status",
+#' block = TRUE, type = "toggle", value = TRUE),
+#' bsButton("actOne", label = "Block Action Button", block = TRUE)
+#'
+#' ),
+#' mainPanel(
+#' textOutput("exampleText")
+#' )
+#' )
+#' ),
+#' server =
+#' function(input, output, session) {
+#' observeEvent(input$togOne, ({
+#' updateButton(session, "actOne", disabled = !input$togOne)
+#' }))
+#' observeEvent(input$bins, ({
+#'
+#' b <- input$bins
+#' disabled = NULL
+#' style = "default"
+#' icon = ""
+#'
+#' if(b < 5) {
+#' disabled = TRUE
+#' icon <- icon("ban")
+#' } else {
+#' disabled = FALSE
+#' }
+#'
+#' if(b < 15 | b > 35) {
+#' style = "danger"
+#' } else if(b < 20 | b > 30) {
+#' style = "warning"
+#' } else {
+#' style = "default"
+#' icon = icon("check")
+#' }
+#'
+#' updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon)
+#'
+#' }))
+#'
+#' output$exampleText <- renderText({
+#' input$actTwo
+#' b <- isolate(input$bins)
+#' txt = ""
+#' if((b > 5 & b < 15) | b > 35) {
+#' txt = "That was dangerous."
+#' } else if((b > 5 & b < 20) | b > 30) {
+#' txt = "I warned you about that."
+#' } else if(b >= 20 & b <= 30) {
+#' txt = "You have chosen... wisely."
+#' }
+#' return(txt)
+#' })
+#' }
+#')
+#'\dontrun{
+#' runApp(app)
+#'}
+#'@templateVar item_name Buttons
+#'@templateVar family_name Buttons
+#'@template footer
NULL
\ No newline at end of file
diff --git a/R/Collapses.R b/R/Collapses.R
index d744235..1208b8e 100644
--- a/R/Collapses.R
+++ b/R/Collapses.R
@@ -1,71 +1,71 @@
-#'Collapses
-#'
-#' Collapse panels allow you to reduce clutter in your Shiny app by making
-#' panels of information that open and close with a user's click. Any type of
-#' content can go in a collapse panel. Standard Bootstrap styling options are
-#' available.
-#'
-#'@section Components:
-#' \describe{
-#' \item{\code{\link{bsCollapse}}}{A container for holder the individual panels created by \code{\link{bsCollapsePanel}}.}
-#' \item{\code{\link{bsCollapsePanel}}}{Creates an individual Collapse Panel that resides within a \code{\link{bsCollapse}}.}
-#' \item{\code{\link{updateCollapse}}}{Used within your server logic to open/close collapse panels or change their style.}
-#'}
-#'
-#'@details
-#'Collapses are designed to mimic \code{\link{tabsetPanel}} in their implementation.
-#'Start with \code{bsCollapse} to create a panel group, then fill it with panels
-#'using \code{bsCollapsePanel}.
-#'
-#'\code{bsCollapse} acts as an input, so you can retrieve which panels are open
-#'from the input object passed to the function in \code{\link{shinyServer}}.
-#'
-#'\code{updateCollapse} can be used within your server logic to open/close
-#'collapse panels or to change their style.
-#'
-#'@section Changes:
-#'\code{style} is a new option that wasn't available in previous versions of
-#'shinyBS.
-#'
-#'@examples
-#'library(shiny)
-#'library(shinyBS)
-#'
-#'app = shinyApp(
-#' ui =
-#' fluidPage(
-#' sidebarLayout(
-#' sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
-#' actionButton("p1Button", "Push Me!"),
-#' selectInput("styleSelect", "Select style for Panel 1",
-#' c("default", "primary", "danger", "warning", "info", "success"))
-#' ),
-#' mainPanel(
-#' bsCollapse(id = "collapseExample", open = "Panel 2",
-#' bsCollapsePanel("Panel 1", "This is a panel with just text ",
-#' "and has the default style. You can change the style in ",
-#' "the sidebar.", style = "info"),
-#' bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
-#' "and a 'success' style.", plotOutput("genericPlot"), style = "success")
-#' )
-#' )
-#' )
-#' ),
-#' server =
-#' function(input, output, session) {
-#' output$genericPlot <- renderPlot(plot(rnorm(100)))
-#' observeEvent(input$p1Button, ({
-#' updateCollapse(session, "collapseExample", open = "Panel 1")
-#' }))
-#' observeEvent(input$styleSelect, ({
-#' updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
-#' }))
-#' }
-#')
-#'\dontrun{
-#' runApp(app)
-#'}
-#'@templateVar item_name Collapses
-#'@templateVar family_name Collapses
-#'@template footer
-NULL
+#'Collapses
+#'
+#' Collapse panels allow you to reduce clutter in your Shiny app by making
+#' panels of information that open and close with a user's click. Any type of
+#' content can go in a collapse panel. Standard Bootstrap styling options are
+#' available.
+#'
+#'@section Components:
+#' \describe{
+#' \item{\code{\link{bsCollapse}}}{A container for holder the individual panels created by \code{\link{bsCollapsePanel}}.}
+#' \item{\code{\link{bsCollapsePanel}}}{Creates an individual Collapse Panel that resides within a \code{\link{bsCollapse}}.}
+#' \item{\code{\link{updateCollapse}}}{Used within your server logic to open/close collapse panels or change their style.}
+#'}
+#'
+#'@details
+#'Collapses are designed to mimic \code{\link{tabsetPanel}} in their implementation.
+#'Start with \code{bsCollapse} to create a panel group, then fill it with panels
+#'using \code{bsCollapsePanel}.
+#'
+#'\code{bsCollapse} acts as an input, so you can retrieve which panels are open
+#'from the input object passed to the function in \code{\link{shinyServer}}.
+#'
+#'\code{updateCollapse} can be used within your server logic to open/close
+#'collapse panels or to change their style.
+#'
+#'@section Changes:
+#'\code{style} is a new option that wasn't available in previous versions of
+#'shinyBS.
+#'
+#'@examples
+#'library(shiny)
+#'library(shinyBS)
+#'
+#'app = shinyApp(
+#' ui =
+#' fluidPage(
+#' sidebarLayout(
+#' sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
+#' actionButton("p1Button", "Push Me!"),
+#' selectInput("styleSelect", "Select style for Panel 1",
+#' c("default", "primary", "danger", "warning", "info", "success"))
+#' ),
+#' mainPanel(
+#' bsCollapse(id = "collapseExample", open = "Panel 2",
+#' bsCollapsePanel("Panel 1", "This is a panel with just text ",
+#' "and has the default style. You can change the style in ",
+#' "the sidebar.", style = "info"),
+#' bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
+#' "and a 'success' style.", plotOutput("genericPlot"), style = "success")
+#' )
+#' )
+#' )
+#' ),
+#' server =
+#' function(input, output, session) {
+#' output$genericPlot <- renderPlot(plot(rnorm(100)))
+#' observeEvent(input$p1Button, ({
+#' updateCollapse(session, "collapseExample", open = "Panel 1")
+#' }))
+#' observeEvent(input$styleSelect, ({
+#' updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
+#' }))
+#' }
+#')
+#'\dontrun{
+#' runApp(app)
+#'}
+#'@templateVar item_name Collapses
+#'@templateVar family_name Collapses
+#'@template footer
+NULL
diff --git a/R/Modals.R b/R/Modals.R
index 9268c34..0237a28 100644
--- a/R/Modals.R
+++ b/R/Modals.R
@@ -1,93 +1,93 @@
-#'Modals
-#'
-#'Modal windows are similar to popups but are rendered within the
-#'original window. They can contain any combination of shiny inputs, shiny
-#'outputs, and html. Possible uses include extra controls that you don't want
-#'cluttering up the main app display or help pages to explain your apps
-#'operation.
-#'
-#'@section Components:
-#'There are only two functions in the Modals family:
-#' \describe{
-#' \item{\code{\link{bsModal}}}{Used in the UI to create a modal window.}
-#' \item{\code{\link{toggleModal}}}{Used in the Server logic to open or
-#' close a modal window programmatically.}
-#' }
-#'
-#'@details
-#'Use \code{\link{bsModal}} in your UI to create a modal window. It works
-#'like \code{\link{Collapses}} or \code{\link{tabPanel}}, any non-named arguments
-#'will be passed as content for the modal.
-#'
-#'Create a button or link and assign its \code{inputId} as the \code{trigger}
-#'in \code{\link{bsModal}}.
-#'
-#'@section Changes:
-#'There is now a \code{toggle} argument in \code{\link{toggleModal}} that allows
-#'you to specify whether you want the modal to open or close.
-#'
-#'The \code{size} argument in \code{\link{bsModal}} allows you to specify the
-#'size of the modal window. Either \code{small} or \code{large}.
-#'
-#'@examples
-#'library(shiny)
-#'library(shinyBS)
-#'
-#'app = shinyApp(
-#' ui =
-#' fluidPage(
-#' sidebarLayout(
-#' sidebarPanel(
-#' sliderInput("bins",
-#' "Number of bins:",
-#' min = 1,
-#' max = 50,
-#' value = 30),
-#' actionButton("tabBut", "View Table")
-#' ),
-#'
-#' mainPanel(
-#' plotOutput("distPlot"),
-#' bsModal("modalExample", "Data Table", "tabBut", size = "large",
-#' dataTableOutput("distTable"))
-#' )
-#' )
-#' ),
-#' server =
-#' function(input, output, session) {
-#'
-#' output$distPlot <- renderPlot({
-#'
-#' x <- faithful[, 2]
-#' bins <- seq(min(x), max(x), length.out = input$bins + 1)
-#'
-#' # draw the histogram with the specified number of bins
-#' hist(x, breaks = bins, col = 'darkgray', border = 'white')
-#'
-#' })
-#'
-#' output$distTable <- renderDataTable({
-#'
-#' x <- faithful[, 2]
-#' bins <- seq(min(x), max(x), length.out = input$bins + 1)
-#'
-#' # draw the histogram with the specified number of bins
-#' tab <- hist(x, breaks = bins, plot = FALSE)
-#' tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
-#' paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))
-#' })
-#' tab <- as.data.frame(do.call(cbind, tab))
-#' colnames(tab) <- c("Bins", "Counts", "Density")
-#' return(tab[, 1:3])
-#'
-#' }, options = list(pageLength=10))
-#'
-#' }
-#')
-#'\dontrun{
-#' runApp(app)
-#'}
-#'@templateVar family_name Modals
-#'@templateVar item_name Modals
-#'@template footer
-NULL
+#'Modals
+#'
+#'Modal windows are similar to popups but are rendered within the
+#'original window. They can contain any combination of shiny inputs, shiny
+#'outputs, and html. Possible uses include extra controls that you don't want
+#'cluttering up the main app display or help pages to explain your apps
+#'operation.
+#'
+#'@section Components:
+#'There are only two functions in the Modals family:
+#' \describe{
+#' \item{\code{\link{bsModal}}}{Used in the UI to create a modal window.}
+#' \item{\code{\link{toggleModal}}}{Used in the Server logic to open or
+#' close a modal window programmatically.}
+#' }
+#'
+#'@details
+#'Use \code{\link{bsModal}} in your UI to create a modal window. It works
+#'like \code{\link{Collapses}} or \code{\link{tabPanel}}, any non-named arguments
+#'will be passed as content for the modal.
+#'
+#'Create a button or link and assign its \code{inputId} as the \code{trigger}
+#'in \code{\link{bsModal}}.
+#'
+#'@section Changes:
+#'There is now a \code{toggle} argument in \code{\link{toggleModal}} that allows
+#'you to specify whether you want the modal to open or close.
+#'
+#'The \code{size} argument in \code{\link{bsModal}} allows you to specify the
+#'size of the modal window. Either \code{small} or \code{large}.
+#'
+#'@examples
+#'library(shiny)
+#'library(shinyBS)
+#'
+#'app = shinyApp(
+#' ui =
+#' fluidPage(
+#' sidebarLayout(
+#' sidebarPanel(
+#' sliderInput("bins",
+#' "Number of bins:",
+#' min = 1,
+#' max = 50,
+#' value = 30),
+#' actionButton("tabBut", "View Table")
+#' ),
+#'
+#' mainPanel(
+#' plotOutput("distPlot"),
+#' bsModal("modalExample", "Data Table", "tabBut", size = "large",
+#' dataTableOutput("distTable"))
+#' )
+#' )
+#' ),
+#' server =
+#' function(input, output, session) {
+#'
+#' output$distPlot <- renderPlot({
+#'
+#' x <- faithful[, 2]
+#' bins <- seq(min(x), max(x), length.out = input$bins + 1)
+#'
+#' # draw the histogram with the specified number of bins
+#' hist(x, breaks = bins, col = 'darkgray', border = 'white')
+#'
+#' })
+#'
+#' output$distTable <- renderDataTable({
+#'
+#' x <- faithful[, 2]
+#' bins <- seq(min(x), max(x), length.out = input$bins + 1)
+#'
+#' # draw the histogram with the specified number of bins
+#' tab <- hist(x, breaks = bins, plot = FALSE)
+#' tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
+#' paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))
+#' })
+#' tab <- as.data.frame(do.call(cbind, tab))
+#' colnames(tab) <- c("Bins", "Counts", "Density")
+#' return(tab[, 1:3])
+#'
+#' }, options = list(pageLength=10))
+#'
+#' }
+#')
+#'\dontrun{
+#' runApp(app)
+#'}
+#'@templateVar family_name Modals
+#'@templateVar item_name Modals
+#'@template footer
+NULL
diff --git a/R/Tooltips_and_Popovers.R b/R/Tooltips_and_Popovers.R
index 3450d31..bce5ccf 100644
--- a/R/Tooltips_and_Popovers.R
+++ b/R/Tooltips_and_Popovers.R
@@ -1,164 +1,166 @@
-#'Tooltips and Popovers
-#'
-#'Tooltips and Popovers allow you to add additional information about controls
-#'or outputs without cluttering up your user interface. You can add a tooltip to
-#'a button that displays on hover and better explains what the button will do, or
-#'you could add a popover to an output providing further analysis of that output.
-#'
-#'@section Components:
-#'There are eight functions in the Tooltips and Popovers family:
-#' \describe{
-#' \item{\code{\link{bsTooltip}}}{Used in the UI to add a tooltip to an element
-#' in your UI.}
-#' \item{\code{\link{bsPopover}}}{Used in the UI to add a popover to an element
-#' in your UI.}
-#' \item{\code{\link{tipify}}}{Wrap any UI element in \code{tipify} to add a
-#' tooltip to the wrapped element. Preferred for elemented created with
-#' \code{\link{renderUI}}.}
-#' \item{\code{\link{popify}}}{Wrap any UI element in \code{popify} to add a
-#' popover to the wrapped element. Preferred for elements created with
-#' \code{\link{renderUI}}.}
-#' \item{\code{\link{addTooltip}}}{Used in the Server logic to add a tooltip
-#' to an element in your UI.}
-#' \item{\code{\link{addPopover}}}{Used in the Server logic to add a popover
-#' to an element in your UI.}
-#' \item{\code{\link{removeTooltip}}}{Used in the Server logic to remove a
-#' tooltip from an element in your UI.}
-#' \item{\code{\link{removePopover}}}{Used in the Server logic to remove a
-#' popover from an element in your UI.}
-#' }
-#'
-#'@details
-#'You can create tooltips and popovers from either the UI script or within the
-#'Server logic. \code{\link{bsTooltip}} and \code{\link{bsPopover}} are used in
-#'the UI, and \code{\link{addTooltip}} and \code{\link{addPopover}} are used in
-#'the Server logic. \code{\link{tipify}} and \code{\link{popify}} can be used
-#'within the UI or from within a \code{\link{renderUI}} in the Server logic. They
-#'also have the added advantage of not requiring that the UI element have an ID
-#'attribute.
-#'
-#'@note
-#'Tooltips and Popovers cannot contain shiny inputs or outputs.
-#'
-#'There must be at least one \code{shinyBS} component in the UI of your
-#'app in order for the necessary dependencies to be loaded. Because of this,
-#'\code{\link{addTooltip}} and \code{\link{addPopover}} will not work if they
-#'are the only shinyBS components in your app.
-#'
-#'Tooltips and popovers may not work on some of the more complex shiny inputs
-#'or outputs. If you encounter a problem with tooltips or popovers not appearing
-#'please file a issue on the github page so I can fix it.
-#'
-#'@section Changes:
-#'An \code{options} argument has been added to the creation functions to allow
-#'advanced users more control over how the tooltips and popovers appear. See
-#'the \href{http://getbootstrap.com}{Twitter Bootstrap 3 documentation} for more
-#'details.
-#'
-#'@examples
-#'library(shiny)
-#'library(shinyBS)
-#'
-#'app = shinyApp(
-#' ui =
-#' fluidPage(
-#' sidebarLayout(
-#' sidebarPanel(
-#' sliderInput("bins",
-#' "Number of bins:",
-#' min = 1,
-#' max = 50,
-#' value = 30),
-#' bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
-#' "right", options = list(container = "body"))
-#' ),
-#' mainPanel(
-#' plotOutput("distPlot"),
-#' uiOutput("uiExample")
-#' )
-#' )
-#' ),
-#' server =
-#' function(input, output, session) {
-#' output$distPlot <- renderPlot({
-#'
-#' # generate bins based on input$bins from ui.R
-#' x <- faithful[, 2]
-#' bins <- seq(min(x), max(x), length.out = input$bins + 1)
-#'
-#' # draw the histogram with the specified number of bins
-#' hist(x, breaks = bins, col = 'darkgray', border = 'white')
-#'
-#' })
-#' output$uiExample <- renderUI({
-#' tags$span(
-#' popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"),
-#' "A Pointless Button",
-#' "This button is <b>pointless</b>. It does not do <em>anything</em>!"),
-#' tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"),
-#' "This button is pointless too!")
-#' )
-#' })
-#' addPopover(session, "distPlot", "Data", content = paste0("<p>Waiting time between ",
-#' "eruptions and the duration of the eruption for the Old Faithful geyser ",
-#' "in Yellowstone National Park, Wyoming, USA.</p><p>Azzalini, A. and ",
-#' "Bowman, A. W. (1990). A look at some data on the Old Faithful geyser. ",
-#' "Applied Statistics 39, 357-365.</p>"), trigger = 'click')
-#' }
-#')
-#'\dontrun{
-#' runApp(app)
-#'}
-#'@templateVar item_name Tooltips_and_Popovers
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template footer
-NULL
-
-
-## These Functions are common to multiple tooltip and popover functions
-# Shared functions with really long names...
-createTooltipOrPopoverOnServer <- function(session, id, type, options) {
-
- data <- list(action = "add", type = type, id = id, options = options)
- session$sendCustomMessage(type = "updateTooltipOrPopover", data)
-
-}
-
-createTooltipOrPopoverOnUI <- function(id, type, options) {
-
- options = paste0("{'", paste(names(options), options, sep = "': '", collapse = "', '"), "'}")
-
- bsTag <- shiny::tags$script(shiny::HTML(paste0("$(document).ready(function() {setTimeout(function() {shinyBS.addTooltip('", id, "', '", type, "', ", options, ")}, 500)});")))
-
- htmltools::attachDependencies(bsTag, shinyBSDep)
-
-}
-
-buildTooltipOrPopoverOptionsList <- function(title, placement, trigger, options, content) {
-
- if(is.null(options)) {
- options = list()
- }
-
- if(!missing(content)) {
- if(is.null(options$content)) {
- options$content = shiny::HTML(content)
- }
- }
-
- if(is.null(options$placement)) {
- options$placement = placement
- }
-
- if(is.null(options$trigger)) {
- if(length(trigger) > 1) trigger = paste(trigger, collapse = " ")
- options$trigger = trigger
- }
-
- if(is.null(options$title)) {
- options$title = title
- }
-
- return(options)
-
+#'Tooltips and Popovers
+#'
+#'Tooltips and Popovers allow you to add additional information about controls
+#'or outputs without cluttering up your user interface. You can add a tooltip to
+#'a button that displays on hover and better explains what the button will do, or
+#'you could add a popover to an output providing further analysis of that output.
+#'
+#'@section Components:
+#'There are eight functions in the Tooltips and Popovers family:
+#' \describe{
+#' \item{\code{\link{bsTooltip}}}{Used in the UI to add a tooltip to an element
+#' in your UI.}
+#' \item{\code{\link{bsPopover}}}{Used in the UI to add a popover to an element
+#' in your UI.}
+#' \item{\code{\link{tipify}}}{Wrap any UI element in \code{tipify} to add a
+#' tooltip to the wrapped element. Preferred for elemented created with
+#' \code{\link{renderUI}}.}
+#' \item{\code{\link{popify}}}{Wrap any UI element in \code{popify} to add a
+#' popover to the wrapped element. Preferred for elements created with
+#' \code{\link{renderUI}}.}
+#' \item{\code{\link{addTooltip}}}{Used in the Server logic to add a tooltip
+#' to an element in your UI.}
+#' \item{\code{\link{addPopover}}}{Used in the Server logic to add a popover
+#' to an element in your UI.}
+#' \item{\code{\link{removeTooltip}}}{Used in the Server logic to remove a
+#' tooltip from an element in your UI.}
+#' \item{\code{\link{removePopover}}}{Used in the Server logic to remove a
+#' popover from an element in your UI.}
+#' }
+#'
+#'@details
+#'You can create tooltips and popovers from either the UI script or within the
+#'Server logic. \code{\link{bsTooltip}} and \code{\link{bsPopover}} are used in
+#'the UI, and \code{\link{addTooltip}} and \code{\link{addPopover}} are used in
+#'the Server logic. \code{\link{tipify}} and \code{\link{popify}} can be used
+#'within the UI or from within a \code{\link{renderUI}} in the Server logic. They
+#'also have the added advantage of not requiring that the UI element have an ID
+#'attribute.
+#'
+#'@note
+#'Tooltips and Popovers cannot contain shiny inputs or outputs.
+#'
+#'There must be at least one \code{shinyBS} component in the UI of your
+#'app in order for the necessary dependencies to be loaded. Because of this,
+#'\code{\link{addTooltip}} and \code{\link{addPopover}} will not work if they
+#'are the only shinyBS components in your app.
+#'
+#'Tooltips and popovers may not work on some of the more complex shiny inputs
+#'or outputs. If you encounter a problem with tooltips or popovers not appearing
+#'please file a issue on the github page so I can fix it.
+#'
+#'@section Changes:
+#'An \code{options} argument has been added to the creation functions to allow
+#'advanced users more control over how the tooltips and popovers appear. See
+#'the \href{http://getbootstrap.com}{Twitter Bootstrap 3 documentation} for more
+#'details.
+#'
+#'@examples
+#'library(shiny)
+#'library(shinyBS)
+#'
+#'app = shinyApp(
+#' ui =
+#' fluidPage(
+#' sidebarLayout(
+#' sidebarPanel(
+#' sliderInput("bins",
+#' "Number of bins:",
+#' min = 1,
+#' max = 50,
+#' value = 30),
+#' bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
+#' "right", options = list(container = "body"))
+#' ),
+#' mainPanel(
+#' plotOutput("distPlot"),
+#' uiOutput("uiExample")
+#' )
+#' )
+#' ),
+#' server =
+#' function(input, output, session) {
+#' output$distPlot <- renderPlot({
+#'
+#' # generate bins based on input$bins from ui.R
+#' x <- faithful[, 2]
+#' bins <- seq(min(x), max(x), length.out = input$bins + 1)
+#'
+#' # draw the histogram with the specified number of bins
+#' hist(x, breaks = bins, col = 'darkgray', border = 'white')
+#'
+#' })
+#' output$uiExample <- renderUI({
+#' tags$span(
+#' popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"),
+#' "A Pointless Button",
+#' "This button is <b>pointless</b>. It does not do <em>anything</em>!"),
+#' tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"),
+#' "This button is pointless too!")
+#' )
+#' })
+#' addPopover(session, "distPlot", "Data", content = paste0("<p>Waiting time between ",
+#' "eruptions and the duration of the eruption for the Old Faithful geyser ",
+#' "in Yellowstone National Park, Wyoming, USA.</p><p>Azzalini, A. and ",
+#' "Bowman, A. W. (1990). A look at some data on the Old Faithful geyser. ",
+#' "Applied Statistics 39, 357-365.</p>"), trigger = 'click')
+#' }
+#')
+#'\dontrun{
+#' runApp(app)
+#'}
+#'@templateVar item_name Tooltips_and_Popovers
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template footer
+NULL
+
+
+## These Functions are common to multiple tooltip and popover functions
+# Shared functions with really long names...
+createTooltipOrPopoverOnServer <- function(session, id, type, options) {
+
+ data <- list(action = "add", type = type, id = id, options = options)
+ session$sendCustomMessage(type = "updateTooltipOrPopover", data)
+
+}
+
+createTooltipOrPopoverOnUI <- function(id, type, options) {
+
+ options = paste0("{'", paste(names(options), options, sep = "': '", collapse = "', '"), "'}")
+
+ bsTag <- shiny::tags$script(shiny::HTML(paste0("$(document).ready(function() {setTimeout(function() {shinyBS.addTooltip('", id, "', '", type, "', ", options, ")}, 500)});")))
+
+ htmltools::attachDependencies(bsTag, shinyBSDep)
+
+}
+
+buildTooltipOrPopoverOptionsList <- function(title, placement, trigger, options, content) {
+
+ if(is.null(options)) {
+ options = list()
+ }
+
+ if(!missing(content)) {
+ content <- gsub("'", "'", content, fixed = TRUE)
+ if(is.null(options$content)) {
+ options$content = shiny::HTML(content)
+ }
+ }
+
+ if(is.null(options$placement)) {
+ options$placement = placement
+ }
+
+ if(is.null(options$trigger)) {
+ if(length(trigger) > 1) trigger = paste(trigger, collapse = " ")
+ options$trigger = trigger
+ }
+
+ if(is.null(options$title)) {
+ options$title = title
+ options$title <- gsub("'", "'", options$title, fixed = TRUE)
+ }
+
+ return(options)
+
}
\ No newline at end of file
diff --git a/R/addPopover.R b/R/addPopover.R
index 1797050..aadf0b1 100644
--- a/R/addPopover.R
+++ b/R/addPopover.R
@@ -1,26 +1,26 @@
-#'addPopover
-#'
-#'\code{addPopover} is used within the Server logic of an app to add a popover to a Shiny
-#'input or output.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param id The id of the element to attach the popover to.
-#'@param title The title of the popover.
-#'@param content The main content of the popover.
-#'@param placement Where the popover should appear relative to its target
-#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{bottom}.
-#'@param trigger What action should cause the popover to appear? (\code{hover},
-#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{hover}.
-#'@param options A named list of additional options to be set on the popover.
-#'
-#'@templateVar item_name addPopover
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-addPopover <- function(session, id, title, content, placement = "bottom", trigger = "hover", options = NULL) {
-
- options <- buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content)
- createTooltipOrPopoverOnServer(session, id, "popover", options)
-
+#'addPopover
+#'
+#'\code{addPopover} is used within the Server logic of an app to add a popover to a Shiny
+#'input or output.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param id The id of the element to attach the popover to.
+#'@param title The title of the popover.
+#'@param content The main content of the popover.
+#'@param placement Where the popover should appear relative to its target
+#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{bottom}.
+#'@param trigger What action should cause the popover to appear? (\code{hover},
+#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{hover}.
+#'@param options A named list of additional options to be set on the popover.
+#'
+#'@templateVar item_name addPopover
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+addPopover <- function(session, id, title, content, placement = "bottom", trigger = "hover", options = NULL) {
+
+ options <- buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content)
+ createTooltipOrPopoverOnServer(session, id, "popover", options)
+
}
\ No newline at end of file
diff --git a/R/addTooltip.R b/R/addTooltip.R
index 077c109..f12af41 100644
--- a/R/addTooltip.R
+++ b/R/addTooltip.R
@@ -1,25 +1,25 @@
-#'addTooltip
-#'
-#'\code{addTooltip} is used within the Server logic of an app to add a tooltip to a Shiny
-#'input or output.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param id The id of the element to attach the tooltip to.
-#'@param title The content of the tooltip.
-#'@param placement Where the tooltip should appear relative to its target
-#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
-#'@param trigger What action should cause the tooltip to appear? (\code{hover},
-#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
-#'@param options A named list of additional options to be set on the tooltip.
-#'
-#'@templateVar item_name addTooltip
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-addTooltip <- function(session, id, title, placement = "bottom", trigger = "hover", options = NULL) {
-
- options <- buildTooltipOrPopoverOptionsList(title, placement, trigger, options)
- createTooltipOrPopoverOnServer(session, id, "tooltip", options)
-
+#'addTooltip
+#'
+#'\code{addTooltip} is used within the Server logic of an app to add a tooltip to a Shiny
+#'input or output.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param id The id of the element to attach the tooltip to.
+#'@param title The content of the tooltip.
+#'@param placement Where the tooltip should appear relative to its target
+#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
+#'@param trigger What action should cause the tooltip to appear? (\code{hover},
+#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
+#'@param options A named list of additional options to be set on the tooltip.
+#'
+#'@templateVar item_name addTooltip
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+addTooltip <- function(session, id, title, placement = "bottom", trigger = "hover", options = NULL) {
+
+ options <- buildTooltipOrPopoverOptionsList(title, placement, trigger, options)
+ createTooltipOrPopoverOnServer(session, id, "tooltip", options)
+
}
\ No newline at end of file
diff --git a/R/bsAlert.R b/R/bsAlert.R
index 860f8bf..7e51cd3 100644
--- a/R/bsAlert.R
+++ b/R/bsAlert.R
@@ -1,18 +1,21 @@
-#'bsAlert
-#'
-#'\code{bsAlert} creates an anchor point in your UI definition. This anchor point
-#'is where alerts created in your Server logic will be displayed.
-#'
-#'@param anchorId A unique id the identifies the anchor.
-#'
-#'@templateVar item_name bsAlert
-#'@templateVar family_name Alerts
-#'@template item_details
-#'@template footer
-#'@export
-bsAlert <- function(anchorId) {
-
- bsTag <- shiny::tags$div(class = "sbs-alert", id = anchorId, " ")
- htmltools::attachDependencies(bsTag, shinyBSDep)
-
-}
+#'bsAlert
+#'
+#'\code{bsAlert} creates an anchor point in your UI definition. This anchor point
+#'is where alerts created in your Server logic will be displayed.
+#'
+#'@param anchorId A unique id the identifies the anchor.
+#'
+#'@templateVar item_name bsAlert
+#'@templateVar family_name Alerts
+#'@template item_details
+#'@template footer
+#'@export
+bsAlert <- function(anchorId, inline = TRUE) {
+
+ class <- "sbs-alert"
+ if(!inline) class = paste(class, "sbs-alert-hover")
+
+ bsTag <- shiny::tags$div(class = class, id = anchorId, " ")
+ htmltools::attachDependencies(bsTag, shinyBSDep)
+
+}
diff --git a/R/bsButton.R b/R/bsButton.R
index e263cd5..576eea6 100644
--- a/R/bsButton.R
+++ b/R/bsButton.R
@@ -1,56 +1,56 @@
-#'bsButton
-#'
-#'\code{bsButton} is used in your UI script to create customizable action and toggle
-#'buttons.
-#'
-#'@inheritParams shiny::actionButton
-#'@param style A Bootstrap style to apply to the button. (\code{default}, \code{primary},
-#'\code{success}, \code{info}, \code{warning}, or \code{danger})
-#'@param size The size of the button (\code{extra-small}, \code{small},
-#'\code{default}, or \code{large})
-#'@param type The type of button to create. (\code{action} or \code{toggle})
-#'@param block \bold{logical} Should the button take the full width of the parent element?
-#'@param disabled \bold{logical} Should the button be disabled (un-clickable)?
-#'@param value \bold{logical} If \code{type = "toggle"}, the initial value of the button.
-#'
-#'@templateVar item_name bsButton
-#'@templateVar family_name Buttons
-#'@template item_details
-#'@template footer
-#'@export
-bsButton <- function(inputId, label, icon = NULL, ..., style = "default",
- size = "default", type = "action", block = FALSE,
- disabled = FALSE, value = FALSE) {
- btn <- shiny::actionButton(inputId, label, icon, ...)
- if(type == "toggle") {
- btn <- removeClass(btn, "action-button")
- btn <- addClass(btn, "sbs-toggle-button")
- if(value == TRUE) {
- btn <- addClass(btn, "active")
- }
- }
- if(style != "default") {
- btn <- removeClass(btn, "btn-default")
- btn <- addClass(btn, paste0("btn-", style))
- }
-
- size <- switch(size,
- "extra-small" = "btn-xs",
- "small" = "btn-sm",
- "large" = "btn-lg",
- "default")
-
- if(size != "default") {
- btn <- addClass(btn, size)
- }
-
- if(block == TRUE) {
- btn <- addClass(btn, "btn-block")
- }
- if(disabled) {
- btn <- addAttribs(btn, disabled = "disabled")
- }
-
- htmltools::attachDependencies(btn, shinyBSDep)
-
+#'bsButton
+#'
+#'\code{bsButton} is used in your UI script to create customizable action and toggle
+#'buttons.
+#'
+#'@inheritParams shiny::actionButton
+#'@param style A Bootstrap style to apply to the button. (\code{default}, \code{primary},
+#'\code{success}, \code{info}, \code{warning}, or \code{danger})
+#'@param size The size of the button (\code{extra-small}, \code{small},
+#'\code{default}, or \code{large})
+#'@param type The type of button to create. (\code{action} or \code{toggle})
+#'@param block \bold{logical} Should the button take the full width of the parent element?
+#'@param disabled \bold{logical} Should the button be disabled (un-clickable)?
+#'@param value \bold{logical} If \code{type = "toggle"}, the initial value of the button.
+#'
+#'@templateVar item_name bsButton
+#'@templateVar family_name Buttons
+#'@template item_details
+#'@template footer
+#'@export
+bsButton <- function(inputId, label, icon = NULL, ..., style = "default",
+ size = "default", type = "action", block = FALSE,
+ disabled = FALSE, value = FALSE) {
+ btn <- shiny::actionButton(inputId, label, icon, ...)
+ if(type == "toggle") {
+ btn <- removeClass(btn, "action-button")
+ btn <- addClass(btn, "sbs-toggle-button")
+ if(value == TRUE) {
+ btn <- addClass(btn, "active")
+ }
+ }
+ if(style != "default") {
+ btn <- removeClass(btn, "btn-default")
+ btn <- addClass(btn, paste0("btn-", style))
+ }
+
+ size <- switch(size,
+ "extra-small" = "btn-xs",
+ "small" = "btn-sm",
+ "large" = "btn-lg",
+ "default")
+
+ if(size != "default") {
+ btn <- addClass(btn, size)
+ }
+
+ if(block == TRUE) {
+ btn <- addClass(btn, "btn-block")
+ }
+ if(disabled) {
+ btn <- addAttribs(btn, disabled = "disabled")
+ }
+
+ htmltools::attachDependencies(btn, shinyBSDep)
+
}
\ No newline at end of file
diff --git a/R/bsCollapse.R b/R/bsCollapse.R
index 0e47b70..cb34f0b 100644
--- a/R/bsCollapse.R
+++ b/R/bsCollapse.R
@@ -1,42 +1,42 @@
-#'bsCollapse
-#'
-#'\code{bsCollapse} is used in your UI to create a collapse panel group. Use
-#'\code{\link{bsCollapsePanel}} to populate this object with panels.
-#'
-#'@param \dots \code{\link{bsCollapsePanel}} elements to include in the Collapse.
-#'@param id \bold{Optional} You can use \code{input$id} in your Server logic to
-#'determine which panels are open, and \code{\link{updateCollapse}} to open/close
-#'panels.
-#'@param multiple Can more than one panel be open at a time? Defaults to \code{FALSE}.
-#'@param open The \code{value}, (or if none was supplied, the \code{title}) of
-#'the panel(s) you want open on load.
-#'
-#'@templateVar item_name bsCollapse
-#'@templateVar family_name Collapses
-#'@template item_details
-#'@template footer
-#'@export
-bsCollapse <- function(..., id = NULL, multiple = FALSE, open = NULL) {
-
- if(is.null(id)) id = paste0("collapse", sprintf("%07i", as.integer(stats::runif(1, 1, 1000000))))
-
- if(!multiple & length(open) > 1) {
- open <- open[1]
- }
-
- panels <- list(...)
-
- for(i in seq(length(panels))) {
- if(getAttribs(panels[[i]])$value %in% open) {
- panels[[i]]$children[[2]] <- addClass(panels[[i]]$children[[2]], "in")
- }
- if(!multiple) {
- panels[[i]]$children[[1]]$children[[1]]$children[[1]] <- addAttribs(panels[[i]]$children[[1]]$children[[1]]$children[[1]], 'data-parent' = paste0("#", id))
- }
- }
-
- bsTag <- shiny::tags$div(class = "panel-group sbs-panel-group", "data-sbs-multi" = multiple, id=id, role = "tablist", panels)
-
- htmltools::attachDependencies(bsTag, shinyBSDep)
-
-}
+#'bsCollapse
+#'
+#'\code{bsCollapse} is used in your UI to create a collapse panel group. Use
+#'\code{\link{bsCollapsePanel}} to populate this object with panels.
+#'
+#'@param \dots \code{\link{bsCollapsePanel}} elements to include in the Collapse.
+#'@param id \bold{Optional} You can use \code{input$id} in your Server logic to
+#'determine which panels are open, and \code{\link{updateCollapse}} to open/close
+#'panels.
+#'@param multiple Can more than one panel be open at a time? Defaults to \code{FALSE}.
+#'@param open The \code{value}, (or if none was supplied, the \code{title}) of
+#'the panel(s) you want open on load.
+#'
+#'@templateVar item_name bsCollapse
+#'@templateVar family_name Collapses
+#'@template item_details
+#'@template footer
+#'@export
+bsCollapse <- function(..., id = NULL, multiple = FALSE, open = NULL) {
+
+ if(is.null(id)) id = paste0("collapse", sprintf("%07i", as.integer(stats::runif(1, 1, 1000000))))
+
+ if(!multiple & length(open) > 1) {
+ open <- open[1]
+ }
+
+ panels <- list(...)
+
+ for(i in seq(length(panels))) {
+ if(getAttribs(panels[[i]])$value %in% open) {
+ panels[[i]]$children[[2]] <- addClass(panels[[i]]$children[[2]], "in")
+ }
+ if(!multiple) {
+ panels[[i]]$children[[1]]$children[[1]]$children[[1]] <- addAttribs(panels[[i]]$children[[1]]$children[[1]]$children[[1]], 'data-parent' = paste0("#", id))
+ }
+ }
+
+ bsTag <- shiny::tags$div(class = "panel-group sbs-panel-group", "data-sbs-multi" = multiple, id=id, role = "tablist", panels)
+
+ htmltools::attachDependencies(bsTag, shinyBSDep)
+
+}
diff --git a/R/bsCollapsePanel.R b/R/bsCollapsePanel.R
index 346f8ac..5f5f16f 100644
--- a/R/bsCollapsePanel.R
+++ b/R/bsCollapsePanel.R
@@ -1,42 +1,42 @@
-#'bsCollapsePanel
-#'
-#'\code{bsCollapsePanel} creates individual panels within a \code{\link{bsCollapse}} object.
-#'
-#'@param title The title to display at the top of the panel.
-#'@param \dots UI elements to include within the panel.
-#'@param value \bold{Optional} The value to return when this panel is open. Defaults to \code{title}.
-#'@param style \bold{Optional} A Bootstrap style to apply to the panel. (\code{primary}, \code{danger}, \code{warning}, \code{info}, or \code{success})
-#'
-#'@templateVar item_name bsCollapsePanel
-#'@templateVar family_name Collapses
-#'@template item_details
-#'@template footer
-#'@export
-bsCollapsePanel <- function(title, ..., value = title, style = NULL) {
-
- content <- list(...)
-
- id <- paste0("cpanel", sprintf("%07i", as.integer(stats::runif(1, 1, 1000000))))
- if(is.null(value)) {
- value = title
- }
- if(is.null(style)) {
- style = "default"
- }
-
- bsTag <- shiny::tags$div(class = paste0("panel panel-", style), value = value,
- shiny::tags$div(class = "panel-heading", role = "tab", id = paste0("heading_", id),
- shiny::tags$h4(class = "panel-title",
- shiny::tags$a("data-toggle" = "collapse", href = paste0("#", id), title)
- )
- ),
- shiny::tags$div(id = id, class = "panel-collapse collapse", role = "tabpanel",
- shiny::tags$div(class = "panel-body", content)
- )
- )
-
- htmltools::attachDependencies(bsTag, shinyBSDep)
-
-}
-
-
+#'bsCollapsePanel
+#'
+#'\code{bsCollapsePanel} creates individual panels within a \code{\link{bsCollapse}} object.
+#'
+#'@param title The title to display at the top of the panel.
+#'@param \dots UI elements to include within the panel.
+#'@param value \bold{Optional} The value to return when this panel is open. Defaults to \code{title}.
+#'@param style \bold{Optional} A Bootstrap style to apply to the panel. (\code{primary}, \code{danger}, \code{warning}, \code{info}, or \code{success})
+#'
+#'@templateVar item_name bsCollapsePanel
+#'@templateVar family_name Collapses
+#'@template item_details
+#'@template footer
+#'@export
+bsCollapsePanel <- function(title, ..., value = title, style = NULL) {
+
+ content <- list(...)
+
+ id <- paste0("cpanel", sprintf("%07i", as.integer(stats::runif(1, 1, 1000000))))
+ if(is.null(value)) {
+ value = title
+ }
+ if(is.null(style)) {
+ style = "default"
+ }
+
+ bsTag <- shiny::tags$div(class = paste0("panel panel-", style), value = value,
+ shiny::tags$div(class = "panel-heading", role = "tab", id = paste0("heading_", id),
+ shiny::tags$h4(class = "panel-title",
+ shiny::tags$a("data-toggle" = "collapse", href = paste0("#", id), title)
+ )
+ ),
+ shiny::tags$div(id = id, class = "panel-collapse collapse", role = "tabpanel",
+ shiny::tags$div(class = "panel-body", content)
+ )
+ )
+
+ htmltools::attachDependencies(bsTag, shinyBSDep)
+
+}
+
+
diff --git a/R/bsExample.R b/R/bsExample.R
index b8eb51a..ce758a7 100644
--- a/R/bsExample.R
+++ b/R/bsExample.R
@@ -1,41 +1,41 @@
-#'bsExample
-#'
-#'A function to view examples of shinyBS functionality. Will run the examples
-#'found in the examples sections of shinyBS documentation. Use this instead of
-#'\code{example}.
-#'
-#'@param family A shinyBS family name
-#'@param display.mode The display mode to use when running the example. See
-#'\code{\link{runApp}}.
-#'@param \dots Other parameters to pass to \code{\link{runApp}}.
-#'
-#'@details
-#'This function is just a wrapper for \code{\link{runApp}} that runs copies of the
-#'examples found in the family documention pages of \code{shinyBS}. By default,
-#'\code{display.mode} is set to \code{showcase} so you can see the code while
-#'the app is running.
-#'
-#'@examples
-#'\dontrun{
-#' bsExample("Alerts")}
-#'@export
-bsExample <- function(family, display.mode = "showcase", ...) {
-
- exp <- system.file("examples", package="shinyBS")
- fams <- list.dirs(exp, full.names = FALSE, recursive = FALSE)
-
- appname <- gsub(" ", "", family, fixed = TRUE)
- appname <- gsub("_", "", appname, fixed = TRUE)
-
- if(appname %in% fams) {
-
- appname <- normalizePath(paste0(exp, "/", appname))
- shiny::runApp(appname, display.mode = display.mode, ...)
-
- } else {
-
- stop("Could not find shinyBS family: ", family, "\nAvailable families are: ", paste0(fams, collapse = ", "))
-
- }
-
+#'bsExample
+#'
+#'A function to view examples of shinyBS functionality. Will run the examples
+#'found in the examples sections of shinyBS documentation. Use this instead of
+#'\code{example}.
+#'
+#'@param family A shinyBS family name
+#'@param display.mode The display mode to use when running the example. See
+#'\code{\link{runApp}}.
+#'@param \dots Other parameters to pass to \code{\link{runApp}}.
+#'
+#'@details
+#'This function is just a wrapper for \code{\link{runApp}} that runs copies of the
+#'examples found in the family documention pages of \code{shinyBS}. By default,
+#'\code{display.mode} is set to \code{showcase} so you can see the code while
+#'the app is running.
+#'
+#'@examples
+#'\dontrun{
+#' bsExample("Alerts")}
+#'@export
+bsExample <- function(family, display.mode = "showcase", ...) {
+
+ exp <- system.file("examples", package="shinyBS")
+ fams <- list.dirs(exp, full.names = FALSE, recursive = FALSE)
+
+ appname <- gsub(" ", "", family, fixed = TRUE)
+ appname <- gsub("_", "", appname, fixed = TRUE)
+
+ if(appname %in% fams) {
+
+ appname <- normalizePath(paste0(exp, "/", appname))
+ shiny::runApp(appname, display.mode = display.mode, ...)
+
+ } else {
+
+ stop("Could not find shinyBS family: ", family, "\nAvailable families are: ", paste0(fams, collapse = ", "))
+
+ }
+
}
\ No newline at end of file
diff --git a/R/bsModal.R b/R/bsModal.R
index 571f788..38d638f 100644
--- a/R/bsModal.R
+++ b/R/bsModal.R
@@ -1,43 +1,62 @@
-#'bsModal
-#'
-#'\code{bsModal} is used within the UI to create a modal window.
-#'
-#'@param id A unique identifier for the modal window
-#'@param title The title to appear at the top of the modal
-#'@param trigger The id of a button or link that will open the modal.
-#'@param \dots UI elements to include within the modal
-#'@param size \bold{Optional} What size should the modal be? (\code{small} or \code{large})
-#'@templateVar item_name bsModal
-#'@templateVar family_name Modals
-#'@template item_details
-#'@template footer
-#'@export
-bsModal <- function(id, title, trigger, ..., size) {
- if(!missing(size)) {
- if(size == "large") {
- size = "modal-lg"
- } else if(size == "small") {
- size = "modal-sm"
- }
- size <- paste("modal-dialog", size)
- } else {
- size <- "modal-dialog"
- }
- bsTag <- shiny::tags$div(class = "modal sbs-modal fade", id = id, tabindex = "-1", "data-sbs-trigger" = trigger,
- shiny::tags$div(class = size,
- shiny::tags$div(class = "modal-content",
- shiny::tags$div(class = "modal-header",
- shiny::tags$button(type = "button", class = "close", "data-dismiss" = "modal", shiny::tags$span(shiny::HTML("×"))),
- shiny::tags$h4(class = "modal-title", title)
- ),
- shiny::tags$div(class = "modal-body", list(...)),
- shiny::tags$div(class = "modal-footer",
- shiny::tags$button(type = "button", class = "btn btn-default", "data-dismiss" = "modal", "Close")
- )
- )
- )
- )
-
- htmltools::attachDependencies(bsTag, shinyBSDep)
-
-}
+#'bsModal
+#'
+#'\code{bsModal} is used within the UI to create a modal window.
+#'
+#'@param id A unique identifier for the modal window
+#'@param title The title to appear at the top of the modal
+#'@param trigger The id of a button or link that will open the modal.
+#'@param \dots UI elements to include within the modal
+#'@param size \bold{Optional} What size should the modal be? (\code{small} or \code{large})
+#'@param footer A \code{list} of shiny UI elements to be added to the footer of the modal.
+#'@param close.button Should a close button be added to the footer of the modal?
+#'@param width An optional width argument for the modal. Must include units. Only applied if \code{size} is missing.
+#'@templateVar item_name bsModal
+#'@templateVar family_name Modals
+#'@template item_details
+#'@template footer
+#'@export
+bsModal <- function(id, title, trigger, ..., size, footer = NULL, close.button = TRUE, width = NULL) {
+ if(!missing(size)) {
+ if(size == "large") {
+ size = "modal-lg"
+ } else if(size == "small") {
+ size = "modal-sm"
+ }
+ size <- paste("modal-dialog", size)
+ width = NULL
+ } else {
+ size <- "modal-dialog"
+ }
+
+ if(is.null(footer)) {
+ footer <- tagList()
+ }
+
+ if(close.button) {
+ footer <- shiny::tagAppendChild(footer, tagList(shiny::tags$button(type = "button", class = "btn btn-default", "data-dismiss" = "modal", "Close")))
+ }
+
+ bsTag <- shiny::tags$div(class = size,
+ shiny::tags$div(class = "modal-content",
+ shiny::tags$div(class = "modal-header",
+ shiny::tags$button(type = "button", class = "close", "data-dismiss" = "modal", shiny::tags$span(shiny::HTML("×"))),
+ shiny::tags$h4(class = "modal-title", title)
+ ),
+ shiny::tags$div(class = "modal-body", list(...)),
+ shiny::tags$div(class = "modal-footer",
+ footer
+ )
+ )
+ )
+
+ if(!is.null(width)) {
+ bsTag <- addAttribs(bsTag, style = paste0("width: ", width, " !important;"))
+ }
+
+ bsTag <- shiny::tags$div(class = "modal sbs-modal fade", id = id, tabindex = "-1", "data-sbs-trigger" = trigger,
+ bsTag
+ )
+
+ htmltools::attachDependencies(bsTag, shinyBSDep)
+
+}
diff --git a/R/bsPopover.R b/R/bsPopover.R
index fffdaf9..28f190a 100644
--- a/R/bsPopover.R
+++ b/R/bsPopover.R
@@ -1,26 +1,26 @@
-#'bsPopover
-#'
-#'\code{bsPopover} is used within the UI of an app to add a popover to a Shiny
-#'input or output.
-#'
-#'@param id The id of the element to attach the popover to.
-#'@param title The title of the popover.
-#'@param content The main content of the popover.
-#'@param placement Where the popover should appear relative to its target
-#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
-#'@param trigger What action should cause the popover to appear? (\code{hover},
-#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
-#'@param options A named list of additional options to be set on the popover.
-#'
-#'@templateVar item_name bsPopover
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-bsPopover <- function(id, title, content, placement="bottom", trigger="hover", options = NULL) {
-
- options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content)
-
- createTooltipOrPopoverOnUI(id, "popover", options)
-
+#'bsPopover
+#'
+#'\code{bsPopover} is used within the UI of an app to add a popover to a Shiny
+#'input or output.
+#'
+#'@param id The id of the element to attach the popover to.
+#'@param title The title of the popover.
+#'@param content The main content of the popover.
+#'@param placement Where the popover should appear relative to its target
+#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
+#'@param trigger What action should cause the popover to appear? (\code{hover},
+#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
+#'@param options A named list of additional options to be set on the popover.
+#'
+#'@templateVar item_name bsPopover
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+bsPopover <- function(id, title, content, placement="bottom", trigger="hover", options = NULL) {
+
+ options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content)
+
+ createTooltipOrPopoverOnUI(id, "popover", options)
+
}
\ No newline at end of file
diff --git a/R/bsTooltip.R b/R/bsTooltip.R
index d897323..ae04f6e 100644
--- a/R/bsTooltip.R
+++ b/R/bsTooltip.R
@@ -1,25 +1,25 @@
-#'bsTooltip
-#'
-#'\code{bsTooltip} is used within the UI of an app to add a tooltip to a Shiny
-#'input or output.
-#'
-#'@param id The id of the element to attach the tooltip to.
-#'@param title The content of the tooltip.
-#'@param placement Where the tooltip should appear relative to its target
-#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
-#'@param trigger What action should cause the tooltip to appear? (\code{hover},
-#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
-#'@param options A named list of additional options to be set on the tooltip.
-#'
-#'@templateVar item_name bsTooltip
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-bsTooltip <- function(id, title, placement="bottom", trigger="hover", options = NULL) {
-
- options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options)
-
- createTooltipOrPopoverOnUI(id, "tooltip", options)
-
+#'bsTooltip
+#'
+#'\code{bsTooltip} is used within the UI of an app to add a tooltip to a Shiny
+#'input or output.
+#'
+#'@param id The id of the element to attach the tooltip to.
+#'@param title The content of the tooltip.
+#'@param placement Where the tooltip should appear relative to its target
+#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
+#'@param trigger What action should cause the tooltip to appear? (\code{hover},
+#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
+#'@param options A named list of additional options to be set on the tooltip.
+#'
+#'@templateVar item_name bsTooltip
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+bsTooltip <- function(id, title, placement="bottom", trigger="hover", options = NULL) {
+
+ options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options)
+
+ createTooltipOrPopoverOnUI(id, "tooltip", options)
+
}
\ No newline at end of file
diff --git a/R/bsTypeahead.R b/R/bsTypeahead.R
new file mode 100644
index 0000000..bd05652
--- /dev/null
+++ b/R/bsTypeahead.R
@@ -0,0 +1,41 @@
+#'bsTypeahead
+#'
+#'\code{typeaheadInput} creates a textinput with type ahead function buttons.
+#'
+#'@param inputId Input variable to assign the control's value to
+#'@param label Display label for the control
+#'@param value Initial value
+#'@param choices Array of strings to match against. Can also be JavaScript
+#' function. Use htmlwidgets::JS() to indicate JavaScript. The length of \code{choices} must no exceed 131370.
+#'@param items The max number of items to display in the dropdown. Can also be
+#' set to 'all'
+#'@param minLength The minimum character length needed before triggering
+#' autocomplete suggestions. You can set it to 0 so suggestion are shown even
+#' when there is no text when lookup function is called.
+#'@seealso \code{\link{updateTypeaheadInput}}
+#'@export
+bsTypeahead <- function(inputId, label, value = "", choices, items = 8, minLength = 1) {
+ if(!is.null(choices)) {
+ if(length(choices) > 131370) {
+ warning("Due to a limitation of the Bootstrap2 Typeahead JavaScript library the length of 'choices' must not exceed 2 ^ 17 - 2!");
+ }
+ }
+ if(!'JS_EVAL' %in% class(choices)) {
+ choices <- jsonlite::toJSON(choices);
+ }
+ typeahead <- shiny::tagList(
+ shiny::div(class = 'form-group shiny-input-container',
+ shiny::tags$label(label, `for` = inputId),
+ shiny::tags$input(id = inputId, type="text",
+ class="form-control shiny-bound-input typeahead",
+ "data-provide" = "typeahead", autocomplete="off",
+ value = value),
+ shiny::tags$script(paste0("$('#", inputId, "').typeahead({source: ", choices, ",
+ items: ", items, ",
+ minLength: ", minLength, "})"))
+ )
+ )
+
+ htmltools::attachDependencies(typeahead, typeaheadDep)
+
+}
\ No newline at end of file
diff --git a/R/closeAlert.R b/R/closeAlert.R
index e23d3eb..f96b328 100644
--- a/R/closeAlert.R
+++ b/R/closeAlert.R
@@ -1,18 +1,18 @@
-#'closeAlert
-#'
-#'\code{closeAlert} is used within your Server logic to close an alert that you
-#'created with \code{\link{createAlert}}.
-#'
-#'@param alertId The id of the alert to be dismissed.
-#'@inheritParams createAlert
-#'
-#'@templateVar item_name closeAlert
-#'@templateVar family_name Alerts
-#'@template item_details
-#'@template footer
-#'@export
-closeAlert <- function(session, alertId) {
-
- session$sendCustomMessage(type="bsAlertClose", alertId)
-
+#'closeAlert
+#'
+#'\code{closeAlert} is used within your Server logic to close an alert that you
+#'created with \code{\link{createAlert}}.
+#'
+#'@param alertId The id of the alert to be dismissed.
+#'@inheritParams createAlert
+#'
+#'@templateVar item_name closeAlert
+#'@templateVar family_name Alerts
+#'@template item_details
+#'@template footer
+#'@export
+closeAlert <- function(session, alertId) {
+
+ session$sendCustomMessage(type="bsAlertClose", alertId)
+
}
\ No newline at end of file
diff --git a/R/createAlert.R b/R/createAlert.R
index 41f02ea..16d8807 100644
--- a/R/createAlert.R
+++ b/R/createAlert.R
@@ -1,30 +1,30 @@
-#'createAlert
-#'
-#'\code{createAlert} is used within the Server logic of your Shiny app to display
-#'an alert to the user.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param anchorId The unique identifier of the anchor where the alert should be
-#'displayed.
-#'@param alertId \bold{Optional} A unique identifier for the Alert.
-#'@param title \bold{Optional} A title for the Alert.
-#'@param content The main body of the Alert. HTML tags are allowed.
-#'@param style A bootstrap style to apply. Defaults to \code{info}.
-#'@param dismiss \code{logical} Should the Alert be user dismissable? Defaults to \code{TRUE}.
-#'@param append \code{logical} Should the Alert be appended below existing Alerts? Default to \code{TRUE}.
-#'
-#'@templateVar item_name createAlert
-#'@templateVar family_name Alerts
-#'@template item_details
-#'@template footer
-#'@export
-createAlert <- function(session, anchorId, alertId = NULL, title=NULL,
- content=NULL, style=NULL, dismiss=TRUE, append=TRUE) {
-
- data <- dropNulls(list(id = anchorId, alertId = alertId, title = title,
- content = content, style = style, dismiss = dismiss,
- append = append))
-
- session$sendCustomMessage(type="bsAlertCreate", data)
-
-}
+#'createAlert
+#'
+#'\code{createAlert} is used within the Server logic of your Shiny app to display
+#'an alert to the user.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param anchorId The unique identifier of the anchor where the alert should be
+#'displayed.
+#'@param alertId \bold{Optional} A unique identifier for the Alert.
+#'@param title \bold{Optional} A title for the Alert.
+#'@param content The main body of the Alert. HTML tags are allowed.
+#'@param style A bootstrap style to apply. Defaults to \code{info}.
+#'@param dismiss \code{logical} Should the Alert be user dismissable? Defaults to \code{TRUE}.
+#'@param append \code{logical} Should the Alert be appended below existing Alerts? Default to \code{TRUE}.
+#'
+#'@templateVar item_name createAlert
+#'@templateVar family_name Alerts
+#'@template item_details
+#'@template footer
+#'@export
+createAlert <- function(session, anchorId, alertId = NULL, title=NULL,
+ content=NULL, style=NULL, dismiss=TRUE, append=TRUE) {
+
+ data <- dropNulls(list(id = anchorId, alertId = alertId, title = title,
+ content = content, style = style, dismiss = dismiss,
+ append = append))
+
+ session$sendCustomMessage(type="bsAlertCreate", data)
+
+}
diff --git a/R/misc.R b/R/misc.R
index 73c4174..3238633 100644
--- a/R/misc.R
+++ b/R/misc.R
@@ -1,50 +1,34 @@
-.onAttach <- function(...) {
-
- # Create link to javascript and css files for package
- shiny::addResourcePath("sbs", system.file("www", package="shinyBS"))
-
-}
-
-shinyBSDep <- htmltools::htmlDependency("shinyBS", packageVersion("shinyBS"), src = c("href" = "sbs"), script = "shinyBS.js", stylesheet = "shinyBS.css")
-
-# Copy of dropNulls function for shiny to avoid using shiny:::dropNulls
-dropNulls <- function(x) {
- x[!vapply(x, is.null, FUN.VALUE = logical(1))]
-}
-
-# Takes a tag and removes any classes in the remove argument
-removeClass <- function(tag, remove) {
-
- if(length(remove) == 1) remove <- strsplit(remove, " ", fixed = TRUE)[[1]]
- class <- strsplit(tag$attribs$class, " ", fixed = TRUE)[[1]]
- class <- class[!(class %in% remove)]
- tag$attribs$class <- paste(class, collapse = " ")
-
- return(tag)
-
-}
-
-addClass <- function(tag, add) {
- tag$attribs$class <- paste(tag$attribs$class, add)
- return(tag)
-}
-
-addAttribs <- function(tag, ...) {
- a <- list(...)
- for(i in seq(length(a))) {
- tag$attribs[names(a)[i]] = a[[i]]
- }
- return(tag)
-}
-
-removeAttribs <- function(tag, ...) {
- a <- list(...)
- for(i in seq(length(a))) {
- tags$attribs[a[[i]]] = NULL
- }
- return(tag)
-}
-
-getAttribs <- function(tag) {
- tag$attribs
-}
+.onAttach <- function(...) {
+
+ # Create link to javascript and css files for package
+ shiny::addResourcePath("sbs", system.file("www", package="shinyBS"))
+
+}
+
+shinyBSDep <- htmltools::htmlDependency("shinyBS", packageVersion("shinyBS"), src = c("href" = "sbs"), script = "shinyBS.js", stylesheet = "shinyBS.css")
+typeaheadDep <- htmltools::htmlDependency("shinyBS", packageVersion("shinyBS"), src = c("href" = "sbs"), script = c("bootstrap3-typeahead.js", "typeahead_inputbinding.js"));
+
+# Copy of dropNulls function for shiny to avoid using shiny:::dropNulls
+dropNulls <- function(x) {
+ x[!vapply(x, is.null, FUN.VALUE = logical(1))]
+}
+
+addAttribs <- function(tag, ...) {
+ a <- list(...)
+ for(i in seq(length(a))) {
+ tag$attribs[names(a)[i]] = a[[i]]
+ }
+ return(tag)
+}
+
+removeAttribs <- function(tag, ...) {
+ a <- list(...)
+ for(i in seq(length(a))) {
+ tags$attribs[a[[i]]] = NULL
+ }
+ return(tag)
+}
+
+getAttribs <- function(tag) {
+ tag$attribs
+}
diff --git a/R/popify.R b/R/popify.R
index e1ada47..1020145 100644
--- a/R/popify.R
+++ b/R/popify.R
@@ -1,36 +1,36 @@
-#'popify
-#'
-#'\code{popify} can be wrapped around any shiny UI element to add a popover to the
-#'wrapped element. This should be a safer way to add popovers to elements created with
-#'\code{\link{renderUI}}.
-#'
-#'@param el A shiny UI element.
-#'@param title The title of the popover.
-#'@param content The main content of the popover.
-#'@param placement Where the popover should appear relative to its target
-#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
-#'@param trigger What action should cause the popover to appear? (\code{hover},
-#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
-#'@param options A named list of additional options to be set on the popover.
-#'
-#'@templateVar item_name popify
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-popify <- function(el, title, content, placement="bottom", trigger="hover", options = NULL) {
-
- id <- el$attribs$id
-
- if(is.null(id)) {
- id <- paste0("tipify", as.integer(runif(1, 1, 10000000)))
- el <- addAttribs(el, id = id)
- }
-
- options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content)
-
- script <- createTooltipOrPopoverOnUI(id, "popover", options)
-
- return(shiny::tagList(el, script))
-
+#'popify
+#'
+#'\code{popify} can be wrapped around any shiny UI element to add a popover to the
+#'wrapped element. This should be a safer way to add popovers to elements created with
+#'\code{\link{renderUI}}.
+#'
+#'@param el A shiny UI element.
+#'@param title The title of the popover.
+#'@param content The main content of the popover.
+#'@param placement Where the popover should appear relative to its target
+#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
+#'@param trigger What action should cause the popover to appear? (\code{hover},
+#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
+#'@param options A named list of additional options to be set on the popover.
+#'
+#'@templateVar item_name popify
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+popify <- function(el, title, content, placement="bottom", trigger="hover", options = NULL) {
+
+ id <- el$attribs$id
+
+ if(is.null(id)) {
+ id <- paste0("tipify", as.integer(runif(1, 1, 10000000)))
+ el <- addAttribs(el, id = id)
+ }
+
+ options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options, content)
+
+ script <- createTooltipOrPopoverOnUI(id, "popover", options)
+
+ return(shiny::tagList(el, script))
+
}
\ No newline at end of file
diff --git a/R/removePopover.R b/R/removePopover.R
index 0612a57..024d1de 100644
--- a/R/removePopover.R
+++ b/R/removePopover.R
@@ -1,18 +1,18 @@
-#'removePopover
-#'
-#'\code{removePopover} is used within the Server logic of an app to remove an
-#'existing popover from a Shiny input or output.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param id The id of the element to remove the popover from.
-#'
-#'@templateVar item_name removePopover
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-removePopover <- function(session, id) {
-
- session$sendCustomMessage(type="updateTooltipOrPopover", list(action = "remove", type = "popover", id = id))
-
+#'removePopover
+#'
+#'\code{removePopover} is used within the Server logic of an app to remove an
+#'existing popover from a Shiny input or output.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param id The id of the element to remove the popover from.
+#'
+#'@templateVar item_name removePopover
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+removePopover <- function(session, id) {
+
+ session$sendCustomMessage(type="updateTooltipOrPopover", list(action = "remove", type = "popover", id = id))
+
}
\ No newline at end of file
diff --git a/R/removeTooltip.R b/R/removeTooltip.R
index d820e3e..51ae00e 100644
--- a/R/removeTooltip.R
+++ b/R/removeTooltip.R
@@ -1,18 +1,18 @@
-#'removeTooltip
-#'
-#'\code{removeTooltip} is used within the Server logic of an app to remove an
-#'existing tooltip from a Shiny input or output.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param id The id of the element to remove the tooltip from.
-#'
-#'@templateVar item_name removeTooltip
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-removeTooltip <- function(session, id) {
-
- session$sendCustomMessage(type="updateTooltipOrPopover", list(action = "remove", type = "tooltip", id = id))
-
+#'removeTooltip
+#'
+#'\code{removeTooltip} is used within the Server logic of an app to remove an
+#'existing tooltip from a Shiny input or output.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param id The id of the element to remove the tooltip from.
+#'
+#'@templateVar item_name removeTooltip
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+removeTooltip <- function(session, id) {
+
+ session$sendCustomMessage(type="updateTooltipOrPopover", list(action = "remove", type = "tooltip", id = id))
+
}
\ No newline at end of file
diff --git a/R/tagManipulators.R b/R/tagManipulators.R
new file mode 100644
index 0000000..a2ad0fe
--- /dev/null
+++ b/R/tagManipulators.R
@@ -0,0 +1,96 @@
+addClass <- function(tag, class) {
+
+ if(!is.null(class)) {
+ tag$attribs$class <- trimws(paste(tag$attribs$class, class), "both")
+ }
+
+ tag
+
+}
+
+removeClass <- function(tag, class) {
+
+ if(!is.null(class) & !is.null(tag$attribs$class)) {
+ cls <- strsplit(tag$attribs$class, " ")[[1]]
+ cls <- cls[cls != class]
+ tag$attribs$class <- paste(cls, collapse = " ")
+ }
+
+ tag
+
+}
+
+hasClass <- function(tag, class) {
+ if(!is.null(class) & !is.null(tag$attribs$class)) {
+ class %in% strsplit(tag$attribs$class, " ")[[1]]
+ } else {
+ FALSE
+ }
+}
+
+checkClass <- function(class, include) {
+ if(!include) class <- NULL
+ class
+}
+
+buildClass <- function(prefix, variable) {
+ if(!is.null(variable)) {
+ variable <- paste0(prefix, variable)
+ }
+ variable
+}
+
+addStyles <- function(tag, ..., .dots) {
+
+ new_styles <- list(...)
+
+ if(!missing(.dots)) {
+ new_styles <- c(new_styles, .dots)
+ }
+
+ if(!is.null(tag$attribs$style)) {
+ styles <- parseStyles(tag$attribs$style)
+ } else {
+ styles <- list()
+ }
+
+ for(i in seq_along(new_styles)) {
+ styles[[names(new_styles)[i]]] <- new_styles[[i]]
+ }
+
+ tag$attribs$style <- writeStyles(styles)
+
+ tag
+
+}
+
+removeStyles <- function(tag, ...) {
+
+ if(!is.null(tag$attribs$style)) {
+ styleList <- list(...)
+ styles <- parseStyles(tag$attribs$style)
+ styles <- styles[!names(styles) %in% styleList]
+ tag$attribs$style <- writeStyles(styles)
+ }
+
+ tag
+
+}
+
+parseStyles <- function(styleString) {
+
+ styles <- trimws(strsplit(styleString, ";")[[1]])
+ styles <- strsplit(styles, ":")
+ style_names <- sapply(styles, function(s) trimws(s[1]))
+ styles <- lapply(styles, function(s) trimws(s[2]))
+ names(styles) <- style_names
+
+ return(styles)
+
+}
+
+writeStyles <- function(styleList) {
+
+ paste(names(styleList), styleList, sep = ": ", collapse = "; ")
+
+}
diff --git a/R/tipify.R b/R/tipify.R
index fc6c3ec..659d53f 100644
--- a/R/tipify.R
+++ b/R/tipify.R
@@ -1,35 +1,35 @@
-#'tipify
-#'
-#'\code{tipify} can be wrapped around any shiny UI element to add a tooltip to the
-#'wrapped element. This should be a safer way to add tooltips to elements created with
-#'\code{\link{renderUI}}.
-#'
-#'@param el A shiny UI element.
-#'@param title The content of the tooltip.
-#'@param placement Where the tooltip should appear relative to its target
-#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
-#'@param trigger What action should cause the tooltip to appear? (\code{hover},
-#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
-#'@param options A named list of additional options to be set on the tooltip.
-#'
-#'@templateVar item_name tipify
-#'@templateVar family_name Tooltips_and_Popovers
-#'@template item_details
-#'@template footer
-#'@export
-tipify <- function(el, title, placement="bottom", trigger="hover", options = NULL) {
-
- id <- el$attribs$id
-
- if(is.null(id)) {
- id <- paste0("tipify", as.integer(runif(1, 1, 10000000)))
- el <- addAttribs(el, id = id)
- }
-
- options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options)
-
- script <- createTooltipOrPopoverOnUI(id, "tooltip", options)
-
- return(shiny::tagList(el, script))
-
+#'tipify
+#'
+#'\code{tipify} can be wrapped around any shiny UI element to add a tooltip to the
+#'wrapped element. This should be a safer way to add tooltips to elements created with
+#'\code{\link{renderUI}}.
+#'
+#'@param el A shiny UI element.
+#'@param title The content of the tooltip.
+#'@param placement Where the tooltip should appear relative to its target
+#'(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.
+#'@param trigger What action should cause the tooltip to appear? (\code{hover},
+#'\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.
+#'@param options A named list of additional options to be set on the tooltip.
+#'
+#'@templateVar item_name tipify
+#'@templateVar family_name Tooltips_and_Popovers
+#'@template item_details
+#'@template footer
+#'@export
+tipify <- function(el, title, placement="bottom", trigger="hover", options = NULL) {
+
+ id <- el$attribs$id
+
+ if(is.null(id)) {
+ id <- paste0("tipify", as.integer(runif(1, 1, 10000000)))
+ el <- addAttribs(el, id = id)
+ }
+
+ options = buildTooltipOrPopoverOptionsList(title, placement, trigger, options)
+
+ script <- createTooltipOrPopoverOnUI(id, "tooltip", options)
+
+ return(shiny::tagList(el, script))
+
}
\ No newline at end of file
diff --git a/R/toggleModal.R b/R/toggleModal.R
index 7729688..3621535 100644
--- a/R/toggleModal.R
+++ b/R/toggleModal.R
@@ -1,19 +1,19 @@
-#'toggleModal
-#'
-#'\code{toggleModal} is used within your Server logic to open or close a modal
-#'window.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param modalId The id of the modal window you want to open/close
-#'@param toggle Should the modal window \code{open}, \code{close}, or \code{toggle}?
-#'
-#'@templateVar item_name toggleModal
-#'@templateVar family_name Modals
-#'@template item_details
-#'@template footer
-#'@export
-toggleModal <- function(session, modalId, toggle = "toggle") {
-
- session$sendInputMessage(modalId, list(toggle = toggle))
-
+#'toggleModal
+#'
+#'\code{toggleModal} is used within your Server logic to open or close a modal
+#'window.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param modalId The id of the modal window you want to open/close
+#'@param toggle Should the modal window \code{open}, \code{close}, or \code{toggle}?
+#'
+#'@templateVar item_name toggleModal
+#'@templateVar family_name Modals
+#'@template item_details
+#'@template footer
+#'@export
+toggleModal <- function(session, modalId, toggle = "toggle") {
+
+ session$sendInputMessage(modalId, list(toggle = toggle))
+
}
\ No newline at end of file
diff --git a/R/updateButton.R b/R/updateButton.R
index c1c8899..03f0c78 100644
--- a/R/updateButton.R
+++ b/R/updateButton.R
@@ -1,37 +1,37 @@
-#'updateButton
-#'
-#'\code{updateButton} is used in your Server logic to update the style or state
-#'of a button.
-#'
-#'@inheritParams bsButton
-#'@param session The session object passed to function given to shinyServer.
-#'
-#'@details Because of the way it is coded, \code{updateButton} may work on buttons not
-#'created by \code{\link{bsButton}} such as \code{\link{submitButton}}.
-#'
-#'See \code{\link{Buttons}} for more information about how to use \code{updateButton} with the rest of the Buttons family.
-#'
-#'@templateVar item_name updateButton
-#'@templateVar family_name Buttons
-#'@template item_details
-#'@template footer
-#'@export
-updateButton <- function(session, inputId, label = NULL, icon = NULL, value = NULL, style = NULL,
- size = NULL, block = NULL, disabled = NULL) {
-
- if(!is.null(icon)) icon <- as.character(icon)
-
- if(!is.null(size)) {
- size <- switch(size,
- "extra-small" = "btn-xs",
- "small" = "btn-sm",
- "large" = "btn-lg",
- "default" = "default")
- }
-
- data <- dropNulls(list(id = inputId, label = label, icon = icon, value = value, style = style,
- size = size, block = block, disabled = disabled))
-
- session$sendCustomMessage("bsButtonUpdate", data)
-
+#'updateButton
+#'
+#'\code{updateButton} is used in your Server logic to update the style or state
+#'of a button.
+#'
+#'@inheritParams bsButton
+#'@param session The session object passed to function given to shinyServer.
+#'
+#'@details Because of the way it is coded, \code{updateButton} may work on buttons not
+#'created by \code{\link{bsButton}} such as \code{\link{submitButton}}.
+#'
+#'See \code{\link{Buttons}} for more information about how to use \code{updateButton} with the rest of the Buttons family.
+#'
+#'@templateVar item_name updateButton
+#'@templateVar family_name Buttons
+#'@template item_details
+#'@template footer
+#'@export
+updateButton <- function(session, inputId, label = NULL, icon = NULL, value = NULL, style = NULL,
+ size = NULL, block = NULL, disabled = NULL) {
+
+ if(!is.null(icon)) icon <- as.character(icon)
+
+ if(!is.null(size)) {
+ size <- switch(size,
+ "extra-small" = "btn-xs",
+ "small" = "btn-sm",
+ "large" = "btn-lg",
+ "default" = "default")
+ }
+
+ data <- dropNulls(list(id = inputId, label = label, icon = icon, value = value, style = style,
+ size = size, block = block, disabled = disabled))
+
+ session$sendCustomMessage("bsButtonUpdate", data)
+
}
\ No newline at end of file
diff --git a/R/updateCollapse.R b/R/updateCollapse.R
index 8bfde96..000dff2 100644
--- a/R/updateCollapse.R
+++ b/R/updateCollapse.R
@@ -1,27 +1,27 @@
-#'updateCollapse
-#'
-#'\code{updateCollapse} is used within the Server logic of your Shiny app to
-#'modify a Collapse after load.
-#'
-#'@param session The session object passed to function given to shinyServer.
-#'@param id The id of the Collapse object you want to change.
-#'@param open A vector of \code{value} (or \code{title} if no \code{value} was
-#'provided) values identifying the panels you want to open.
-#'@param close A vector of \code{value} (or \code{title} if no \code{value} was
-#'provided) values identifying the panels you want to close.
-#'@param style A named list of Bootstrap styles (\code{primary}, \code{danger}, \code{info},
-#'\code{warning}, \code{success}, or \code{default}). The names should correspond
-#'to the \code{value} (or \code{title} if no \code{value} was provided) of the
-#'\code{\link{bsCollapsePanel}} you want to change.
-#'
-#'@templateVar item_name updateCollapse
-#'@templateVar family_name Collapses
-#'@template item_details
-#'@template footer
-#'@export
-updateCollapse <- function(session, id, open = NULL, close = NULL, style = NULL) {
-
- data <- dropNulls(list(open = open, close = close, style = style))
- session$sendInputMessage(id, data)
-
+#'updateCollapse
+#'
+#'\code{updateCollapse} is used within the Server logic of your Shiny app to
+#'modify a Collapse after load.
+#'
+#'@param session The session object passed to function given to shinyServer.
+#'@param id The id of the Collapse object you want to change.
+#'@param open A vector of \code{value} (or \code{title} if no \code{value} was
+#'provided) values identifying the panels you want to open.
+#'@param close A vector of \code{value} (or \code{title} if no \code{value} was
+#'provided) values identifying the panels you want to close.
+#'@param style A named list of Bootstrap styles (\code{primary}, \code{danger}, \code{info},
+#'\code{warning}, \code{success}, or \code{default}). The names should correspond
+#'to the \code{value} (or \code{title} if no \code{value} was provided) of the
+#'\code{\link{bsCollapsePanel}} you want to change.
+#'
+#'@templateVar item_name updateCollapse
+#'@templateVar family_name Collapses
+#'@template item_details
+#'@template footer
+#'@export
+updateCollapse <- function(session, id, open = NULL, close = NULL, style = NULL) {
+
+ data <- dropNulls(list(open = open, close = close, style = style))
+ session$sendInputMessage(id, data)
+
}
\ No newline at end of file
diff --git a/R/updateTypeahead.R b/R/updateTypeahead.R
new file mode 100644
index 0000000..8acadba
--- /dev/null
+++ b/R/updateTypeahead.R
@@ -0,0 +1,23 @@
+#'updateTypeahead
+#'
+#'\code{updateTypeahead} Update a typeaheadInput buttons.
+#'@param session The session object passed to function given to shinyServer.
+#'@param inputId Input variable to assign the control's value to
+#'@param label Display label for the control
+#'@param value Initial value
+#'@param choices Array of strings to match against. Can also be JavaScript
+#' function. Use htmlwidgets::JS() to indicate JavaScript.
+#'@seealso \code{\link{typeaheadInput}}
+#'@export
+updateTypeahead<- function(session, inputId, label=NULL, value=NULL, choices=NULL) {
+
+ if(!is.null(choices)) {
+ if(length(choices) > 131370) {
+ warning("Due to a limitation of the Bootstrap2 Typeahead JavaScript library the length of 'choices' must not exceed 2 ^ 17 - 2!");
+ }
+ }
+
+ data <- dropNulls(list(id = inputId, label=label, value=value, choices=choices))
+ session$sendCustomMessage("typeaheadUpdate", data)
+
+}
diff --git a/debian/changelog b/debian/changelog
index b59c82d..e680d93 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+r-cran-shinybs (0.61.1+git20160701.1.c329f8c-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Mon, 17 Oct 2022 21:09:38 -0000
+
r-cran-shinybs (0.61.1-1) unstable; urgency=medium
* Team upload.
diff --git a/inst/examples/Alerts/server.R b/inst/examples/Alerts/server.R
index 19ba436..b1eee03 100644
--- a/inst/examples/Alerts/server.R
+++ b/inst/examples/Alerts/server.R
@@ -1,22 +1,22 @@
-library(shiny)
-library(shinyBS)
-shinyServer(
- function(input, output, session) {
- output$exampleOutput <- renderText({
- num1 <- as.numeric(input$num1)
- num2 <- as.numeric(input$num2)
-
- if(is.na(num1) | is.na(num2)) {
- createAlert(session, "alert", "exampleAlert", title = "Oops",
- content = "Both inputs should be numeric.", append = FALSE)
- } else if(num2 == 0) {
- createAlert(session, "alert", "exampleAlert", title = "Oops",
- content = "You cannot divide by 0.", append = FALSE)
- } else {
- closeAlert(session, "exampleAlert")
- return(num1/num2)
- }
-
- })
- }
-)
+library(shiny)
+library(shinyBS)
+shinyServer(
+ function(input, output, session) {
+ output$exampleOutput <- renderText({
+ num1 <- as.numeric(input$num1)
+ num2 <- as.numeric(input$num2)
+
+ if(is.na(num1) | is.na(num2)) {
+ createAlert(session, "alert", "exampleAlert", title = "Oops",
+ content = "Both inputs should be numeric.", append = FALSE)
+ } else if(num2 == 0) {
+ createAlert(session, "alert", "exampleAlert", title = "Oops",
+ content = "You cannot divide by 0.", append = FALSE)
+ } else {
+ closeAlert(session, "exampleAlert")
+ return(num1/num2)
+ }
+
+ })
+ }
+)
diff --git a/inst/examples/Alerts/ui.R b/inst/examples/Alerts/ui.R
index 54aed3d..6378a91 100644
--- a/inst/examples/Alerts/ui.R
+++ b/inst/examples/Alerts/ui.R
@@ -1,13 +1,13 @@
-library(shiny)
-library(shinyBS)
- fluidPage(
- sidebarLayout(
- sidebarPanel(textInput("num1", NULL, value = 100),
- "divided by", textInput("num2", NULL, value = 20),
- "equals", textOutput("exampleOutput")),
- mainPanel(
- bsAlert("alert")
- )
- )
-)
-
+library(shiny)
+library(shinyBS)
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(textInput("num1", NULL, value = 100),
+ "divided by", textInput("num2", NULL, value = 20),
+ "equals", textOutput("exampleOutput")),
+ mainPanel(
+ bsAlert("alert")
+ )
+ )
+)
+
diff --git a/inst/examples/Buttons/server.R b/inst/examples/Buttons/server.R
index 95ec313..e0a21c1 100644
--- a/inst/examples/Buttons/server.R
+++ b/inst/examples/Buttons/server.R
@@ -1,49 +1,49 @@
-library(shiny)
-library(shinyBS)
-shinyServer(
- function(input, output, session) {
- observeEvent(input$togOne, ({
- updateButton(session, "actOne", disabled = !input$togOne)
- }))
- observeEvent(input$bins, ({
-
- b <- input$bins
- disabled = NULL
- style = "default"
- icon = ""
-
- if(b < 5) {
- disabled = TRUE
- icon <- icon("ban")
- } else {
- disabled = FALSE
- }
-
- if(b < 15 | b > 35) {
- style = "danger"
- } else if(b < 20 | b > 30) {
- style = "warning"
- } else {
- style = "default"
- icon = icon("check")
- }
-
- updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon)
-
- }))
-
- output$exampleText <- renderText({
- input$actTwo
- b <- isolate(input$bins)
- txt = ""
- if((b > 5 & b < 15) | b > 35) {
- txt = "That was dangerous."
- } else if((b > 5 & b < 20) | b > 30) {
- txt = "I warned you about that."
- } else if(b >= 20 & b <= 30) {
- txt = "You have chosen... wisely."
- }
- return(txt)
- })
- }
-)
+library(shiny)
+library(shinyBS)
+shinyServer(
+ function(input, output, session) {
+ observeEvent(input$togOne, ({
+ updateButton(session, "actOne", disabled = !input$togOne)
+ }))
+ observeEvent(input$bins, ({
+
+ b <- input$bins
+ disabled = NULL
+ style = "default"
+ icon = ""
+
+ if(b < 5) {
+ disabled = TRUE
+ icon <- icon("ban")
+ } else {
+ disabled = FALSE
+ }
+
+ if(b < 15 | b > 35) {
+ style = "danger"
+ } else if(b < 20 | b > 30) {
+ style = "warning"
+ } else {
+ style = "default"
+ icon = icon("check")
+ }
+
+ updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon)
+
+ }))
+
+ output$exampleText <- renderText({
+ input$actTwo
+ b <- isolate(input$bins)
+ txt = ""
+ if((b > 5 & b < 15) | b > 35) {
+ txt = "That was dangerous."
+ } else if((b > 5 & b < 20) | b > 30) {
+ txt = "I warned you about that."
+ } else if(b >= 20 & b <= 30) {
+ txt = "You have chosen... wisely."
+ }
+ return(txt)
+ })
+ }
+)
diff --git a/inst/examples/Buttons/ui.R b/inst/examples/Buttons/ui.R
index 3fdf773..7b37a05 100644
--- a/inst/examples/Buttons/ui.R
+++ b/inst/examples/Buttons/ui.R
@@ -1,23 +1,23 @@
-library(shiny)
-library(shinyBS)
- fluidPage(
- sidebarLayout(
- sidebarPanel(
- sliderInput("bins",
- "Move the slider to see its effect on the button below:",
- min = 1,
- max = 50,
- value = 1),
- bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")),
- tags$p("Clicking the first button below changes the disabled state of the second button."),
- bsButton("togOne", label = "Toggle button disabled status",
- block = TRUE, type = "toggle", value = TRUE),
- bsButton("actOne", label = "Block Action Button", block = TRUE)
-
- ),
- mainPanel(
- textOutput("exampleText")
- )
- )
-)
-
+library(shiny)
+library(shinyBS)
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(
+ sliderInput("bins",
+ "Move the slider to see its effect on the button below:",
+ min = 1,
+ max = 50,
+ value = 1),
+ bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")),
+ tags$p("Clicking the first button below changes the disabled state of the second button."),
+ bsButton("togOne", label = "Toggle button disabled status",
+ block = TRUE, type = "toggle", value = TRUE),
+ bsButton("actOne", label = "Block Action Button", block = TRUE)
+
+ ),
+ mainPanel(
+ textOutput("exampleText")
+ )
+ )
+)
+
diff --git a/inst/examples/Collapses/server.R b/inst/examples/Collapses/server.R
index 8e99242..c2fac84 100644
--- a/inst/examples/Collapses/server.R
+++ b/inst/examples/Collapses/server.R
@@ -1,13 +1,13 @@
-library(shiny)
-library(shinyBS)
-shinyServer(
- function(input, output, session) {
- output$genericPlot <- renderPlot(plot(rnorm(100)))
- observeEvent(input$p1Button, ({
- updateCollapse(session, "collapseExample", open = "Panel 1")
- }))
- observeEvent(input$styleSelect, ({
- updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
- }))
- }
-)
+library(shiny)
+library(shinyBS)
+shinyServer(
+ function(input, output, session) {
+ output$genericPlot <- renderPlot(plot(rnorm(100)))
+ observeEvent(input$p1Button, ({
+ updateCollapse(session, "collapseExample", open = "Panel 1")
+ }))
+ observeEvent(input$styleSelect, ({
+ updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
+ }))
+ }
+)
diff --git a/inst/examples/Collapses/ui.R b/inst/examples/Collapses/ui.R
index dff25e5..0dd53a7 100644
--- a/inst/examples/Collapses/ui.R
+++ b/inst/examples/Collapses/ui.R
@@ -1,21 +1,21 @@
-library(shiny)
-library(shinyBS)
- fluidPage(
- sidebarLayout(
- sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
- actionButton("p1Button", "Push Me!"),
- selectInput("styleSelect", "Select style for Panel 1",
- c("default", "primary", "danger", "warning", "info", "success"))
- ),
- mainPanel(
- bsCollapse(id = "collapseExample", open = "Panel 2",
- bsCollapsePanel("Panel 1", "This is a panel with just text ",
- "and has the default style. You can change the style in ",
- "the sidebar.", style = "info"),
- bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
- "and a 'success' style.", plotOutput("genericPlot"), style = "success")
- )
- )
- )
-)
-
+library(shiny)
+library(shinyBS)
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
+ actionButton("p1Button", "Push Me!"),
+ selectInput("styleSelect", "Select style for Panel 1",
+ c("default", "primary", "danger", "warning", "info", "success"))
+ ),
+ mainPanel(
+ bsCollapse(id = "collapseExample", open = "Panel 2",
+ bsCollapsePanel("Panel 1", "This is a panel with just text ",
+ "and has the default style. You can change the style in ",
+ "the sidebar.", style = "info"),
+ bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
+ "and a 'success' style.", plotOutput("genericPlot"), style = "success")
+ )
+ )
+ )
+)
+
diff --git a/inst/examples/Modals/server.R b/inst/examples/Modals/server.R
index 36ec50b..174fde5 100644
--- a/inst/examples/Modals/server.R
+++ b/inst/examples/Modals/server.R
@@ -1,33 +1,33 @@
-library(shiny)
-library(shinyBS)
-shinyServer(
- function(input, output, session) {
-
- output$distPlot <- renderPlot({
-
- x <- faithful[, 2]
- bins <- seq(min(x), max(x), length.out = input$bins + 1)
-
- # draw the histogram with the specified number of bins
- hist(x, breaks = bins, col = 'darkgray', border = 'white')
-
- })
-
- output$distTable <- renderDataTable({
-
- x <- faithful[, 2]
- bins <- seq(min(x), max(x), length.out = input$bins + 1)
-
- # draw the histogram with the specified number of bins
- tab <- hist(x, breaks = bins, plot = FALSE)
- tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
- paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))
- })
- tab <- as.data.frame(do.call(cbind, tab))
- colnames(tab) <- c("Bins", "Counts", "Density")
- return(tab[, 1:3])
-
- }, options = list(pageLength=10))
-
- }
-)
+library(shiny)
+library(shinyBS)
+shinyServer(
+ function(input, output, session) {
+
+ output$distPlot <- renderPlot({
+
+ x <- faithful[, 2]
+ bins <- seq(min(x), max(x), length.out = input$bins + 1)
+
+ # draw the histogram with the specified number of bins
+ hist(x, breaks = bins, col = 'darkgray', border = 'white')
+
+ })
+
+ output$distTable <- renderDataTable({
+
+ x <- faithful[, 2]
+ bins <- seq(min(x), max(x), length.out = input$bins + 1)
+
+ # draw the histogram with the specified number of bins
+ tab <- hist(x, breaks = bins, plot = FALSE)
+ tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
+ paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))
+ })
+ tab <- as.data.frame(do.call(cbind, tab))
+ colnames(tab) <- c("Bins", "Counts", "Density")
+ return(tab[, 1:3])
+
+ }, options = list(pageLength=10))
+
+ }
+)
diff --git a/inst/examples/Modals/ui.R b/inst/examples/Modals/ui.R
index 80723c0..bc0170a 100644
--- a/inst/examples/Modals/ui.R
+++ b/inst/examples/Modals/ui.R
@@ -1,21 +1,21 @@
-library(shiny)
-library(shinyBS)
- fluidPage(
- sidebarLayout(
- sidebarPanel(
- sliderInput("bins",
- "Number of bins:",
- min = 1,
- max = 50,
- value = 30),
- actionButton("tabBut", "View Table")
- ),
-
- mainPanel(
- plotOutput("distPlot"),
- bsModal("modalExample", "Data Table", "tabBut", size = "large",
- dataTableOutput("distTable"))
- )
- )
-)
-
+library(shiny)
+library(shinyBS)
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(
+ sliderInput("bins",
+ "Number of bins:",
+ min = 1,
+ max = 50,
+ value = 30),
+ actionButton("tabBut", "View Table")
+ ),
+
+ mainPanel(
+ plotOutput("distPlot"),
+ bsModal("modalExample", "Data Table", "tabBut", size = "large",
+ dataTableOutput("distTable"))
+ )
+ )
+)
+
diff --git a/inst/examples/TooltipsandPopovers/server.R b/inst/examples/TooltipsandPopovers/server.R
index 4f2a1c3..d7de9e2 100644
--- a/inst/examples/TooltipsandPopovers/server.R
+++ b/inst/examples/TooltipsandPopovers/server.R
@@ -1,30 +1,33 @@
-library(shiny)
-library(shinyBS)
-shinyServer(
- function(input, output, session) {
- output$distPlot <- renderPlot({
-
- # generate bins based on input$bins from ui.R
- x <- faithful[, 2]
- bins <- seq(min(x), max(x), length.out = input$bins + 1)
-
- # draw the histogram with the specified number of bins
- hist(x, breaks = bins, col = 'darkgray', border = 'white')
-
- })
- output$uiExample <- renderUI({
- tags$span(
- popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"),
- "A Pointless Button",
- "This button is <b>pointless</b>. It does not do <em>anything</em>!"),
- tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"),
- "This button is pointless too!")
- )
- })
- addPopover(session, "distPlot", "Data", content = paste0("<p>Waiting time between ",
- "eruptions and the duration of the eruption for the Old Faithful geyser ",
- "in Yellowstone National Park, Wyoming, USA.</p><p>Azzalini, A. and ",
- "Bowman, A. W. (1990). A look at some data on the Old Faithful geyser. ",
- "Applied Statistics 39, 357-365.</p>"), trigger = 'click')
- }
-)
+library(shiny)
+library(shinyBS)
+shinyServer(
+ function(input, output, session) {
+ output$distPlot <- renderPlot({
+
+ # generate bins based on input$bins from ui.R
+ x <- faithful[, 2]
+ bins <- seq(min(x), max(x), length.out = input$bins + 1)
+
+ # draw the histogram with the specified number of bins
+ hist(x, breaks = bins, col = 'darkgray', border = 'white')
+
+ })
+ output$dataTable <- renderDataTable({
+ faithful
+ })
+ output$uiExample <- renderUI({
+ tags$span(
+ popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"),
+ "A Pointless Button",
+ "This button is <b>pointless</b>. It does not do <em>anything</em>!"),
+ tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"),
+ "This button is pointless too!")
+ )
+ })
+ addPopover(session, "distPlot", "Data", content = paste0("<p>Waiting time between ",
+ "eruptions and the duration of the eruption for the Old Faithful geyser ",
+ "in Yellowstone National Park, Wyoming, USA.</p><p>Azzalini, A. and ",
+ "Bowman, A. W. (1990). A look at some data on the Old Faithful geyser. ",
+ "Applied Statistics 39, 357-365.</p>"), trigger = 'click')
+ }
+)
diff --git a/inst/examples/TooltipsandPopovers/ui.R b/inst/examples/TooltipsandPopovers/ui.R
index 6bb17c0..99c2cbc 100644
--- a/inst/examples/TooltipsandPopovers/ui.R
+++ b/inst/examples/TooltipsandPopovers/ui.R
@@ -1,20 +1,24 @@
-library(shiny)
-library(shinyBS)
- fluidPage(
- sidebarLayout(
- sidebarPanel(
- sliderInput("bins",
- "Number of bins:",
- min = 1,
- max = 50,
- value = 30),
- bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
- "right", options = list(container = "body"))
- ),
- mainPanel(
- plotOutput("distPlot"),
- uiOutput("uiExample")
- )
- )
-)
-
+library(shiny)
+library(shinyBS)
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(
+ sliderInput("bins",
+ "Number of bins:",
+ min = 1,
+ max = 50,
+ value = 30),
+ selectInput("pointlessSelect", "Pointless Select", choices = c("A", "B", "C"), selectize = FALSE),
+ bsTooltip("pointlessSelect", "This is another pointless input element, its just here to look pretty."),
+ bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
+ "right", options = list(container = "body"))
+ ),
+ mainPanel(
+ plotOutput("distPlot"),
+ dataTableOutput("dataTable"),
+ uiOutput("uiExample"),
+ bsPopover("dataTable", "A popover", "This is a popover. I hope it works.", placement = "left")
+ )
+ )
+)
+
diff --git a/inst/tests/tipify_test.R b/inst/tests/tipify_test.R
index ee0f99f..1a91ca5 100644
--- a/inst/tests/tipify_test.R
+++ b/inst/tests/tipify_test.R
@@ -1,35 +1,35 @@
-library(shiny)
-library(shinyBS)
-
-shinyApp(
- ui =
- fluidPage(
- tabsetPanel(
- tabPanel("Tab #1",
- plotOutput("genericPlot")
- ),
- tabPanel("Tab #2",
- checkboxInput("showOptions", "Show Options"),
- uiOutput("ui_multiview_customize"),
- plotOutput("multiview_plot")
- )
- )
- ),
- server =
- function(input, output, session) {
- output$genericPlot <- renderPlot(plot(rnorm(1000)))
- output$multiview_plot <- renderPlot(plot(runif(1000)))
- output$ui_multiview_customize <- renderUI({
- if(input$showOptions) {
- bsCollapse(
- bsCollapsePanel(title = "View Options",
- checkboxInput("multiview_checkbox", label = "Include warmup", value = FALSE),
- hr(),
- tipify(downloadButton("download_multiview", "Save as ggplot2 objects"),
- title = "Save ggplot2 object in .RData file.", placement="right")
- )
- )
- }
- })
- }
-)
+library(shiny)
+library(shinyBS)
+
+shinyApp(
+ ui =
+ fluidPage(
+ tabsetPanel(
+ tabPanel("Tab #1",
+ plotOutput("genericPlot")
+ ),
+ tabPanel("Tab #2",
+ checkboxInput("showOptions", "Show Options"),
+ uiOutput("ui_multiview_customize"),
+ plotOutput("multiview_plot")
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+ output$genericPlot <- renderPlot(plot(rnorm(1000)))
+ output$multiview_plot <- renderPlot(plot(runif(1000)))
+ output$ui_multiview_customize <- renderUI({
+ if(input$showOptions) {
+ bsCollapse(
+ bsCollapsePanel(title = "View Options",
+ checkboxInput("multiview_checkbox", label = "Include warmup", value = FALSE),
+ hr(),
+ tipify(downloadButton("download_multiview", "Save as ggplot2 objects"),
+ title = "Save ggplot2 object in .RData file.", placement="right")
+ )
+ )
+ }
+ })
+ }
+)
diff --git a/inst/tests/tipify_test2.R b/inst/tests/tipify_test2.R
index 936f1bf..b6ccf28 100644
--- a/inst/tests/tipify_test2.R
+++ b/inst/tests/tipify_test2.R
@@ -1,46 +1,46 @@
-library(shiny)
-library(shinyBS)
-
-app <- shinyApp(
- ui =
- fluidPage(
- sidebarLayout(
- sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
- actionButton("p1Button", "Push Me!"),
- selectInput("styleSelect", "Select style for Panel 1",
- c("default", "primary", "danger", "warning", "info", "success"))
- ),
- mainPanel(
- bsCollapse(id = "collapseExample", open = "Panel 2",
- bsCollapsePanel("Panel 1", "This is a panel with just text ",
- "and has the default style. You can change the style in ",
- "the sidebar.", style = "info"),
- bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
- "and a 'success' style.", plotOutput("genericPlot"), style = "success")
- ),
-
- uiOutput("tooltip_test"),
- actionButton("test2", "Test2"),
- bsTooltip("test2", title = "Test2", placement="right"),
- tipify(tags$button("Hello"), "Test without ID")
-
- )
- )
- ),
- server =
- function(input, output, session) {
- output$genericPlot <- renderPlot(plot(rnorm(100)))
- observeEvent(input$p1Button, ({
- updateCollapse(session, "collapseExample", open = "Panel 1")
- }))
- observeEvent(input$styleSelect, ({
- updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
- }))
-
- output$tooltip_test <- renderUI({
- tipify(actionButton("test", "Test"), title = "test", placement = "right")
- })
- }
-)
-
+library(shiny)
+library(shinyBS)
+
+app <- shinyApp(
+ ui =
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
+ actionButton("p1Button", "Push Me!"),
+ selectInput("styleSelect", "Select style for Panel 1",
+ c("default", "primary", "danger", "warning", "info", "success"))
+ ),
+ mainPanel(
+ bsCollapse(id = "collapseExample", open = "Panel 2",
+ bsCollapsePanel("Panel 1", "This is a panel with just text ",
+ "and has the default style. You can change the style in ",
+ "the sidebar.", style = "info"),
+ bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
+ "and a 'success' style.", plotOutput("genericPlot"), style = "success")
+ ),
+
+ uiOutput("tooltip_test"),
+ actionButton("test2", "Test2"),
+ bsTooltip("test2", title = "Test2", placement="right"),
+ tipify(tags$button("Hello"), "Test without ID")
+
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+ output$genericPlot <- renderPlot(plot(rnorm(100)))
+ observeEvent(input$p1Button, ({
+ updateCollapse(session, "collapseExample", open = "Panel 1")
+ }))
+ observeEvent(input$styleSelect, ({
+ updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
+ }))
+
+ output$tooltip_test <- renderUI({
+ tipify(actionButton("test", "Test"), title = "test", placement = "right")
+ })
+ }
+)
+
runApp(app)
\ No newline at end of file
diff --git a/inst/www/bootstrap3-typeahead.js b/inst/www/bootstrap3-typeahead.js
new file mode 100644
index 0000000..d824f6d
--- /dev/null
+++ b/inst/www/bootstrap3-typeahead.js
@@ -0,0 +1,476 @@
+/* =============================================================
+ * bootstrap3-typeahead.js v3.1.0
+ * https://github.com/bassjobsen/Bootstrap-3-Typeahead
+ * =============================================================
+ * Original written by @mdo and @fat
+ * =============================================================
+ * Copyright 2014 Bass Jobsen @bassjobsen
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+(function (root, factory) {
+
+ 'use strict';
+
+ // CommonJS module is defined
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = factory(require('jquery'));
+ }
+ // AMD module is defined
+ else if (typeof define === 'function' && define.amd) {
+ define(['jquery'], function ($) {
+ return factory ($);
+ });
+ } else {
+ factory(root.jQuery);
+ }
+
+}(this, function ($) {
+
+ 'use strict';
+ // jshint laxcomma: true
+
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+ * ================================= */
+
+ var Typeahead = function (element, options) {
+ this.$element = $(element);
+ this.options = $.extend({}, $.fn.typeahead.defaults, options);
+ this.matcher = this.options.matcher || this.matcher;
+ this.sorter = this.options.sorter || this.sorter;
+ this.select = this.options.select || this.select;
+ this.autoSelect = typeof this.options.autoSelect == 'boolean' ? this.options.autoSelect : true;
+ this.highlighter = this.options.highlighter || this.highlighter;
+ this.render = this.options.render || this.render;
+ this.updater = this.options.updater || this.updater;
+ this.displayText = this.options.displayText || this.displayText;
+ this.source = this.options.source;
+ this.delay = this.options.delay;
+ this.$menu = $(this.options.menu);
+ this.$appendTo = this.options.appendTo ? $(this.options.appendTo) : null;
+ this.shown = false;
+ this.listen();
+ this.showHintOnFocus = typeof this.options.showHintOnFocus == 'boolean' ? this.options.showHintOnFocus : false;
+ this.afterSelect = this.options.afterSelect;
+ this.addItem = false;
+ };
+
+ Typeahead.prototype = {
+
+ constructor: Typeahead,
+
+ select: function () {
+ var val = this.$menu.find('.active').data('value');
+ this.$element.data('active', val);
+ if(this.autoSelect || val) {
+ var newVal = this.updater(val);
+ this.$element
+ .val(this.displayText(newVal) || newVal)
+ .change();
+ this.afterSelect(newVal);
+ }
+ return this.hide();
+ },
+
+ updater: function (item) {
+ return item;
+ },
+
+ setSource: function (source) {
+ this.source = source;
+ },
+
+ show: function () {
+ var pos = $.extend({}, this.$element.position(), {
+ height: this.$element[0].offsetHeight
+ }), scrollHeight;
+
+ scrollHeight = typeof this.options.scrollHeight == 'function' ?
+ this.options.scrollHeight.call() :
+ this.options.scrollHeight;
+
+ (this.$appendTo ? this.$menu.appendTo(this.$appendTo) : this.$menu.insertAfter(this.$element))
+ .css({
+ top: pos.top + pos.height + scrollHeight
+ , left: pos.left
+ })
+ .show();
+
+ this.shown = true;
+ return this;
+ },
+
+ hide: function () {
+ this.$menu.hide();
+ this.shown = false;
+ return this;
+ },
+
+ lookup: function (query) {
+ var items;
+ if (typeof(query) != 'undefined' && query !== null) {
+ this.query = query;
+ } else {
+ this.query = this.$element.val() || '';
+ }
+
+ if (this.query.length < this.options.minLength) {
+ return this.shown ? this.hide() : this;
+ }
+
+ var worker = $.proxy(function() {
+
+ if($.isFunction(this.source)) this.source(this.query, $.proxy(this.process, this));
+ else if (this.source) {
+ this.process(this.source);
+ }
+ }, this);
+
+ clearTimeout(this.lookupWorker);
+ this.lookupWorker = setTimeout(worker, this.delay);
+ },
+
+ process: function (items) {
+ var that = this;
+
+ items = $.grep(items, function (item) {
+ return that.matcher(item);
+ });
+
+ items = this.sorter(items);
+
+ if (!items.length && !this.options.addItem) {
+ return this.shown ? this.hide() : this;
+ }
+
+ if (items.length > 0) {
+ this.$element.data('active', items[0]);
+ } else {
+ this.$element.data('active', null);
+ }
+
+ // Add item
+ if (this.options.addItem){
+ items.push(this.options.addItem);
+ }
+
+ if (this.options.items == 'all') {
+ return this.render(items).show();
+ } else {
+ return this.render(items.slice(0, this.options.items)).show();
+ }
+ },
+
+ matcher: function (item) {
+ var it = this.displayText(item);
+ return ~it.toLowerCase().indexOf(this.query.toLowerCase());
+ },
+
+ sorter: function (items) {
+ var beginswith = []
+ , caseSensitive = []
+ , caseInsensitive = []
+ , item;
+
+ while ((item = items.shift())) {
+ var it = this.displayText(item);
+ if (!it.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item);
+ else if (~it.indexOf(this.query)) caseSensitive.push(item);
+ else caseInsensitive.push(item);
+ }
+
+ return beginswith.concat(caseSensitive, caseInsensitive);
+ },
+
+ highlighter: function (item) {
+ var html = $('<div></div>');
+ var query = this.query;
+ var i = item.toLowerCase().indexOf(query.toLowerCase());
+ var len, leftPart, middlePart, rightPart, strong;
+ len = query.length;
+ if(len === 0){
+ return html.text(item).html();
+ }
+ while (i > -1) {
+ leftPart = item.substr(0, i);
+ middlePart = item.substr(i, len);
+ rightPart = item.substr(i + len);
+ strong = $('<strong></strong>').text(middlePart);
+ html
+ .append(document.createTextNode(leftPart))
+ .append(strong);
+ item = rightPart;
+ i = item.toLowerCase().indexOf(query.toLowerCase());
+ }
+ return html.append(document.createTextNode(item)).html();
+ },
+
+ render: function (items) {
+ var that = this;
+ var self = this;
+ var activeFound = false;
+ items = $(items).map(function (i, item) {
+ var text = self.displayText(item);
+ i = $(that.options.item).data('value', item);
+ i.find('a').html(that.highlighter(text));
+ if (text == self.$element.val()) {
+ i.addClass('active');
+ self.$element.data('active', item);
+ activeFound = true;
+ }
+ return i[0];
+ });
+
+ if (this.autoSelect && !activeFound) {
+ items.first().addClass('active');
+ this.$element.data('active', items.first().data('value'));
+ }
+ this.$menu.html(items);
+ return this;
+ },
+
+ displayText: function(item) {
+ return item.name || item;
+ },
+
+ next: function (event) {
+ var active = this.$menu.find('.active').removeClass('active')
+ , next = active.next();
+
+ if (!next.length) {
+ next = $(this.$menu.find('li')[0]);
+ }
+
+ next.addClass('active');
+ },
+
+ prev: function (event) {
+ var active = this.$menu.find('.active').removeClass('active')
+ , prev = active.prev();
+
+ if (!prev.length) {
+ prev = this.$menu.find('li').last();
+ }
+
+ prev.addClass('active');
+ },
+
+ listen: function () {
+ this.$element
+ .on('focus', $.proxy(this.focus, this))
+ .on('blur', $.proxy(this.blur, this))
+ .on('keypress', $.proxy(this.keypress, this))
+ .on('keyup', $.proxy(this.keyup, this));
+
+ if (this.eventSupported('keydown')) {
+ this.$element.on('keydown', $.proxy(this.keydown, this));
+ }
+
+ this.$menu
+ .on('click', $.proxy(this.click, this))
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
+ .on('mouseleave', 'li', $.proxy(this.mouseleave, this));
+ },
+
+ destroy : function () {
+ this.$element.data('typeahead',null);
+ this.$element.data('active',null);
+ this.$element
+ .off('focus')
+ .off('blur')
+ .off('keypress')
+ .off('keyup');
+
+ if (this.eventSupported('keydown')) {
+ this.$element.off('keydown');
+ }
+
+ this.$menu.remove();
+ },
+
+ eventSupported: function(eventName) {
+ var isSupported = eventName in this.$element;
+ if (!isSupported) {
+ this.$element.setAttribute(eventName, 'return;');
+ isSupported = typeof this.$element[eventName] === 'function';
+ }
+ return isSupported;
+ },
+
+ move: function (e) {
+ if (!this.shown) return;
+
+ switch(e.keyCode) {
+ case 9: // tab
+ case 13: // enter
+ case 27: // escape
+ e.preventDefault();
+ break;
+
+ case 38: // up arrow
+ // with the shiftKey (this is actually the left parenthesis)
+ if (e.shiftKey) return;
+ e.preventDefault();
+ this.prev();
+ break;
+
+ case 40: // down arrow
+ // with the shiftKey (this is actually the right parenthesis)
+ if (e.shiftKey) return;
+ e.preventDefault();
+ this.next();
+ break;
+ }
+
+ e.stopPropagation();
+ },
+
+ keydown: function (e) {
+ this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]);
+ if (!this.shown && e.keyCode == 40) {
+ this.lookup();
+ } else {
+ this.move(e);
+ }
+ },
+
+ keypress: function (e) {
+ if (this.suppressKeyPressRepeat) return;
+ this.move(e);
+ },
+
+ keyup: function (e) {
+ switch(e.keyCode) {
+ case 40: // down arrow
+ case 38: // up arrow
+ case 16: // shift
+ case 17: // ctrl
+ case 18: // alt
+ break;
+
+ case 9: // tab
+ case 13: // enter
+ if (!this.shown) return;
+ this.select();
+ break;
+
+ case 27: // escape
+ if (!this.shown) return;
+ this.hide();
+ break;
+ default:
+ this.lookup();
+ }
+
+ e.stopPropagation();
+ e.preventDefault();
+ },
+
+ focus: function (e) {
+ if (!this.focused) {
+ this.focused = true;
+ if (this.options.showHintOnFocus) {
+ this.lookup('');
+ }
+ }
+ },
+
+ blur: function (e) {
+ this.focused = false;
+ if (!this.mousedover && this.shown) this.hide();
+ },
+
+ click: function (e) {
+ e.stopPropagation();
+ e.preventDefault();
+ this.select();
+ this.$element.focus();
+ },
+
+ mouseenter: function (e) {
+ this.mousedover = true;
+ this.$menu.find('.active').removeClass('active');
+ $(e.currentTarget).addClass('active');
+ },
+
+ mouseleave: function (e) {
+ this.mousedover = false;
+ if (!this.focused && this.shown) this.hide();
+ }
+
+ };
+
+
+ /* TYPEAHEAD PLUGIN DEFINITION
+ * =========================== */
+
+ var old = $.fn.typeahead;
+
+ $.fn.typeahead = function (option) {
+ var arg = arguments;
+ if (typeof option == 'string' && option == 'getActive') {
+ return this.data('active');
+ }
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('typeahead')
+ , options = typeof option == 'object' && option;
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)));
+ if (typeof option == 'string') {
+ if (arg.length > 1) {
+ data[option].apply(data, Array.prototype.slice.call(arg ,1));
+ } else {
+ data[option]();
+ }
+ }
+ });
+ };
+
+ $.fn.typeahead.defaults = {
+ source: []
+ , items: 8
+ , menu: '<ul class="typeahead dropdown-menu" role="listbox"></ul>'
+ , item: '<li><a href="#" role="option"></a></li>'
+ , minLength: 1
+ , scrollHeight: 0
+ , autoSelect: true
+ , afterSelect: $.noop
+ , addItem: false
+ , delay: 0
+ };
+
+ $.fn.typeahead.Constructor = Typeahead;
+
+
+ /* TYPEAHEAD NO CONFLICT
+ * =================== */
+
+ $.fn.typeahead.noConflict = function () {
+ $.fn.typeahead = old;
+ return this;
+ };
+
+
+ /* TYPEAHEAD DATA-API
+ * ================== */
+
+ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
+ var $this = $(this);
+ if ($this.data('typeahead')) return;
+ $this.typeahead($this.data());
+ });
+
+}));
diff --git a/inst/www/shinyBS.css b/inst/www/shinyBS.css
index e69de29..8a3c628 100644
--- a/inst/www/shinyBS.css
+++ b/inst/www/shinyBS.css
@@ -0,0 +1,12 @@
+.sbs-alert-hover {
+ position: absolute;
+ z-index: 1000;
+ width: 30%;
+ margin-left: 35%;
+ margin-top: 10px;
+ opacity: 0.7;
+}
+
+.sbs-alert-hover:hover {
+ opacity: 1.0;
+}
\ No newline at end of file
diff --git a/inst/www/shinyBS.js b/inst/www/shinyBS.js
index 96561be..cd65e90 100644
--- a/inst/www/shinyBS.js
+++ b/inst/www/shinyBS.js
@@ -1,303 +1,305 @@
-var shinyBS = {inputBindings: {}};
-
-shinyBS.inputBindings.toggle = new Shiny.InputBinding();
-$.extend(shinyBS.inputBindings.toggle, {
- find: function(scope) {
- return $(scope).find(".sbs-toggle-button");
- },
- getValue: function(el) {
- return $(el).hasClass("active");
- },
- subscribe: function(el, callback) {
- $(el).on("click", function(e) {
- $(el).toggleClass("active").blur();
- callback();
- })
- },
- unsubscribe: function(el) {
- $(el).off("click");
- }
-});
-Shiny.inputBindings.register(shinyBS.inputBindings.toggle)
-
-shinyBS.inputBindings.modal = new Shiny.InputBinding();
-$.extend(shinyBS.inputBindings.modal, {
- find: function(scope) {
- return $(scope).find(".sbs-modal");
- },
- getValue: function(el) {
- return $(el).hasClass("in");
- },
- subscribe: function(el, callback) {
- $(el).on("hidden.bs.modal shown.bs.modal", callback)
- },
- unsubscribe: function(el) {
- $(el).off("hidden.bs.modal shown.bs.modal")
- },
- receiveMessage: function(el, data) {
- if(data.hasOwnProperty("toggle")) {
- if(data.toggle == "show") {
- $(el).modal("show");
- } else if(data.toggle == "hide") {
- $(el).modal("hide");
- } else {
- $(el).modal("toggle");
- }
- };
- },
- initialize: function(el) {
- $("#" + $(el).attr("data-sbs-trigger")).attr({"data-toggle": "modal", "data-target": "#" + $(el).attr("id")});
- }
-});
-Shiny.inputBindings.register(shinyBS.inputBindings.modal);
-
-shinyBS.inputBindings.collapse = new Shiny.InputBinding();
-$.extend(shinyBS.inputBindings.collapse, {
- find: function(scope) {
- return $(scope).find(".sbs-panel-group");
- },
- getValue: function(el) {
- return $(el).data("sbs-value");
- },
- receiveMessage: function(el, data) {
- var $el = $(el);
-/* I would think this code should work, but it doesn't for some reason so I am
- commenting it out.
- if(data.hasOwnProperty('multiple')) {
- if(data.multiple) {
- $el.find(".collapse").each(function(i) {$(this).collapse({parent: false, toggle: false})});
- } else {
- $el.find(".collapse").each(function(i) {$(this).collapse({parent: "#"+$el.attr("id"), toggle: false})});
- }
- }
-*/
- if(data.hasOwnProperty('style')) {
- var panels = Object.keys(data.style)
- for(var i = 0; i < panels.length; i++) {
- var $p = $el.find("div[value='" + panels[i] + "']")
- $p
- .removeClass("panel-primary panel-danger panel-warning panel-error panel-info panel-success")
- .addClass("panel-" + data.style[panels[i]]);
- }
- }
- if(data.hasOwnProperty('open')) {
- if(!Array.isArray(data.open)) {
- data.open = [data.open]
- }
- data.open.forEach(function(value, index, array) {
- $el.find("div[value='" + value + "'] > .panel-collapse").collapse("show");
- })
- }
- if(data.hasOwnProperty("close")) {
- if(!Array.isArray(data.close)) {
- data.close = [data.close];
- }
- data.close.forEach(function(value, index, array) {
- $el.find("div[value='" + value + "'] > .panel-collapse").collapse("hide");
- })
- }
- },
- subscribe: function(el, callback) {
- $(el).find(".collapse").on("shown.bs.collapse hidden.bs.collapse", callback);
- },
- initialize: function(el) {
- var $el = $(el);
- var $panels = $el.children(".panel");
- var val = [];
- $panels.each(function(i) {
- if($(this).children("div.panel-collapse.collapse").hasClass("in")) {
- val.push($(this).attr("value"));
- }
- var $pan = $(this).children("div.panel-collapse.collapse");
- if($el.attr("data-sbs-multi") == "FALSE") {
- var par = "#" + $el.attr("id");
- } else {
- var par = false;
- }
- $pan.collapse({parent: par, toggle: false});
- });
- $el.data("sbs-value", val);
- $panels.on("show.bs.collapse", function(event) {
- var val = $el.data("sbs-value");
- val.push($(this).attr("value"));
- $el.data("sbs-value", val)
- });
- $panels.on("hide.bs.collapse", function(event) {
- var val = $el.data("sbs-value");
- var i = val.indexOf($(this).attr("value"))
- if(i != -1) {
- val.splice(i, 1);
- $el.data("sbs-value", val);
- }
- });
- }
-})
-Shiny.inputBindings.register(shinyBS.inputBindings.collapse);
-
-
-Shiny.addCustomMessageHandler("bsAlertCreate", function(data) {
-
- var create = true;
-
- if(data.hasOwnProperty("alertId")) {
- if($("#" + data.alertId).length > 0) {
- create = false;
- }
- }
-
- if(create) {
-
- var $alert = $("<div class = 'alert'></div>");
-
- if(data.hasOwnProperty('style')) {
- $alert.addClass("alert-" + data.style);
- } else {
- $alert.addClass("alert-info");
- }
-
- if(data.hasOwnProperty("dismiss")) {
- $alert.addClass("alert-dismissable");
- }
-
- if(data.hasOwnProperty("alertId")) {
- $alert.attr("id", data.alertId);
- }
-
- if(data.hasOwnProperty('dismiss')) {
- if(data.dismiss == true) {
- $alert.append("<button type='button' class='close' data-dismiss='alert'>×</button>")
- }
- }
-
- if(data.hasOwnProperty('title')) {
- $alert.append("<h4>" + data.title + "</h4>");
- }
-
- if(data.hasOwnProperty("content")) {
- $alert.append(data.content);
- }
-
- if(data.append == true) {
- $alert.appendTo("#" + data.id);
- } else {
- $("#" + data.id).html($alert);
- }
-
- }
-
-});
-
-Shiny.addCustomMessageHandler("bsAlertClose", function(alertId) {
- $("#" + alertId).alert('close');
-});
-
-// The following function refer to tooltips but are used in the creation of
-// tooltips and popovers because there structure is so similar. type="popover"
-// will create a popover.
-
-shinyBS.addTooltip = function(id, type, opts) {
- var $id = shinyBS.getTooltipTarget(id);
- var dopts = {html: true};
- opts = $.extend(opts, dopts);
-
- if(type == "tooltip") {
- $id.tooltip("destroy");
- $id.tooltip(opts);
- } else if(type == "popover") {
- $id.popover("destroy");
- $id.popover(opts);
- }
-
-}
-
-shinyBS.removeTooltip = function(id, type) {
- var $id = shinyBS.getTooltipTarget(id);
- if(type == "tooltip") {
- $id.tooltip("destroy");
- } else if(type == "popover") {
- $id.popover("destroy");
- }
-}
-
-// Makes adjustments to the tooltip and popover targets for specialized
-// shiny inputs/outputs
-shinyBS.getTooltipTarget = function(id) {
-
- var $id = $("#" + id);
-
- if($id.hasClass("js-range-slider")) {
- $id = $id.parent();
- } else if($id.hasClass("selectized")) {
- $id = $id.siblings("div.selectize-control")
- }
-
- return $id;
-
-}
-
-Shiny.addCustomMessageHandler("updateTooltipOrPopover", function(data) {
- if(data.action == "add") {
- shinyBS.addTooltip(data.id, data.type, data.options);
- } else if(data.action == "remove") {
- shinyBS.removeTooltip(data.id, data.type)
- }
-})
-
-Shiny.addCustomMessageHandler("bsButtonUpdate", function(data) {
-
- var btn = $("button#" + data.id);
- var ico = btn.find("i");
-
- if(ico.length > 0) {
- ico = ico[0].outerHTML;
- } else {
- ico = "";
- };
-
- if(data.hasOwnProperty("label")) {
- btn.html(ico + data.label);
- };
-
- if(data.hasOwnProperty("icon")) {
- var ch = btn.children();
- if(ch.length == 0) {
- btn.prepend(data.icon);
- } else {
- btn.find("i").replaceWith(data.icon);
- };
- };
-
- if(data.hasOwnProperty("value")) {
- if(btn.hasClass("sbs-toggle-button")) {
- if(data.value != btn.hasClass("active")) {
- btn.trigger("click");
- };
- };
- };
-
- if(data.hasOwnProperty("style")) {
- btn
- .removeClass("btn-default btn-primary btn-success btn-info btn-warning btn-danger btn-link")
- .addClass("btn-" + data.style);
- };
-
- if(data.hasOwnProperty("size")) {
- btn.removeClass("btn-lg btn-sm btn-xs")
- if(data.size != "default") {
- btn.addClass(data.size);
- };
- };
-
- if(data.hasOwnProperty("block")) {
- btn.toggleClass("btn-block", data.block);
- };
-
- if(data.hasOwnProperty("disabled")) {
- if(data.disabled) {
- btn.attr("disabled", "disabled")
- } else {
- btn.attr("disabled", false)
- };
- };
-
+var shinyBS = {inputBindings: {}};
+
+shinyBS.inputBindings.toggle = new Shiny.InputBinding();
+$.extend(shinyBS.inputBindings.toggle, {
+ find: function(scope) {
+ return $(scope).find(".sbs-toggle-button");
+ },
+ getValue: function(el) {
+ return $(el).hasClass("active");
+ },
+ subscribe: function(el, callback) {
+ $(el).on("click", function(e) {
+ $(el).toggleClass("active").blur();
+ callback();
+ })
+ },
+ unsubscribe: function(el) {
+ $(el).off("click");
+ }
+});
+Shiny.inputBindings.register(shinyBS.inputBindings.toggle)
+
+shinyBS.inputBindings.modal = new Shiny.InputBinding();
+$.extend(shinyBS.inputBindings.modal, {
+ find: function(scope) {
+ return $(scope).find(".sbs-modal");
+ },
+ getValue: function(el) {
+ return $(el).hasClass("in");
+ },
+ subscribe: function(el, callback) {
+ $(el).on("hidden.bs.modal shown.bs.modal", callback)
+ },
+ unsubscribe: function(el) {
+ $(el).off("hidden.bs.modal shown.bs.modal")
+ },
+ receiveMessage: function(el, data) {
+ if(data.hasOwnProperty("toggle")) {
+ if(data.toggle == "show") {
+ $(el).modal("show");
+ } else if(data.toggle == "hide") {
+ $(el).modal("hide");
+ } else {
+ $(el).modal("toggle");
+ }
+ };
+ },
+ initialize: function(el) {
+ $("#" + $(el).attr("data-sbs-trigger")).attr({"data-toggle": "modal", "data-target": "#" + $(el).attr("id")});
+ }
+});
+Shiny.inputBindings.register(shinyBS.inputBindings.modal);
+
+shinyBS.inputBindings.collapse = new Shiny.InputBinding();
+$.extend(shinyBS.inputBindings.collapse, {
+ find: function(scope) {
+ return $(scope).find(".sbs-panel-group");
+ },
+ getValue: function(el) {
+ return $(el).data("sbs-value");
+ },
+ receiveMessage: function(el, data) {
+ var $el = $(el);
+/* I would think this code should work, but it doesn't for some reason so I am
+ commenting it out.
+ if(data.hasOwnProperty('multiple')) {
+ if(data.multiple) {
+ $el.find(".collapse").each(function(i) {$(this).collapse({parent: false, toggle: false})});
+ } else {
+ $el.find(".collapse").each(function(i) {$(this).collapse({parent: "#"+$el.attr("id"), toggle: false})});
+ }
+ }
+*/
+ if(data.hasOwnProperty('style')) {
+ var panels = Object.keys(data.style)
+ for(var i = 0; i < panels.length; i++) {
+ var $p = $el.find("div[value='" + panels[i] + "']")
+ $p
+ .removeClass("panel-primary panel-danger panel-warning panel-error panel-info panel-success")
+ .addClass("panel-" + data.style[panels[i]]);
+ }
+ }
+ if(data.hasOwnProperty('open')) {
+ if(!Array.isArray(data.open)) {
+ data.open = [data.open]
+ }
+ data.open.forEach(function(value, index, array) {
+ $el.find("div[value='" + value + "'] > .panel-collapse").collapse("show");
+ })
+ }
+ if(data.hasOwnProperty("close")) {
+ if(!Array.isArray(data.close)) {
+ data.close = [data.close];
+ }
+ data.close.forEach(function(value, index, array) {
+ $el.find("div[value='" + value + "'] > .panel-collapse").collapse("hide");
+ })
+ }
+ },
+ subscribe: function(el, callback) {
+ $(el).find(".collapse").on("shown.bs.collapse hidden.bs.collapse", callback);
+ },
+ initialize: function(el) {
+ var $el = $(el);
+ var $panels = $el.children(".panel");
+ var val = [];
+ $panels.each(function(i) {
+ if($(this).children("div.panel-collapse.collapse").hasClass("in")) {
+ val.push($(this).attr("value"));
+ }
+ var $pan = $(this).children("div.panel-collapse.collapse");
+ if($el.attr("data-sbs-multi") == "FALSE") {
+ var par = "#" + $el.attr("id");
+ } else {
+ var par = false;
+ }
+ $pan.collapse({parent: par, toggle: false});
+ });
+ $el.data("sbs-value", val);
+ $panels.on("show.bs.collapse", function(event) {
+ var val = $el.data("sbs-value");
+ val.push($(this).attr("value"));
+ $el.data("sbs-value", val)
+ });
+ $panels.on("hide.bs.collapse", function(event) {
+ var val = $el.data("sbs-value");
+ var i = val.indexOf($(this).attr("value"))
+ if(i != -1) {
+ val.splice(i, 1);
+ $el.data("sbs-value", val);
+ }
+ });
+ }
+})
+Shiny.inputBindings.register(shinyBS.inputBindings.collapse);
+
+
+Shiny.addCustomMessageHandler("bsAlertCreate", function(data) {
+
+ var create = true;
+
+ if(data.hasOwnProperty("alertId")) {
+ if($("#" + data.alertId).length > 0) {
+ create = false;
+ }
+ }
+
+ if(create) {
+
+ var $alert = $("<div class = 'alert'></div>");
+
+ if(data.hasOwnProperty('style')) {
+ $alert.addClass("alert-" + data.style);
+ } else {
+ $alert.addClass("alert-info");
+ }
+
+ if(data.hasOwnProperty("dismiss")) {
+ $alert.addClass("alert-dismissable");
+ }
+
+ if(data.hasOwnProperty("alertId")) {
+ $alert.attr("id", data.alertId);
+ }
+
+ if(data.hasOwnProperty('dismiss')) {
+ if(data.dismiss == true) {
+ $alert.append("<button type='button' class='close' data-dismiss='alert'>×</button>")
+ }
+ }
+
+ if(data.hasOwnProperty('title')) {
+ $alert.append("<h4>" + data.title + "</h4>");
+ }
+
+ if(data.hasOwnProperty("content")) {
+ $alert.append(data.content);
+ }
+
+ if(data.append == true) {
+ $alert.appendTo("#" + data.id);
+ } else {
+ $("#" + data.id).html($alert);
+ }
+
+ }
+
+});
+
+Shiny.addCustomMessageHandler("bsAlertClose", function(alertId) {
+ $("#" + alertId).alert('close');
+});
+
+// The following function refer to tooltips but are used in the creation of
+// tooltips and popovers because there structure is so similar. type="popover"
+// will create a popover.
+
+shinyBS.addTooltip = function(id, type, opts) {
+ var $id = shinyBS.getTooltipTarget(id);
+ var dopts = {html: true};
+ opts = $.extend(opts, dopts);
+
+ if(type == "tooltip") {
+ $id.tooltip("destroy");
+ $id.tooltip(opts);
+ } else if(type == "popover") {
+ $id.popover("destroy");
+ $id.popover(opts);
+ }
+
+}
+
+shinyBS.removeTooltip = function(id, type) {
+ var $id = shinyBS.getTooltipTarget(id);
+ if(type == "tooltip") {
+ $id.tooltip("destroy");
+ } else if(type == "popover") {
+ $id.popover("destroy");
+ }
+}
+
+// Makes adjustments to the tooltip and popover targets for specialized
+// shiny inputs/outputs
+shinyBS.getTooltipTarget = function(id) {
+
+ var $id = $("#" + id).closest(".shiny-input-container, .shiny-bound-output, .btn, .shiny-download-link");
+
+/*
+ if($id.hasClass("js-range-slider")) {
+ $id = $id.parent();
+ } else if($id.hasClass("selectized")) {
+ $id = $id.siblings("div.selectize-control")
+ }
+*/
+
+ return $id;
+
+}
+
+Shiny.addCustomMessageHandler("updateTooltipOrPopover", function(data) {
+ if(data.action == "add") {
+ shinyBS.addTooltip(data.id, data.type, data.options);
+ } else if(data.action == "remove") {
+ shinyBS.removeTooltip(data.id, data.type)
+ }
+})
+
+Shiny.addCustomMessageHandler("bsButtonUpdate", function(data) {
+
+ var btn = $("button#" + data.id);
+ var ico = btn.find("i");
+
+ if(ico.length > 0) {
+ ico = ico[0].outerHTML;
+ } else {
+ ico = "";
+ };
+
+ if(data.hasOwnProperty("label")) {
+ btn.html(ico + data.label);
+ };
+
+ if(data.hasOwnProperty("icon")) {
+ var ch = btn.children();
+ if(ch.length == 0) {
+ btn.prepend(data.icon);
+ } else {
+ btn.find("i").replaceWith(data.icon);
+ };
+ };
+
+ if(data.hasOwnProperty("value")) {
+ if(btn.hasClass("sbs-toggle-button")) {
+ if(data.value != btn.hasClass("active")) {
+ btn.trigger("click");
+ };
+ };
+ };
+
+ if(data.hasOwnProperty("style")) {
+ btn
+ .removeClass("btn-default btn-primary btn-success btn-info btn-warning btn-danger btn-link")
+ .addClass("btn-" + data.style);
+ };
+
+ if(data.hasOwnProperty("size")) {
+ btn.removeClass("btn-lg btn-sm btn-xs")
+ if(data.size != "default") {
+ btn.addClass(data.size);
+ };
+ };
+
+ if(data.hasOwnProperty("block")) {
+ btn.toggleClass("btn-block", data.block);
+ };
+
+ if(data.hasOwnProperty("disabled")) {
+ if(data.disabled) {
+ btn.attr("disabled", "disabled")
+ } else {
+ btn.attr("disabled", false)
+ };
+ };
+
})
\ No newline at end of file
diff --git a/inst/www/typeahead_inputbinding.js b/inst/www/typeahead_inputbinding.js
new file mode 100644
index 0000000..042bb05
--- /dev/null
+++ b/inst/www/typeahead_inputbinding.js
@@ -0,0 +1,69 @@
+//Creates input binding for TypeAhead Objects
+var typeAheadBinding = new Shiny.InputBinding();
+$.extend(typeAheadBinding, {
+ find: function(scope) {
+ return $(scope).find('.typeahead');
+ },
+ getId: function(el) {
+ return Shiny.InputBinding.prototype.getId.call(this, el) || el.name;
+ },
+ getValue: function(el) {
+ return el.value;
+ },
+ setValue: function(el, value) {
+ el.value = value;
+ },
+ initialize: function(el) {
+ $(el).typeahead();
+ },
+ subscribe: function(el, callback) {
+ $(el).on('keyup.typeAheadBinding input.typeAheadBinding', function(event) {
+ callback(true);
+ });
+ $(el).on('change.typeAheadBinding', function(event) {
+ callback(false);
+ });
+ },
+ unsubscribe: function(el) {
+ $(el).off('.typeAheadBinding');
+ },
+ receiveMessage: function(el, data) {
+ if (data.hasOwnProperty('value')) {
+ this.setValue(el, data.value);
+ };
+ if (data.hasOwnProperty('label')) {
+ $(el).parent().find('label[for=' + el.id + ']').text(data.label);
+ };
+ if (data.hasOwnProperty('choices')) {
+ $(el).data('typeahead').source = data.choices;
+ };
+ $(el).trigger('change');
+ },
+ getState: function(el) {
+ return {
+ label: $(el).parent().find('label[for=' + el.id + ']').text(),
+ value: el.value
+ };
+ },
+ getRatePolicy: function() {
+ return {
+ policy: 'debounce',
+ delay: 250
+ };
+ }
+});
+Shiny.inputBindings.register(typeAheadBinding);
+
+Shiny.addCustomMessageHandler("typeaheadUpdate", function(data) {
+ var typeahead = $("input#" + data.id);
+ if (data.hasOwnProperty('value')) {
+ typeahead[0].value = data.value;
+ };
+ if (data.hasOwnProperty('label')) {
+ typeahead.parent().find('label[for=' + data.id + ']').text(data.label);
+ };
+ if (data.hasOwnProperty('choices')) {
+ typeahead.data('typeahead').source = data.choices;
+ };
+ typeahead.trigger('change');
+})
\ No newline at end of file
diff --git a/man/Alerts.Rd b/man/Alerts.Rd
index 5302ab5..9c6c1be 100644
--- a/man/Alerts.Rd
+++ b/man/Alerts.Rd
@@ -1,96 +1,96 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/Alerts.R
-\name{Alerts}
-\alias{Alerts}
-\title{Alerts}
-\description{
-Alerts allow you to communicate information to the user on the fly. Standard
-Bootstrap styling options give the user a hint at the type of information
-contained in the Alert.
-}
-\details{
-To create alerts in your Shiny app you must place \code{bsAlert} in your ui.
-This serves as an anchor that tells shinyBS where to place the alerts created
-with \code{createAlert}.
-
-Use \code{createAlert} in your server script to add alerts to the anchor
-you created with \code{bsAlert} in your ui. You can place \code{createAlert}
-in observers, reactives, or outputs. A common usage may be to have logic that
-validates a user's inputs. If they are valid produce the requested output, if
-not use \code{createAlert} to give the user info about what they need to
-change.
-}
-\note{
-Run \code{bsExample("Alerts")} for an example
-of \code{Alerts} functionality.
-}
-\section{Components}{
-
-There are three functions in the Alerts family:
- \describe{
- \item{\code{\link{bsAlert}}}{Used in the UI to create an anchor where your
- Alerts will be displayed.}
- \item{\code{\link{createAlert}}}{Used in the Server logic to create
- alerts. This would be used within a reactive context to display error
- or success messages to the user based on the status of that context.}
- \item{\code{\link{closeAlert}}}{Used in the Server logic to close an alert
- that is already open. By default, Alerts are dismissable by the user,
- but this offers you a way to close them programmatically.}
- }
-}
-
-\section{Changes}{
-
-\code{style} was called \code{type} in previous versions of shinyBS.
-
-\code{anchorId} was called \code{inputId} in previous versions of shinyBS.
-
-\code{content} was called \code{message} in previous versions of shinyBS.
-}
-\examples{
-library(shiny)
-library(shinyBS)
-app = shinyApp(
- ui =
- fluidPage(
- sidebarLayout(
- sidebarPanel(textInput("num1", NULL, value = 100),
- "divided by", textInput("num2", NULL, value = 20),
- "equals", textOutput("exampleOutput")),
- mainPanel(
- bsAlert("alert")
- )
- )
- ),
- server =
- function(input, output, session) {
- output$exampleOutput <- renderText({
- num1 <- as.numeric(input$num1)
- num2 <- as.numeric(input$num2)
-
- if(is.na(num1) | is.na(num2)) {
- createAlert(session, "alert", "exampleAlert", title = "Oops",
- content = "Both inputs should be numeric.", append = FALSE)
- } else if(num2 == 0) {
- createAlert(session, "alert", "exampleAlert", title = "Oops",
- content = "You cannot divide by 0.", append = FALSE)
- } else {
- closeAlert(session, "exampleAlert")
- return(num1/num2)
- }
-
- })
- }
-)
-
-\dontrun{
- runApp(app)
-}
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Alerts: \code{\link{bsAlert}};
- \code{\link{closeAlert}}; \code{\link{createAlert}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/Alerts.R
+\name{Alerts}
+\alias{Alerts}
+\title{Alerts}
+\description{
+Alerts allow you to communicate information to the user on the fly. Standard
+Bootstrap styling options give the user a hint at the type of information
+contained in the Alert.
+}
+\details{
+To create alerts in your Shiny app you must place \code{bsAlert} in your ui.
+This serves as an anchor that tells shinyBS where to place the alerts created
+with \code{createAlert}.
+
+Use \code{createAlert} in your server script to add alerts to the anchor
+you created with \code{bsAlert} in your ui. You can place \code{createAlert}
+in observers, reactives, or outputs. A common usage may be to have logic that
+validates a user's inputs. If they are valid produce the requested output, if
+not use \code{createAlert} to give the user info about what they need to
+change.
+}
+\note{
+Run \code{bsExample("Alerts")} for an example
+of \code{Alerts} functionality.
+}
+\section{Components}{
+
+There are three functions in the Alerts family:
+ \describe{
+ \item{\code{\link{bsAlert}}}{Used in the UI to create an anchor where your
+ Alerts will be displayed.}
+ \item{\code{\link{createAlert}}}{Used in the Server logic to create
+ alerts. This would be used within a reactive context to display error
+ or success messages to the user based on the status of that context.}
+ \item{\code{\link{closeAlert}}}{Used in the Server logic to close an alert
+ that is already open. By default, Alerts are dismissable by the user,
+ but this offers you a way to close them programmatically.}
+ }
+}
+
+\section{Changes}{
+
+\code{style} was called \code{type} in previous versions of shinyBS.
+
+\code{anchorId} was called \code{inputId} in previous versions of shinyBS.
+
+\code{content} was called \code{message} in previous versions of shinyBS.
+}
+\examples{
+library(shiny)
+library(shinyBS)
+app = shinyApp(
+ ui =
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(textInput("num1", NULL, value = 100),
+ "divided by", textInput("num2", NULL, value = 20),
+ "equals", textOutput("exampleOutput")),
+ mainPanel(
+ bsAlert("alert")
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+ output$exampleOutput <- renderText({
+ num1 <- as.numeric(input$num1)
+ num2 <- as.numeric(input$num2)
+
+ if(is.na(num1) | is.na(num2)) {
+ createAlert(session, "alert", "exampleAlert", title = "Oops",
+ content = "Both inputs should be numeric.", append = FALSE)
+ } else if(num2 == 0) {
+ createAlert(session, "alert", "exampleAlert", title = "Oops",
+ content = "You cannot divide by 0.", append = FALSE)
+ } else {
+ closeAlert(session, "exampleAlert")
+ return(num1/num2)
+ }
+
+ })
+ }
+)
+
+\dontrun{
+ runApp(app)
+}
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Alerts: \code{\link{bsAlert}};
+ \code{\link{closeAlert}}; \code{\link{createAlert}}
+}
+
diff --git a/man/Buttons.Rd b/man/Buttons.Rd
index 0c69e0f..d1c773a 100644
--- a/man/Buttons.Rd
+++ b/man/Buttons.Rd
@@ -1,130 +1,130 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/Buttons.R
-\name{Buttons}
-\alias{Buttons}
-\title{Buttons}
-\description{
-Twitter Bootstrap gives many options for styling buttons that aren't made
-available by standard Shiny. Use shinyBS to create buttons of different sizes,
-shapes, and colors.
-}
-\details{
-Create a button in the UI with \code{\link{bsButton}}. If \code{type = "action"}
-the button will behave like the standard \code{\link{actionButton}} in shiny.
-If \code{type = "toggle"} the button will behave like a \code{\link{checkboxInput}}
-with an on and off state. It will return \code{TRUE} or \code{FALSE} to the Server
-depending on its state.
-
-You can update the style and state of a \code{\link{bsButton}} from the Server
-logic with \code{\link{updateButton}}. For example, a button could be set to
-\code{disabled = TRUE} until the user has made some other selections, then once
-those selections have been made, an observer on the Server could use \code{\link{updateButton}}
-to enable the button allowing the user to proceed. Alternatively, you could set
-the button to \code{style = "success"} to let them know that the button is ready
-to be clicked.
-}
-\note{
-Run \code{bsExample("Buttons")} for an example
-of \code{Buttons} functionality.
-}
-\section{Components}{
-
-There are two functions in the Buttons family:
- \describe{
- \item{\code{\link{bsButton}}}{Used in the UI to create a button. Buttons
- can be of the type \code{action} or \code{toggle}.}
- \item{\code{\link{updateButton}}}{Used in the Server logic to modify the
- state of a button created with \code{\link{bsButton}}}
- }
-}
-
-\section{Changes}{
-
-\code{bsActionButton} and \code{bsToggleButton} were replaced with just
-\code{\link{bsButton}} with a \code{type} argument.
-
-\code{icon} was added to allow placing an icon in the button.
-}
-\examples{
-library(shiny)
-library(shinyBS)
-app = shinyApp(
- ui =
- fluidPage(
- sidebarLayout(
- sidebarPanel(
- sliderInput("bins",
- "Move the slider to see its effect on the button below:",
- min = 1,
- max = 50,
- value = 1),
- bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")),
- tags$p("Clicking the first button below changes the disabled state of the second button."),
- bsButton("togOne", label = "Toggle button disabled status",
- block = TRUE, type = "toggle", value = TRUE),
- bsButton("actOne", label = "Block Action Button", block = TRUE)
-
- ),
- mainPanel(
- textOutput("exampleText")
- )
- )
- ),
- server =
- function(input, output, session) {
- observeEvent(input$togOne, ({
- updateButton(session, "actOne", disabled = !input$togOne)
- }))
- observeEvent(input$bins, ({
-
- b <- input$bins
- disabled = NULL
- style = "default"
- icon = ""
-
- if(b < 5) {
- disabled = TRUE
- icon <- icon("ban")
- } else {
- disabled = FALSE
- }
-
- if(b < 15 | b > 35) {
- style = "danger"
- } else if(b < 20 | b > 30) {
- style = "warning"
- } else {
- style = "default"
- icon = icon("check")
- }
-
- updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon)
-
- }))
-
- output$exampleText <- renderText({
- input$actTwo
- b <- isolate(input$bins)
- txt = ""
- if((b > 5 & b < 15) | b > 35) {
- txt = "That was dangerous."
- } else if((b > 5 & b < 20) | b > 30) {
- txt = "I warned you about that."
- } else if(b >= 20 & b <= 30) {
- txt = "You have chosen... wisely."
- }
- return(txt)
- })
- }
-)
-\dontrun{
- runApp(app)
-}
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Buttons: \code{\link{bsButton}};
- \code{\link{updateButton}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/Buttons.R
+\name{Buttons}
+\alias{Buttons}
+\title{Buttons}
+\description{
+Twitter Bootstrap gives many options for styling buttons that aren't made
+available by standard Shiny. Use shinyBS to create buttons of different sizes,
+shapes, and colors.
+}
+\details{
+Create a button in the UI with \code{\link{bsButton}}. If \code{type = "action"}
+the button will behave like the standard \code{\link{actionButton}} in shiny.
+If \code{type = "toggle"} the button will behave like a \code{\link{checkboxInput}}
+with an on and off state. It will return \code{TRUE} or \code{FALSE} to the Server
+depending on its state.
+
+You can update the style and state of a \code{\link{bsButton}} from the Server
+logic with \code{\link{updateButton}}. For example, a button could be set to
+\code{disabled = TRUE} until the user has made some other selections, then once
+those selections have been made, an observer on the Server could use \code{\link{updateButton}}
+to enable the button allowing the user to proceed. Alternatively, you could set
+the button to \code{style = "success"} to let them know that the button is ready
+to be clicked.
+}
+\note{
+Run \code{bsExample("Buttons")} for an example
+of \code{Buttons} functionality.
+}
+\section{Components}{
+
+There are two functions in the Buttons family:
+ \describe{
+ \item{\code{\link{bsButton}}}{Used in the UI to create a button. Buttons
+ can be of the type \code{action} or \code{toggle}.}
+ \item{\code{\link{updateButton}}}{Used in the Server logic to modify the
+ state of a button created with \code{\link{bsButton}}}
+ }
+}
+
+\section{Changes}{
+
+\code{bsActionButton} and \code{bsToggleButton} were replaced with just
+\code{\link{bsButton}} with a \code{type} argument.
+
+\code{icon} was added to allow placing an icon in the button.
+}
+\examples{
+library(shiny)
+library(shinyBS)
+app = shinyApp(
+ ui =
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(
+ sliderInput("bins",
+ "Move the slider to see its effect on the button below:",
+ min = 1,
+ max = 50,
+ value = 1),
+ bsButton("actTwo", label = "Click me if you dare!", icon = icon("ban")),
+ tags$p("Clicking the first button below changes the disabled state of the second button."),
+ bsButton("togOne", label = "Toggle button disabled status",
+ block = TRUE, type = "toggle", value = TRUE),
+ bsButton("actOne", label = "Block Action Button", block = TRUE)
+
+ ),
+ mainPanel(
+ textOutput("exampleText")
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+ observeEvent(input$togOne, ({
+ updateButton(session, "actOne", disabled = !input$togOne)
+ }))
+ observeEvent(input$bins, ({
+
+ b <- input$bins
+ disabled = NULL
+ style = "default"
+ icon = ""
+
+ if(b < 5) {
+ disabled = TRUE
+ icon <- icon("ban")
+ } else {
+ disabled = FALSE
+ }
+
+ if(b < 15 | b > 35) {
+ style = "danger"
+ } else if(b < 20 | b > 30) {
+ style = "warning"
+ } else {
+ style = "default"
+ icon = icon("check")
+ }
+
+ updateButton(session, "actTwo", disabled = disabled, style = style, icon = icon)
+
+ }))
+
+ output$exampleText <- renderText({
+ input$actTwo
+ b <- isolate(input$bins)
+ txt = ""
+ if((b > 5 & b < 15) | b > 35) {
+ txt = "That was dangerous."
+ } else if((b > 5 & b < 20) | b > 30) {
+ txt = "I warned you about that."
+ } else if(b >= 20 & b <= 30) {
+ txt = "You have chosen... wisely."
+ }
+ return(txt)
+ })
+ }
+)
+\dontrun{
+ runApp(app)
+}
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Buttons: \code{\link{bsButton}};
+ \code{\link{updateButton}}
+}
+
diff --git a/man/Collapses.Rd b/man/Collapses.Rd
index 1596a9c..c348f66 100644
--- a/man/Collapses.Rd
+++ b/man/Collapses.Rd
@@ -1,86 +1,86 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/Collapses.R
-\name{Collapses}
-\alias{Collapses}
-\title{Collapses}
-\description{
-Collapse panels allow you to reduce clutter in your Shiny app by making
-panels of information that open and close with a user's click. Any type of
-content can go in a collapse panel. Standard Bootstrap styling options are
-available.
-}
-\details{
-Collapses are designed to mimic \code{\link{tabsetPanel}} in their implementation.
-Start with \code{bsCollapse} to create a panel group, then fill it with panels
-using \code{bsCollapsePanel}.
-
-\code{bsCollapse} acts as an input, so you can retrieve which panels are open
-from the input object passed to the function in \code{\link{shinyServer}}.
-
-\code{updateCollapse} can be used within your server logic to open/close
-collapse panels or to change their style.
-}
-\note{
-Run \code{bsExample("Collapses")} for an example
-of \code{Collapses} functionality.
-}
-\section{Components}{
-
-\describe{
- \item{\code{\link{bsCollapse}}}{A container for holder the individual panels created by \code{\link{bsCollapsePanel}}.}
- \item{\code{\link{bsCollapsePanel}}}{Creates an individual Collapse Panel that resides within a \code{\link{bsCollapse}}.}
- \item{\code{\link{updateCollapse}}}{Used within your server logic to open/close collapse panels or change their style.}
-}
-}
-
-\section{Changes}{
-
-\code{style} is a new option that wasn't available in previous versions of
-shinyBS.
-}
-\examples{
-library(shiny)
-library(shinyBS)
-
-app = shinyApp(
- ui =
- fluidPage(
- sidebarLayout(
- sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
- actionButton("p1Button", "Push Me!"),
- selectInput("styleSelect", "Select style for Panel 1",
- c("default", "primary", "danger", "warning", "info", "success"))
- ),
- mainPanel(
- bsCollapse(id = "collapseExample", open = "Panel 2",
- bsCollapsePanel("Panel 1", "This is a panel with just text ",
- "and has the default style. You can change the style in ",
- "the sidebar.", style = "info"),
- bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
- "and a 'success' style.", plotOutput("genericPlot"), style = "success")
- )
- )
- )
- ),
- server =
- function(input, output, session) {
- output$genericPlot <- renderPlot(plot(rnorm(100)))
- observeEvent(input$p1Button, ({
- updateCollapse(session, "collapseExample", open = "Panel 1")
- }))
- observeEvent(input$styleSelect, ({
- updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
- }))
- }
-)
-\dontrun{
- runApp(app)
-}
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Collapses: \code{\link{bsCollapsePanel}};
- \code{\link{bsCollapse}}; \code{\link{updateCollapse}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/Collapses.R
+\name{Collapses}
+\alias{Collapses}
+\title{Collapses}
+\description{
+Collapse panels allow you to reduce clutter in your Shiny app by making
+panels of information that open and close with a user's click. Any type of
+content can go in a collapse panel. Standard Bootstrap styling options are
+available.
+}
+\details{
+Collapses are designed to mimic \code{\link{tabsetPanel}} in their implementation.
+Start with \code{bsCollapse} to create a panel group, then fill it with panels
+using \code{bsCollapsePanel}.
+
+\code{bsCollapse} acts as an input, so you can retrieve which panels are open
+from the input object passed to the function in \code{\link{shinyServer}}.
+
+\code{updateCollapse} can be used within your server logic to open/close
+collapse panels or to change their style.
+}
+\note{
+Run \code{bsExample("Collapses")} for an example
+of \code{Collapses} functionality.
+}
+\section{Components}{
+
+\describe{
+ \item{\code{\link{bsCollapse}}}{A container for holder the individual panels created by \code{\link{bsCollapsePanel}}.}
+ \item{\code{\link{bsCollapsePanel}}}{Creates an individual Collapse Panel that resides within a \code{\link{bsCollapse}}.}
+ \item{\code{\link{updateCollapse}}}{Used within your server logic to open/close collapse panels or change their style.}
+}
+}
+
+\section{Changes}{
+
+\code{style} is a new option that wasn't available in previous versions of
+shinyBS.
+}
+\examples{
+library(shiny)
+library(shinyBS)
+
+app = shinyApp(
+ ui =
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."),
+ actionButton("p1Button", "Push Me!"),
+ selectInput("styleSelect", "Select style for Panel 1",
+ c("default", "primary", "danger", "warning", "info", "success"))
+ ),
+ mainPanel(
+ bsCollapse(id = "collapseExample", open = "Panel 2",
+ bsCollapsePanel("Panel 1", "This is a panel with just text ",
+ "and has the default style. You can change the style in ",
+ "the sidebar.", style = "info"),
+ bsCollapsePanel("Panel 2", "This panel has a generic plot. ",
+ "and a 'success' style.", plotOutput("genericPlot"), style = "success")
+ )
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+ output$genericPlot <- renderPlot(plot(rnorm(100)))
+ observeEvent(input$p1Button, ({
+ updateCollapse(session, "collapseExample", open = "Panel 1")
+ }))
+ observeEvent(input$styleSelect, ({
+ updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect))
+ }))
+ }
+)
+\dontrun{
+ runApp(app)
+}
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Collapses: \code{\link{bsCollapsePanel}};
+ \code{\link{bsCollapse}}; \code{\link{updateCollapse}}
+}
+
diff --git a/man/Modals.Rd b/man/Modals.Rd
index 8fddf67..bcdda74 100644
--- a/man/Modals.Rd
+++ b/man/Modals.Rd
@@ -1,108 +1,108 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/Modals.R
-\name{Modals}
-\alias{Modals}
-\title{Modals}
-\description{
-Modal windows are similar to popups but are rendered within the
-original window. They can contain any combination of shiny inputs, shiny
-outputs, and html. Possible uses include extra controls that you don't want
-cluttering up the main app display or help pages to explain your apps
-operation.
-}
-\details{
-Use \code{\link{bsModal}} in your UI to create a modal window. It works
-like \code{\link{Collapses}} or \code{\link{tabPanel}}, any non-named arguments
-will be passed as content for the modal.
-
-Create a button or link and assign its \code{inputId} as the \code{trigger}
-in \code{\link{bsModal}}.
-}
-\note{
-Run \code{bsExample("Modals")} for an example
-of \code{Modals} functionality.
-}
-\section{Components}{
-
-There are only two functions in the Modals family:
- \describe{
- \item{\code{\link{bsModal}}}{Used in the UI to create a modal window.}
- \item{\code{\link{toggleModal}}}{Used in the Server logic to open or
- close a modal window programmatically.}
- }
-}
-
-\section{Changes}{
-
-There is now a \code{toggle} argument in \code{\link{toggleModal}} that allows
-you to specify whether you want the modal to open or close.
-
-The \code{size} argument in \code{\link{bsModal}} allows you to specify the
-size of the modal window. Either \code{small} or \code{large}.
-}
-\examples{
-library(shiny)
-library(shinyBS)
-
-app = shinyApp(
- ui =
- fluidPage(
- sidebarLayout(
- sidebarPanel(
- sliderInput("bins",
- "Number of bins:",
- min = 1,
- max = 50,
- value = 30),
- actionButton("tabBut", "View Table")
- ),
-
- mainPanel(
- plotOutput("distPlot"),
- bsModal("modalExample", "Data Table", "tabBut", size = "large",
- dataTableOutput("distTable"))
- )
- )
- ),
- server =
- function(input, output, session) {
-
- output$distPlot <- renderPlot({
-
- x <- faithful[, 2]
- bins <- seq(min(x), max(x), length.out = input$bins + 1)
-
- # draw the histogram with the specified number of bins
- hist(x, breaks = bins, col = 'darkgray', border = 'white')
-
- })
-
- output$distTable <- renderDataTable({
-
- x <- faithful[, 2]
- bins <- seq(min(x), max(x), length.out = input$bins + 1)
-
- # draw the histogram with the specified number of bins
- tab <- hist(x, breaks = bins, plot = FALSE)
- tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
- paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))
- })
- tab <- as.data.frame(do.call(cbind, tab))
- colnames(tab) <- c("Bins", "Counts", "Density")
- return(tab[, 1:3])
-
- }, options = list(pageLength=10))
-
- }
-)
-\dontrun{
- runApp(app)
-}
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Modals: \code{\link{bsModal}};
- \code{\link{toggleModal}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/Modals.R
+\name{Modals}
+\alias{Modals}
+\title{Modals}
+\description{
+Modal windows are similar to popups but are rendered within the
+original window. They can contain any combination of shiny inputs, shiny
+outputs, and html. Possible uses include extra controls that you don't want
+cluttering up the main app display or help pages to explain your apps
+operation.
+}
+\details{
+Use \code{\link{bsModal}} in your UI to create a modal window. It works
+like \code{\link{Collapses}} or \code{\link{tabPanel}}, any non-named arguments
+will be passed as content for the modal.
+
+Create a button or link and assign its \code{inputId} as the \code{trigger}
+in \code{\link{bsModal}}.
+}
+\note{
+Run \code{bsExample("Modals")} for an example
+of \code{Modals} functionality.
+}
+\section{Components}{
+
+There are only two functions in the Modals family:
+ \describe{
+ \item{\code{\link{bsModal}}}{Used in the UI to create a modal window.}
+ \item{\code{\link{toggleModal}}}{Used in the Server logic to open or
+ close a modal window programmatically.}
+ }
+}
+
+\section{Changes}{
+
+There is now a \code{toggle} argument in \code{\link{toggleModal}} that allows
+you to specify whether you want the modal to open or close.
+
+The \code{size} argument in \code{\link{bsModal}} allows you to specify the
+size of the modal window. Either \code{small} or \code{large}.
+}
+\examples{
+library(shiny)
+library(shinyBS)
+
+app = shinyApp(
+ ui =
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(
+ sliderInput("bins",
+ "Number of bins:",
+ min = 1,
+ max = 50,
+ value = 30),
+ actionButton("tabBut", "View Table")
+ ),
+
+ mainPanel(
+ plotOutput("distPlot"),
+ bsModal("modalExample", "Data Table", "tabBut", size = "large",
+ dataTableOutput("distTable"))
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+
+ output$distPlot <- renderPlot({
+
+ x <- faithful[, 2]
+ bins <- seq(min(x), max(x), length.out = input$bins + 1)
+
+ # draw the histogram with the specified number of bins
+ hist(x, breaks = bins, col = 'darkgray', border = 'white')
+
+ })
+
+ output$distTable <- renderDataTable({
+
+ x <- faithful[, 2]
+ bins <- seq(min(x), max(x), length.out = input$bins + 1)
+
+ # draw the histogram with the specified number of bins
+ tab <- hist(x, breaks = bins, plot = FALSE)
+ tab$breaks <- sapply(seq(length(tab$breaks) - 1), function(i) {
+ paste0(signif(tab$breaks[i], 3), "-", signif(tab$breaks[i+1], 3))
+ })
+ tab <- as.data.frame(do.call(cbind, tab))
+ colnames(tab) <- c("Bins", "Counts", "Density")
+ return(tab[, 1:3])
+
+ }, options = list(pageLength=10))
+
+ }
+)
+\dontrun{
+ runApp(app)
+}
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Modals: \code{\link{bsModal}};
+ \code{\link{toggleModal}}
+}
+
diff --git a/man/Tooltips_and_Popovers.Rd b/man/Tooltips_and_Popovers.Rd
index f483c1f..1520004 100644
--- a/man/Tooltips_and_Popovers.Rd
+++ b/man/Tooltips_and_Popovers.Rd
@@ -1,132 +1,132 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/Tooltips_and_Popovers.R
-\name{Tooltips_and_Popovers}
-\alias{Tooltips_and_Popovers}
-\title{Tooltips and Popovers}
-\description{
-Tooltips and Popovers allow you to add additional information about controls
-or outputs without cluttering up your user interface. You can add a tooltip to
-a button that displays on hover and better explains what the button will do, or
-you could add a popover to an output providing further analysis of that output.
-}
-\details{
-You can create tooltips and popovers from either the UI script or within the
-Server logic. \code{\link{bsTooltip}} and \code{\link{bsPopover}} are used in
-the UI, and \code{\link{addTooltip}} and \code{\link{addPopover}} are used in
-the Server logic. \code{\link{tipify}} and \code{\link{popify}} can be used
-within the UI or from within a \code{\link{renderUI}} in the Server logic. They
-also have the added advantage of not requiring that the UI element have an ID
-attribute.
-}
-\note{
-Tooltips and Popovers cannot contain shiny inputs or outputs.
-
-There must be at least one \code{shinyBS} component in the UI of your
-app in order for the necessary dependencies to be loaded. Because of this,
-\code{\link{addTooltip}} and \code{\link{addPopover}} will not work if they
-are the only shinyBS components in your app.
-
-Tooltips and popovers may not work on some of the more complex shiny inputs
-or outputs. If you encounter a problem with tooltips or popovers not appearing
-please file a issue on the github page so I can fix it.
-
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{Tooltips_and_Popovers} functionality.
-}
-\section{Components}{
-
-There are eight functions in the Tooltips and Popovers family:
- \describe{
- \item{\code{\link{bsTooltip}}}{Used in the UI to add a tooltip to an element
- in your UI.}
- \item{\code{\link{bsPopover}}}{Used in the UI to add a popover to an element
- in your UI.}
- \item{\code{\link{tipify}}}{Wrap any UI element in \code{tipify} to add a
- tooltip to the wrapped element. Preferred for elemented created with
- \code{\link{renderUI}}.}
- \item{\code{\link{popify}}}{Wrap any UI element in \code{popify} to add a
- popover to the wrapped element. Preferred for elements created with
- \code{\link{renderUI}}.}
- \item{\code{\link{addTooltip}}}{Used in the Server logic to add a tooltip
- to an element in your UI.}
- \item{\code{\link{addPopover}}}{Used in the Server logic to add a popover
- to an element in your UI.}
- \item{\code{\link{removeTooltip}}}{Used in the Server logic to remove a
- tooltip from an element in your UI.}
- \item{\code{\link{removePopover}}}{Used in the Server logic to remove a
- popover from an element in your UI.}
- }
-}
-
-\section{Changes}{
-
-An \code{options} argument has been added to the creation functions to allow
-advanced users more control over how the tooltips and popovers appear. See
-the \href{http://getbootstrap.com}{Twitter Bootstrap 3 documentation} for more
-details.
-}
-\examples{
-library(shiny)
-library(shinyBS)
-
-app = shinyApp(
- ui =
- fluidPage(
- sidebarLayout(
- sidebarPanel(
- sliderInput("bins",
- "Number of bins:",
- min = 1,
- max = 50,
- value = 30),
- bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
- "right", options = list(container = "body"))
- ),
- mainPanel(
- plotOutput("distPlot"),
- uiOutput("uiExample")
- )
- )
- ),
- server =
- function(input, output, session) {
- output$distPlot <- renderPlot({
-
- # generate bins based on input$bins from ui.R
- x <- faithful[, 2]
- bins <- seq(min(x), max(x), length.out = input$bins + 1)
-
- # draw the histogram with the specified number of bins
- hist(x, breaks = bins, col = 'darkgray', border = 'white')
-
- })
- output$uiExample <- renderUI({
- tags$span(
- popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"),
- "A Pointless Button",
- "This button is <b>pointless</b>. It does not do <em>anything</em>!"),
- tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"),
- "This button is pointless too!")
- )
- })
- addPopover(session, "distPlot", "Data", content = paste0("<p>Waiting time between ",
- "eruptions and the duration of the eruption for the Old Faithful geyser ",
- "in Yellowstone National Park, Wyoming, USA.</p><p>Azzalini, A. and ",
- "Bowman, A. W. (1990). A look at some data on the Old Faithful geyser. ",
- "Applied Statistics 39, 357-365.</p>"), trigger = 'click')
- }
-)
-\dontrun{
- runApp(app)
-}
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{addPopover}};
- \code{\link{addTooltip}}; \code{\link{bsPopover}};
- \code{\link{bsTooltip}}; \code{\link{popify}};
- \code{\link{removePopover}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/Tooltips_and_Popovers.R
+\name{Tooltips_and_Popovers}
+\alias{Tooltips_and_Popovers}
+\title{Tooltips and Popovers}
+\description{
+Tooltips and Popovers allow you to add additional information about controls
+or outputs without cluttering up your user interface. You can add a tooltip to
+a button that displays on hover and better explains what the button will do, or
+you could add a popover to an output providing further analysis of that output.
+}
+\details{
+You can create tooltips and popovers from either the UI script or within the
+Server logic. \code{\link{bsTooltip}} and \code{\link{bsPopover}} are used in
+the UI, and \code{\link{addTooltip}} and \code{\link{addPopover}} are used in
+the Server logic. \code{\link{tipify}} and \code{\link{popify}} can be used
+within the UI or from within a \code{\link{renderUI}} in the Server logic. They
+also have the added advantage of not requiring that the UI element have an ID
+attribute.
+}
+\note{
+Tooltips and Popovers cannot contain shiny inputs or outputs.
+
+There must be at least one \code{shinyBS} component in the UI of your
+app in order for the necessary dependencies to be loaded. Because of this,
+\code{\link{addTooltip}} and \code{\link{addPopover}} will not work if they
+are the only shinyBS components in your app.
+
+Tooltips and popovers may not work on some of the more complex shiny inputs
+or outputs. If you encounter a problem with tooltips or popovers not appearing
+please file a issue on the github page so I can fix it.
+
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{Tooltips_and_Popovers} functionality.
+}
+\section{Components}{
+
+There are eight functions in the Tooltips and Popovers family:
+ \describe{
+ \item{\code{\link{bsTooltip}}}{Used in the UI to add a tooltip to an element
+ in your UI.}
+ \item{\code{\link{bsPopover}}}{Used in the UI to add a popover to an element
+ in your UI.}
+ \item{\code{\link{tipify}}}{Wrap any UI element in \code{tipify} to add a
+ tooltip to the wrapped element. Preferred for elemented created with
+ \code{\link{renderUI}}.}
+ \item{\code{\link{popify}}}{Wrap any UI element in \code{popify} to add a
+ popover to the wrapped element. Preferred for elements created with
+ \code{\link{renderUI}}.}
+ \item{\code{\link{addTooltip}}}{Used in the Server logic to add a tooltip
+ to an element in your UI.}
+ \item{\code{\link{addPopover}}}{Used in the Server logic to add a popover
+ to an element in your UI.}
+ \item{\code{\link{removeTooltip}}}{Used in the Server logic to remove a
+ tooltip from an element in your UI.}
+ \item{\code{\link{removePopover}}}{Used in the Server logic to remove a
+ popover from an element in your UI.}
+ }
+}
+
+\section{Changes}{
+
+An \code{options} argument has been added to the creation functions to allow
+advanced users more control over how the tooltips and popovers appear. See
+the \href{http://getbootstrap.com}{Twitter Bootstrap 3 documentation} for more
+details.
+}
+\examples{
+library(shiny)
+library(shinyBS)
+
+app = shinyApp(
+ ui =
+ fluidPage(
+ sidebarLayout(
+ sidebarPanel(
+ sliderInput("bins",
+ "Number of bins:",
+ min = 1,
+ max = 50,
+ value = 30),
+ bsTooltip("bins", "The wait times will be broken into this many equally spaced bins",
+ "right", options = list(container = "body"))
+ ),
+ mainPanel(
+ plotOutput("distPlot"),
+ uiOutput("uiExample")
+ )
+ )
+ ),
+ server =
+ function(input, output, session) {
+ output$distPlot <- renderPlot({
+
+ # generate bins based on input$bins from ui.R
+ x <- faithful[, 2]
+ bins <- seq(min(x), max(x), length.out = input$bins + 1)
+
+ # draw the histogram with the specified number of bins
+ hist(x, breaks = bins, col = 'darkgray', border = 'white')
+
+ })
+ output$uiExample <- renderUI({
+ tags$span(
+ popify(bsButton("pointlessButton", "Button", style = "primary", size = "large"),
+ "A Pointless Button",
+ "This button is <b>pointless</b>. It does not do <em>anything</em>!"),
+ tipify(bsButton("pB2", "Button", style = "inverse", size = "extra-small"),
+ "This button is pointless too!")
+ )
+ })
+ addPopover(session, "distPlot", "Data", content = paste0("<p>Waiting time between ",
+ "eruptions and the duration of the eruption for the Old Faithful geyser ",
+ "in Yellowstone National Park, Wyoming, USA.</p><p>Azzalini, A. and ",
+ "Bowman, A. W. (1990). A look at some data on the Old Faithful geyser. ",
+ "Applied Statistics 39, 357-365.</p>"), trigger = 'click')
+ }
+)
+\dontrun{
+ runApp(app)
+}
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{addPopover}};
+ \code{\link{addTooltip}}; \code{\link{bsPopover}};
+ \code{\link{bsTooltip}}; \code{\link{popify}};
+ \code{\link{removePopover}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/addPopover.Rd b/man/addPopover.Rd
index dc6ecb5..36b3c6d 100644
--- a/man/addPopover.Rd
+++ b/man/addPopover.Rd
@@ -1,48 +1,48 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/addPopover.R
-\name{addPopover}
-\alias{addPopover}
-\title{addPopover}
-\usage{
-addPopover(session, id, title, content, placement = "bottom",
- trigger = "hover", options = NULL)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{id}{The id of the element to attach the popover to.}
-
-\item{title}{The title of the popover.}
-
-\item{content}{The main content of the popover.}
-
-\item{placement}{Where the popover should appear relative to its target
-(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{bottom}.}
-
-\item{trigger}{What action should cause the popover to appear? (\code{hover},
-\code{focus}, \code{click}, or \code{manual}). Defaults to \code{hover}.}
-
-\item{options}{A named list of additional options to be set on the popover.}
-}
-\description{
-\code{addPopover} is used within the Server logic of an app to add a popover to a Shiny
-input or output.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{addPopover} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{addPopover} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addTooltip}}; \code{\link{bsPopover}};
- \code{\link{bsTooltip}}; \code{\link{popify}};
- \code{\link{removePopover}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/addPopover.R
+\name{addPopover}
+\alias{addPopover}
+\title{addPopover}
+\usage{
+addPopover(session, id, title, content, placement = "bottom",
+ trigger = "hover", options = NULL)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{id}{The id of the element to attach the popover to.}
+
+\item{title}{The title of the popover.}
+
+\item{content}{The main content of the popover.}
+
+\item{placement}{Where the popover should appear relative to its target
+(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{bottom}.}
+
+\item{trigger}{What action should cause the popover to appear? (\code{hover},
+\code{focus}, \code{click}, or \code{manual}). Defaults to \code{hover}.}
+
+\item{options}{A named list of additional options to be set on the popover.}
+}
+\description{
+\code{addPopover} is used within the Server logic of an app to add a popover to a Shiny
+input or output.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{addPopover} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{addPopover} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addTooltip}}; \code{\link{bsPopover}};
+ \code{\link{bsTooltip}}; \code{\link{popify}};
+ \code{\link{removePopover}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/addTooltip.Rd b/man/addTooltip.Rd
index 04f4969..7049d87 100644
--- a/man/addTooltip.Rd
+++ b/man/addTooltip.Rd
@@ -1,46 +1,46 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/addTooltip.R
-\name{addTooltip}
-\alias{addTooltip}
-\title{addTooltip}
-\usage{
-addTooltip(session, id, title, placement = "bottom", trigger = "hover",
- options = NULL)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{id}{The id of the element to attach the tooltip to.}
-
-\item{title}{The content of the tooltip.}
-
-\item{placement}{Where the tooltip should appear relative to its target
-(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
-
-\item{trigger}{What action should cause the tooltip to appear? (\code{hover},
-\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
-
-\item{options}{A named list of additional options to be set on the tooltip.}
-}
-\description{
-\code{addTooltip} is used within the Server logic of an app to add a tooltip to a Shiny
-input or output.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{addTooltip} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{addTooltip} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{bsPopover}};
- \code{\link{bsTooltip}}; \code{\link{popify}};
- \code{\link{removePopover}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/addTooltip.R
+\name{addTooltip}
+\alias{addTooltip}
+\title{addTooltip}
+\usage{
+addTooltip(session, id, title, placement = "bottom", trigger = "hover",
+ options = NULL)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{id}{The id of the element to attach the tooltip to.}
+
+\item{title}{The content of the tooltip.}
+
+\item{placement}{Where the tooltip should appear relative to its target
+(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
+
+\item{trigger}{What action should cause the tooltip to appear? (\code{hover},
+\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
+
+\item{options}{A named list of additional options to be set on the tooltip.}
+}
+\description{
+\code{addTooltip} is used within the Server logic of an app to add a tooltip to a Shiny
+input or output.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{addTooltip} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{addTooltip} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{bsPopover}};
+ \code{\link{bsTooltip}}; \code{\link{popify}};
+ \code{\link{removePopover}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/bsAlert.Rd b/man/bsAlert.Rd
index e4a2985..351fe5e 100644
--- a/man/bsAlert.Rd
+++ b/man/bsAlert.Rd
@@ -1,30 +1,30 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsAlert.R
-\name{bsAlert}
-\alias{bsAlert}
-\title{bsAlert}
-\usage{
-bsAlert(anchorId)
-}
-\arguments{
-\item{anchorId}{A unique id the identifies the anchor.}
-}
-\description{
-\code{bsAlert} creates an anchor point in your UI definition. This anchor point
-is where alerts created in your Server logic will be displayed.
-}
-\details{
-See \link{Alerts} for more information about how to use \code{bsAlert} with the
-rest of the Alerts family.
-}
-\note{
-Run \code{bsExample("Alerts")} for an example
-of \code{bsAlert} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Alerts: \code{\link{Alerts}};
- \code{\link{closeAlert}}; \code{\link{createAlert}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsAlert.R
+\name{bsAlert}
+\alias{bsAlert}
+\title{bsAlert}
+\usage{
+bsAlert(anchorId)
+}
+\arguments{
+\item{anchorId}{A unique id the identifies the anchor.}
+}
+\description{
+\code{bsAlert} creates an anchor point in your UI definition. This anchor point
+is where alerts created in your Server logic will be displayed.
+}
+\details{
+See \link{Alerts} for more information about how to use \code{bsAlert} with the
+rest of the Alerts family.
+}
+\note{
+Run \code{bsExample("Alerts")} for an example
+of \code{bsAlert} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Alerts: \code{\link{Alerts}};
+ \code{\link{closeAlert}}; \code{\link{createAlert}}
+}
+
diff --git a/man/bsButton.Rd b/man/bsButton.Rd
index 0e9f301..517fcf9 100644
--- a/man/bsButton.Rd
+++ b/man/bsButton.Rd
@@ -1,54 +1,54 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsButton.R
-\name{bsButton}
-\alias{bsButton}
-\title{bsButton}
-\usage{
-bsButton(inputId, label, icon = NULL, ..., style = "default",
- size = "default", type = "action", block = FALSE, disabled = FALSE,
- value = FALSE)
-}
-\arguments{
-\item{inputId}{Specifies the input slot that will be used to access the
-value.}
-
-\item{label}{The contents of the button or link--usually a text label, but
-you could also use any other HTML, like an image.}
-
-\item{icon}{An optional \code{\link{icon}} to appear on the button.}
-
-\item{...}{Named attributes to be applied to the button or link.}
-
-\item{style}{A Bootstrap style to apply to the button. (\code{default}, \code{primary},
-\code{success}, \code{info}, \code{warning}, or \code{danger})}
-
-\item{size}{The size of the button (\code{extra-small}, \code{small},
-\code{default}, or \code{large})}
-
-\item{type}{The type of button to create. (\code{action} or \code{toggle})}
-
-\item{block}{\bold{logical} Should the button take the full width of the parent element?}
-
-\item{disabled}{\bold{logical} Should the button be disabled (un-clickable)?}
-
-\item{value}{\bold{logical} If \code{type = "toggle"}, the initial value of the button.}
-}
-\description{
-\code{bsButton} is used in your UI script to create customizable action and toggle
-buttons.
-}
-\details{
-See \link{Buttons} for more information about how to use \code{bsButton} with the
-rest of the Buttons family.
-}
-\note{
-Run \code{bsExample("Buttons")} for an example
-of \code{bsButton} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Buttons: \code{\link{Buttons}};
- \code{\link{updateButton}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsButton.R
+\name{bsButton}
+\alias{bsButton}
+\title{bsButton}
+\usage{
+bsButton(inputId, label, icon = NULL, ..., style = "default",
+ size = "default", type = "action", block = FALSE, disabled = FALSE,
+ value = FALSE)
+}
+\arguments{
+\item{inputId}{Specifies the input slot that will be used to access the
+value.}
+
+\item{label}{The contents of the button or link--usually a text label, but
+you could also use any other HTML, like an image.}
+
+\item{icon}{An optional \code{\link{icon}} to appear on the button.}
+
+\item{...}{Named attributes to be applied to the button or link.}
+
+\item{style}{A Bootstrap style to apply to the button. (\code{default}, \code{primary},
+\code{success}, \code{info}, \code{warning}, or \code{danger})}
+
+\item{size}{The size of the button (\code{extra-small}, \code{small},
+\code{default}, or \code{large})}
+
+\item{type}{The type of button to create. (\code{action} or \code{toggle})}
+
+\item{block}{\bold{logical} Should the button take the full width of the parent element?}
+
+\item{disabled}{\bold{logical} Should the button be disabled (un-clickable)?}
+
+\item{value}{\bold{logical} If \code{type = "toggle"}, the initial value of the button.}
+}
+\description{
+\code{bsButton} is used in your UI script to create customizable action and toggle
+buttons.
+}
+\details{
+See \link{Buttons} for more information about how to use \code{bsButton} with the
+rest of the Buttons family.
+}
+\note{
+Run \code{bsExample("Buttons")} for an example
+of \code{bsButton} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Buttons: \code{\link{Buttons}};
+ \code{\link{updateButton}}
+}
+
diff --git a/man/bsCollapse.Rd b/man/bsCollapse.Rd
index 804d858..8d887df 100644
--- a/man/bsCollapse.Rd
+++ b/man/bsCollapse.Rd
@@ -1,40 +1,40 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsCollapse.R
-\name{bsCollapse}
-\alias{bsCollapse}
-\title{bsCollapse}
-\usage{
-bsCollapse(..., id = NULL, multiple = FALSE, open = NULL)
-}
-\arguments{
-\item{id}{\bold{Optional} You can use \code{input$id} in your Server logic to
-determine which panels are open, and \code{\link{updateCollapse}} to open/close
-panels.}
-
-\item{multiple}{Can more than one panel be open at a time? Defaults to \code{FALSE}.}
-
-\item{open}{The \code{value}, (or if none was supplied, the \code{title}) of
-the panel(s) you want open on load.}
-
-\item{\dots}{\code{\link{bsCollapsePanel}} elements to include in the Collapse.}
-}
-\description{
-\code{bsCollapse} is used in your UI to create a collapse panel group. Use
-\code{\link{bsCollapsePanel}} to populate this object with panels.
-}
-\details{
-See \link{Collapses} for more information about how to use \code{bsCollapse} with the
-rest of the Collapses family.
-}
-\note{
-Run \code{bsExample("Collapses")} for an example
-of \code{bsCollapse} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Collapses: \code{\link{Collapses}};
- \code{\link{bsCollapsePanel}};
- \code{\link{updateCollapse}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsCollapse.R
+\name{bsCollapse}
+\alias{bsCollapse}
+\title{bsCollapse}
+\usage{
+bsCollapse(..., id = NULL, multiple = FALSE, open = NULL)
+}
+\arguments{
+\item{id}{\bold{Optional} You can use \code{input$id} in your Server logic to
+determine which panels are open, and \code{\link{updateCollapse}} to open/close
+panels.}
+
+\item{multiple}{Can more than one panel be open at a time? Defaults to \code{FALSE}.}
+
+\item{open}{The \code{value}, (or if none was supplied, the \code{title}) of
+the panel(s) you want open on load.}
+
+\item{\dots}{\code{\link{bsCollapsePanel}} elements to include in the Collapse.}
+}
+\description{
+\code{bsCollapse} is used in your UI to create a collapse panel group. Use
+\code{\link{bsCollapsePanel}} to populate this object with panels.
+}
+\details{
+See \link{Collapses} for more information about how to use \code{bsCollapse} with the
+rest of the Collapses family.
+}
+\note{
+Run \code{bsExample("Collapses")} for an example
+of \code{bsCollapse} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Collapses: \code{\link{Collapses}};
+ \code{\link{bsCollapsePanel}};
+ \code{\link{updateCollapse}}
+}
+
diff --git a/man/bsCollapsePanel.Rd b/man/bsCollapsePanel.Rd
index 57eeb7b..2f1d410 100644
--- a/man/bsCollapsePanel.Rd
+++ b/man/bsCollapsePanel.Rd
@@ -1,35 +1,35 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsCollapsePanel.R
-\name{bsCollapsePanel}
-\alias{bsCollapsePanel}
-\title{bsCollapsePanel}
-\usage{
-bsCollapsePanel(title, ..., value = title, style = NULL)
-}
-\arguments{
-\item{title}{The title to display at the top of the panel.}
-
-\item{value}{\bold{Optional} The value to return when this panel is open. Defaults to \code{title}.}
-
-\item{style}{\bold{Optional} A Bootstrap style to apply to the panel. (\code{primary}, \code{danger}, \code{warning}, \code{info}, or \code{success})}
-
-\item{\dots}{UI elements to include within the panel.}
-}
-\description{
-\code{bsCollapsePanel} creates individual panels within a \code{\link{bsCollapse}} object.
-}
-\details{
-See \link{Collapses} for more information about how to use \code{bsCollapsePanel} with the
-rest of the Collapses family.
-}
-\note{
-Run \code{bsExample("Collapses")} for an example
-of \code{bsCollapsePanel} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Collapses: \code{\link{Collapses}};
- \code{\link{bsCollapse}}; \code{\link{updateCollapse}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsCollapsePanel.R
+\name{bsCollapsePanel}
+\alias{bsCollapsePanel}
+\title{bsCollapsePanel}
+\usage{
+bsCollapsePanel(title, ..., value = title, style = NULL)
+}
+\arguments{
+\item{title}{The title to display at the top of the panel.}
+
+\item{value}{\bold{Optional} The value to return when this panel is open. Defaults to \code{title}.}
+
+\item{style}{\bold{Optional} A Bootstrap style to apply to the panel. (\code{primary}, \code{danger}, \code{warning}, \code{info}, or \code{success})}
+
+\item{\dots}{UI elements to include within the panel.}
+}
+\description{
+\code{bsCollapsePanel} creates individual panels within a \code{\link{bsCollapse}} object.
+}
+\details{
+See \link{Collapses} for more information about how to use \code{bsCollapsePanel} with the
+rest of the Collapses family.
+}
+\note{
+Run \code{bsExample("Collapses")} for an example
+of \code{bsCollapsePanel} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Collapses: \code{\link{Collapses}};
+ \code{\link{bsCollapse}}; \code{\link{updateCollapse}}
+}
+
diff --git a/man/bsExample.Rd b/man/bsExample.Rd
index bae7cd9..624b627 100644
--- a/man/bsExample.Rd
+++ b/man/bsExample.Rd
@@ -1,32 +1,32 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsExample.R
-\name{bsExample}
-\alias{bsExample}
-\title{bsExample}
-\usage{
-bsExample(family, display.mode = "showcase", ...)
-}
-\arguments{
-\item{family}{A shinyBS family name}
-
-\item{display.mode}{The display mode to use when running the example. See
-\code{\link{runApp}}.}
-
-\item{\dots}{Other parameters to pass to \code{\link{runApp}}.}
-}
-\description{
-A function to view examples of shinyBS functionality. Will run the examples
-found in the examples sections of shinyBS documentation. Use this instead of
-\code{example}.
-}
-\details{
-This function is just a wrapper for \code{\link{runApp}} that runs copies of the
-examples found in the family documention pages of \code{shinyBS}. By default,
-\code{display.mode} is set to \code{showcase} so you can see the code while
-the app is running.
-}
-\examples{
-\dontrun{
- bsExample("Alerts")}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsExample.R
+\name{bsExample}
+\alias{bsExample}
+\title{bsExample}
+\usage{
+bsExample(family, display.mode = "showcase", ...)
+}
+\arguments{
+\item{family}{A shinyBS family name}
+
+\item{display.mode}{The display mode to use when running the example. See
+\code{\link{runApp}}.}
+
+\item{\dots}{Other parameters to pass to \code{\link{runApp}}.}
+}
+\description{
+A function to view examples of shinyBS functionality. Will run the examples
+found in the examples sections of shinyBS documentation. Use this instead of
+\code{example}.
+}
+\details{
+This function is just a wrapper for \code{\link{runApp}} that runs copies of the
+examples found in the family documention pages of \code{shinyBS}. By default,
+\code{display.mode} is set to \code{showcase} so you can see the code while
+the app is running.
+}
+\examples{
+\dontrun{
+ bsExample("Alerts")}
+}
+
diff --git a/man/bsModal.Rd b/man/bsModal.Rd
index 03218c5..0ae2e2f 100644
--- a/man/bsModal.Rd
+++ b/man/bsModal.Rd
@@ -1,37 +1,37 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsModal.R
-\name{bsModal}
-\alias{bsModal}
-\title{bsModal}
-\usage{
-bsModal(id, title, trigger, ..., size)
-}
-\arguments{
-\item{id}{A unique identifier for the modal window}
-
-\item{title}{The title to appear at the top of the modal}
-
-\item{trigger}{The id of a button or link that will open the modal.}
-
-\item{size}{\bold{Optional} What size should the modal be? (\code{small} or \code{large})}
-
-\item{\dots}{UI elements to include within the modal}
-}
-\description{
-\code{bsModal} is used within the UI to create a modal window.
-}
-\details{
-See \link{Modals} for more information about how to use \code{bsModal} with the
-rest of the Modals family.
-}
-\note{
-Run \code{bsExample("Modals")} for an example
-of \code{bsModal} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Modals: \code{\link{Modals}};
- \code{\link{toggleModal}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsModal.R
+\name{bsModal}
+\alias{bsModal}
+\title{bsModal}
+\usage{
+bsModal(id, title, trigger, ..., size)
+}
+\arguments{
+\item{id}{A unique identifier for the modal window}
+
+\item{title}{The title to appear at the top of the modal}
+
+\item{trigger}{The id of a button or link that will open the modal.}
+
+\item{size}{\bold{Optional} What size should the modal be? (\code{small} or \code{large})}
+
+\item{\dots}{UI elements to include within the modal}
+}
+\description{
+\code{bsModal} is used within the UI to create a modal window.
+}
+\details{
+See \link{Modals} for more information about how to use \code{bsModal} with the
+rest of the Modals family.
+}
+\note{
+Run \code{bsExample("Modals")} for an example
+of \code{bsModal} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Modals: \code{\link{Modals}};
+ \code{\link{toggleModal}}
+}
+
diff --git a/man/bsPopover.Rd b/man/bsPopover.Rd
index d5ad677..3cdc3af 100644
--- a/man/bsPopover.Rd
+++ b/man/bsPopover.Rd
@@ -1,46 +1,46 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsPopover.R
-\name{bsPopover}
-\alias{bsPopover}
-\title{bsPopover}
-\usage{
-bsPopover(id, title, content, placement = "bottom", trigger = "hover",
- options = NULL)
-}
-\arguments{
-\item{id}{The id of the element to attach the popover to.}
-
-\item{title}{The title of the popover.}
-
-\item{content}{The main content of the popover.}
-
-\item{placement}{Where the popover should appear relative to its target
-(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
-
-\item{trigger}{What action should cause the popover to appear? (\code{hover},
-\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
-
-\item{options}{A named list of additional options to be set on the popover.}
-}
-\description{
-\code{bsPopover} is used within the UI of an app to add a popover to a Shiny
-input or output.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{bsPopover} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{bsPopover} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{addTooltip}};
- \code{\link{bsTooltip}}; \code{\link{popify}};
- \code{\link{removePopover}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsPopover.R
+\name{bsPopover}
+\alias{bsPopover}
+\title{bsPopover}
+\usage{
+bsPopover(id, title, content, placement = "bottom", trigger = "hover",
+ options = NULL)
+}
+\arguments{
+\item{id}{The id of the element to attach the popover to.}
+
+\item{title}{The title of the popover.}
+
+\item{content}{The main content of the popover.}
+
+\item{placement}{Where the popover should appear relative to its target
+(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
+
+\item{trigger}{What action should cause the popover to appear? (\code{hover},
+\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
+
+\item{options}{A named list of additional options to be set on the popover.}
+}
+\description{
+\code{bsPopover} is used within the UI of an app to add a popover to a Shiny
+input or output.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{bsPopover} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{bsPopover} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{addTooltip}};
+ \code{\link{bsTooltip}}; \code{\link{popify}};
+ \code{\link{removePopover}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/bsTooltip.Rd b/man/bsTooltip.Rd
index d23c6d5..1494de7 100644
--- a/man/bsTooltip.Rd
+++ b/man/bsTooltip.Rd
@@ -1,44 +1,44 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/bsTooltip.R
-\name{bsTooltip}
-\alias{bsTooltip}
-\title{bsTooltip}
-\usage{
-bsTooltip(id, title, placement = "bottom", trigger = "hover",
- options = NULL)
-}
-\arguments{
-\item{id}{The id of the element to attach the tooltip to.}
-
-\item{title}{The content of the tooltip.}
-
-\item{placement}{Where the tooltip should appear relative to its target
-(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
-
-\item{trigger}{What action should cause the tooltip to appear? (\code{hover},
-\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
-
-\item{options}{A named list of additional options to be set on the tooltip.}
-}
-\description{
-\code{bsTooltip} is used within the UI of an app to add a tooltip to a Shiny
-input or output.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{bsTooltip} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{bsTooltip} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{addTooltip}};
- \code{\link{bsPopover}}; \code{\link{popify}};
- \code{\link{removePopover}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsTooltip.R
+\name{bsTooltip}
+\alias{bsTooltip}
+\title{bsTooltip}
+\usage{
+bsTooltip(id, title, placement = "bottom", trigger = "hover",
+ options = NULL)
+}
+\arguments{
+\item{id}{The id of the element to attach the tooltip to.}
+
+\item{title}{The content of the tooltip.}
+
+\item{placement}{Where the tooltip should appear relative to its target
+(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
+
+\item{trigger}{What action should cause the tooltip to appear? (\code{hover},
+\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
+
+\item{options}{A named list of additional options to be set on the tooltip.}
+}
+\description{
+\code{bsTooltip} is used within the UI of an app to add a tooltip to a Shiny
+input or output.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{bsTooltip} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{bsTooltip} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{addTooltip}};
+ \code{\link{bsPopover}}; \code{\link{popify}};
+ \code{\link{removePopover}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/bsTypeahead.Rd b/man/bsTypeahead.Rd
new file mode 100644
index 0000000..baf5243
--- /dev/null
+++ b/man/bsTypeahead.Rd
@@ -0,0 +1,32 @@
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/bsTypeahead.R
+\name{bsTypeahead}
+\alias{bsTypeahead}
+\title{bsTypeahead}
+\usage{
+bsTypeahead(inputId, label, value = "", choices, items = 8, minLength = 1)
+}
+\arguments{
+\item{inputId}{Input variable to assign the control's value to}
+
+\item{label}{Display label for the control}
+
+\item{value}{Initial value}
+
+\item{choices}{Array of strings to match against. Can also be JavaScript
+function. Use htmlwidgets::JS() to indicate JavaScript. The length of \code{choices} must no exceed 131370.}
+
+\item{items}{The max number of items to display in the dropdown. Can also be
+set to 'all'}
+
+\item{minLength}{The minimum character length needed before triggering
+autocomplete suggestions. You can set it to 0 so suggestion are shown even
+when there is no text when lookup function is called.}
+}
+\description{
+\code{typeaheadInput} creates a textinput with type ahead function buttons.
+}
+\seealso{
+\code{\link{updateTypeaheadInput}}
+}
+
diff --git a/man/closeAlert.Rd b/man/closeAlert.Rd
index e554c08..707330f 100644
--- a/man/closeAlert.Rd
+++ b/man/closeAlert.Rd
@@ -1,32 +1,32 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/closeAlert.R
-\name{closeAlert}
-\alias{closeAlert}
-\title{closeAlert}
-\usage{
-closeAlert(session, alertId)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{alertId}{The id of the alert to be dismissed.}
-}
-\description{
-\code{closeAlert} is used within your Server logic to close an alert that you
-created with \code{\link{createAlert}}.
-}
-\details{
-See \link{Alerts} for more information about how to use \code{closeAlert} with the
-rest of the Alerts family.
-}
-\note{
-Run \code{bsExample("Alerts")} for an example
-of \code{closeAlert} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Alerts: \code{\link{Alerts}}; \code{\link{bsAlert}};
- \code{\link{createAlert}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/closeAlert.R
+\name{closeAlert}
+\alias{closeAlert}
+\title{closeAlert}
+\usage{
+closeAlert(session, alertId)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{alertId}{The id of the alert to be dismissed.}
+}
+\description{
+\code{closeAlert} is used within your Server logic to close an alert that you
+created with \code{\link{createAlert}}.
+}
+\details{
+See \link{Alerts} for more information about how to use \code{closeAlert} with the
+rest of the Alerts family.
+}
+\note{
+Run \code{bsExample("Alerts")} for an example
+of \code{closeAlert} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Alerts: \code{\link{Alerts}}; \code{\link{bsAlert}};
+ \code{\link{createAlert}}
+}
+
diff --git a/man/createAlert.Rd b/man/createAlert.Rd
index 9aa8212..5b6217e 100644
--- a/man/createAlert.Rd
+++ b/man/createAlert.Rd
@@ -1,46 +1,46 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/createAlert.R
-\name{createAlert}
-\alias{createAlert}
-\title{createAlert}
-\usage{
-createAlert(session, anchorId, alertId = NULL, title = NULL,
- content = NULL, style = NULL, dismiss = TRUE, append = TRUE)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{anchorId}{The unique identifier of the anchor where the alert should be
-displayed.}
-
-\item{alertId}{\bold{Optional} A unique identifier for the Alert.}
-
-\item{title}{\bold{Optional} A title for the Alert.}
-
-\item{content}{The main body of the Alert. HTML tags are allowed.}
-
-\item{style}{A bootstrap style to apply. Defaults to \code{info}.}
-
-\item{dismiss}{\code{logical} Should the Alert be user dismissable? Defaults to \code{TRUE}.}
-
-\item{append}{\code{logical} Should the Alert be appended below existing Alerts? Default to \code{TRUE}.}
-}
-\description{
-\code{createAlert} is used within the Server logic of your Shiny app to display
-an alert to the user.
-}
-\details{
-See \link{Alerts} for more information about how to use \code{createAlert} with the
-rest of the Alerts family.
-}
-\note{
-Run \code{bsExample("Alerts")} for an example
-of \code{createAlert} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Alerts: \code{\link{Alerts}}; \code{\link{bsAlert}};
- \code{\link{closeAlert}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/createAlert.R
+\name{createAlert}
+\alias{createAlert}
+\title{createAlert}
+\usage{
+createAlert(session, anchorId, alertId = NULL, title = NULL,
+ content = NULL, style = NULL, dismiss = TRUE, append = TRUE)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{anchorId}{The unique identifier of the anchor where the alert should be
+displayed.}
+
+\item{alertId}{\bold{Optional} A unique identifier for the Alert.}
+
+\item{title}{\bold{Optional} A title for the Alert.}
+
+\item{content}{The main body of the Alert. HTML tags are allowed.}
+
+\item{style}{A bootstrap style to apply. Defaults to \code{info}.}
+
+\item{dismiss}{\code{logical} Should the Alert be user dismissable? Defaults to \code{TRUE}.}
+
+\item{append}{\code{logical} Should the Alert be appended below existing Alerts? Default to \code{TRUE}.}
+}
+\description{
+\code{createAlert} is used within the Server logic of your Shiny app to display
+an alert to the user.
+}
+\details{
+See \link{Alerts} for more information about how to use \code{createAlert} with the
+rest of the Alerts family.
+}
+\note{
+Run \code{bsExample("Alerts")} for an example
+of \code{createAlert} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Alerts: \code{\link{Alerts}}; \code{\link{bsAlert}};
+ \code{\link{closeAlert}}
+}
+
diff --git a/man/popify.Rd b/man/popify.Rd
index 7a1dcbf..180135d 100644
--- a/man/popify.Rd
+++ b/man/popify.Rd
@@ -1,47 +1,47 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/popify.R
-\name{popify}
-\alias{popify}
-\title{popify}
-\usage{
-popify(el, title, content, placement = "bottom", trigger = "hover",
- options = NULL)
-}
-\arguments{
-\item{el}{A shiny UI element.}
-
-\item{title}{The title of the popover.}
-
-\item{content}{The main content of the popover.}
-
-\item{placement}{Where the popover should appear relative to its target
-(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
-
-\item{trigger}{What action should cause the popover to appear? (\code{hover},
-\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
-
-\item{options}{A named list of additional options to be set on the popover.}
-}
-\description{
-\code{popify} can be wrapped around any shiny UI element to add a popover to the
-wrapped element. This should be a safer way to add popovers to elements created with
-\code{\link{renderUI}}.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{popify} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{popify} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{addTooltip}};
- \code{\link{bsPopover}}; \code{\link{bsTooltip}};
- \code{\link{removePopover}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/popify.R
+\name{popify}
+\alias{popify}
+\title{popify}
+\usage{
+popify(el, title, content, placement = "bottom", trigger = "hover",
+ options = NULL)
+}
+\arguments{
+\item{el}{A shiny UI element.}
+
+\item{title}{The title of the popover.}
+
+\item{content}{The main content of the popover.}
+
+\item{placement}{Where the popover should appear relative to its target
+(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
+
+\item{trigger}{What action should cause the popover to appear? (\code{hover},
+\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
+
+\item{options}{A named list of additional options to be set on the popover.}
+}
+\description{
+\code{popify} can be wrapped around any shiny UI element to add a popover to the
+wrapped element. This should be a safer way to add popovers to elements created with
+\code{\link{renderUI}}.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{popify} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{popify} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{addTooltip}};
+ \code{\link{bsPopover}}; \code{\link{bsTooltip}};
+ \code{\link{removePopover}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/removePopover.Rd b/man/removePopover.Rd
index 19eb4fa..6cb805f 100644
--- a/man/removePopover.Rd
+++ b/man/removePopover.Rd
@@ -1,35 +1,35 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/removePopover.R
-\name{removePopover}
-\alias{removePopover}
-\title{removePopover}
-\usage{
-removePopover(session, id)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{id}{The id of the element to remove the popover from.}
-}
-\description{
-\code{removePopover} is used within the Server logic of an app to remove an
-existing popover from a Shiny input or output.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{removePopover} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{removePopover} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{addTooltip}};
- \code{\link{bsPopover}}; \code{\link{bsTooltip}};
- \code{\link{popify}}; \code{\link{removeTooltip}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/removePopover.R
+\name{removePopover}
+\alias{removePopover}
+\title{removePopover}
+\usage{
+removePopover(session, id)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{id}{The id of the element to remove the popover from.}
+}
+\description{
+\code{removePopover} is used within the Server logic of an app to remove an
+existing popover from a Shiny input or output.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{removePopover} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{removePopover} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{addTooltip}};
+ \code{\link{bsPopover}}; \code{\link{bsTooltip}};
+ \code{\link{popify}}; \code{\link{removeTooltip}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/removeTooltip.Rd b/man/removeTooltip.Rd
index 75fe564..6f85807 100644
--- a/man/removeTooltip.Rd
+++ b/man/removeTooltip.Rd
@@ -1,35 +1,35 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/removeTooltip.R
-\name{removeTooltip}
-\alias{removeTooltip}
-\title{removeTooltip}
-\usage{
-removeTooltip(session, id)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{id}{The id of the element to remove the tooltip from.}
-}
-\description{
-\code{removeTooltip} is used within the Server logic of an app to remove an
-existing tooltip from a Shiny input or output.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{removeTooltip} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{removeTooltip} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{addTooltip}};
- \code{\link{bsPopover}}; \code{\link{bsTooltip}};
- \code{\link{popify}}; \code{\link{removePopover}};
- \code{\link{tipify}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/removeTooltip.R
+\name{removeTooltip}
+\alias{removeTooltip}
+\title{removeTooltip}
+\usage{
+removeTooltip(session, id)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{id}{The id of the element to remove the tooltip from.}
+}
+\description{
+\code{removeTooltip} is used within the Server logic of an app to remove an
+existing tooltip from a Shiny input or output.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{removeTooltip} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{removeTooltip} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{addTooltip}};
+ \code{\link{bsPopover}}; \code{\link{bsTooltip}};
+ \code{\link{popify}}; \code{\link{removePopover}};
+ \code{\link{tipify}}
+}
+
diff --git a/man/tipify.Rd b/man/tipify.Rd
index 9d8402b..e4f3dc2 100644
--- a/man/tipify.Rd
+++ b/man/tipify.Rd
@@ -1,44 +1,44 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/tipify.R
-\name{tipify}
-\alias{tipify}
-\title{tipify}
-\usage{
-tipify(el, title, placement = "bottom", trigger = "hover", options = NULL)
-}
-\arguments{
-\item{el}{A shiny UI element.}
-
-\item{title}{The content of the tooltip.}
-
-\item{placement}{Where the tooltip should appear relative to its target
-(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
-
-\item{trigger}{What action should cause the tooltip to appear? (\code{hover},
-\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
-
-\item{options}{A named list of additional options to be set on the tooltip.}
-}
-\description{
-\code{tipify} can be wrapped around any shiny UI element to add a tooltip to the
-wrapped element. This should be a safer way to add tooltips to elements created with
-\code{\link{renderUI}}.
-}
-\details{
-See \link{Tooltips_and_Popovers} for more information about how to use \code{tipify} with the
-rest of the Tooltips_and_Popovers family.
-}
-\note{
-Run \code{bsExample("Tooltips_and_Popovers")} for an example
-of \code{tipify} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
- \code{\link{addPopover}}; \code{\link{addTooltip}};
- \code{\link{bsPopover}}; \code{\link{bsTooltip}};
- \code{\link{popify}}; \code{\link{removePopover}};
- \code{\link{removeTooltip}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/tipify.R
+\name{tipify}
+\alias{tipify}
+\title{tipify}
+\usage{
+tipify(el, title, placement = "bottom", trigger = "hover", options = NULL)
+}
+\arguments{
+\item{el}{A shiny UI element.}
+
+\item{title}{The content of the tooltip.}
+
+\item{placement}{Where the tooltip should appear relative to its target
+(\code{top}, \code{bottom}, \code{left}, or \code{right}). Defaults to \code{"bottom"}.}
+
+\item{trigger}{What action should cause the tooltip to appear? (\code{hover},
+\code{focus}, \code{click}, or \code{manual}). Defaults to \code{"hover"}.}
+
+\item{options}{A named list of additional options to be set on the tooltip.}
+}
+\description{
+\code{tipify} can be wrapped around any shiny UI element to add a tooltip to the
+wrapped element. This should be a safer way to add tooltips to elements created with
+\code{\link{renderUI}}.
+}
+\details{
+See \link{Tooltips_and_Popovers} for more information about how to use \code{tipify} with the
+rest of the Tooltips_and_Popovers family.
+}
+\note{
+Run \code{bsExample("Tooltips_and_Popovers")} for an example
+of \code{tipify} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Tooltips_and_Popovers: \code{\link{Tooltips_and_Popovers}};
+ \code{\link{addPopover}}; \code{\link{addTooltip}};
+ \code{\link{bsPopover}}; \code{\link{bsTooltip}};
+ \code{\link{popify}}; \code{\link{removePopover}};
+ \code{\link{removeTooltip}}
+}
+
diff --git a/man/toggleModal.Rd b/man/toggleModal.Rd
index dd6b961..1af7454 100644
--- a/man/toggleModal.Rd
+++ b/man/toggleModal.Rd
@@ -1,33 +1,33 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/toggleModal.R
-\name{toggleModal}
-\alias{toggleModal}
-\title{toggleModal}
-\usage{
-toggleModal(session, modalId, toggle = "toggle")
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{modalId}{The id of the modal window you want to open/close}
-
-\item{toggle}{Should the modal window \code{open}, \code{close}, or \code{toggle}?}
-}
-\description{
-\code{toggleModal} is used within your Server logic to open or close a modal
-window.
-}
-\details{
-See \link{Modals} for more information about how to use \code{toggleModal} with the
-rest of the Modals family.
-}
-\note{
-Run \code{bsExample("Modals")} for an example
-of \code{toggleModal} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Modals: \code{\link{Modals}}; \code{\link{bsModal}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/toggleModal.R
+\name{toggleModal}
+\alias{toggleModal}
+\title{toggleModal}
+\usage{
+toggleModal(session, modalId, toggle = "toggle")
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{modalId}{The id of the modal window you want to open/close}
+
+\item{toggle}{Should the modal window \code{open}, \code{close}, or \code{toggle}?}
+}
+\description{
+\code{toggleModal} is used within your Server logic to open or close a modal
+window.
+}
+\details{
+See \link{Modals} for more information about how to use \code{toggleModal} with the
+rest of the Modals family.
+}
+\note{
+Run \code{bsExample("Modals")} for an example
+of \code{toggleModal} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Modals: \code{\link{Modals}}; \code{\link{bsModal}}
+}
+
diff --git a/man/updateButton.Rd b/man/updateButton.Rd
index 97a717e..219637b 100644
--- a/man/updateButton.Rd
+++ b/man/updateButton.Rd
@@ -1,53 +1,53 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/updateButton.R
-\name{updateButton}
-\alias{updateButton}
-\title{updateButton}
-\usage{
-updateButton(session, inputId, label = NULL, icon = NULL, value = NULL,
- style = NULL, size = NULL, block = NULL, disabled = NULL)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{inputId}{Specifies the input slot that will be used to access the
-value.}
-
-\item{label}{The contents of the button or link--usually a text label, but
-you could also use any other HTML, like an image.}
-
-\item{icon}{An optional \code{\link{icon}} to appear on the button.}
-
-\item{value}{\bold{logical} If \code{type = "toggle"}, the initial value of the button.}
-
-\item{style}{A Bootstrap style to apply to the button. (\code{default}, \code{primary},
-\code{success}, \code{info}, \code{warning}, or \code{danger})}
-
-\item{size}{The size of the button (\code{extra-small}, \code{small},
-\code{default}, or \code{large})}
-
-\item{block}{\bold{logical} Should the button take the full width of the parent element?}
-
-\item{disabled}{\bold{logical} Should the button be disabled (un-clickable)?}
-}
-\description{
-\code{updateButton} is used in your Server logic to update the style or state
-of a button.
-}
-\details{
-Because of the way it is coded, \code{updateButton} may work on buttons not
-created by \code{\link{bsButton}} such as \code{\link{submitButton}}.
-
-See \code{\link{Buttons}} for more information about how to use \code{updateButton} with the rest of the Buttons family.
-}
-\note{
-Run \code{bsExample("Buttons")} for an example
-of \code{updateButton} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Buttons: \code{\link{Buttons}};
- \code{\link{bsButton}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/updateButton.R
+\name{updateButton}
+\alias{updateButton}
+\title{updateButton}
+\usage{
+updateButton(session, inputId, label = NULL, icon = NULL, value = NULL,
+ style = NULL, size = NULL, block = NULL, disabled = NULL)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{inputId}{Specifies the input slot that will be used to access the
+value.}
+
+\item{label}{The contents of the button or link--usually a text label, but
+you could also use any other HTML, like an image.}
+
+\item{icon}{An optional \code{\link{icon}} to appear on the button.}
+
+\item{value}{\bold{logical} If \code{type = "toggle"}, the initial value of the button.}
+
+\item{style}{A Bootstrap style to apply to the button. (\code{default}, \code{primary},
+\code{success}, \code{info}, \code{warning}, or \code{danger})}
+
+\item{size}{The size of the button (\code{extra-small}, \code{small},
+\code{default}, or \code{large})}
+
+\item{block}{\bold{logical} Should the button take the full width of the parent element?}
+
+\item{disabled}{\bold{logical} Should the button be disabled (un-clickable)?}
+}
+\description{
+\code{updateButton} is used in your Server logic to update the style or state
+of a button.
+}
+\details{
+Because of the way it is coded, \code{updateButton} may work on buttons not
+created by \code{\link{bsButton}} such as \code{\link{submitButton}}.
+
+See \code{\link{Buttons}} for more information about how to use \code{updateButton} with the rest of the Buttons family.
+}
+\note{
+Run \code{bsExample("Buttons")} for an example
+of \code{updateButton} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Buttons: \code{\link{Buttons}};
+ \code{\link{bsButton}}
+}
+
diff --git a/man/updateCollapse.Rd b/man/updateCollapse.Rd
index f644788..42b717a 100644
--- a/man/updateCollapse.Rd
+++ b/man/updateCollapse.Rd
@@ -1,43 +1,43 @@
-% Generated by roxygen2 (4.1.0): do not edit by hand
-% Please edit documentation in R/updateCollapse.R
-\name{updateCollapse}
-\alias{updateCollapse}
-\title{updateCollapse}
-\usage{
-updateCollapse(session, id, open = NULL, close = NULL, style = NULL)
-}
-\arguments{
-\item{session}{The session object passed to function given to shinyServer.}
-
-\item{id}{The id of the Collapse object you want to change.}
-
-\item{open}{A vector of \code{value} (or \code{title} if no \code{value} was
-provided) values identifying the panels you want to open.}
-
-\item{close}{A vector of \code{value} (or \code{title} if no \code{value} was
-provided) values identifying the panels you want to close.}
-
-\item{style}{A named list of Bootstrap styles (\code{primary}, \code{danger}, \code{info},
-\code{warning}, \code{success}, or \code{default}). The names should correspond
-to the \code{value} (or \code{title} if no \code{value} was provided) of the
-\code{\link{bsCollapsePanel}} you want to change.}
-}
-\description{
-\code{updateCollapse} is used within the Server logic of your Shiny app to
-modify a Collapse after load.
-}
-\details{
-See \link{Collapses} for more information about how to use \code{updateCollapse} with the
-rest of the Collapses family.
-}
-\note{
-Run \code{bsExample("Collapses")} for an example
-of \code{updateCollapse} functionality.
-}
-\seealso{
-\href{http://getbootstrap.com}{Twitter Bootstrap 3}
-
-Other Collapses: \code{\link{Collapses}};
- \code{\link{bsCollapsePanel}}; \code{\link{bsCollapse}}
-}
-
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/updateCollapse.R
+\name{updateCollapse}
+\alias{updateCollapse}
+\title{updateCollapse}
+\usage{
+updateCollapse(session, id, open = NULL, close = NULL, style = NULL)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{id}{The id of the Collapse object you want to change.}
+
+\item{open}{A vector of \code{value} (or \code{title} if no \code{value} was
+provided) values identifying the panels you want to open.}
+
+\item{close}{A vector of \code{value} (or \code{title} if no \code{value} was
+provided) values identifying the panels you want to close.}
+
+\item{style}{A named list of Bootstrap styles (\code{primary}, \code{danger}, \code{info},
+\code{warning}, \code{success}, or \code{default}). The names should correspond
+to the \code{value} (or \code{title} if no \code{value} was provided) of the
+\code{\link{bsCollapsePanel}} you want to change.}
+}
+\description{
+\code{updateCollapse} is used within the Server logic of your Shiny app to
+modify a Collapse after load.
+}
+\details{
+See \link{Collapses} for more information about how to use \code{updateCollapse} with the
+rest of the Collapses family.
+}
+\note{
+Run \code{bsExample("Collapses")} for an example
+of \code{updateCollapse} functionality.
+}
+\seealso{
+\href{http://getbootstrap.com}{Twitter Bootstrap 3}
+
+Other Collapses: \code{\link{Collapses}};
+ \code{\link{bsCollapsePanel}}; \code{\link{bsCollapse}}
+}
+
diff --git a/man/updateTypeahead.Rd b/man/updateTypeahead.Rd
new file mode 100644
index 0000000..3084f05
--- /dev/null
+++ b/man/updateTypeahead.Rd
@@ -0,0 +1,28 @@
+% Generated by roxygen2 (4.1.0): do not edit by hand
+% Please edit documentation in R/updateTypeahead.R
+\name{updateTypeahead}
+\alias{updateTypeahead}
+\title{updateTypeahead}
+\usage{
+updateTypeahead(session, inputId, label = NULL, value = NULL,
+ choices = NULL)
+}
+\arguments{
+\item{session}{The session object passed to function given to shinyServer.}
+
+\item{inputId}{Input variable to assign the control's value to}
+
+\item{label}{Display label for the control}
+
+\item{value}{Initial value}
+
+\item{choices}{Array of strings to match against. Can also be JavaScript
+function. Use htmlwidgets::JS() to indicate JavaScript.}
+}
+\description{
+\code{updateTypeahead} Update a typeaheadInput buttons.
+}
+\seealso{
+\code{\link{typeaheadInput}}
+}
+
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/lib/R/site-library/shinyBS/www/bootstrap3-typeahead.js -rw-r--r-- root/root /usr/lib/R/site-library/shinyBS/www/typeahead_inputbinding.js
Control files: lines which differ (wdiff format)
Depends: r-base-core (>= 4.2.2.20221110-2), 4.2.1-3), r-api-4.0, r-cran-shiny (>= 0.11), 0.13.2), r-cran-htmltools