From 4e82adee2229ba89c8a5b8050c2fa0fb51b747fa Mon Sep 17 00:00:00 2001 From: esraay <36202874+esraay@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:41:11 +0300 Subject: [PATCH 1/4] Add a new register input handler for the shiny.vector type --- R/shiny.R | 8 ++++++++ inst/www/shiny-semantic-slider.js | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/R/shiny.R b/R/shiny.R index 09b759ac..30811557 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -31,6 +31,14 @@ NULL # Add directory for static resources file <- system.file("www", package = "shiny.semantic", mustWork = TRUE) shiny::addResourcePath("shiny.semantic", file) + shiny::registerInputHandler("shiny.vector", function(value, ...) { + if (is.null(value)) { + return(value) + } else { + values <- shiny:::safeFromJSON(value) + return(values) + } + }, force = TRUE) } #' Create universal Shiny input binding diff --git a/inst/www/shiny-semantic-slider.js b/inst/www/shiny-semantic-slider.js index 4376e42b..2bd6d8ff 100644 --- a/inst/www/shiny-semantic-slider.js +++ b/inst/www/shiny-semantic-slider.js @@ -52,14 +52,14 @@ $.extend(semanticSliderBinding, { if ($(el).data('ticks')) { return $(el).data('ticks')[value]; } else { - return value; + return(JSON.stringify(value)) } }, getType: function(el) { if ($(el).data('ticks')) { return false; } else { - return 'shiny.number'; + return 'shiny.vector'; } }, // Given the DOM element for the input, set the value. From f7ac2768fe51107efaaef1d5a8b3a3fc874680d9 Mon Sep 17 00:00:00 2001 From: Jakub Nowicki Date: Wed, 31 Jan 2024 15:46:42 +0100 Subject: [PATCH 2/4] chore: Change handler name. --- R/shiny.R | 2 +- inst/www/shiny-semantic-slider.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/shiny.R b/R/shiny.R index 06ce3858..08f57811 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -31,7 +31,7 @@ NULL # Add directory for static resources file <- system.file("www", package = "shiny.semantic", mustWork = TRUE) shiny::addResourcePath("shiny.semantic", file) - shiny::registerInputHandler("shiny.vector", function(value, ...) { + shiny::registerInputHandler("shiny.semantic.vector", function(value, ...) { if (is.null(value)) { return(value) } else { diff --git a/inst/www/shiny-semantic-slider.js b/inst/www/shiny-semantic-slider.js index 2bd6d8ff..1a48b009 100644 --- a/inst/www/shiny-semantic-slider.js +++ b/inst/www/shiny-semantic-slider.js @@ -59,7 +59,7 @@ $.extend(semanticSliderBinding, { if ($(el).data('ticks')) { return false; } else { - return 'shiny.vector'; + return 'shiny.semantic.vector'; } }, // Given the DOM element for the input, set the value. From 318495fcde00489d6cfda7c008b91fa278ee7402 Mon Sep 17 00:00:00 2001 From: Jakub Nowicki Date: Wed, 31 Jan 2024 15:46:58 +0100 Subject: [PATCH 3/4] chore: Update DESCRIPTION and NEWS. --- DESCRIPTION | 2 +- NEWS.md | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index af583bb5..55680c89 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: shiny.semantic Title: Semantic UI Support for Shiny -Version: 0.5.0 +Version: 0.5.0.9000 Authors@R: c(person("Filip", "Stachura", email = "filip@appsilon.com", role = "aut"), person("Dominik", "Krzeminski", role = "aut"), person("Krystian", "Igras", role = "aut"), diff --git a/NEWS.md b/NEWS.md index b45cf476..ea82d199 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ -# shiny.semantic 0.5.0 +# shiny.semantic (development) + +- Fixed `range_input` now returns both lower and upper bound. + +# [shiny.semantic 0.5.0](https://github.com/Appsilon/shiny.semantic/releases/tag/0.5.0) - `shiny.semantic` no longer uses CDN as the default source of assets. Instead, `semantic.assets` package was introduced. From 3e8abd4e0e21119ae14b5842c0868276e5107607 Mon Sep 17 00:00:00 2001 From: Jakub Nowicki Date: Wed, 31 Jan 2024 16:12:48 +0100 Subject: [PATCH 4/4] chore: Use jsonlite instead of shiny not imported function. --- R/shiny.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/shiny.R b/R/shiny.R index 08f57811..9484ba68 100644 --- a/R/shiny.R +++ b/R/shiny.R @@ -35,7 +35,7 @@ NULL if (is.null(value)) { return(value) } else { - values <- shiny:::safeFromJSON(value) + values <- jsonlite::fromJSON(value) return(values) } }, force = TRUE)