Skip to content

Commit

Permalink
start update f7Panel, soft deprecate f7Shadow, update doc + vignettes…
Browse files Browse the repository at this point in the history
…, ...
  • Loading branch information
DivadNojnarg committed Mar 21, 2024
1 parent 8db8908 commit c05b882
Show file tree
Hide file tree
Showing 43 changed files with 676 additions and 978 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- `f7Fabs()`: `morph` is deprecated. Only `morphTarget` is used.
- `f7Toolbar()`:
- `hairline` and `shadow` are deprecated, removed from Framework7.
- `f7Shadow()`removed from Framework7. No replacement. Will be removed in a future release.

## Minor change
- New component `f7Treeview()`: display items in a treeview. Used in combination with `f7TreeviewItem()` and `f7TreeviewGroup()`.
Expand All @@ -44,6 +45,8 @@ the check icon position. Default to left.
- `f7CheckboxChoice()`: new function to pass inside `choices` in a
`f7CheckboxGroup()`. Improved choice with title, subtitle, ...
- `f7List()` has new `outline`, `dividers` and `strong` styles. `mode` gains 2 new values: `simple` and `links`.
- `f7Panel()` has new "floating"/"push" effets as well as a new `options` parameter
to pass in extra configuration. See https://framework7.io/docs/panel#panel-parameters.
- Fix various issues in documentation.

# shinyMobile 1.0.1
Expand Down
41 changes: 22 additions & 19 deletions R/f7-deprecated.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ f7SocialCard <- function(..., image = NULL, author = NULL, date = NULL,

#' Framework7 menu container
#'
#' `r lifecycle::badge("deprecated")`.
#' \code{f7Menu} is a container for \link{f7MenuItem} and/or \link{f7MenuDropdown}.
#'
#' @param ... Slot for \link{f7MenuItem} or \link{f7MenuDropdown}.
Expand Down Expand Up @@ -221,6 +222,7 @@ f7Flex <- function(...) {

#' Create a manifest for your shiny app
#'
#' `r lifecycle::badge("deprecated")`.
#' \code{create_manifest} creates a manifest for your shiny App. Please use this workflow instead:
#' \url{https://unleash-shiny.rinterface.com/mobile-pwa.html#charpente-and-pwa-tools}.
#'
Expand All @@ -241,27 +243,8 @@ f7Flex <- function(...) {
#' It creates 1 folders to contain icons and the manifest.json file.
#'
#' @note See \url{https://developer.mozilla.org/en-US/docs/Web/Manifest} for more informations.
#' @rdname f7-deprecated
#' @keywords internal
#' @export
#'
#' @examples
#' create_manifest(
#' path = tempdir(),
#' name = "My App",
#' shortName = "My App",
#' description = "What it does!",
#' lang = "en-US",
#' startUrl = "https://www.google.com/",
#' display = "standalone",
#' background_color = "#3367D6",
#' theme_color = "#3367D6",
#' icon = data.frame(
#' src = "icons/128x128.png",
#' sizes = "128x128", 10,
#' types = "image/png"
#' )
#' )
create_manifest <- function(path, name = "My App", shortName = "My App",
description = "What it does!", lang = "en-US",
startUrl, display = c("minimal-ui", "standalone", "fullscreen", "browser"),
Expand Down Expand Up @@ -297,3 +280,23 @@ create_manifest <- function(path, name = "My App", shortName = "My App",
}
jsonlite::write_json(manifest, path = paste0(path, "/www/manifest.json"))
}

#' Framework7 shadow effect
#'
#' `r lifecycle::badge("deprecated")`.
#' Creates a shadow effect to apply on UI elements like \link{f7Card}.
#'
#' @param tag Tag to apply the shadow on.
#' @param intensity Shadow intensity. Numeric between 1 and 24. 24 is the highest elevation.
#' @param hover Whether to display the shadow on hover. FALSE by default.
#' @param pressed Whether to display the shadow on click. FALSE by default.
#'
#' @keywords internal
#' @export
f7Shadow <- function(tag, intensity, hover = FALSE, pressed = FALSE) {
lifecycle::deprecate_warn(
when = "1.1.0",
what = "f7Shadow"
)
tag
}
90 changes: 38 additions & 52 deletions R/f7-tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@
#' title = "My app",
#' f7SingleLayout(
#' navbar = f7Navbar(
#' title = "Standalone tabs",
#' hairline = FALSE,
#' shadow = TRUE
#' title = "Standalone tabs"
#' ),
#' f7Tabs(
#' id = "tabs",
Expand All @@ -82,66 +80,54 @@
#' tabName = "Tab1",
#' icon = f7Icon("envelope"),
#' active = TRUE,
#' f7Shadow(
#' intensity = 10,
#' hover = TRUE,
#' f7Card(
#' title = "Card header",
#' f7Stepper(
#' "obs1",
#' "Number of observations",
#' min = 0,
#' max = 1000,
#' value = 500,
#' step = 100
#' ),
#' plotOutput("distPlot")
#' )
#' f7Card(
#' title = "Card header",
#' f7Stepper(
#' "obs1",
#' "Number of observations",
#' min = 0,
#' max = 1000,
#' value = 500,
#' step = 100
#' ),
#' plotOutput("distPlot")
#' )
#' ),
#' f7Tab(
#' tabName = "Tab2",
#' icon = f7Icon("today"),
#' f7Shadow(
#' intensity = 10,
#' hover = TRUE,
#' f7Card(
#' title = "Card header",
#' f7Select(
#' inputId = "obs2",
#' label = "Distribution type:",
#' choices = c(
#' "Normal" = "norm",
#' "Uniform" = "unif",
#' "Log-normal" = "lnorm",
#' "Exponential" = "exp"
#' )
#' ),
#' plotOutput("distPlot2")
#' )
#' f7Card(
#' title = "Card header",
#' f7Select(
#' inputId = "obs2",
#' label = "Distribution type:",
#' choices = c(
#' "Normal" = "norm",
#' "Uniform" = "unif",
#' "Log-normal" = "lnorm",
#' "Exponential" = "exp"
#' )
#' ),
#' plotOutput("distPlot2")
#' )
#' ),
#' f7Tab(
#' tabName = "Tab3",
#' icon = f7Icon("cloud_upload"),
#' f7Shadow(
#' intensity = 10,
#' hover = TRUE,
#' f7Card(
#' title = "Card header",
#' f7SmartSelect(
#' inputId = "variable",
#' label = "Variables to show:",
#' c(
#' "Cylinders" = "cyl",
#' "Transmission" = "am",
#' "Gears" = "gear"
#' ),
#' multiple = TRUE,
#' selected = "cyl"
#' f7Card(
#' title = "Card header",
#' f7SmartSelect(
#' inputId = "variable",
#' label = "Variables to show:",
#' c(
#' "Cylinders" = "cyl",
#' "Transmission" = "am",
#' "Gears" = "gear"
#' ),
#' tableOutput("data")
#' )
#' multiple = TRUE,
#' selected = "cyl"
#' ),
#' tableOutput("data")
#' )
#' )
#' )
Expand Down
Loading

0 comments on commit c05b882

Please sign in to comment.