dreamRs / shinyWidgets

Compare 8f4a8c7 ... +8 ... b6ae8a0

Showing 5 of 76 files from the diff.
Other files ignored by Codecov
NAMESPACE has changed.
cran-comments.md has changed.
DESCRIPTION has changed.
man/setShadow.Rd has changed.
NEWS.md has changed.

@@ -19,7 +19,7 @@
Loading
19 19
  }
20 20
  if (inline)
21 21
    # if (!checkbox)
22 -
      divClass <- paste(divClass, "radio-inline radio-inline")
22 +
      divClass <- paste(divClass, "radio-inline radio-inline form-check-inline")
23 23
    # else
24 24
    #   divClass <- paste(divClass, "checkbox-inline checkbox-inline")
25 25
  inputTag <- tags$input(name=name, id=id, value=value, type="radio")
@@ -133,18 +133,19 @@
Loading
133 133
  } else {
134 134
    as.character(selected)
135 135
  }
136 -
  tagLabel <- tags$label(
137 -
    class = "control-label",
138 -
    `for` = inputId,
139 -
    label, style = "margin-bottom: 5px;"
140 -
  )
141 136
  awesomeRadioTag <- tags$div(
142 137
    id = inputId,
143 138
    class = "form-group shiny-input-radiogroup awesome-bootstrap-radio shiny-input-container",
144 -
    class = if(inline) "shiny-input-container-inline",
139 +
    class = if (inline) "shiny-input-container-inline",
145 140
    style = if (!is.null(width))
146 141
      paste0("width: ", validateCssUnit(width), ";"),
147 -
    if (!is.null(label)) tagLabel,
142 +
    tags$label(
143 +
      class = "control-label",
144 +
      `for` = inputId,
145 +
      label,
146 +
      style = "margin-bottom: 5px;",
147 +
      class = if (is.null(label)) "shiny-label-null"
148 +
    ),
148 149
    if (!is.null(label) & !inline) tags$div(style = "height: 7px;"),
149 150
    generateAwesomeRadio(inputId, choices, selected, inline, status, checkbox)
150 151
  )

@@ -80,16 +80,19 @@
Loading
80 80
        inputTag$attribs$checked <- "checked"
81 81
      if (inline) {
82 82
        tags$div(
83 -
          class = paste0("awesome-checkbox checkbox-inline checkbox-", status),
83 +
          class = paste0("awesome-checkbox checkbox-inline form-check-inline checkbox-", status),
84 84
          inputTag,
85 -
          tags$label(name, `for` = paste0(inputId, value))
85 +
          tags$label(
86 +
            name,
87 +
            `for` = paste0(inputId, value),
88 +
            class = "form-check-label form-check-label-inline"
89 +
          )
86 90
        )
87 -
      }
88 -
      else {
91 +
      } else {
89 92
        tags$div(
90 93
          class = paste0("awesome-checkbox checkbox-", status),
91 94
          inputTag,
92 -
          tags$label(name, `for` = paste0(inputId, value))
95 +
          tags$label(name, `for` = paste0(inputId, value), class = "form-check-label")
93 96
        )
94 97
      }
95 98
    }, SIMPLIFY = FALSE, USE.NAMES = FALSE
@@ -178,7 +181,13 @@
Loading
178 181
    style = if (!is.null(width))
179 182
      paste0("width: ", validateCssUnit(width), ";"),
180 183
    class = divClass,
181 -
    tags$label(label, `for` = inputId, style = "margin-bottom: 10px;"),
184 +
    tags$label(
185 +
      class = "control-label",
186 +
      label,
187 +
      `for` = inputId,
188 +
      style = "margin-bottom: 10px;",
189 +
      class = if (is.null(label)) "shiny-label-null"
190 +
    ),
182 191
    options
183 192
  )
184 193
  # Dep

@@ -25,65 +25,36 @@
Loading
25 25
#'   setBackgroundColor(color = "ghostwhite"),
26 26
#'
27 27
#'   # boxPlus
28 -
#'   fluidRow(
29 -
#'    boxPlus(
30 -
#'      title = "Closable Box with dropdown",
31 -
#'      closable = TRUE,
32 -
#'      status = "warning",
33 -
#'      solidHeader = FALSE,
34 -
#'      collapsible = TRUE,
35 -
#'      enable_dropdown = TRUE,
36 -
#'      dropdown_icon = "wrench",
37 -
#'      dropdown_menu = dropdownItemList(
38 -
#'        dropdownItem(url = "http://www.google.com", name = "Link to google"),
39 -
#'        dropdownItem(url = "#", name = "item 2"),
40 -
#'        dropdownDivider(),
41 -
#'        dropdownItem(url = "#", name = "item 3")
42 -
#'      ),
43 -
#'      p("Box Content")
28 +
#'   box(
29 +
#'    title = "Improved box",
30 +
#'    closable = TRUE,
31 +
#'    width = 12,
32 +
#'    status = "warning",
33 +
#'    solidHeader = FALSE,
34 +
#'    collapsible = TRUE,
35 +
#'    label = boxLabel(
36 +
#'      text = 1,
37 +
#'      status = "danger",
38 +
#'      style = "circle"
44 39
#'    ),
45 -
#'    boxPlus(
46 -
#'      title = "Closable box, with label",
47 -
#'      closable = TRUE,
48 -
#'      enable_label = TRUE,
49 -
#'      label_text = 1,
50 -
#'      label_status = "danger",
51 -
#'      status = "warning",
52 -
#'      solidHeader = FALSE,
53 -
#'      collapsible = TRUE,
54 -
#'      p("Box Content")
55 -
#'    )
56 -
#'   ),
57 -
#'
58 -
#'   br(),
59 -
#'
60 -
#'   # gradientBoxes
61 -
#'   fluidRow(
62 -
#'     gradientBox(
63 -
#'      title = "My gradient Box",
64 -
#'      icon = "fa fa-th",
65 -
#'      gradientColor = "teal",
66 -
#'      boxToolSize = "sm",
67 -
#'      footer = column(
68 -
#'        width = 12,
69 -
#'        align = "center",
70 -
#'        sliderInput(
71 -
#'          "obs",
72 -
#'          "Number of observations:",
73 -
#'          min = 0, max = 1000, value = 500
74 -
#'        )
75 -
#'      ),
76 -
#'      plotOutput("distPlot")
77 -
#'     ),
78 -
#'     gradientBox(
79 -
#'      title = "My gradient Box",
80 -
#'      icon = "fa fa-heart",
81 -
#'      gradientColor = "maroon",
82 -
#'      boxToolSize = "xs",
83 -
#'      closable = TRUE,
84 -
#'      footer = "The footer goes here. You can include anything",
85 -
#'      "This is a gradient box"
86 -
#'     )
40 +
#'    dropdownMenu = boxDropdown(
41 +
#'      boxDropdownItem("Link to google", href = "http://www.google.com"),
42 +
#'      boxDropdownItem("item 2", href = "#"),
43 +
#'      dropdownDivider(),
44 +
#'      boxDropdownItem("item 3", href = "#", icon = icon("th"))
45 +
#'    ),
46 +
#'    sidebar = boxSidebar(
47 +
#'      startOpen = TRUE,
48 +
#'      id = "mycardsidebar",
49 +
#'      sliderInput(
50 +
#'        "obs",
51 +
#'        "Number of observations:",
52 +
#'        min = 0,
53 +
#'        max = 1000,
54 +
#'        value = 500
55 +
#'      )
56 +
#'    ),
57 +
#'    plotOutput("distPlot")
87 58
#'   ),
88 59
#'
89 60
#'   br(),
@@ -93,32 +64,32 @@
Loading
93 64
#'   column(
94 65
#'    width = 6,
95 66
#'    timelineBlock(
96 -
#'      reversed = FALSE,
97 -
#'      timelineEnd(color = "danger"),
98 -
#'      timelineLabel(2018, color = "teal"),
99 -
#'      timelineItem(
100 -
#'        title = "Item 1",
101 -
#'        icon = "gears",
102 -
#'        color = "olive",
103 -
#'        time = "now",
104 -
#'        footer = "Here is the footer",
105 -
#'        "This is the body"
106 -
#'      ),
107 -
#'      timelineItem(
108 -
#'        title = "Item 2",
109 -
#'        border = FALSE
110 -
#'      ),
111 -
#'      timelineLabel(2015, color = "orange"),
112 -
#'      timelineItem(
113 -
#'        title = "Item 3",
114 -
#'        icon = "paint-brush",
115 -
#'        color = "maroon",
116 -
#'        timelineItemMedia(src = "http://placehold.it/150x100"),
117 -
#'        timelineItemMedia(src = "http://placehold.it/150x100")
118 -
#'      ),
119 -
#'      timelineStart(color = "gray")
120 -
#'     )
121 -
#'    ),
67 +
#'     reversed = FALSE,
68 +
#'     timelineEnd(color = "red"),
69 +
#'     timelineLabel(2018, color = "teal"),
70 +
#'     timelineItem(
71 +
#'       title = "Item 1",
72 +
#'       icon = icon("gears"),
73 +
#'       color = "olive",
74 +
#'       time = "now",
75 +
#'       footer = "Here is the footer",
76 +
#'       "This is the body"
77 +
#'     ),
78 +
#'     timelineItem(
79 +
#'       title = "Item 2",
80 +
#'       border = FALSE
81 +
#'     ),
82 +
#'     timelineLabel(2015, color = "orange"),
83 +
#'     timelineItem(
84 +
#'       title = "Item 3",
85 +
#'       icon = icon("paint-brush"),
86 +
#'       color = "maroon",
87 +
#'       timelineItemMedia(image = "https://placehold.it/150x100"),
88 +
#'       timelineItemMedia(image = "https://placehold.it/150x100")
89 +
#'     ),
90 +
#'     timelineStart(color = "purple")
91 +
#'    )
92 +
#'   ),
122 93
#'   column(
123 94
#'    width = 6,
124 95
#'    box(
@@ -191,8 +162,8 @@
Loading
191 162
useShinydashboardPlus <- function() {
192 163
  if (!requireNamespace(package = "shinydashboardPlus"))
193 164
    message("Package 'shinydashboardPlus' is required to run this function")
194 -
  deps <- findDependencies(shinydashboardPlus::dashboardPagePlus(
195 -
    header = shinydashboardPlus::dashboardHeaderPlus(),
165 +
  deps <- findDependencies(shinydashboardPlus::dashboardPage(
166 +
    header = shinydashboardPlus::dashboardHeader(),
196 167
    sidebar = shinydashboard::dashboardSidebar(),
197 168
    body = shinydashboard::dashboardBody()
198 169
  ))

@@ -134,19 +134,59 @@
Loading
134 134
#' )
135 135
#'
136 136
html_dependency_awesome <- function() {
137 -
  htmlDependency(
137 +
  bslib::bs_dependency_defer(awesomeDependencyCSS)
138 +
}
139 +
140 +
#' @importFrom sass sass_file
141 +
#' @importFrom bslib bs_dependency
142 +
awesomeDependencyCSS <- function(theme) {
143 +
  if (!bslib::is_bs_theme(theme)) {
144 +
    return(htmlDependency(
145 +
      name = "awesome-bootstrap",
146 +
      version = "0.3.7",
147 +
      src = c(
148 +
        href = "shinyWidgets/awesome-bootstrap-checkbox",
149 +
        file = "assets/awesome-bootstrap-checkbox"
150 +
      ),
151 +
      package = "shinyWidgets",
152 +
      stylesheet = "awesome-bootstrap-checkbox.min.css",
153 +
      all_files = FALSE
154 +
    ))
155 +
  }
156 +
157 +
  sass_input <- list(
158 +
    list(
159 +
      "fa-var-check" = "\"\\f00c\"",
160 +
      "input-bg-disabled" = "$gray-300",
161 +
      "brand-primary" = "$primary",
162 +
      "brand-info" = "$info",
163 +
      "brand-success" = "$success",
164 +
      "brand-warning" = "$warning",
165 +
      "brand-danger" = "$danger",
166 +
      "awesome-label-inline-margin-left" = "10px"
167 +
    ),
168 +
    # sass::sass_file(
169 +
    #   system.file(package = "shinyWidgets", "assets/awesome-bootstrap-checkbox/_variables.scss")
170 +
    # ),
171 +
    sass::sass_file(
172 +
      system.file(package = "shinyWidgets", "assets/awesome-bootstrap-checkbox/_mixins.scss")
173 +
    ),
174 +
    sass::sass_file(
175 +
      system.file(package = "shinyWidgets", "assets/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.scss")
176 +
    )
177 +
  )
178 +
179 +
  bslib::bs_dependency(
180 +
    input = sass_input,
181 +
    theme = theme,
138 182
    name = "awesome-bootstrap",
139 183
    version = "0.3.7",
140 -
    src = c(
141 -
      href = "shinyWidgets/awesome-bootstrap-checkbox",
142 -
      file = "assets/awesome-bootstrap-checkbox"
143 -
    ),
144 -
    package = "shinyWidgets",
145 -
    stylesheet = "awesome-bootstrap-checkbox.min.css",
146 -
    all_files = FALSE
184 +
    cache_key_extra = packageVersion("shinyWidgets")
147 185
  )
148 186
}
149 187
188 +
189 +
150 190
#' @export
151 191
#' @rdname html-dependencies
152 192
html_dependency_bttn <- function() {
@@ -161,13 +201,43 @@
Loading
161 201
162 202
#' @export
163 203
#' @rdname html-dependencies
204 +
#' @importFrom bslib bs_dependency_defer
164 205
html_dependency_pretty <- function() {
165 -
  htmlDependency(
206 +
  bslib::bs_dependency_defer(prettyDependencyCSS)
207 +
}
208 +
209 +
#' @importFrom sass sass_file
210 +
#' @importFrom bslib bs_dependency
211 +
prettyDependencyCSS <- function(theme) {
212 +
  if (!bslib::is_bs_theme(theme)) {
213 +
    return(htmlDependency(
214 +
      name = "pretty",
215 +
      version = "3.0.3",
216 +
      src = c(href = "shinyWidgets/pretty-checkbox", file = "assets/pretty-checkbox"),
217 +
      package = "shinyWidgets",
218 +
      stylesheet = "pretty-checkbox.min.css"
219 +
    ))
220 +
  }
221 +
222 +
  sass_input <- list(
223 +
    list(
224 +
      "pretty--color-primary" = "$primary",
225 +
      "pretty--color-info" = "$info",
226 +
      "pretty--color-success" = "$success",
227 +
      "pretty--color-warning" = "$warning",
228 +
      "pretty--color-danger" = "$danger"
229 +
    ),
230 +
    sass::sass_file(
231 +
      system.file(package = "shinyWidgets", "assets/pretty-checkbox/pretty-checkbox.scss")
232 +
    )
233 +
  )
234 +
235 +
  bslib::bs_dependency(
236 +
    input = sass_input,
237 +
    theme = theme,
166 238
    name = "pretty",
167 239
    version = "3.0.3",
168 -
    src = c(href = "shinyWidgets/pretty-checkbox", file = "assets/pretty-checkbox"),
169 -
    package = "shinyWidgets",
170 -
    stylesheet = "pretty-checkbox.min.css"
240 +
    cache_key_extra = packageVersion("shinyWidgets")
171 241
  )
172 242
}
173 243

@@ -16,24 +16,22 @@
Loading
16 16
#'   library(shinydashboardPlus)
17 17
#'   library(shinyWidgets)
18 18
#'
19 -
#'   boxTag <- boxPlus(
19 +
#'   boxTag <- box(
20 20
#'    title = "Closable box, with label",
21 21
#'    closable = TRUE,
22 -
#'    enable_label = TRUE,
23 -
#'    label_text = 1,
24 -
#'    label_status = "danger",
22 +
#'    label = boxLabel(
23 +
#'     text = 1,
24 +
#'     status = "danger"
25 +
#'    ),
25 26
#'    status = "warning",
26 27
#'    solidHeader = FALSE,
27 28
#'    collapsible = TRUE,
28 29
#'    p("Box Content")
29 30
#'   )
30 31
#'
31 32
#'   shinyApp(
32 -
#'    ui = dashboardPagePlus(
33 -
#'      header = dashboardHeaderPlus(
34 -
#'        enable_rightsidebar = TRUE,
35 -
#'        rightSidebarIcon = "gears"
36 -
#'      ),
33 +
#'    ui = dashboardPage(
34 +
#'      header = dashboardHeader(),
37 35
#'      sidebar = dashboardSidebar(),
38 36
#'      body = dashboardBody(
39 37
#'
@@ -44,27 +42,23 @@
Loading
44 42
#'       fluidRow(boxTag, boxTag),
45 43
#'       tags$h2("Add shadow only to the first element using id"),
46 44
#'       tagAppendAttributes(
47 -
#'        verticalProgress(
45 +
#'        shinydashboardPlus::progressBar(
48 46
#'         value = 10,
49 47
#'         striped = TRUE,
50 -
#'         active = TRUE
48 +
#'         animated = TRUE
51 49
#'        ),
52 50
#'        id = "my-progress"
53 51
#'       ),
54 -
#'       verticalProgress(
52 +
#'       shinydashboardPlus::progressBar(
55 53
#'         value = 50,
56 -
#'         active = TRUE,
57 -
#'         status = "warning",
58 -
#'         size = "xs"
54 +
#'         status = "warning"
59 55
#'       ),
60 -
#'       verticalProgress(
56 +
#'       shinydashboardPlus::progressBar(
61 57
#'         value = 20,
62 -
#'         status = "danger",
63 -
#'         size = "sm",
64 -
#'         height = "60%"
58 +
#'         status = "danger"
65 59
#'       )
66 60
#'      ),
67 -
#'      rightsidebar = rightSidebar(),
61 +
#'      controlbar = dashboardControlbar(),
68 62
#'      title = "DashboardPage"
69 63
#'    ),
70 64
#'    server = function(input, output) { }

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -1.34% 75.35%
Project Totals (51 files) 75.35%
Loading