Skip to content

Commit

Permalink
Merge pull request #1 from RinteRface/master
Browse files Browse the repository at this point in the history
merge RinterFace latest changes
  • Loading branch information
Seyphaton authored Feb 20, 2020
2 parents 7c9781a + 8362ae6 commit 667dc81
Show file tree
Hide file tree
Showing 310 changed files with 13,740 additions and 3,559 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
^docs$
^cran-comments\.md$
^appveyor\.yml$
^index\.md$
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: shinyMobile
Type: Package
Title: Mobile Ready 'shiny' Apps with Standalone Capabilities
Version: 0.2.0.9000
Version: 0.5.0.9000
Authors@R: c(
person("David", "Granjon", email = "[email protected]", role = c("aut", "cre")),
person("Victor", "Perrier", email = "[email protected]", role = "aut"),
Expand Down Expand Up @@ -34,5 +34,6 @@ Suggests:
cli,
rstudioapi,
shinyWidgets,
echarts4r
echarts4r,
golem
VignetteBuilder: knitr
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export(f7ListGroup)
export(f7ListIndex)
export(f7ListIndexItem)
export(f7ListItem)
export(f7Login)
export(f7LoginServer)
export(f7Margin)
export(f7Message)
export(f7Messages)
Expand Down Expand Up @@ -90,6 +92,7 @@ export(f7SwipeoutItem)
export(f7Swiper)
export(f7Tab)
export(f7TabLayout)
export(f7TabLink)
export(f7Tabs)
export(f7TapHold)
export(f7Text)
Expand All @@ -106,19 +109,27 @@ export(getF7Colors)
export(preview_mobile)
export(updateF7Accordion)
export(updateF7AutoComplete)
export(updateF7Button)
export(updateF7Card)
export(updateF7Checkbox)
export(updateF7DatePicker)
export(updateF7Fab)
export(updateF7Fabs)
export(updateF7Gauge)
export(updateF7Login)
export(updateF7Panel)
export(updateF7Picker)
export(updateF7Progress)
export(updateF7Select)
export(updateF7Sheet)
export(updateF7Slider)
export(updateF7Stepper)
export(updateF7Tabs)
export(updateF7Text)
export(updateF7Toggle)
importFrom(htmltools,htmlDependency)
importFrom(jsonlite,toJSON)
importFrom(magrittr,"%>%")
importFrom(shiny,getDefaultReactiveDomain)
importFrom(shiny,registerInputHandler)
importFrom(utils,packageVersion)
49 changes: 48 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,57 @@
# shinyMobile 0.2.0.9000
# shinyMobile 0.5.0.9000

## Breaking changes
- `f7Sheet()` is still inserted in the UI side but can be triggered either on the server side in combination with `updateF7Sheet()` (see example) or on the UI side. Overall, this improves flexibility since user may choose any trigger element. In practice, any element having `data-sheet` pointing to the sheet id as well as the "sheet-open" css class may open it, instead of having a default trigger contained in the sheet. A use case may be to open a sheet in the tabbar (the trigger would be a `f7TabLink()` that is a special button styled for the tabbar).
- All update method for inputs : argument `session` is now optional and has been moved to the last position in function call.
- `f7AutoComplete()`: type becomes openIn to align with the framework7 documentation
- remove parameter fill from `f7Icon()` (not used)
- Rewrite `f7Popup()`. It has now an input associated giving the popup state (opened or closed) as well
as new parameters: backdrop, closeByBackdropClick, closeOnEscape, animate and swipeToClose.
label parameters has been removed. To create an `f7Popup()` put the `f7Popup()` tag in you UI. On the server side call `f7TogglePopup()`. See documentation for a detailed example. Thanks @pasahe
- `f7NavbarHide()` renamed to `f7HideNavbar()` for consistancy
- `f7NavbarShow()` renamed to `f7ShowNavbar()` for consistancy
- In `f7Gauge()` valueText was removed. It does not make sense that the value can be accidentally
different from the text displayed. valueText is then an internal parameter.
- In `f7DatePicker()`: min becomes minDate, max becomes maxDate and format becomes dateFormat
- remove maximizable parameter from `f7Appbar()`

## Major changes
- new `f7Login()` and `updateF7Login()` feature to provide UI boilerplates
for authentication
- `f7Tabs()` may be used as standalone components with the style argument (segmented or strong). toolbar has the default behavior.
- update `f7Icon()` and icons dependencies. thanks @pvictor
- new `updateF7DatePicker()`: thanks @pvictor
- add input binding to `f7Fabs()` to get the status of the container
- add `updateF7Button()` and `updateF7Fabs()`
- new pullToRefresh parameter to `f7Init()`. Pull the screen from top to bottom
fires input$ptr which becomes TRUE. When the pull to refresh event is finished,
input$ptr is NULL. Useful to trigger events in an observEvent
- add new `updateF7Select()`: thanks @Seyphaton for the suggestion
- add `f7TogglePopup()` to close/open a `f7Popup()`. Thanks @pasahe
- add `preview_mobile()`: function that previews your app in a seleted range of
devices (iphone, samsung, htc, ...)
- redesign the way inputs options are passed from R to Javascript. This does not have impact
on the user side but improves security and code quality

## Minor changes
- add new `f7TabLink()` (special link to insert in `f7Tabs()` that may open a `f7Sheet()`)
- add new active parameter to `f7Button()`
- add new strong parameter to `f7Segment()`
- Improve website. Thanks @pvictor
- new fullsize and closeButton parameter to `f7Popup()` + rewrite js binding. Thanks @pvictor
- add extra parameters to `f7DatePicker()`: direction, openIn,
scrollToInput, closeByOutsideClick, toolbar, toolbarCloseText,
header and headerPlaceholder
- add new parameters to `updateF7Gauge()`. Thanks @rodrigoheck for the suggestion
- add noSwipping argument to `f7Slider()` to prevent wrong behaviour when used in `f7TabLayout()`
- `f7Select()` does not rely anymore on the shiny selectInput binding (does not have impact on user experience)
- add hidden argument to `f7Tab()`: allows to navigate through hidden tabs without displaying them
in the tab menu. Thanks @rodrigoheck
- add closeOnSelect param to `f7AutoComplete()`
- add new parameters to `f7Picker()` and `updateF7Picker()`: rotateEffect, openIn, scrollToInput, closeByOutsideClick, toolbar, toolbarCloseText and sheetSwipeToClose
- add color argument to `f7Icon()`
- add selected parameter to `f7Select()`
- update framework7 to 5.3.0
- add color to `updateF7Slider()`
- add color to `f7Slider()`
- add cheatsheet reference in the readme
Expand All @@ -31,6 +68,16 @@ on old devices
- add more copyrights

## Bug fix
- trigger shown event for `f7Tabs()` on click. This allows to use `f7Tabs()`
without swipeable and animated
- Allow output elements to be displayed in `f7Panel()` (need to provide the `f7Panel()` inputId)
- Prevent `f7Swipeout()` to make the current tab swipping if in `f7TabLayout()`
- Fix `f7Fab()` label white background color in dark mode
- fix #19: letting bigger TRUE in `f7Navbar()` would center the body content on scroll, due to a css conflict
- fix issue with `f7Slider()` and `f7TabLayout()`: When setting value of a slider in a swipeable f7TabLayout it cause the tab to be swip. This describe here : framework7io/framework7#2603. Thanks @pvictor
- fix #39: issue in `f7DatePicker()` format for months. Thanks @kmaheshkulkarni
- fix issue in `f7DatePicker()`: the viewport does not scroll to input by default
- fix typo in `f7AutoComplete()` example
- fix #43: slider label not visible on drag. Thanks @pasahe
- fix #42: add vertical overflow to `f7Popup()`. Thanks @pasahe
- fix #41: cannot render shiny outputs in `f7Popup()`. Now `f7Popup()` triggers shiny output rendering. Thanks @pasahe
Expand Down
70 changes: 38 additions & 32 deletions R/deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,28 @@ addCSSDeps <- function(x) {

# CSS
framework7_css <- "framework7.bundle.min.css"
framework7_icons_css <- "framework7-icons.css"
custom_css <- "my-app.css"
# card extra elements
social_cards_css <- "social-cards.css"
card_img_css <- "card-img.css"
# swiper css
swiper_css <- "swiper.css"
# grid extra css
grid_css <- "grid-extra.css"
# material icons
material_icons_css <- "material-icons.css"

f7Deps <- list(
# deps
htmltools::htmlDependency(
name = "framework7",
version = "5.1.3",
src = c(file = system.file("framework7-5.1.3", package = "shinyMobile")),
version = "5.3.0",
src = c(file = system.file("framework7-5.3.0", package = "shinyMobile")),
script = NULL,
stylesheet = c(
framework7_css,
material_icons_css,
custom_css,
framework7_icons_css,
social_cards_css,
card_img_css,
grid_css,
swiper_css
)
)
Expand All @@ -61,22 +56,18 @@ addCSSDeps <- function(x) {
# located at the end of the body.
addJSDeps <- function() {

depsPath <- "framework7-5.1.3/"
depsPath <- "framework7-5.3.0/"

# JS
framework7_js <- paste0(depsPath, "framework7.bundle.min.js")
custom_js <- paste0(depsPath, "my-app.js")
fullScreen_js <- paste0(depsPath, "fullscreen.js")

shiny::tagList(
shiny::singleton(
shiny::tags$script(src = framework7_js)
),
shiny::singleton(
shiny::tags$script(src = custom_js)
),
shiny::singleton(
shiny::tags$script(src = fullScreen_js)
)
)
}
Expand All @@ -85,32 +76,47 @@ addJSDeps <- function() {
#' @importFrom utils packageVersion
#' @importFrom htmltools htmlDependency
f7InputsDeps <- function() {

bindings_path <- system.file("framework7-5.3.0/input-bindings", package = "shinyMobile")

htmltools::htmlDependency(
name = "framework7-bindings",
version = as.character(packageVersion("shinyMobile")),
src = c(
file = system.file("framework7-5.1.3/input-bindings", package = "shinyMobile"),
href = "framework7-5.1.3/input-bindings"
file = bindings_path,
href = "framework7-5.3.0/input-bindings"
),
package = "shinyMobile",
script = c(
"sliderInputBinding.js",
"stepperInputBinding.js",
"toggleInputBinding.js",
"datePickerInputBinding.js",
"pickerInputBinding.js",
"colorPickerInputBinding.js",
"tabsInputBinding.js",
"dateInputBinding.js",
"panelInputBinding.js",
"collapsibleInputBinding.js",
"sheetInputBinding.js",
"cardInputBinding.js",
"autoCompleteInputBinding.js",
"actionSheetInputBinding.js",
"gaugeInputBinding.js",
"popupInputBinding.js"
)
script = list.files(bindings_path)
)
}


html_dependencies_f7Icons <- function(old = TRUE) {
path <- "framework7-5.3.0/f7-icons"
name <- "f7-icons"
if (isTRUE(old)) {
path <- paste0(path, "-old")
name <- paste0(name, "-old")
}
htmlDependency(
name = name,
version = "3.0.0",
src = list(
href = path,
file = path
),
package = "shinyMobile",
stylesheet = "css/framework7-icons.css",
all_files = TRUE
)
}









Loading

0 comments on commit 667dc81

Please sign in to comment.