Skip to content

Commit

Permalink
Make devtools::check pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Sep 12, 2024
1 parent f2db08e commit fa627dd
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 36 deletions.
13 changes: 7 additions & 6 deletions R/columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ set_formatter_money <- function(
column,
decimal = c(",", "."),
thousand = c(".", ","),
symbol = "£",
symbol = "EUR",
symbol_after = "p",
negative_sign = "-",
precision = FALSE,
Expand All @@ -131,7 +131,7 @@ set_formatter_money <- function(
#' Image Formatter
#' @inheritParams set_formatter_html
#' @param height (character): A CSS value for the height of the image.
#' @param width: (character): A CSS value for the width of the image.
#' @param width (character): A CSS value for the width of the image.
#' @param url_prefix (character): String to add to the start of the cell value
#' when generating the image src url.
#' @param url_suffix (character): String to add to the end of the cell value
Expand Down Expand Up @@ -165,7 +165,7 @@ set_formatter_image <- function(
#' @param url_prefix (character): Prefix to add to the URL value.
#' @param url (JS function): A JS function that return the URL value.
#' The cell is passed to the function as its first argument.
#' Use \link[htmltools]{JS} to pass JS code.
#' Use \link[htmlwidgets]{JS} to pass JS code.
#' @param target (character): Target attribute of the anchor tag.
#' @example examples/formatters/formatter_link.R
#' @export
Expand Down Expand Up @@ -215,7 +215,7 @@ set_formatter_star <- function(widget, column, number_of_stars, hoz_align = "cen
#' @param color (character): Either a single color or a vector of colors
#' @param legend (character, \code{TRUE}, JavaScript function): If set to \code{TRUE} the value of the cell is displayed.
#' Set to \code{NA} to display no value at all.
#' Use \link[htmltools]{JS} to pass a JS function as legend.
#' Use \link[htmlwidgets]{JS} to pass a JS function as legend.
#' The cell value is passed to the function as its first argument.
#' @param legend_color (character): The text color of the legend.
#' @param legend_align (character): The text alignment of the legend.
Expand Down Expand Up @@ -271,7 +271,7 @@ set_formatter_tick_cross <- function(widget, column) {
#' @param on_truthy (bool): TODO: ???
#' @param on_color (character): The color of the switch if it is on.
#' @param off_color (character): The color of the switch if it is off.
#' @param clickable: (bool): Enable switch functionality to toggle the cell value on click.
#' @param clickable (bool): Enable switch functionality to toggle the cell value on click.
#' @example examples/formatters/formatter_toggle_switch.R
#' @export
set_formatter_toggle_switch <- function(
Expand Down Expand Up @@ -304,6 +304,7 @@ set_formatter_toggle_switch <- function(
#' @inheritParams set_formatter_html
#' @param input_format (character): The datetime input format.
#' @param output_format (character): The datetime output format.
#' @param invalid_placeholder (character): The value to be displayed if an invalid datetime is provided.
#' @param timezone (character): The timezone of the datetime.
#' @example examples/formatters/formatter_datetime.R
#' @export
Expand Down Expand Up @@ -338,7 +339,7 @@ set_formatter_color <- function(widget, column) {
}

#' Traffic Light Formatter
#' @inheritParams set_formatter_html
#' @inheritParams set_formatter_progress
#' @export
set_formatter_traffic_light <- function(
widget,
Expand Down
40 changes: 28 additions & 12 deletions R/tabulator_options.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
#' Tabulator Setup Options
#' @param height (character) The height of the table in px.
#' @param history (bool): description
#' @param colummns (list): description
#' @param layout (character): ...
#' @param responsive_layout (bool): description
#' @param movable_columns (bool): description
#' @param header_visible (bool): description
#' @param row_height description
#' @param add_row_pos (character): description
#' @param movable_rows (bool): description
#' @param resizable_rows (bool): description
#' @param frozen_rows description
#' @param history (bool): Enable user interaction history functionality.
#' @param columns (list): Column definitions.
#' If set to \code{NULL} definitions are auto generated from table data.
#' @param layout (character): Layout mode of the table columns.
#' @param responsive_layout (bool): Automatically hide and show columns to fit
#' the width of the Tabulator element.
#' @param movable_columns (bool): Allow users to move and reorder rows.
#' @param header_visible (bool): Whether header is visible.
#' @param row_height (numeric): A fixed height of the rows.
#' @param add_row_pos (character): The table position where new rows are added.
#' @param movable_rows (bool): Allow users to move and reorder rows.
#' @param resizable_rows (bool): Allow user to resize rows.
#' @param frozen_rows (numeric): Number of frozen rows.
#' @param index (character): Field to be used as the unique index for each row.
#' @param group_by (character): Field to group rows by.
#' @param edit_trigger_event description
#' @param selectable_rows description
#' @param pagination (bool): description
#' @param pagination_size (integer): description
#' @param pagination_add_row (character): description
#' @param spreadsheet (bool): description
#' @param spreadsheet_rows (integer): description
#' @param spreadsheet_columns (integer): description
#' @param spreadsheet_column_definition description
#' @param spreadsheet_sheets (list): description
#' @param spreadsheet_sheet_tabs (bool): description
#' @param ... Further options.
#' @seealso \url{https://tabulator.info/docs/6.2/options}
#' @export
tabulator_options <- function(
Expand Down Expand Up @@ -39,7 +55,7 @@ tabulator_options <- function(
selectable_rows = "highlight", # 'highlight', bool or integer
# Pagination
pagination = FALSE,
paginations_size = 10,
pagination_size = 10,
pagination_add_row = "page",
# Spreadsheet
spreadsheet = FALSE,
Expand Down
2 changes: 2 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ compact <- function(x) {
x[!sapply(x, is.null)]
}

#' Parse List to Data Frame
#' @param x (list): A list of named lists.
#' @export
list_to_data_frame <- function(x) {
# jsonlite::toJSON(x, auto_unbox = TRUE) |> jsonlite::fromJSON()
Expand Down
14 changes: 14 additions & 0 deletions man/list_to_data_frame.Rd

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

2 changes: 2 additions & 0 deletions man/set_formatter_datetime.Rd

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

4 changes: 2 additions & 2 deletions man/set_formatter_image.Rd

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

2 changes: 1 addition & 1 deletion man/set_formatter_link.Rd

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

2 changes: 1 addition & 1 deletion man/set_formatter_money.Rd

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

2 changes: 1 addition & 1 deletion man/set_formatter_progress.Rd

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

2 changes: 1 addition & 1 deletion man/set_formatter_toggle_switch.Rd

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

7 changes: 7 additions & 0 deletions man/set_formatter_traffic_light.Rd

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

54 changes: 42 additions & 12 deletions man/tabulator_options.Rd

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

0 comments on commit fa627dd

Please sign in to comment.