R/pkg-wrapper-shinyjqui.R

Defines functions hlpr_order_input change_order_input

Documented in change_order_input hlpr_order_input

#' @title Change order input

change_order_input <- function(ns,
                               id = "change_order",
                               items,
                               item_class = "default",
                               ...){

  shinyjqui::orderInput(
    inputId = ns(id),
    label = "Change Order:",
    items = items,
    item_class = "default"
  )

}

#' @title Work around
#'
#' @description Awkward solution to the problem that
#' input$change_order_order (of shinyjqui::orderInput()) somehow changes it's class

hlpr_order_input <- function(order_input){

  if(base::is.data.frame(order_input)){

    order <- order_input$text

  } else if(base::is.character(order_input)){

    order <- order_input

  }

  base::return(order)

}
kueckelj/confuns documentation built on June 28, 2024, 9:19 a.m.