-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shinyMobile 2.0.0 #256
shinyMobile 2.0.0 #256
Conversation
Another change I want to introduce. Instead of having examples code in the roxygen skeleton, we'll use: #' @example inst/examples/accordion/app.R So that we can use this file to do testing with shinytest2 |
@DivadNojnarg removed functionality from v8:
We can use |
deprecate_warn("X.0.0", "foo(arg = 'has been removed from Framework7')") so that it does not error when people use them but they won't have any effect. Also this might be good to add a lifecycle badge in the roxygen doc to say #' Blabla
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' This function was deprecated because it was removed from Framework7 ...
#' @keywords internal |
Example in practice: Warning (test-f7Accordion.R:4:3): accordion
The `multiCollapse` argument of `f7Accordion()` is deprecated as of shinyMobile 1.1.0.
ℹ multiCollapse has been removed from Framework7 and will be removed from shinyMobile in
the next release. |
const widgets = uiWidgets.concat(serverWidgets); | ||
|
||
// Instantiate a widget | ||
activateWidget = function(widget) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename to createWidget
?
var f7MessageBarBinding = new Shiny.InputBinding(); | ||
|
||
$.extend(f7MessageBarBinding, { | ||
|
||
initialize: function(el) { | ||
app.messagebar.create({ | ||
this.app = getAppInstance(); | ||
this.app.messagebar.create({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hypebright: if we stored the instance into this.instance =this.app.messagebar.create(...)
, we would not need to do all the this.app.messagebar.get
. Not super fan about instance
word. Maybe something shorter, except that el
is already taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inst
, object
, obj
?
}, | ||
|
||
// see updatef7Messages | ||
setValue: function(el, value) { | ||
var messages = this.app.messages.get(el); | ||
var self = this; | ||
var message = value.value; | ||
// TO DO: does not work if TRUE | ||
if (value.showTyping) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hypebright I could not make this one working. You can try with this below example and put a console.log(data)
in the receiveMessage
messages binding method. You'll see that after sending your message through the app, the second message is empty which does not make much sense since updateF7Messages sends the correct JSON. Something with session$sendInputMessages()
? Something JS side? Maybe we don't need a binding after all and just use session$sendCustomMessage
+ some JS code like for other widgets (gauges...). I'll continue working on the other elements.
shinyApp(
ui = f7Page(
title = "Messages",
f7SingleLayout(
navbar = f7Navbar(
title = "Messages",
hairline = FALSE,
shadow = TRUE
),
toolbar = f7MessageBar(inputId = "mymessagebar", placeholder = "Message"),
# main content
f7Messages(id = "mymessages", title = "My message")
)
),
server = function(input, output, session) {
messageSent <- reactiveVal()
observeEvent(input[["mymessagebar-send"]], {
messageSent(FALSE)
updateF7Messages(
id = "mymessages",
list(
f7Message(
text = input$mymessagebar,
name = "David",
type = "sent",
header = "Message Header",
footer = "Message Footer",
textHeader = "Text Header",
textFooter = "text Footer",
avatar = "https://cdn.framework7.io/placeholder/people-100x100-7.jpg"
)
)
)
messageSent(TRUE)
})
observeEvent(req(messageSent()), {
names <- c("Victor", "John")
name <- sample(names, 1)
updateF7Messages(
id = "mymessages",
showTyping = TRUE,
list(
f7Message(
text = "Some message",
name = name,
type = "received",
avatar = "https://cdn.framework7.io/placeholder/people-100x100-9.jpg"
)
)
)
})
}
)
N checking installed package size ...
installed size is 7.3Mb
sub-directories of 1Mb or more:
shinyMobile-1.0.1 4.8Mb |
what happened in that last commit, this is insane... |
hard reset prev commit and force pushed |
R/f7Preloader.R
Outdated
#' }) | ||
#' | ||
#' observeEvent(input$obs, { | ||
#' showF7Preloader(color = "red", type = "dialog", id = "loader") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hypebright this is similar to {waiter} and it might feel more natural to be able to chain functions. However, I don't want to depends on R6.
inst/examples/datepicker/app.R
Outdated
label = "Choose a date", | ||
value = Sys.Date() - 7, | ||
label = "Choose a date and time", | ||
value = Sys.time() - 3600*24, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DivadNojnarg using things like Sys.Date()
and Sys.time()
will cause issues with testing. Results will always be different, so reverting back to fixed dates (and times)
#' @param ... Item text. | ||
#' @param id Optional id for item. | ||
#' @param title Item title. | ||
#' @param subtitle Item subtitle. | ||
#' @param header Item header. | ||
#' @param footer Item footer. | ||
#' @param href Item external link. | ||
#' @param media Expect \link{f7Icon} or \code{img}. | ||
#' @param right Right content if any. | ||
#' @param routable Works when href is not NULL. Default to FALSE. If TRUE, | ||
#' the list item may point to another page, but we recommend using \link{f7List} | ||
#' and \link{f7ListItem} instead. See \link{f7MultiLayout}. Can also be used in | ||
#' combination with href = "#" to make items appear as links, but not actually | ||
#' navigate anywhere, which is useful for custom click events. | ||
#' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DivadNojnarg I added a routable
argument here, which has in strict sense no relevance for a virtual list. But it is handy to use in combination with href = "#"
because based on this routable arg, we can remove the external class. I thought it was best to align with f7ListItem()
.
Now, in combination with the id in both list items, it is relatively user-friendly to add custom click events if desired.
What are your thoughts on this? I don't want make things too messy or too unclear, but I guess it doesn't harm much but will be very helpful in specific cases? Could support this in the lists vignette..
@hypebright Will need your green light for merging this into main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😎
Poke @hypebright.
TO DO/roadmap:
updateF7Entity
) --> THIS DOES NOT WORK SMOOTHLY FOR INPUTS (some inputs need modified attributes in addition to the config json, which is too complex to cover, too many edge cases). So for now, we won't support inputs.filled
option inf7Page
Components progress:
f7DatePicker
.updateCheckboxGroup
(LOLOL).