Skip to content

Commit

Permalink
updated WinBox to 0.2.82
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Apr 3, 2024
1 parent d2e7f96 commit a797521
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 16 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: shinywb
Title: 'WinBox' Window for 'shiny' Applications
Version: 0.0.0.9140
Version: 0.0.0.9200
Authors@R: c(
person("Victor", "Perrier", , "[email protected]", role = c("aut", "cre")),
person("Fanny", "Meyer", role = "aut"),
Expand All @@ -14,7 +14,7 @@ Description: Interface to 'WinBox' 'JavaScript' library to use in 'shiny' applic
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.3.1
Imports:
htmltools,
shiny
11 changes: 8 additions & 3 deletions R/WinBox.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ closeWinBox <- function(id, session = shiny::getDefaultReactiveDomain()) {
#' @param minwidth,minheight Set the minimal width/height of the window (supports units "px" and "%").
#' @param x,y Set the initial position of the window (supports: "right" for x-axis, "bottom" for y-axis,
#' "center" for both, units "px" and "%" for both).
#' @param max Automatically toggles the window into maximized state when created.
#' @param max,min Automatically toggles the window into maximized / minimized state when created.
#' @param top,right,bottom,left Set or limit the viewport of the window's available area (supports units "px" and "%").
#' @param background Set the background of the window (supports all CSS styles which are also supported by the style-attribute "background",
#' e.g. colors, transparent colors, hsl, gradients, background images).
#' @param border Set the border width of the window (supports all css units, like px, %, em, rem, vh, vmax).
#' @param modal Shows the window as modal.
#' @param index Set the initial z-index of the window to this value (could be increased automatically when unfocused/focused).
#' @param ... Other options, see https://github.com/nextapps-de/winbox?tab=readme-ov-file#options.
#'
#' @return A `list` of options to use in [WinBox()].
#' @export
Expand All @@ -113,14 +114,16 @@ wbOptions <- function(width = NULL,
x = NULL,
y = NULL,
max = NULL,
min = NULL,
top = NULL,
right = NULL,
bottom = NULL,
left = NULL,
background = NULL,
border = NULL,
modal = NULL,
index = 1045) {
index = 1045,
...) {
dropNulls(list(
width = width,
height = height,
Expand All @@ -129,14 +132,16 @@ wbOptions <- function(width = NULL,
x = x,
y = y,
max = max,
min = min,
top = top,
right = right,
bottom = bottom,
left = left,
background = background,
border = border,
modal = modal,
index = index
index = index,
...
))
}

Expand Down
58 changes: 58 additions & 0 deletions inst/examples/options2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
library(shiny)
library(shinywb)
library(htmltools)
library(phosphoricons)


ui <- fluidPage(
html_dependency_winbox(),
actionButton(inputId = "show", label = "Show one or more WinBox"),
radioButtons(
inputId = "background",
label = "Background color:",
choices = c("forestgreen", "firebrick", "steelblue", "goldenrod")
),
checkboxInput(
inputId = "modal",
label = "Shows the window as modal",
value = FALSE
),
checkboxInput(
inputId = "autosize",
label = "Automatically size the window to fit the window contents.",
value = FALSE
),
checkboxInput(
inputId = "max",
label = "Automatically toggles the window into maximized state when created.",
value = FALSE
),
checkboxInput(
inputId = "min",
label = "Automatically toggles the window into minimized state when created.",
value = FALSE
)
)

server <- function(input, output, session) {

observeEvent(input$show, {
WinBox(
title = "This is a WinBox",
ui = tagList(
tags$h3("Hello from WinBox!")
),
options = wbOptions(
background = input$background,
modal = input$modal,
autosize = input$autosize,
max = input$max,
min = input$min
)
)
})

}

if (interactive())
shinyApp(ui, server)
2 changes: 1 addition & 1 deletion inst/packer/WinBox.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions man/wbOptions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2",
"webpack-merge": "^5.8.0",
"winbox": "^0.2.1"
"winbox": "^0.2.82"
}
}

0 comments on commit a797521

Please sign in to comment.