Skip to content

Commit

Permalink
rework buttons, segmented
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Mar 15, 2024
1 parent 9b11d62 commit b4affa8
Show file tree
Hide file tree
Showing 24 changed files with 409 additions and 423 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
^styles$
^esbuild\.dev\.js$
^esbuild\.prod\.js$
^codecov\.yml$
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
11 changes: 8 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# shinyMobile 1.1.0
## New
## Major change
- Update Framework7 from 5.7.14 to 8.3.2

## Breaking changes
- The aurora theme has been removed. Supported themes are now: ios, md and auto. In case of auto it will use iOS theme for iOS devices and MD theme for all other devices.
- `f7AddMessages()` is definitely removed. Deprecated from previous releases.
- `f7Appbar()` has been removed in Framework7. We have no alternative to replace it.

## Deprecation
- `f7Accordion()`:
- `multiCollapse` has been removed in Framework7.
- `f7AddMessages()` is definitely removed. Deprecated from other releases.
- `f7Appbar()` has been removed in Framework7. We have no alternative to replace it.
- `f7Block()`:
- `hairlines` is deprecated since removed from Framework7.
- `f7Segment()`:
- `container` is deprecated, removed from Framework7.

## Minor change
- `f7Messages()`: the corresponding input is now a list of lists, each item
being a single `f7Message()`. The previous setting was not optimal R,the JS binding was returning a array of objects, which can't be easily translated to R.
We now return an object of objects which becomes a list of lists.
- `f7Block()` gains an `outline` parameter (add grey border).
- `f7Button()` get a new `tonal` style.

# shinyMobile 1.0.1

Expand Down
13 changes: 5 additions & 8 deletions R/f7Block.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#' \code{f7Block} creates a block container.
#'
#' @param ... Block content. Also for \link{f7BlockHeader} and \link{f7BlockFooter}.
#' @param hairlines Whether to allow hairlines. TRUE by default.
#' @param hairlines `r lifecycle::badge("deprecated")`:
#' removed from Framework7.
#' @param strong Add white background so that text is highlighted. FALSE by default.
#' @param inset Whether to set block inset. FALSE by default. Works only if strong is TRUE.
#' @param tablet Whether to make block inset only on large screens. FALSE by default.
Expand Down Expand Up @@ -127,8 +128,6 @@ f7Block <- function(..., hairlines = TRUE, strong = FALSE, inset = FALSE,
)
}



#' Framework7 block title
#'
#' \code{f7BlockTitle} creates a title for \link{f7Block}.
Expand All @@ -139,6 +138,7 @@ f7Block <- function(..., hairlines = TRUE, strong = FALSE, inset = FALSE,
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
#' @rdname block
f7BlockTitle <- function(title, size = NULL) {
titleCl <- "block-title"
if (!is.null(size)) {
Expand All @@ -153,21 +153,17 @@ f7BlockTitle <- function(title, size = NULL) {
shiny::tags$div(class = titleCl, title)
}



#' Framework7 block header
#'
#' \code{f7BlockHeader} creates a header content for \link{f7Block}.
#'
#' @param text Any text.
#' @rdname block
#'
#' @export
#' @rdname block
f7BlockHeader <- function(text) {
shiny::tags$div(class = "block-header", text)
}


#' Framework7 block footer
#'
#' \link{f7BlockFooter} creates a footer content for \link{f7Block}.
Expand All @@ -177,6 +173,7 @@ f7BlockHeader <- function(text) {
#' @author David Granjon, \email{dgranjon@@ymail.com}
#'
#' @export
#' @rdname block
f7BlockFooter <- function(text) {
shiny::tags$div(class = "block-footer", text)
}
Loading

0 comments on commit b4affa8

Please sign in to comment.