From 6112024d8b16879fd4dbe48b3b9f476368f4e157 Mon Sep 17 00:00:00 2001 From: Benoit Thieurmel Date: Thu, 16 Mar 2023 20:30:29 +0000 Subject: [PATCH 01/19] add limit to autocomplete --- R/f7-inputs.R | 6 ++++-- srcjs/autoCompleteInputBinding.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/R/f7-inputs.R b/R/f7-inputs.R index 99927bc5..434cef71 100644 --- a/R/f7-inputs.R +++ b/R/f7-inputs.R @@ -21,6 +21,7 @@ #' Only if openIn is "dropdown". #' @param multiple Whether to allow multiple value selection. Only works #' when openIn is 'popup' or 'page'. +#' @param limit Limit number of maximum displayed items in autocomplete per query #' #' @rdname autocomplete #' @@ -75,7 +76,7 @@ f7AutoComplete <- function(inputId, label, placeholder = NULL, value = choices[1], choices, openIn = c("popup", "page", "dropdown"), typeahead = TRUE, expandInput = TRUE, closeOnSelect = FALSE, - dropdownPlaceholderText = NULL, multiple = FALSE) { + dropdownPlaceholderText = NULL, multiple = FALSE, limit = NULL) { type <- match.arg(openIn) @@ -90,7 +91,8 @@ f7AutoComplete <- function(inputId, label, placeholder = NULL, class = "autocomplete-input", `data-choices` = choices, `data-value` = value, - `data-open-in` = type + `data-open-in` = type, + `data-limit` = limit ) # specific props diff --git a/srcjs/autoCompleteInputBinding.js b/srcjs/autoCompleteInputBinding.js index a79fb172..089d93a6 100644 --- a/srcjs/autoCompleteInputBinding.js +++ b/srcjs/autoCompleteInputBinding.js @@ -33,7 +33,7 @@ $.extend(f7AutoCompleteBinding, { return $1.toUpperCase(); }); // convert "true" to true and "false" to false only for booleans - if (["openIn", "choices", "value", "dropdownPlaceholderText"].indexOf(camelCaseName) == -1) { + if (["openIn", "choices", "value", "dropdownPlaceholderText", "limit"].indexOf(camelCaseName) == -1) { var isTrueSet = (attr.value == 'true'); data[camelCaseName] = isTrueSet; } else { From 676c92ca43475448f6e9655d85daf64b14d47e1e Mon Sep 17 00:00:00 2001 From: Benoit Thieurmel Date: Thu, 23 Mar 2023 12:17:34 +0000 Subject: [PATCH 02/19] Update doc --- man/autocomplete.Rd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/man/autocomplete.Rd b/man/autocomplete.Rd index 7d2f0866..b4025cf8 100644 --- a/man/autocomplete.Rd +++ b/man/autocomplete.Rd @@ -16,7 +16,8 @@ f7AutoComplete( expandInput = TRUE, closeOnSelect = FALSE, dropdownPlaceholderText = NULL, - multiple = FALSE + multiple = FALSE, + limit = NULL ) updateF7AutoComplete( @@ -57,6 +58,8 @@ Only if openIn is "dropdown".} \item{multiple}{Whether to allow multiple value selection. Only works when openIn is 'popup' or 'page'.} +\item{limit}{Limit number of maximum displayed items in autocomplete per query} + \item{session}{The Shiny session object.} } \description{ From 658dbacc94e6b18048cc8593f4c353ce870dae8f Mon Sep 17 00:00:00 2001 From: DavidNojnarg Date: Sun, 26 Mar 2023 06:02:52 +0000 Subject: [PATCH 03/19] rebuild js + bump --- DESCRIPTION | 2 +- NEWS.md | 5 +++++ _pkgdown.yml | 1 + inst/shinyMobile-1.0.0/js/shinyMobile.js | 2 +- inst/shinyMobile-1.0.0/js/shinyMobile.min.js | 2 +- inst/shinyMobile-1.0.0/js/shinyMobile.min.js.map | 2 +- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 41640738..899b0320 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: shinyMobile Type: Package Title: Mobile Ready 'shiny' Apps with Standalone Capabilities -Version: 1.0.0 +Version: 1.0.1.9000 Authors@R: c( person("David", "Granjon", email = "dgranjon@ymail.com", role = c("aut", "cre")), person("Victor", "Perrier", email = "info@dreamrs.fr", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 9254e5f2..204984dd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# shinyMobile 1.0.1.9000 + +## Minor change +- Add `limit` to `f7AutoComplete()`. Thanks @bthieurmel. + # shinyMobile 1.0.0 ## New diff --git a/_pkgdown.yml b/_pkgdown.yml index 33dcc480..1c9e0d7f 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -291,6 +291,7 @@ template: news: releases: + - text: "shinyMobile 1.0.1.9000" - text: "shinyMobile 1.0.0" - text: "shinyMobile 0.9.1" - text: "shinyMobile 0.9.0" diff --git a/inst/shinyMobile-1.0.0/js/shinyMobile.js b/inst/shinyMobile-1.0.0/js/shinyMobile.js index 8bd3b464..900ffc54 100644 --- a/inst/shinyMobile-1.0.0/js/shinyMobile.js +++ b/inst/shinyMobile-1.0.0/js/shinyMobile.js @@ -647,7 +647,7 @@ $.extend(f7AutoCompleteBinding, { var camelCaseName = attr.name.substr(5).replace(/-(.)/g, (function($0, $1) { return $1.toUpperCase(); })); - if ([ "openIn", "choices", "value", "dropdownPlaceholderText" ].indexOf(camelCaseName) == -1) { + if ([ "openIn", "choices", "value", "dropdownPlaceholderText", "limit" ].indexOf(camelCaseName) == -1) { var isTrueSet = attr.value == "true"; data[camelCaseName] = isTrueSet; } else { diff --git a/inst/shinyMobile-1.0.0/js/shinyMobile.min.js b/inst/shinyMobile-1.0.0/js/shinyMobile.min.js index 46972314..5f7e2509 100644 --- a/inst/shinyMobile-1.0.0/js/shinyMobile.min.js +++ b/inst/shinyMobile-1.0.0/js/shinyMobile.min.js @@ -1,2 +1,2 @@ -$((function(){var e=$(document).find("script[data-for='app']");e=JSON.parse(e.html());var n="true"===$("body").attr("data-pwa");if(e.root="#app",n&&(e.serviceWorker={path:window.location.pathname+"service-worker.js",scope:window.location.pathname}),e.methods={toggleDarkTheme:function(){this.$(".view-main").toggleClass("theme-dark")}},e.data=function(){return{popovers:[],tooltips:[],actions:[]}},app=new Framework7(e),mainView=app.views.create(".view-main"),e.hasOwnProperty("dark")||(e.dark=!1),e.dark&&app.methods.toggleDarkTheme(),app.device.desktop||$("