Skip to content

Commit bde62d7

Browse files
committed
Pass on adding input_submit_button() (at least for now)
1 parent da419ba commit bde62d7

File tree

11 files changed

+21
-289
lines changed

11 files changed

+21
-289
lines changed

NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export(font_face)
8787
export(font_google)
8888
export(font_link)
8989
export(input_dark_mode)
90-
export(input_submit_button)
9190
export(input_submit_textarea)
9291
export(input_switch)
9392
export(input_task_button)

NEWS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
* Added a new `input_submit_textarea()` function. This input is similar in nature to `shiny::textAreaInput()`, but includes a submit button to only submit the text changes to the server on click. This is especially useful when the input text change triggers a long-running operation and/or the user wants to type longer-form input and review it before submitting it.
66

7-
* Added a new `input_submit_button()` function. This input is similar in nature to `shiny::submitButton()`, but is more flexible and provides more visual feedback (i.e., progress). More specifically, it enables multiple submit buttons (each targetting a different set of input controls) in a single Shiny app.
8-
97
## Improvements and bug fixes
108

119
* `bs_theme_dependencies()` now avoids unecessarily copying internal package files to R's temporary directory more than once when preparing precompiled theme dependencies (e.g. for a standard `bs_theme()` theme). (#1184)

R/input-submit.R

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,3 @@
1-
#' Suspend input changes until a button is clicked
2-
#'
3-
#' Suspend changes to a particular set of input controls until a submit button
4-
#' is clicked. This is particularly useful for allowing the user to review their
5-
#' input(s) before sending them to the server for a potentially expensive
6-
#' operation. Note that, by default, all inputs that are children of the
7-
#' button's parent are deferred until the button is clicked. This can be changed
8-
#' by setting the `scope` argument to a CSS selector that matches the container
9-
#' of inputs you wish to suspend.
10-
#'
11-
#' @param id The input ID.
12-
#' @param label A label to place on the button.
13-
#' @param ... Arguments passed along to [input_task_button()].
14-
#' @param scope The scope of the submit button. Can be one of the following:
15-
#' - `NULL`: Inputs that are children of the button's parent are
16-
#' deferred until the button is clicked.
17-
#' - A CSS selector: Only inputs that are within the element matching the
18-
#' selector are deferred until the button is clicked.
19-
#'
20-
#' @seealso [input_submit_textarea()], [input_task_button()]
21-
#' @export
22-
input_submit_button <- function(id, label, ..., scope = NULL) {
23-
rlang::check_installed("shiny", version = "1.11.1")
24-
25-
btn <- input_task_button(id, label, ...)
26-
27-
# Change type from "button" to "submit"
28-
btn$attribs$type <- "submit"
29-
30-
tagAppendAttributes(
31-
btn,
32-
class = "bslib-submit-button",
33-
`data-submit-scope` = scope
34-
)
35-
}
36-
37-
38-
# TODO: maybe update_task_button() should gain label/icon arguments
39-
# and then we can just call that here? Or just tell people to use
40-
# update_task_button() directly?
41-
42-
## @param id The input ID.
43-
## @param ... Currently ignored.
44-
## @param label The label of the button.
45-
## @param icon An optional icon to display next to the label while the button
46-
## is in ready state. See [fontawesome::fa_i()].
47-
## @param session The `session` object; using the default is recommended.
48-
## @rdname input_submit_button
49-
## @export
50-
#update_submit_button <- function(
51-
# id,
52-
# ...,
53-
# label = NULL,
54-
# icon = NULL,
55-
# session = get_current_session()
56-
#) {
57-
#
58-
#}
59-
601
#' Create a textarea input control with explicit submission
612
#'
623
#' Creates a textarea input where users can enter multi-line text and submit

inst/components/dist/components.js

Lines changed: 8 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/components/dist/components.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/components/dist/components.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/components/dist/components.min.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/input_submit_button.Rd

Lines changed: 0 additions & 35 deletions
This file was deleted.

man/input_submit_textarea.Rd

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

srcts/src/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import "./accordion";
55
import "./card";
66
import "./sidebar";
77
import "./taskButton";
8-
import "./submitButton";
98
import "./submitTextArea";
109

1110
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)